[PATCH] x86: enable long section names for xen.efi

Jan Beulich posted 1 patch 1 year, 1 month ago
Failed in applying to current master (apply log)
[PATCH] x86: enable long section names for xen.efi
Posted by Jan Beulich 1 year, 1 month ago
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).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
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.

--- a/xen/arch/x86/arch.mk
+++ b/xen/arch/x86/arch.mk
@@ -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)
Re: [PATCH] x86: enable long section names for xen.efi
Posted by Frediano Ziglio 1 year, 1 month ago
On Mon, Sep 23, 2024 at 4:39 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> 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).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> 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.
>
> --- a/xen/arch/x86/arch.mk
> +++ b/xen/arch/x86/arch.mk
> @@ -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)
>

Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>


Frediano
Re: [PATCH] x86: enable long section names for xen.efi
Posted by Andrew Cooper 1 year, 1 month ago
On 23/09/2024 4:39 pm, Jan Beulich wrote:
> 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).
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

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