blob: d9012d1dd6353d0be91e10f2e059f7b6b706c2cc [file] [log] [blame]
Patrick Williamsf52e3dd2024-01-26 13:04:43 -06001From b316ed326bd492106006d78f5bfcd767b49a4f2e 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
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060011
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>
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060043
Patrick Williamsc0f7c042017-02-23 20:41:17 -060044---
45 grub-core/genmod.sh.in | 2 +-
46 1 file changed, 1 insertion(+), 1 deletion(-)
47
Brad Bishop08902b02019-08-20 09:16:51 -040048diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in
Patrick Williamsf52e3dd2024-01-26 13:04:43 -060049index e57c4d9..42bb1ba 100644
Brad Bishop08902b02019-08-20 09:16:51 -040050--- a/grub-core/genmod.sh.in
51+++ b/grub-core/genmod.sh.in
52@@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; then
Patrick Williamsc0f7c042017-02-23 20:41:17 -060053 if test x@platform@ != xemu; then
Brad Bishop316dfdd2018-06-25 12:45:53 -040054 @TARGET_STRIP@ --strip-unneeded \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060055 -K grub_mod_init -K grub_mod_fini \
56- -K _grub_mod_init -K _grub_mod_fini \
57+ -K _grub_mod_init -K _grub_mod_fini -K .module_license \
58 -R .note.gnu.gold-version -R .note.GNU-stack \
Brad Bishop08902b02019-08-20 09:16:51 -040059 -R .gnu.build.attributes \
60 -R .rel.gnu.build.attributes \