[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86: quote section names when defining them in linker script


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Wed, 15 Sep 2021 10:21:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l1g5PWVzKl8h5wZ1rimfreosePf43AUvwJvgZD4ri1w=; b=TA993vvhtn1dq2PNMBYQwisuzLuBcDGh7OJMsGJVUZ5YC+JbczO11GysNXGpYh/HaOMf0Z5D7j/c8nnbSMuvpByZxkUiSkqc+JoY/rgwNxRVZqKQZ9iKpqX+rA50xeqEpsM7lDUjOT5pV0/1DK5SIqU2u9RzWWaDF1RB+6O6U4lU1FF3lkz89XhCThreUFnvwzgabCszhxNJ2xB5q2MWI7GdDztpjnsbULS6K0vsCgwH35jaZkWHLKKcOaYPorsHPsQCvPL4iYWqEiafXJOvJXRjsbm8tFFtjYAmltRstyA+uAzB378Qo8JrU/Mrx9mnwSjaFGq8MTO5Z5TCwqb39w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xsfg29d6nQijV227xIrtff5jRdj9mQ+u8w9kiMivZUVyHVzwWmP/oExKxxMBrZGbvv9cJLvHVTzsCSTZOUhRaXKiqszuaBQS3JuOnknaYGMwK5EZHlhkKBPrGytW8f1QcO6wjHUgkQAwiaNuJ62sJMWjcFAYwi2uE5nejZHjiZ0e+P2I1tE+WOF4B2Sld8qy0LfptwtCPAn6/uFlc8VihdRwlT6cuBD1f877cnMeF+rDabz4BKm11l/qMYQ6QsWkaTiQ4jmGOASxxK4DIk/T7UaJGnJZEU1t/ye3P+mTeGkbsyp2a+zZiconpj9JLrjf7cQqSsbq8YJa966SQotgfA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 15 Sep 2021 08:21:42 +0000
  • Ironport-data: A9a23:9HxskqgyBTYcm42gslW486NtX161XhcKZh0ujC45NGQN5FlHY01je htvXz/TOfuOMGChKN8na4i+9RkPuMODzoIyTAA6/yFkH34b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oAMKRCQ7InQLlbGILes1htZGEk0FU/NtTo5w7Rg2t8x3IDja++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /11n82xSFd5OpHru84ZXDsHMz5lA/BZreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zPKOHxO4wSoDd4xCzxBvc6W5HTBa7N4Le02R9t3J8RQaiPO qL1bxJvL0THYDlfPmtQI7A5xdexlETFXS1h/Qf9Sa0fvDGIkV0ZPKLWGMXRUsyHQ4NShEnwj mDM8nn9AxoaHMeC0jfD+XWp7sffkCW+VI8MGbmQ8v9xnEbV1mEVEAcRV1awvb++kEHWZj5EA xVKoGx09/F0rRH1CImmN/GlnJKaliY2CttRQ70+1Cau4K7bwVm5GXM6EyEUPbTKq/QKqSwWO k6hxo2yXGE+7+LLEBpx5Z/P8mjjYnF9wXsqIHZeFFpbuYGLTJQb00qXJuuPBpJZmTEc9dvY+ DmMsCF2rLEal8djO06TrA2f3m7ESnQkSGcICuTrs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ILSiEsHfjWK1RH5m5+BwlquCm71gn1P HKvhcbJsx2r0jce2mkyCGdrTXI4XIL0TvP2FWYiXzsrYjSXzQhEfdMgopfb1/w91cglMsU6t ME40up875sST/QliX04NbFEztwkFCvnHYkmekPy1RCTIolbqNLp4B3xjIbLH45JlO71GkbKp gsMCmFj8wmM29yLkqp8lWH+ebcH0jaRXy9Mw0/Us/86UkgoJk29Tpd+CSz9k1whq7VcKM0l9 gsBJ4Y4I2mfvVmHJ6VO91xMvdfcla9OS4kEFjiaGgPR5t3c04klfbMkcAIDaeRCds18Kc=
  • Ironport-sdr: kSRl9OQFdxrrQfG2ta0ZSHY5zughj5udQSqXxHFWAF6Um5TH9nmjKFj2lP+ex5Ao7V/lha02V/ xstB7ou/fJ55K1UI5eldUkrRhRqmpNaJWO2yke/vQWxb8PnjCBirbVfEACAfkHFdeN8dRQWnzx CDz9nW7QYKmIxzaoh5D3iNRUmhQM7c+8K7aEXh64xnss6P+T/gu96Gb60RQPgrzQ5kc/e2//iB amI2cVj5F5k2Q66SQdgez1vsqcTVkmfDG3hjKsav2tH2SaieJaMfPigdcCypRz0GakvSCLQR/v WDV/yJs4YVoNrT0ZPZdBnznG
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

LLVM ld seems to require section names to be quoted at both definition
and when referencing them for a match to happen, or else we get the
following errors:

ld: error: xen.lds:45: undefined section ".text"
ld: error: xen.lds:69: undefined section ".rodata"
ld: error: xen.lds:104: undefined section ".note.gnu.build-id"
[...]

The original fix for GNU ld 2.37 only quoted the section name when
referencing it in the ADDR function. Fix by also quoting the section
names when declaring them.

Fixes: 58ad654ebce7 ("x86: work around build issue with GNU ld 2.37")
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
This seems to make all versions that we test in gitlab happy:
https://gitlab.com/xen-project/people/royger/xen/-/pipelines/370610794
Plus the FreeBSD Cirrus-CI:
https://cirrus-ci.com/build/6690836768358400

I'm slightly worried that LLVM ld requires quotes to be present always
in order to match, but I can confirm such quotes are not present in
the sections names in the output binary.
---
 xen/arch/x86/xen.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 955d5cf4a0..11b1da2154 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -18,7 +18,7 @@ ENTRY(efi_start)
 #else /* !EFI */
 
 #define FORMAT "elf64-x86-64"
-#define DECL_SECTION(x) x : AT(ADDR(#x) - __XEN_VIRT_START)
+#define DECL_SECTION(x) #x : AT(ADDR(#x) - __XEN_VIRT_START)
 
 ENTRY(start_pa)
 
-- 
2.33.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.