linker/lld: do not generate quoted section names

LLVM LD doesn't strip the quotes from the section names, and so the
resulting binary ends up with section names like:

  [ 1] ".text"           PROGBITS         ffff82d040200000  00008000
       000000000018cbc1  0000000000000000  AX       0     0     4096

This confuses some tools (like gdb) and prevents proper parsing of the
binary.

The issue has already been reported and is being fixed in LLD.  In
order to workaround this issue and keep the GNU ld support define
different DECL_SECTION macros depending on the used ld
implementation.

Drop the quotes from the definitions of the debug sections in
DECL_DEBUG{2}, as those quotes are not required for GNU ld either.

Fixes: 6254920587 ('x86: quote section names when defining them in linker script')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 702c9a800e
master date: 2022-05-02 08:51:45 +0200
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2022-06-07 14:20:45 +02:00
1 parent c92c99fdfa
commit 0a7f20c0df
1 file changed
+5 -1
+5 -1
View File
@@ -18,7 +18,11 @@ ENTRY(efi_start)
#else /* !EFI */
#define FORMAT "elf64-x86-64"
#define DECL_SECTION(x) #x : AT(ADDR(#x) - __XEN_VIRT_START)
#ifdef CONFIG_LD_IS_GNU
# define DECL_SECTION(x) x : AT(ADDR(#x) - __XEN_VIRT_START)
#else
# define DECL_SECTION(x) x : AT(ADDR(x) - __XEN_VIRT_START)
#endif
ENTRY(start_pa)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.