Commit 702c9a80 authored by Roger Pau Monné's avatar Roger Pau Monné Committed by Jan Beulich

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

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

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: 62549205 ('x86: quote section names when defining them in linker script')
Signed-off-by: default avatarRoger Pau Monné <>
Reviewed-by: default avatarJan Beulich <>
parent c70c4b62
......@@ -20,7 +20,11 @@ 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)
# define DECL_SECTION(x) x : AT(ADDR(x) - __XEN_VIRT_START)
......@@ -18,11 +18,11 @@
* for PE output, in order to record that we'd prefer these sections to not
* be loaded into memory.
#define DECL_DEBUG(x, a) #x ALIGN(a) (NOLOAD) : { *(x) }
#define DECL_DEBUG2(x, y, a) #x ALIGN(a) (NOLOAD) : { *(x) *(y) }
#define DECL_DEBUG(x, a) x ALIGN(a) (NOLOAD) : { *(x) }
#define DECL_DEBUG2(x, y, a) x ALIGN(a) (NOLOAD) : { *(x) *(y) }
#define DECL_DEBUG(x, a) #x 0 : { *(x) }
#define DECL_DEBUG2(x, y, a) #x 0 : { *(x) *(y) }
#define DECL_DEBUG(x, a) x 0 : { *(x) }
#define DECL_DEBUG2(x, y, a) x 0 : { *(x) *(y) }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment