nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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