blob: 26890261b70074fc59cfaeb4aa3ab59a11097cad [file] [log] [blame]
Brad Bishop08902b02019-08-20 09:16:51 -04001From 917133acc701dbc4636165d3b08d15dc5829a06f Mon Sep 17 00:00:00 2001
Patrick Williamsc0f7c042017-02-23 20:41:17 -06002From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Wed, 17 Aug 2016 04:06:34 -0400
4Subject: [PATCH] grub module explicitly keeps symbole .module_license
5
6While using oe-core toolchain to strip grub module 'all_video.mod',
7it stripped symbol table:
Patrick Williamsc0f7c042017-02-23 20:41:17 -06008
Brad Bishop08902b02019-08-20 09:16:51 -04009---------------
10root@localhost:~# objdump -t all_video.mod
11
Patrick Williamsc0f7c042017-02-23 20:41:17 -060012all_video.mod: file format elf64-x86-64
13
14SYMBOL TABLE:
15no symbols
16--------------
17
18It caused grub to load module all_video failed.
19--------------
20grub> insmod all_video
21error: no symbol table.
22--------------
23
24Tweak strip option to keep symbol .module_license could workaround
25the issue.
26--------------
27root@localhost:~# objdump -t all_video.mod
28
29all_video.mod: file format elf64-x86-64
30
31SYMBOL TABLE:
320000000000000000 l d .text 0000000000000000 .text
330000000000000000 l d .data 0000000000000000 .data
340000000000000000 l d .module_license 0000000000000000 .module_license
350000000000000000 l d .bss 0000000000000000 .bss
360000000000000000 l d .moddeps 0000000000000000 .moddeps
370000000000000000 l d .modname 0000000000000000 .modname
38--------------
39
40Upstream-Status: Pending
41
42Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
43---
44 grub-core/genmod.sh.in | 2 +-
45 1 file changed, 1 insertion(+), 1 deletion(-)
46
Brad Bishop08902b02019-08-20 09:16:51 -040047diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in
48index 1250589..dd14308 100644
49--- a/grub-core/genmod.sh.in
50+++ b/grub-core/genmod.sh.in
51@@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060052 if test x@platform@ != xemu; then
Brad Bishop316dfdd2018-06-25 12:45:53 -040053 @TARGET_STRIP@ --strip-unneeded \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060054 -K grub_mod_init -K grub_mod_fini \
55- -K _grub_mod_init -K _grub_mod_fini \
56+ -K _grub_mod_init -K _grub_mod_fini -K .module_license \
57 -R .note.gnu.gold-version -R .note.GNU-stack \
Brad Bishop08902b02019-08-20 09:16:51 -040058 -R .gnu.build.attributes \
59 -R .rel.gnu.build.attributes \