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

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