Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 1 | From 7461a3de38b66edbe2f5593f9bdab9f2704d32bc Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Wed, 17 Aug 2016 04:06:34 -0400 |
| 4 | Subject: [PATCH] grub module explicitly keeps symbole .module_license |
| 5 | |
| 6 | While using oe-core toolchain to strip grub module 'all_video.mod', |
| 7 | it stripped symbol table: |
| 8 | -------------- |
| 9 | root@localhost:~# objdump -t all_video.mod |
| 10 | |
| 11 | all_video.mod: file format elf64-x86-64 |
| 12 | |
| 13 | SYMBOL TABLE: |
| 14 | no symbols |
| 15 | -------------- |
| 16 | |
| 17 | It caused grub to load module all_video failed. |
| 18 | -------------- |
| 19 | grub> insmod all_video |
| 20 | error: no symbol table. |
| 21 | -------------- |
| 22 | |
| 23 | Tweak strip option to keep symbol .module_license could workaround |
| 24 | the issue. |
| 25 | -------------- |
| 26 | root@localhost:~# objdump -t all_video.mod |
| 27 | |
| 28 | all_video.mod: file format elf64-x86-64 |
| 29 | |
| 30 | SYMBOL TABLE: |
| 31 | 0000000000000000 l d .text 0000000000000000 .text |
| 32 | 0000000000000000 l d .data 0000000000000000 .data |
| 33 | 0000000000000000 l d .module_license 0000000000000000 .module_license |
| 34 | 0000000000000000 l d .bss 0000000000000000 .bss |
| 35 | 0000000000000000 l d .moddeps 0000000000000000 .moddeps |
| 36 | 0000000000000000 l d .modname 0000000000000000 .modname |
| 37 | -------------- |
| 38 | |
| 39 | Upstream-Status: Pending |
| 40 | |
| 41 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 42 | --- |
| 43 | grub-core/genmod.sh.in | 2 +- |
| 44 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 45 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 46 | Index: grub-2.02/grub-core/genmod.sh.in |
| 47 | =================================================================== |
| 48 | --- grub-2.02.orig/grub-core/genmod.sh.in |
| 49 | +++ grub-2.02/grub-core/genmod.sh.in |
| 50 | @@ -56,7 +56,7 @@ if test x@TARGET_APPLE_LINKER@ != x1; th |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 51 | if test x@platform@ != xemu; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 52 | @TARGET_STRIP@ --strip-unneeded \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 53 | -K grub_mod_init -K grub_mod_fini \ |
| 54 | - -K _grub_mod_init -K _grub_mod_fini \ |
| 55 | + -K _grub_mod_init -K _grub_mod_fini -K .module_license \ |
| 56 | -R .note.gnu.gold-version -R .note.GNU-stack \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 57 | -R .note -R .comment -R .ARM.exidx $tmpfile || exit 1 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 58 | fi |