From patchwork Wed Nov 6 11:41:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 13864420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5AF15D44D53 for ; Wed, 6 Nov 2024 11:42:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.830783.1245884 (Exim 4.92) (envelope-from ) id 1t8eQK-00089V-6o; Wed, 06 Nov 2024 11:42:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 830783.1245884; Wed, 06 Nov 2024 11:42:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8eQK-00088h-2m; Wed, 06 Nov 2024 11:42:08 +0000 Received: by outflank-mailman (input) for mailman id 830783; Wed, 06 Nov 2024 11:42:07 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8eQJ-0007RL-Cx for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 11:42:07 +0000 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [2a00:1450:4864:20::142]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 233e1cce-9c34-11ef-99a3-01e77a169b0f; Wed, 06 Nov 2024 12:42:01 +0100 (CET) Received: by mail-lf1-x142.google.com with SMTP id 2adb3069b0e04-539eb97f26aso4528658e87.2 for ; Wed, 06 Nov 2024 03:42:01 -0800 (PST) Received: from fziglio-desktop.lan (99.149.115.87.dyn.plus.net. [87.115.149.99]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10e7465sm18840783f8f.53.2024.11.06.03.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 03:42:00 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 233e1cce-9c34-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjoxNDIiLCJoZWxvIjoibWFpbC1sZjEteDE0Mi5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6IjIzM2UxY2NlLTljMzQtMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMwODkzMzIxLjY2NzQ1Miwic2VuZGVyIjoiZnJlZGlhbm8uemlnbGlvQGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730893321; x=1731498121; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=clpuiLr6+GNq2EjFM/kTGl+9a7wk5TUx5RlFDo/t/qA=; b=S8RFwYTv6+qDv01uYf98yOGhM3RWhiCImmUBnurmkGJnH6YrBaFEwJ5RuqZyhBqv/M llATVarc3EK78eHGjV42RRlhc//qyBp2g6fCCnWtaNLhowxd8XUeeY5lDSOlsGuw+lvq Ox1cMForHfT5nYyB1GFGzkSASC+YP4zay8aBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730893321; x=1731498121; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=clpuiLr6+GNq2EjFM/kTGl+9a7wk5TUx5RlFDo/t/qA=; b=TwobDD6Q0M6YR0ZuQfrP9IdwOe/APh9To364j8i04RRkeDggsbrNocH6FJS6guJZx5 0gNqPYdBrftvvrYMeplRhiqSxPQrq6lrvIGqfEDqUZMur6MpS/cj19NI0Hm6igAQZeAY 08jRuuYXkL5S0dZ8oEUqMStwnaAF8bA2lYHPmSNyvYa2tkdYPi0motHtqaHNIDjNkvRX NcK7Dn8ZWWoc+SdnpqeRvI1RCKde5PtVryWjTw3xFN96N0QUTizaunV9OPXH3HMkhFxE Gsft3P22isKV3JQWrSSExDS9jydrHDDArnK+7oczQwmXdGsQtjwq+NxC503QqJIrLlDc zDlA== X-Gm-Message-State: AOJu0Yy+SebDuVDZmD85aQpJcfPH0iBmPtWqZNNPykZvn9eWxgoyqaW+ AiLpCs5J1TRVyZE3wCmWF7lQuNrXucbLYMLg9PqU9khK39eNFGh/OZN2x7HGJSncpwUpvl1H6vG 76EpOeQ== X-Google-Smtp-Source: AGHT+IGPktNd6V7yTFf7xSW6d54nFXzj0fIqfdwBNhvEnopSInn+Z50KIVoIvRfqeiQ3GamMp0m1Ng== X-Received: by 2002:a05:6512:3408:b0:539:f8cb:f5e3 with SMTP id 2adb3069b0e04-53b7ed18520mr14053903e87.48.1730893320764; Wed, 06 Nov 2024 03:42:00 -0800 (PST) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v2 1/3] x86/boot: Fix intermediate file names to generate 32 bit code Date: Wed, 6 Nov 2024 11:41:48 +0000 Message-Id: <20241106114150.1432512-2-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106114150.1432512-1-frediano.ziglio@cloud.com> References: <20241106114150.1432512-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 The "base" and "offset" definition were inverted, "base" file should be the files without offsets applied while "offset" should have the offsets applied. Also update an old usage of "final" to "apply offset" to make more clear and consistent (in former commit messages the "final" term was used instead of "offset"). Fixes: aa9045e77130 ('x86/boot: Rework how 32bit C is linked/included for early boot') Signed-off-by: Frediano Ziglio --- Anthony was right, it was the opposite --- xen/arch/x86/boot/Makefile | 7 ++++--- xen/arch/x86/boot/build32.lds.S | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index e102bd8c70..777b4befeb 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -44,7 +44,8 @@ text_gap := 0x010200 text_diff := 0x408020 $(obj)/build32.base.lds: AFLAGS-y += -DGAP=$(text_gap) -DTEXT_DIFF=$(text_diff) -$(obj)/build32.offset.lds: AFLAGS-y += -DGAP=$(text_gap) -DTEXT_DIFF=$(text_diff) -DFINAL +$(obj)/build32.offset.lds: AFLAGS-y += -DGAP=$(text_gap) -DTEXT_DIFF=$(text_diff) \ + -DAPPLY_OFFSET $(obj)/build32.base.lds $(obj)/build32.offset.lds: $(src)/build32.lds.S FORCE $(call if_changed_dep,cpp_lds_S) @@ -75,10 +76,10 @@ cmd_combine = \ $(PYTHON) $(srctree)/tools/combine_two_binaries.py \ --gap $(text_gap) \ --text-diff $(text_diff) \ - --script $(obj)/build32.offset.lds \ + --script $(obj)/build32.base.lds \ --bin1 $(obj)/built-in-32.base.bin \ --bin2 $(obj)/built-in-32.offset.bin \ - --map $(obj)/built-in-32.offset.map \ + --map $(obj)/built-in-32.base.map \ --exports cmdline_parse_early,reloc,reloc_trampoline32 \ --output $@ diff --git a/xen/arch/x86/boot/build32.lds.S b/xen/arch/x86/boot/build32.lds.S index f20fc18977..9b29f0184f 100644 --- a/xen/arch/x86/boot/build32.lds.S +++ b/xen/arch/x86/boot/build32.lds.S @@ -15,7 +15,7 @@ * with this program. If not, see . */ -#ifdef FINAL +#ifndef APPLY_OFFSET # undef GAP # define GAP 0 # define MULT 0 From patchwork Wed Nov 6 11:41:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 13864421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D8FFD44D51 for ; Wed, 6 Nov 2024 11:42:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.830780.1245870 (Exim 4.92) (envelope-from ) id 1t8eQI-0007qk-Kg; Wed, 06 Nov 2024 11:42:06 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 830780.1245870; Wed, 06 Nov 2024 11:42:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8eQI-0007qd-GB; Wed, 06 Nov 2024 11:42:06 +0000 Received: by outflank-mailman (input) for mailman id 830780; Wed, 06 Nov 2024 11:42:04 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8eQG-0007aw-QF for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 11:42:04 +0000 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [2a00:1450:4864:20::436]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 23bce103-9c34-11ef-a0c6-8be0dac302b0; Wed, 06 Nov 2024 12:42:02 +0100 (CET) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-37d4d1b48f3so3793776f8f.1 for ; Wed, 06 Nov 2024 03:42:02 -0800 (PST) Received: from fziglio-desktop.lan (99.149.115.87.dyn.plus.net. [87.115.149.99]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10e7465sm18840783f8f.53.2024.11.06.03.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 03:42:01 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 23bce103-9c34-11ef-a0c6-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjo0MzYiLCJoZWxvIjoibWFpbC13cjEteDQzNi5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6IjIzYmNlMTAzLTljMzQtMTFlZi1hMGM2LThiZTBkYWMzMDJiMCIsInRzIjoxNzMwODkzMzIyLjU1MzQwOSwic2VuZGVyIjoiZnJlZGlhbm8uemlnbGlvQGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730893322; x=1731498122; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JqBG/ejxY0G3tcFASKQ8s4CSPdRpi1GybkGCC/y1PZI=; b=M0LKNKb4MzltoxZVOmCmo1FazkBchinZQZ1MkT22ddDEa2SVKMQJK9Okw2z3ngevdM 42+G+Qm12FH3g773b+yfsU5kGNc4DksYon/DelUKmXXKK9dw2uCdfJzgyGyOIHqrIPw9 EXvFk9yh7klEMrXEIvC0bJeoXgKXjocqZ4D9A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730893322; x=1731498122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JqBG/ejxY0G3tcFASKQ8s4CSPdRpi1GybkGCC/y1PZI=; b=cMznNoGnkn38aZ5QNkSscRxFIXCzBM2ntLpuFe+s289RQF8S/dMAI/y1lhB3s6C9E2 S8GazyjeC8OI9101hPS1/rWAYXAhMJzV4SArU04m6A3DzRCru94ZKTZDCu03BpOGf8gj UsOaZiUi05i/i0UKC38MtobQ5964ZjSDANFRdrFFIKkwRZjtsfa73PuUtY6TFeiUwUjG E4AwbItmVWn5v2+NmVw7KQbSm6RNBvOPpcE56lzQQPjZWkkQD9qY4gho0iLV6Y4ogTFS 3ih3cBOgpg7azJUihvICq787TTC7stW1jhRZM8G0duniSJTEMdLpx6UUhHYpHW4XeYXn I1hA== X-Gm-Message-State: AOJu0Yz7vSf9Zq/oY/oxI3wHTyWCsAwcYa/vpkCGe62B/1coat1rmqKp WwgPX+Zra4JhUPBiP8JlVGxfuwefTFcqzqbLHjOmrJqF1n8yCMK6QP86C7+WIoQsnJeYjx/OTrK umlY= X-Google-Smtp-Source: AGHT+IFD0Xyd4TJ84//eoDdUUxQkCWpWoZGmc7QsnwCtLxo/N+BKH3P92x9UO8Aq7fy35wObAzOaEA== X-Received: by 2002:adf:f204:0:b0:37d:39aa:b9f4 with SMTP id ffacd0b85a97d-381b708ae51mr18136525f8f.26.1730893321695; Wed, 06 Nov 2024 03:42:01 -0800 (PST) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Julien Grall , Stefano Stabellini Subject: [PATCH v2 2/3] x86/boot: Uses nm command instead of map file to get symbols Date: Wed, 6 Nov 2024 11:41:49 +0000 Message-Id: <20241106114150.1432512-3-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106114150.1432512-1-frediano.ziglio@cloud.com> References: <20241106114150.1432512-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Map file format is not standard making it code readind it not portable and potentially hard to maintain. Use nm command instead to get list of symbols; specifically BSD format as it does not truncate symbols names like sysv one. Fixes: aa9045e77130 ('x86/boot: Rework how 32bit C is linked/included for early boot') Signed-off-by: Frediano Ziglio --- xen/arch/x86/boot/Makefile | 5 +++-- xen/tools/combine_two_binaries.py | 28 ++++++++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index 777b4befeb..01100a4b72 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -67,7 +67,8 @@ $(obj)/built-in-32.tmp.o: $(obj32) # If possible we use --orphan-handling=error option to make sure we account # for all possible sections from C code. $(obj)/built-in-32.%.bin: $(obj)/build32.%.lds $(obj)/built-in-32.tmp.o - $(LD32) $(orphan-handling-y) -N -T $< -Map $(@:bin=map) -o $(@:bin=o) $(filter %.o,$^) + $(LD32) $(orphan-handling-y) -N -T $< -o $(@:bin=o) $(filter %.o,$^) + $(NM) -p --format=bsd $(@:bin=o) > $(@:bin=nm) $(OBJCOPY) -j .text -O binary $(@:bin=o) $@ rm -f $(@:bin=o) @@ -79,7 +80,7 @@ cmd_combine = \ --script $(obj)/build32.base.lds \ --bin1 $(obj)/built-in-32.base.bin \ --bin2 $(obj)/built-in-32.offset.bin \ - --map $(obj)/built-in-32.base.map \ + --symbols $(obj)/built-in-32.base.nm \ --exports cmdline_parse_early,reloc,reloc_trampoline32 \ --output $@ diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_binaries.py index 447c0d3bdb..db02494b28 100755 --- a/xen/tools/combine_two_binaries.py +++ b/xen/tools/combine_two_binaries.py @@ -28,8 +28,8 @@ parser.add_argument('--text-diff', dest='text_diff', help='Difference between code section start') parser.add_argument('--output', dest='output', help='Output file') -parser.add_argument('--map', dest='mapfile', - help='Map file to read for symbols to export') +parser.add_argument('--symbols', dest='symbols_file', + help='Nm command output to read for symbols to export') parser.add_argument('--exports', dest='exports', help='Symbols to export') parser.add_argument('--section-header', dest='section_header', @@ -65,15 +65,23 @@ exports = [] if args.exports is not None: exports = dict([(name, None) for name in args.exports.split(',')]) -# Parse mapfile, look for ther symbols we want to export. -if args.mapfile is not None: - symbol_re = re.compile(r'\s{15,}0x([0-9a-f]+)\s+(\S+)\n') - for line in open(args.mapfile): - m = symbol_re.match(line) - if not m or m.group(2) not in exports: +# Parse symbols file, look for symbols we want to export. +if args.symbols_file is not None: + dummy_start = -1 + for line in open(args.symbols_file): + v = line.split() + if len(v) != 3 or v[1].upper() != 'T': continue - addr = int(m.group(1), 16) - exports[m.group(2)] = addr + addr = int(v[0], 16) + if v[2] == 'dummy_start': + dummy_start = addr + continue + if v[2] not in exports: + continue + exports[v[2]] = addr + if dummy_start != 0: + raise Exception("dummy_start symbol expected to be present and 0") + for (name, addr) in exports.items(): if addr is None: raise Exception("Required export symbols %s not found" % name) From patchwork Wed Nov 6 11:41:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frediano Ziglio X-Patchwork-Id: 13864422 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6B36D44D53 for ; Wed, 6 Nov 2024 11:42:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.830782.1245879 (Exim 4.92) (envelope-from ) id 1t8eQJ-00086L-Tm; Wed, 06 Nov 2024 11:42:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 830782.1245879; Wed, 06 Nov 2024 11:42:07 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8eQJ-00086D-Qz; Wed, 06 Nov 2024 11:42:07 +0000 Received: by outflank-mailman (input) for mailman id 830782; Wed, 06 Nov 2024 11:42:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8eQI-0007RL-Cl for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 11:42:06 +0000 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [2a00:1450:4864:20::435]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 2436fafd-9c34-11ef-99a3-01e77a169b0f; Wed, 06 Nov 2024 12:42:03 +0100 (CET) Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-37d447de11dso5035966f8f.1 for ; Wed, 06 Nov 2024 03:42:03 -0800 (PST) Received: from fziglio-desktop.lan (99.149.115.87.dyn.plus.net. [87.115.149.99]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10e7465sm18840783f8f.53.2024.11.06.03.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 03:42:02 -0800 (PST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 2436fafd-9c34-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjo0MzUiLCJoZWxvIjoibWFpbC13cjEteDQzNS5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6IjI0MzZmYWZkLTljMzQtMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMwODkzMzIzLjM1NDM2Nywic2VuZGVyIjoiZnJlZGlhbm8uemlnbGlvQGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730893322; x=1731498122; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vMi0+FOW37XSiIpmJo9yDY5hKngxNrldiecxy5czma8=; b=FWItkgwT5PVvTxvtaicZroIZynwnZSAPU5Kdo7JJ4TBbiooKy2/QP8+b8crtAaCMYC 8UeNDaT7++vh5wGlZjS+5fV+NhmZbnhv1Mg0iNOiJmK3FHVO4n9seCZVZo47ujsCV8cr i7Rmb0bN+aGFBPKbIWKffmCF+leCel31E+SI8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730893322; x=1731498122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vMi0+FOW37XSiIpmJo9yDY5hKngxNrldiecxy5czma8=; b=kszxBd9SOvb/obITSBWmPnceBMd4v1WzEKcioD36mknOwO8GKbKCN3OyXSJJhUN6tU kvGG1KMIMBgoG06Vzt3MoSvBeWcDo4nPg5qcV2AlSf+k4BWQXcu1Kqn5OXyu73Uu3Cjo US0D1XB40YCdHobC37cQ3TPy5AEveLc+TjizLgOnpIWnlh43CoU/2Wc1xCfpCNuVj5Cs 3eWfeWkWoN9RXIf2Xmrf7ARlEFcgqMODJeiXOxZc/9lqkfbRCFYL1SFIvBWmBCcvc65y IeA1wH0PWjnPliju8sUS0W93380XV4dBVjNBWSVXCNV+esvgZyTWjS+yNE72xUOrhUhL HQpg== X-Gm-Message-State: AOJu0Yyw/UZ0OBf4FkYS6wE48XaRDcgExOA5B70AF3oGWdapi+hKQWRr s9qAXM1vuTuAnT2qD9pPsqaRj3rE8LkhlRO0AbfNsO7/HV+esGLQ2w3aQA80dRoj/H1f+RJRO2O n6HA= X-Google-Smtp-Source: AGHT+IGJpNvzHflsKJ3yMWA/g3GWreDCCpsXVONWpKrd2U0D7czGn7NehhOveo3/szy/NQY6a7X/Gw== X-Received: by 2002:a5d:584a:0:b0:371:8eb3:603a with SMTP id ffacd0b85a97d-381be7d6144mr21054824f8f.27.1730893322493; Wed, 06 Nov 2024 03:42:02 -0800 (PST) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [PATCH v2 3/3] x86/boot: Fix build with LLVM toolchain Date: Wed, 6 Nov 2024 11:41:50 +0000 Message-Id: <20241106114150.1432512-4-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106114150.1432512-1-frediano.ziglio@cloud.com> References: <20241106114150.1432512-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 This toolchain generates different object files. Object have 3 additional sections which must be handled by the linker script. Added sections need to have special type so we put them in separate sections as linker will copy type from input sections. Fixes: aa9045e77130 ('x86/boot: Rework how 32bit C is linked/included for early boot') Signed-off-by: Frediano Ziglio --- xen/arch/x86/boot/build32.lds.S | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/x86/boot/build32.lds.S b/xen/arch/x86/boot/build32.lds.S index 9b29f0184f..1e59732edd 100644 --- a/xen/arch/x86/boot/build32.lds.S +++ b/xen/arch/x86/boot/build32.lds.S @@ -66,6 +66,15 @@ SECTIONS *(.comment.*) *(.note.*) } + .shstrtab : { + *(.shstrtab) + } + .strtab : { + *(.strtab) + } + .symtab : { + *(.symtab) + } /* Dynamic linkage sections. Collected simply so we can check they're empty. */ .got : { *(.got)