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

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


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 15 Sep 2021 10:50:58 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=3XNe/JhcU0nN+6cWPJW+M2KdPbtv7prVQ7AwVqLTYJk=; b=cCYN4CVcFnbmwkfldTnsWMe1ZSWwQFJuMYfrl5bGPOzG0wo6sj+bDLC7TSO5Oi89Yc3Y7+9p3eIhSM/V+5+EmDqOVsChaI74h6aXiHwDIO4Gm4Y/JkFIYP0WfR8jQWrnUqKFBxp2OHo52BWNDvcyBSLqSnlJg/Ki1FPQBU+smW5DYqQ9aY/hN9H8+HZXndUd49YphNvQ72eSmFZxSZMZaTWcE5+WYYkrW+jfImrROsA9wWt1SKuI1ig4MQjrfhL7oRyl26lNhZG7A2MWilOE8n8hZKpSl1OHj0LRnV36yWt2MBo3JjNfI6nmdzoDqEQEmoXv9lcP/BwlCbWIPYhYbQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nrqptWP5yG/BOIDI+QeSl14nPF7WDggOrQydE+jsmvGyQG36HThP96fsKlIw6tQQu13sptv9eSYVCuvx1fYAbJO86ckTvKBAyl1QXvI5URNvjcgsrA8EPMS0NTPzZQWM7dVvUyGBZshNh0MeTj7xcEUL/BVdASkOV90cJd7RwBVzNWJdB0UQ2Qnifxh0u5bHfp0A/A55utQV0a5Ff6QA/RLXKkmKXkmRUdLVxqbQuptDKnA+KuO7/Ay1xj5SmTQU+e+OlqUjHRUeHRwDVIeTr0hvnuS96rid6WNXBRLeTbtPJDhiRx7Scu7hkiPQ71C7FPLCPL1DPIvGs32dMaguIQ==
  • Authentication-results: lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 15 Sep 2021 08:51:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.09.2021 10:21, Roger Pau Monne wrote:
> 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>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> 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.

They're "drop in replacement" statement clearly is too ambitious.

> --- 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)

Indeed much neater an adjustment. Thanks!

Jan




 


Rackspace

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