From e5600fea061c3689f93a3fb68c75565677991832 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 7 Jun 2021 11:51:23 +0200 Subject: [PATCH] dde_linux/extract_initcall_order: support v5.12 This patch adjusts the 'extract_initcall_order' utility to the changed initcall symbol syntax introduced in Linux by the following commit: https://github.com/torvalds/linux/commit/a8cccdd9 It uses an additional sed step to strip away the kmod prefix, __COUNTER__, and __LINE__ information so that the symbol names match those of earlier kernel versions. Issue #4188 --- tool/dde_linux/extract_initcall_order | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tool/dde_linux/extract_initcall_order b/tool/dde_linux/extract_initcall_order index 445ab7e3bf..76d9288f31 100755 --- a/tool/dde_linux/extract_initcall_order +++ b/tool/dde_linux/extract_initcall_order @@ -62,7 +62,16 @@ echo " \"END_OF_INITCALL_ORDER_ARRAY_DUMMY_ENTRY\"" >> $(1); echo "};" >> $(1); endef -INITCALLS = $(shell grep -i "^[0-9a-f]* [t] __initcall_" $(LINUX_KERNEL_DIR)/System.map | awk '{print $$3}') +# +# Linux 5.12 upwards generates data symbols featuring an '__initcall_id' +# including a counter value and __LINE__ information. Discard this information +# when collecting the 'lx_emul_initcall_order'. +# +strip_kmod_prefix = sed "s/__initcall__.*__[0-9]\+_[0-9]\+/__initcall/" + +INITCALLS = $(shell grep -i "^[0-9a-f]* [td] __initcall_" $(LINUX_KERNEL_DIR)/System.map |\ + $(strip_kmod_prefix) |\ + awk '{print $$3}') extract: @$(call print_file_header,$(shell date +"%F"),$(HEADER_FILE))