Skip to contentSkip to conversation

x86: enable long section names for xen.efi

PATCH In review Jan Beulich 3 participants 3 messages Sep 23, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: enable long section names for xen.efi

While for our present .data.read_mostly it may be deemed tolerable that the name is truncated to .data.re, for the planned .init.trampoline an abbreviation to .init.tr would end up pretty meaningless. Engage the long section names extension that GNU ld has had support for already in 2.22 (which we consider the baseline release for xen.efi building).

---
Interestingly builds with debug info actually use long section names by default, at least with recent ld. Or I'm unaware of where we control that behavior.

xen/arch/x86/arch.mk +1 -1
@@ -91,7 +91,7 @@ XEN_BUILD_EFI := $(call if-success,$(CC)
                                          -c $(srctree)/$(efi-check).c -o $(efi-check).o,y)
 
 # Check if the linker supports PE.
-EFI_LDFLAGS := $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
+EFI_LDFLAGS := $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10 --enable-long-section-names
 LD_PE_check_cmd = $(call ld-option,$(EFI_LDFLAGS) --image-base=0x100000000 -o $(efi-check).efi $(efi-check).o)
 XEN_BUILD_PE := $(LD_PE_check_cmd)
 
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

While for our present .data.read_mostly it may be deemed tolerable that the name is truncated to .data.re, for the planned .init.trampoline an abbreviation to .init.tr would end up pretty meaningless. Engage the long section names extension that GNU ld has had support for already in 2.22 (which we consider the baseline release for xen.efi building).

It's rather disappointing that this needs enabling explicitly, but oh well.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jan Beulich
Quoted 16 lines · Jan Beulich

While for our present .data.read_mostly it may be deemed tolerable that the name is truncated to .data.re, for the planned .init.trampoline an abbreviation to .init.tr would end up pretty meaningless. Engage the long section names extension that GNU ld has had support for already in 2.22 (which we consider the baseline release for xen.efi building).

---
Interestingly builds with debug info actually use long section names by default, at least with recent ld. Or I'm unaware of where we control that behavior.

xen/arch/x86/arch.mk XEN_BUILD_EFI := $(call if-success,$(CC) · line 97

Quoted 8 lines
xen/arch/x86/arch.mk +1 -1
@@ -91,7 +91,7 @@ XEN_BUILD_EFI := $(call if-success,$(CC)
                                          -c $(srctree)/$(efi-check).c -o $(efi-check).o,y)
 
 # Check if the linker supports PE.
-EFI_LDFLAGS := $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
+EFI_LDFLAGS := $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10 --enable-long-section-names
 LD_PE_check_cmd = $(call ld-option,$(EFI_LDFLAGS) --image-base=0x100000000 -o $(efi-check).efi $(efi-check).o)
 XEN_BUILD_PE := $(LD_PE_check_cmd)
 

Frediano