Blame SOURCES/0250-modules-strip-.llvm_addrsig-sections-and-similar.patch

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