Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 1 | From 917133acc701dbc4636165d3b08d15dc5829a06f Mon Sep 17 00:00:00 2001 |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 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: |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 8 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 9 | --------------- |
| 10 | root@localhost:~# objdump -t all_video.mod |
| 11 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 12 | all_video.mod: file format elf64-x86-64 |
| 13 | |
| 14 | SYMBOL TABLE: |
| 15 | no symbols |
| 16 | -------------- |
| 17 | |
| 18 | It caused grub to load module all_video failed. |
| 19 | -------------- |
| 20 | grub> insmod all_video |
| 21 | error: no symbol table. |
| 22 | -------------- |
| 23 | |
| 24 | Tweak strip option to keep symbol .module_license could workaround |
| 25 | the issue. |
| 26 | -------------- |
| 27 | root@localhost:~# objdump -t all_video.mod |
| 28 | |
| 29 | all_video.mod: file format elf64-x86-64 |
| 30 | |
| 31 | SYMBOL TABLE: |
| 32 | 0000000000000000 l d .text 0000000000000000 .text |
| 33 | 0000000000000000 l d .data 0000000000000000 .data |
| 34 | 0000000000000000 l d .module_license 0000000000000000 .module_license |
| 35 | 0000000000000000 l d .bss 0000000000000000 .bss |
| 36 | 0000000000000000 l d .moddeps 0000000000000000 .moddeps |
| 37 | 0000000000000000 l d .modname 0000000000000000 .modname |
| 38 | -------------- |
| 39 | |
| 40 | Upstream-Status: Pending |
| 41 | |
| 42 | Signed-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 Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 47 | diff --git a/grub-core/genmod.sh.in b/grub-core/genmod.sh.in |
| 48 | index 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 52 | if test x@platform@ != xemu; then |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 53 | @TARGET_STRIP@ --strip-unneeded \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 54 | -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 Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 58 | -R .gnu.build.attributes \ |
| 59 | -R .rel.gnu.build.attributes \ |