Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Colton Lewis <coltonlewis@google.com>
To: andrew.jones@linux.dev, pbonzini@redhat.com
Cc: alexandru.elisei@arm.com, eric.auger@redhat.com,
	kvmarm@lists.linux.dev,  kvm@vger.kernel.org,
	kvm-riscv@lists.infradead.org,
	 Colton Lewis <coltonlewis@google.com>
Subject: [kvm-unit-tests PATCH] Makefile: efi: preserve .dynstr section for LLVM objcopy compatibility
Date: Thu, 16 Jul 2026 17:33:15 +0000	[thread overview]
Message-ID: <20260716173315.2775989-1-coltonlewis@google.com> (raw)

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 <coltonlewis@google.com>
---
 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) --add-gnu-debuglink=$@.debug $^
 	$(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) --add-gnu-debuglink=$@.debug $^
 	$(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) --add-gnu-debuglink=$@.debug $^
 	$(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


             reply	other threads:[~2026-07-16 17:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 17:33 Colton Lewis [this message]
2026-07-21  8:58 ` [kvm-unit-tests PATCH] Makefile: efi: preserve .dynstr section for LLVM objcopy compatibility Andrew Jones
2026-07-21 23:07   ` Colton Lewis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260716173315.2775989-1-coltonlewis@google.com \
    --to=coltonlewis@google.com \
    --cc=alexandru.elisei@arm.com \
    --cc=andrew.jones@linux.dev \
    --cc=eric.auger@redhat.com \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox