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

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