From nobody Thu Nov 21 15:37:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1730898974; cv=none; d=zohomail.com; s=zohoarc; b=jcRtGM5iOr6DW6Fsq88pt+FmzswLjSUxuybrev68eoBJE7hmxN+go6sJtzak90fdSUFSmZyn7OriE29yxQV6aFVmAmYZ6BxMDlS50/3kn3hP7ATaHbd4hiMTkoIW1iEyyT5eHq0fESNZ0vPUna55eqhH+DelXtgCQF/a9wIE9kc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730898974; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=K0Wmxp+X0d8KRimyktl9WakzvrvZ8qqvwU0jRtgqs7s=; b=SN7PEp/F53bdFEWXPm8PyvNq0ZQICXM0wGSUxPaMisfXTWZzPXgGDGUIMIayla1chIfx9vCt/XT1DeTPENotAo/fZ6wc/TdDNjpCSFFid8SyVkqPU/sjkb5a8ybxmRHBeTVXiYKcfhlKmtF3N9UHXXytUKGWoahSivGjrsoboO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1730898974065205.5611545126236; Wed, 6 Nov 2024 05:16:14 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.830944.1246065 (Exim 4.92) (envelope-from ) id 1t8ft2-0000dZ-5A; Wed, 06 Nov 2024 13:15:52 +0000 Received: by outflank-mailman (output) from mailman id 830944.1246065; Wed, 06 Nov 2024 13:15:52 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8ft1-0000cf-UM; Wed, 06 Nov 2024 13:15:51 +0000 Received: by outflank-mailman (input) for mailman id 830944; Wed, 06 Nov 2024 13:15:50 +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 1t8ft0-0000Zv-L1 for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 13:15:50 +0000 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [2a00:1450:4864:20::144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f1f913a9-9c3f-11ef-a0c6-8be0dac302b0; Wed, 06 Nov 2024 14:13:24 +0100 (CET) Received: by mail-lf1-x144.google.com with SMTP id 2adb3069b0e04-539f1292a9bso7697688e87.2 for ; Wed, 06 Nov 2024 05:07:48 -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 5b1f17b1804b1-432aa6ae615sm21785875e9.8.2024.11.06.05.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 05:06:31 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f1f913a9-9c3f-11ef-a0c6-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjoxNDQiLCJoZWxvIjoibWFpbC1sZjEteDE0NC5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6ImYxZjkxM2E5LTljM2YtMTFlZi1hMGM2LThiZTBkYWMzMDJiMCIsInRzIjoxNzMwODk4ODkzLjk5NDcwNSwic2VuZGVyIjoiZnJlZGlhbm8uemlnbGlvQGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730898392; x=1731503192; 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=K0Wmxp+X0d8KRimyktl9WakzvrvZ8qqvwU0jRtgqs7s=; b=iByM5UnDJ4sti2aMDQsDEnWdgCmhJ0p2wLPpO63qw3yuCXIm+wczCKr8G1jW3jAnra r734FesZqX/iYHWsueMvua3xjOO9aJaaQ0W3R3xNFCNmhwKHvwSFikQEcBNeds367iXO oG4HKjpmUo30melzN6MakglQYbTRgZFkblCeM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730898392; x=1731503192; 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=K0Wmxp+X0d8KRimyktl9WakzvrvZ8qqvwU0jRtgqs7s=; b=Cm6EEKYW2uOlOK5Jl6DikENLtGEVRPhSWm+acsYIqGHKD17dxw2bRpDS8FnY62famj 6i4mZmCBVR1h70lxec6UyMONgjWoSsRUw0RFbIFC0hl6P77n0Y6+z9M4qNM3yyVuyntb z1hzKg4bBxr1ZnayaqVwoWCs3QwQ2rMZgvaVQ8DYdt3V1Rdd0jYuM0VV+gz0nSd4ZtkT xw2D9csF1nLrpgMeXLtWUfBSwyfEvkWS2XIw83+QNUvmpUSoISZcG9gJqCaNm5vpijw+ fFKfUwOj2j7nxcy7bbmbdrl01d/2GSV8m+ktou6ZF++Aadp7yYbkZGZSLepgiralQTq5 lFEA== X-Gm-Message-State: AOJu0YwgpA6g/0E/vMoLA36ycWWhztFNjuj3VNmPgreacmPC0zQs2HXi VC13Rj96L8+vA70VEI6CqAqt17B7SM3aHayWZgWz/XbDsTlIf5DpAOewQxnVroVy9rOlo+vF3eK iyiuCEw== X-Google-Smtp-Source: AGHT+IF6Fqam+2yIIUN2Q0MVd8Q6BiDLRSGvBIEl/NP7+yLY0PieDzwN/Iw020fIhLIerZptg99bRQ== X-Received: by 2002:a05:6512:23a9:b0:539:f619:b459 with SMTP id 2adb3069b0e04-53b348cb0e0mr19364854e87.17.1730898392026; Wed, 06 Nov 2024 05:06:32 -0800 (PST) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v3 1/3] x86/boot: Fix intermediate file names to generate 32 bit code Date: Wed, 6 Nov 2024 13:06:18 +0000 Message-Id: <20241106130620.1928109-2-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106130620.1928109-1-frediano.ziglio@cloud.com> References: <20241106130620.1928109-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1730898976124116600 Content-Type: text/plain; charset="utf-8" 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 e= arly boot') Signed-off-by: Frediano Ziglio Acked-by: Andrew Cooper --- Anthony was right, it was the opposite --- xen/arch/x86/boot/Makefile | 6 +++--- xen/arch/x86/boot/build32.lds.S | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index e102bd8c70..5f832c5896 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -44,7 +44,7 @@ text_gap :=3D 0x010200 text_diff :=3D 0x408020 =20 $(obj)/build32.base.lds: AFLAGS-y +=3D -DGAP=3D$(text_gap) -DTEXT_DIFF=3D$= (text_diff) -$(obj)/build32.offset.lds: AFLAGS-y +=3D -DGAP=3D$(text_gap) -DTEXT_DIFF= =3D$(text_diff) -DFINAL +$(obj)/build32.offset.lds: AFLAGS-y +=3D -DGAP=3D$(text_gap) -DTEXT_DIFF= =3D$(text_diff) -DAPPLY_OFFSET $(obj)/build32.base.lds $(obj)/build32.offset.lds: $(src)/build32.lds.S FO= RCE $(call if_changed_dep,cpp_lds_S) =20 @@ -75,10 +75,10 @@ cmd_combine =3D \ $(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 $@ =20 diff --git a/xen/arch/x86/boot/build32.lds.S b/xen/arch/x86/boot/build32.ld= s.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 . */ =20 -#ifdef FINAL +#ifndef APPLY_OFFSET # undef GAP # define GAP 0 # define MULT 0 --=20 2.34.1 From nobody Thu Nov 21 15:37:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1730898977; cv=none; d=zohomail.com; s=zohoarc; b=Pqi57Q10cUqA1OTYZ2qiAcwY1UUL3ei4o/ScW2aj2CGZZy+hw9wuV9+n2noHIhf6OjDHHxVxdrhm6GHhJGIsrnyfbVnK4fCNTeQZmlwr/vQHa77RqeP3u49IKpOdS+8zoZTByjgcqbppJfZT93vZ0JgsCdO86HFTVmV0rP5yMMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730898977; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9RoSBfLejw4Kcn3H7vZdus13EaC1lB3WlrWWJRCZVH0=; b=RdZIZW0zMMWYBVD7WA9YjyqJVmez5zgUPwLy+pKz0WiTEVTsUkfeD/N6luwMXwxQkvWt2yX69T9MXkrNBsUs739Lahxv1s3oe1JPuB6apX3XzMu2+6eDhOY6vPofGCVcL8wOTaXeCVAKg7ag1Odp65nhDSHV+QieR0c/InGj0Rw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1730898977093293.67023158539075; Wed, 6 Nov 2024 05:16:17 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.830943.1246059 (Exim 4.92) (envelope-from ) id 1t8ft1-0000aJ-Qh; Wed, 06 Nov 2024 13:15:51 +0000 Received: by outflank-mailman (output) from mailman id 830943.1246059; Wed, 06 Nov 2024 13:15:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8ft1-0000aC-Nw; Wed, 06 Nov 2024 13:15:51 +0000 Received: by outflank-mailman (input) for mailman id 830943; Wed, 06 Nov 2024 13:15:50 +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 1t8fsz-0000Zv-VZ for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 13:15:50 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f2813688-9c3f-11ef-a0c6-8be0dac302b0; Wed, 06 Nov 2024 14:13:24 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-431695fa98bso52326685e9.3 for ; Wed, 06 Nov 2024 05:07:48 -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 5b1f17b1804b1-432aa6ae615sm21785875e9.8.2024.11.06.05.06.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 05:06:32 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: f2813688-9c3f-11ef-a0c6-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjozMzEiLCJoZWxvIjoibWFpbC13bTEteDMzMS5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6ImYyODEzNjg4LTljM2YtMTFlZi1hMGM2LThiZTBkYWMzMDJiMCIsInRzIjoxNzMwODk4OTEwLjIyMDcxLCJzZW5kZXIiOiJmcmVkaWFuby56aWdsaW9AY2xvdWQuY29tIiwicmVjaXBpZW50IjoieGVuLWRldmVsQGxpc3RzLnhlbnByb2plY3Qub3JnIn0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730898393; x=1731503193; 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=9RoSBfLejw4Kcn3H7vZdus13EaC1lB3WlrWWJRCZVH0=; b=ID41hzumXzLTv0l1N8kGFeugR5diwB+PC+Vlg8hXY8q3aqurp2Ux1+FR6JBkCGFRvq 14EqxIC2U0ajsPcBATnK9+MqqjOe+8hlYaFpewuDozwIPhd4ZVoOl5HtQeuA1SGqbwXr TNlwMpi9G0QotMB5Toi4p503AN/uiK5VCuCaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730898393; x=1731503193; 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=9RoSBfLejw4Kcn3H7vZdus13EaC1lB3WlrWWJRCZVH0=; b=Sk6YS8qDeNFltMOLEVoUdljTeIiywo8QJr7sgSwUdxoYG8ZRkUrwtnI4fzqGCWuzIu Bl4TDiXUe8zUXkklH3+bEwSMOs0/ECJtUaMpkvNW0wCWr7PRxJndOCb7xSLg4Uvpke9l JsWhzbQJsD2FoGg8637SC3Nynfv/4l0v4TzOj4CZ3VQ/s3obpcteN1ZoXOwZU61Wt87Z wRk/dTK+Rtl5phqp/dAm9kWlQNoehiHwcQydHWDqJ/UnkNzFjyrgf5ct1pPgvYlgLGLT Dyd0xP9wNO0x4vsqlOC0o4ygZ/+rI/AtJnAhL8DY4vaqHpwrfUA6Y6sxVZhRToonVrXZ 2PYQ== X-Gm-Message-State: AOJu0YytL6EHAzG56LbViKL5nRQOwG04dLKL5bcJm4Kkd+Qkr8VO/ikS j1qjoKuxPJmHRA+v6k1rUW/7eUcQQXpt0eYILVVSp5117l1caAcqMUuxn1ZqJaJADl8zccUvkEZ C59A= X-Google-Smtp-Source: AGHT+IHl8SNz+vXul5B+T/K1yfYzQ7WCfeo1q0YW4/izx/tc4fDc7sq1uqFZ2b2EHSAAKLJJ0/pPNw== X-Received: by 2002:a05:600c:3586:b0:431:4c14:abf4 with SMTP id 5b1f17b1804b1-4319acac8dbmr368763935e9.14.1730898393076; Wed, 06 Nov 2024 05:06:33 -0800 (PST) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Julien Grall , Stefano Stabellini Subject: [PATCH v3 2/3] x86/boot: Uses nm command instead of map file to get symbols Date: Wed, 6 Nov 2024 13:06:19 +0000 Message-Id: <20241106130620.1928109-3-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106130620.1928109-1-frediano.ziglio@cloud.com> References: <20241106130620.1928109-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1730898977793116600 Content-Type: text/plain; charset="utf-8" combine_two_binaries.py only understands GNU LD's format, and does not work with LLVM's LLD. 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 e= arly boot') Signed-off-by: Frediano Ziglio --- xen/arch/x86/boot/Makefile | 3 ++- xen/tools/combine_two_binaries.py | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile index 5f832c5896..d457876659 100644 --- a/xen/arch/x86/boot/Makefile +++ b/xen/arch/x86/boot/Makefile @@ -66,7 +66,8 @@ $(obj)/built-in-32.tmp.o: $(obj32) # If possible we use --orphan-handling=3Derror option to make sure we acco= unt # 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=3Dmap) -o $(@:bin=3Do)= $(filter %.o,$^) + $(LD32) $(orphan-handling-y) -N -T $< -o $(@:bin=3Do) $(filter %.o,$^) + $(NM) -p --format=3Dbsd $(@:bin=3Do) > $(@:bin=3Dmap) $(OBJCOPY) -j .text -O binary $(@:bin=3Do) $@ rm -f $(@:bin=3Do) =20 diff --git a/xen/tools/combine_two_binaries.py b/xen/tools/combine_two_bina= ries.py index 447c0d3bdb..581e57cbc0 100755 --- a/xen/tools/combine_two_binaries.py +++ b/xen/tools/combine_two_binaries.py @@ -29,7 +29,7 @@ parser.add_argument('--text-diff', dest=3D'text_diff', parser.add_argument('--output', dest=3D'output', help=3D'Output file') parser.add_argument('--map', dest=3D'mapfile', - help=3D'Map file to read for symbols to export') + help=3D'Map file (NM) to read for symbols to export') parser.add_argument('--exports', dest=3D'exports', help=3D'Symbols to export') parser.add_argument('--section-header', dest=3D'section_header', @@ -65,15 +65,20 @@ exports =3D [] if args.exports is not None: exports =3D dict([(name, None) for name in args.exports.split(',')]) =20 -# Parse mapfile, look for ther symbols we want to export. +# Parse mapfile, look for symbols we want to export. if args.mapfile is not None: - symbol_re =3D re.compile(r'\s{15,}0x([0-9a-f]+)\s+(\S+)\n') + exports["dummy_start"] =3D None for line in open(args.mapfile): - m =3D symbol_re.match(line) - if not m or m.group(2) not in exports: + parts =3D line.split() + if len(parts) !=3D 3: continue - addr =3D int(m.group(1), 16) - exports[m.group(2)] =3D addr + addr, sym_type, sym =3D parts + if sym_type.upper() =3D=3D 'T' and sym in exports: + exports[sym] =3D int(addr, 16) + if exports["dummy_start"] !=3D 0: + raise Exception("dummy_start symbol expected to be present and 0") + del exports["dummy_start"] + for (name, addr) in exports.items(): if addr is None: raise Exception("Required export symbols %s not found" % name) --=20 2.34.1 From nobody Thu Nov 21 15:37:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=cloud.com ARC-Seal: i=1; a=rsa-sha256; t=1730900344; cv=none; d=zohomail.com; s=zohoarc; b=QYirMslG4uDC6l58LVRIzkvfbQ5pkHmWIEzfr+3oNKK3rogyIYLCybP3VsQiHGsFNZQHfyu1u3iia/0h/JkMQjXS/H67EqwOE0tOdKead76Ge/m18oSaIn7601OFOthzcxQaUCHH6GfCkGdRwgTv/+mf+26bnUdvg1dQ9XR3+k0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730900344; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jNXAAQEeft4M3yHeAl+E+8ZpS3tKf0AXKURNXRVDvkI=; b=NP6I8MQM6gBjZXP/KB4lrBEfm+so1Qf2jz/ifGrttEE6iFSSf5YhwvZSwyUhCoXFaqMNTZFi7IWXDhm0S09JmNaA3iu4C3LoKjwgtt8k6Jamu/jB3lV6bFzV+Y/sfHNAcDs3neayK2O5hCwK32a39E1/XeIrjA/RLw2xTV7bUZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1730900344258330.0867489836587; Wed, 6 Nov 2024 05:39:04 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.831025.1246179 (Exim 4.92) (envelope-from ) id 1t8gFB-0002CV-JJ; Wed, 06 Nov 2024 13:38:45 +0000 Received: by outflank-mailman (output) from mailman id 831025.1246179; Wed, 06 Nov 2024 13:38:45 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t8gFB-0002CO-Gk; Wed, 06 Nov 2024 13:38:45 +0000 Received: by outflank-mailman (input) for mailman id 831025; Wed, 06 Nov 2024 13:38:44 +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 1t8gFA-00015Z-Gv for xen-devel@lists.xenproject.org; Wed, 06 Nov 2024 13:38:44 +0000 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [2a00:1450:4864:20::631]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 700c2d7b-9c44-11ef-a0c6-8be0dac302b0; Wed, 06 Nov 2024 14:38:42 +0100 (CET) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a9a0ec0a94fso1066922166b.1 for ; Wed, 06 Nov 2024 05:38:42 -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 5b1f17b1804b1-432aa6ae615sm21785875e9.8.2024.11.06.05.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 05:06:33 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 700c2d7b-9c44-11ef-a0c6-8be0dac302b0 X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjo2MzEiLCJoZWxvIjoibWFpbC1lajEteDYzMS5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6IjcwMGMyZDdiLTljNDQtMTFlZi1hMGM2LThiZTBkYWMzMDJiMCIsInRzIjoxNzMwOTAwMzIyLjQ5MzQ1Nywic2VuZGVyIjoiZnJlZGlhbm8uemlnbGlvQGNsb3VkLmNvbSIsInJlY2lwaWVudCI6Inhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyJ9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1730900322; x=1731505122; 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=jNXAAQEeft4M3yHeAl+E+8ZpS3tKf0AXKURNXRVDvkI=; b=G9/wro57tjy1YNw9AEn5pnVIqz0EXLVPQ+FMEhiRYWriOYP6yfrVDyNyXD7nbZ27yz hLBHYDs83cdBhkcEw8c8lAVAjY5jehY4VC4ELdOPMzuvvzOwh3BOd2U7h8KbaI9+EUAr 1utJOZepDYFTt44YgLrwmU1mQxtyVoypvBLv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730900322; x=1731505122; 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=jNXAAQEeft4M3yHeAl+E+8ZpS3tKf0AXKURNXRVDvkI=; b=vsn4LOgznxhBzUVTv0nheeWLhVt6JcET1lm7yB3BYTiscrpoa3bHlv0qF4s53fT055 NexXQfdfoAZkpGznrtUEzgLMu+aHNkE6mdUChRBU+BO0OZQ9W2t5sFMaBxDtKJf73Uai VZ2viJHUKeS/RmqQG5GQo0UCwZoVKvDV1CQPM1JKk0R6QIglcaJH92SHNuWEodarlsJQ ENVEGa77Eng7d0bCQd+yGSxzhyw+npS2taqyx86Bide2Zb3MhcB5LceMjoMyjIZzpGJD bDFnci+XlW+MDP/xZxtFnYexmVvdZLyUVjzq1x4Lm8T4azxsI4tAg1K6hGiXpgrWYc+d GjKA== X-Gm-Message-State: AOJu0Ywk8yLBok+KK1GDE3VIMG5APW/7+9oRj/23uS7kvkesl+a903A5 wyxjoAMVpQ/EmIJUJSZcUgH/GXaQTjGo6HIhCXxFrN5jVikSufdeh/zbr0tQyBNDhLik24kQcly XSq4= X-Google-Smtp-Source: AGHT+IHtwN3ieirDaOOPhRyRU6kaYSf9448q2ZSYS/K6+6OC8xNmi7RTqs+tpo0NOe79hlbipOhFxQ== X-Received: by 2002:ac2:4a83:0:b0:533:44e7:1b2a with SMTP id 2adb3069b0e04-53d6bb3fad8mr6374380e87.40.1730898393970; Wed, 06 Nov 2024 05:06:33 -0800 (PST) From: Frediano Ziglio To: xen-devel@lists.xenproject.org Cc: Frediano Ziglio , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v3 3/3] x86/boot: Explicitly list .{sym,shstr,str}tab in build32.lds.S Date: Wed, 6 Nov 2024 13:06:20 +0000 Message-Id: <20241106130620.1928109-4-frediano.ziglio@cloud.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241106130620.1928109-1-frediano.ziglio@cloud.com> References: <20241106130620.1928109-1-frediano.ziglio@cloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @cloud.com) X-ZM-MESSAGEID: 1730900345541116600 Content-Type: text/plain; charset="utf-8" Currently, building with LLVM's LLD fails: ld -melf_i386_fbsd --orphan-handling=3Derror -N -T ... ld: error: :(.symtab) is being placed in '.symtab' ld: error: :(.shstrtab) is being placed in '.shstrtab' ld: error: :(.strtab) is being placed in '.strtab' gmake[11]: *** [arch/x86/boot/Makefile:69: arch/x86/boot/built-in-32.base.bin] Error 1 This is a consequence of --orphan-handling, and it appears that Binutils doesn't diagnose some orphaned sections even explicitly asked to do so. List the sections explicitly. Fixes: aa9045e77130 ('x86/boot: Rework how 32bit C is linked/included for e= arly 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.ld= s.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 e= mpty. */ .got : { *(.got) --=20 2.34.1