[kvm-unit-tests PATCH] Makefile: efi: preserve .dynstr section for LLVM objcopy compatibility
Colton Lewis <[email protected]> Thu, 16 Jul 2026 17:33:15 +0000
| Newsgroups | org.infradead.lists.kvm-riscv,dev.linux.lists.kvmarm,org.kernel.vger.kvm |
|---|---|
| Message-ID | <[email protected]> |
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. Assisted-by: Gemini:gemini-next Signed-off-by: Colton Lewis <[email protected]> --- arm/Makefile.common | 2 +- riscv/Makefile | 2 +- x86/Makefile.common | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arm/Makefile.common b/arm/Makefile.common index a5d97bcf..550ec0a1 100644 --- a/arm/Makefile.common +++ b/arm/Makefile.common @@ -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 $^ $@ diff --git a/riscv/Makefile b/riscv/Makefile index 64720c38..348a30a7 100644 --- a/riscv/Makefile +++ b/riscv/Makefile @@ -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 $^ $@ diff --git a/x86/Makefile.common b/x86/Makefile.common index a251dd71..054e2391 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -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 -- 2.55.0.229.g6434b31f56-goog -- kvm-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kvm-riscv