3d407d2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
3d407d2
From: Peter Jones <pjones@redhat.com>
3d407d2
Date: Thu, 24 Feb 2022 16:40:11 -0500
3d407d2
Subject: [PATCH] modules: strip .llvm_addrsig sections and similar.
3d407d2
3d407d2
Currently grub modules built with clang or gcc have several sections
3d407d2
which we don't actually need or support.
3d407d2
3d407d2
We already have a list of section to skip in genmod.sh, and this patch
3d407d2
adds the following sections to that list (as well as a few newlines):
3d407d2
3d407d2
.note.gnu.property
3d407d2
.llvm*
3d407d2
3d407d2
Note that the glob there won't work without a new enough linker, but the
3d407d2
failure is just reversion to the status quo, so that's not a big problem.
3d407d2
3d407d2
Signed-off-by: Peter Jones <pjones@redhat.com>
3d407d2
---
3d407d2
 grub-core/genmod.sh.in | 5 ++++-
3d407d2
 1 file changed, 4 insertions(+), 1 deletion(-)
3d407d2
3d407d2
diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in
3d407d2
index 1250589b3f..c2c5280d75 100644
3d407d2
--- a/grub-core/genmod.sh.in
3d407d2
+++ b/grub-core/genmod.sh.in
3d407d2
@@ -57,8 +57,11 @@ if test x@TARGET_APPLE_LINKER@ != x1; then
3d407d2
 	    @TARGET_STRIP@ --strip-unneeded \
3d407d2
 		-K grub_mod_init -K grub_mod_fini \
3d407d2
 		-K _grub_mod_init -K _grub_mod_fini \
3d407d2
-		-R .note.gnu.gold-version -R .note.GNU-stack \
3d407d2
+		-R .note.GNU-stack \
3d407d2
+		-R .note.gnu.gold-version \
3d407d2
+		-R .note.gnu.property \
3d407d2
 		-R .gnu.build.attributes \
3d407d2
+		-R '.llvm*' \
3d407d2
 		-R .rel.gnu.build.attributes \
3d407d2
 		-R .rela.gnu.build.attributes \
3d407d2
 		-R .eh_frame -R .rela.eh_frame -R .rel.eh_frame \