[PATCH] modpost: decreasing the log print level

oaygnahzz posted 1 patch 7 months ago
scripts/mod/modpost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] modpost: decreasing the log print level
Posted by oaygnahzz 7 months ago
We are doing a kernel hot patch and have modified the internal 
implementation of an exported function (funcA) while also adding 
a new function (funcB) and exporting it. The compilation of the 
kernel hot patch failed, and the print is as follows:.
export_stymbol section contains strange symbol '(unknown)'.

I found that there was a change in whether to call sym_add_exported. 
Before commit ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by modpost")
 committed, it only judged whether it was equal to __ksymtab_. But now, 
it obtains the export symbol by traversing the. rela.export_symbol section 
and then calls check_export_symbol. In the above case, the. 
rela.export_symbol section will have additional funcA information, 
but no export information. This will lead to an error in calling 
check_export_symbol (null is returned when find_fromsym processes funcA), 
and the hot patch make fails.

Signed-off-by: oaygnahzz <oaygnahzz@gmail.com>
---
 scripts/mod/modpost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index be89921d60b6..cbf83c58f00f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1075,7 +1075,7 @@ static void check_export_symbol(struct module *mod, struct elf_info *elf,
 	label_name = sym_name(elf, label);
 
 	if (!strstarts(label_name, prefix)) {
-		error("%s: .export_symbol section contains strange symbol '%s'\n",
+		warn("%s: .export_symbol section contains strange symbol '%s'\n",
 		      mod->name, label_name);
 		return;
 	}
-- 
2.33.0