aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Salvaterra <rsalvaterra@gmail.com>2020-12-30 20:04:42 +0000
committerHauke Mehrtens <hauke@hauke-m.de>2021-01-01 19:55:59 +0100
commitf3bfff9d7f85ab5f2df2728a760ddeebdb185f4c (patch)
treeec61f490654e1b8a8166fdee5c2c87dfbf1c2120
parent59b5c52a6b77e3b6edd45f2526d55efbd0a04043 (diff)
downloadupstream-f3bfff9d7f85ab5f2df2728a760ddeebdb185f4c.tar.gz
upstream-f3bfff9d7f85ab5f2df2728a760ddeebdb185f4c.tar.bz2
upstream-f3bfff9d7f85ab5f2df2728a760ddeebdb185f4c.zip
kernel-build: fix STRIP_KERNEL_EXPORTS for 64-bit kernels
While parsing the nm output, we need to account for the fact that 64-bit kernels have 64-bit wide addresses. While at it, replace the grep | sed combo with a single awk invocation and a stronger regex. Fixes: 2ef0acc5fcda557fa5aaad35d27cb8cf75be96d2 "kernel-build: fix STRIP_KERNEL_EXPORTS for recent kernels" Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
-rw-r--r--include/kernel-build.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/kernel-build.mk b/include/kernel-build.mk
index 22f7c4c7c7..6123c9d456 100644
--- a/include/kernel-build.mk
+++ b/include/kernel-build.mk
@@ -105,7 +105,7 @@ define BuildKernel
xargs $(TARGET_CROSS)nm | \
awk '$$$$1 == "U" { print $$$$2 } ' | \
sort -u > $(KERNEL_BUILD_DIR)/mod_symtab.txt
- $(TARGET_CROSS)nm -n $(LINUX_DIR)/vmlinux.o | grep ' [rR] __ksymtab' | sed -e 's,........ [rR] __ksymtab_,,' > $(KERNEL_BUILD_DIR)/kernel_symtab.txt
+ $(TARGET_CROSS)nm -n $(LINUX_DIR)/vmlinux.o | awk '/^[0-9a-f]+ [rR] __ksymtab_/ {print substr($$$$3,11)}' > $(KERNEL_BUILD_DIR)/kernel_symtab.txt
grep -Ff $(KERNEL_BUILD_DIR)/mod_symtab.txt $(KERNEL_BUILD_DIR)/kernel_symtab.txt > $(KERNEL_BUILD_DIR)/sym_include.txt
grep -Fvf $(KERNEL_BUILD_DIR)/mod_symtab.txt $(KERNEL_BUILD_DIR)/kernel_symtab.txt > $(KERNEL_BUILD_DIR)/sym_exclude.txt
( \