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

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