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

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