Makefile: efi: preserve .dynstr section for LLVM objcopy compatibility
Subsystems (4)
PATCH 1/1 Makefile: efi: preserve .dynstr section for LLVM objcopy compatibility
When building EFI binaries with llvm-objcopy, keeping sections with '-j .dynamic -j .dynsym' without '-j .dynstr' fails with:
llvm-objcopy: error: 'arm/spinlock-test.so': section '.dynstr' cannot be removed because it is referenced by the section '.dynamic'
Include '.dynstr' in the list of preserved sections across arm/Makefile.common, riscv/Makefile, and x86/Makefile.common so that EFI binaries can be built cleanly using llvm-objcopy.
--- arm/Makefile.common | 2 +- riscv/Makefile | 2 +- x86/Makefile.common | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arm/Makefile.common +1 -1
@@ -88,7 +88,7 @@ ifeq ($(CONFIG_EFI),y) $(OBJCOPY) --strip-debug $^ $(OBJCOPY) [email protected] $^ $(OBJCOPY) \ - -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ + -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .dynstr \ -j .rel -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \ -j .reloc \ -O binary $^ $@
riscv/Makefile +1 -1
@@ -123,7 +123,7 @@ cflatobjs += lib/efi.o $(OBJCOPY) --strip-debug $^ $(OBJCOPY) [email protected] $^ $(OBJCOPY) \ - -j .text -j .sdata -j .data -j .rodata -j .dynamic -j .dynsym \ + -j .text -j .sdata -j .data -j .rodata -j .dynamic -j .dynsym -j .dynstr \ -j .rel -j .rela -j .rel.* -j .rela.* -j .rel* -j .rela* \ -j .reloc \ -O binary $^ $@
x86/Makefile.common +1 -1
@@ -58,7 +58,7 @@ ifeq ($(CONFIG_EFI),y) $(OBJCOPY) --strip-debug $^ $(OBJCOPY) [email protected] $^ $(OBJCOPY) \ - -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ + -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .dynstr -j .rel \ -j .rela -j .reloc -S --target=$(FORMAT) $< $@ @chmod a-x $@ else
Signature · 1 line
2.55.0.229.g6434b31f56-goog
Quoted 10 lines · Colton Lewis
When building EFI binaries with llvm-objcopy, keeping sections with '-j .dynamic -j .dynsym' without '-j .dynstr' fails with:
llvm-objcopy: error: 'arm/spinlock-test.so': section '.dynstr' cannot be removed because it is referenced by the section '.dynamic'
Include '.dynstr' in the list of preserved sections across arm/Makefile.common, riscv/Makefile, and x86/Makefile.common so that EFI binaries can be built cleanly using llvm-objcopy.
Quoted 8 lines
Assisted-by Gemini:gemini-nextSigned-off-by Colton Lewis <[email protected]>--- arm/Makefile.common | 2 +- riscv/Makefile | 2 +- x86/Makefile.common | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Pushed.
Thanks,
drew
Thanks Andrew!
Quoted 24 lines · Andrew Jones
Quoted 10 lines · Colton Lewis
When building EFI binaries with llvm-objcopy, keeping sections with '-j .dynamic -j .dynsym' without '-j .dynstr' fails with:
llvm-objcopy: error: 'arm/spinlock-test.so': section '.dynstr' cannot be removed because it is referenced by the section '.dynamic'
Include '.dynstr' in the list of preserved sections across arm/Makefile.common, riscv/Makefile, and x86/Makefile.common so that EFI binaries can be built cleanly using llvm-objcopy.
Quoted 7 lines
Assisted-by Gemini:gemini-nextSigned-off-by Colton Lewis <[email protected]>--- arm/Makefile.common | 2 +- riscv/Makefile | 2 +- x86/Makefile.common | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)Pushed.
Thanks,
drew