Skip to contentSkip to conversation

livepatch: Fix the error message about unresolvable ambiguity

PATCH In review Petr Mladek 4 participants 4 messages Mar 9, 2016 Live patching

lore
Share & tools
lore

Petr Mladek

author maintainer
#0 lore raw

PATCH 1/1 livepatch: Fix the error message about unresolvable ambiguity

klp_find_callback() stops the search when sympos is not defined and a second symbol of the same name is found. It means that the current error message about the unresolvable ambiguity always prints "(2 matches)".

Let's remove this information. The total number of occurrences is not much helpful. The author of the patch still must put a non-trivial effort into searching the right position in the object file.

---
 kernel/livepatch/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/livepatch/core.c +2 -2
index bc2c85c064c1..f2eda09e8357 100644
@@ -190,8 +190,8 @@ static int klp_find_object_symbol(const char *objname, const char *name,
 	if (args.addr == 0)
 		pr_err("symbol '%s' not found in symbol table\n", name);
 	else if (args.count > 1 && sympos == 0) {
-		pr_err("unresolvable ambiguity (%lu matches) on symbol '%s' in object '%s'\n",
-		       args.count, name, objname);
+		pr_err("unresolvable ambiguity on symbol '%s' in object '%s'\n",
+		       name, objname);
 	} else if (sympos != args.count && sympos > 0) {
 		pr_err("symbol position %lu for symbol '%s' in object '%s' not found\n",
 		       sympos, name, objname ? objname : "vmlinux");
Signature · 1 line
1.8.5.6
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Petr Mladek

klp_find_callback() stops the search when sympos is not defined and a second symbol of the same name is found. It means that the current error message about the unresolvable ambiguity always prints "(2 matches)".

Let's remove this information. The total number of occurrences is not much helpful. The author of the patch still must put a non-trivial effort into searching the right position in the object file.

---
 kernel/livepatch/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/livepatch/core.c +0 -0
index bc2c85c064c1..f2eda09e8357 100644

kernel/livepatch/core.c static int klp_find_object_symbol(const char *objname, const char *name, · line 193

Quoted 6 lines
kernel/livepatch/core.c +1 -2
@@ -190,8 +190,8 @@ static int klp_find_object_symbol(const char *objname, const char *name,
 	if (args.addr == 0)
 		pr_err("symbol '%s' not found in symbol table\n", name);
 	else if (args.count > 1 && sympos == 0) {
-		pr_err("unresolvable ambiguity (%lu matches) on symbol '%s' in object '%s'\n",
-		       args.count, name, objname);
+		pr_err("unresolvable ambiguity on symbol '%s' in object '%s'\n",

While you're at it, can you improve the grammar: s/on/for/ ?

"unresolvable ambiguity *for* symbol..."

Either way,

Signature · 1 line
Josh
Acked-by
#2 lore raw
Quoted 28 lines · Josh Poimboeuf
Quoted 18 lines · Petr Mladek

klp_find_callback() stops the search when sympos is not defined and a second symbol of the same name is found. It means that the current error message about the unresolvable ambiguity always prints "(2 matches)".

Let's remove this information. The total number of occurrences is not much helpful. The author of the patch still must put a non-trivial effort into searching the right position in the object file.

---
 kernel/livepatch/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/livepatch/core.c +0 -0
index bc2c85c064c1..f2eda09e8357 100644

kernel/livepatch/core.c static int klp_find_object_symbol(const char *objname, const char *name, · line 193

Quoted 6 lines
kernel/livepatch/core.c +1 -2
@@ -190,8 +190,8 @@ static int klp_find_object_symbol(const char *objname, const char *name,
 	if (args.addr == 0)
 		pr_err("symbol '%s' not found in symbol table\n", name);
 	else if (args.count > 1 && sympos == 0) {
-		pr_err("unresolvable ambiguity (%lu matches) on symbol '%s' in object '%s'\n",
-		       args.count, name, objname);
+		pr_err("unresolvable ambiguity on symbol '%s' in object '%s'\n",

While you're at it, can you improve the grammar: s/on/for/ ?

Quoted 9 lines

"unresolvable ambiguity *for* symbol..."

Either way,

Signature · 1 line
Josh

I agree that the 'matches' error message doesn't added anything helpful. With the word change above:

--chris

#3 lore raw
In reply to Petr Mladek
Quoted 9 lines · Petr Mladek

klp_find_callback() stops the search when sympos is not defined and a second symbol of the same name is found. It means that the current error message about the unresolvable ambiguity always prints "(2 matches)".

Let's remove this information. The total number of occurrences is not much helpful. The author of the patch still must put a non-trivial effort into searching the right position in the object file.

I've fixed the grammar as suggested by Josh and applied to for-4.6/upstream.

Signature · 2 lines
Jiri Kosina
SUSE Labs