[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250619145659.1377970-7-alexandre.chartre@oracle.com>
Date: Thu, 19 Jun 2025 16:56:48 +0200
From: Alexandre Chartre <alexandre.chartre@...cle.com>
To: linux-kernel@...r.kernel.org, mingo@...nel.org, jpoimboe@...nel.org,
peterz@...radead.org
Cc: alexandre.chartre@...cle.com
Subject: [RFC PATCH v2 06/17] objtool: Improve offstr() output
offset() formats a section offset into a "<symbol>+<offset>" string.
Improve the output to just "<symbol>" when the offset is zero.
Signed-off-by: Alexandre Chartre <alexandre.chartre@...cle.com>
---
tools/objtool/include/objtool/warn.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/objtool/include/objtool/warn.h b/tools/objtool/include/objtool/warn.h
index 125093d568be..d89e6ae69143 100644
--- a/tools/objtool/include/objtool/warn.h
+++ b/tools/objtool/include/objtool/warn.h
@@ -43,12 +43,12 @@ static inline char *offstr(struct section *sec, unsigned long offset)
if (sym) {
str = malloc(strlen(sym->name) + strlen(sec->name) + 40);
- len = sprintf(str, "%s+0x%lx", sym->name, offset - sym->offset);
+ len = sprint_name(str, sym->name, offset - sym->offset);
if (opts.sec_address)
sprintf(str+len, " (%s+0x%lx)", sec->name, offset);
} else {
str = malloc(strlen(sec->name) + 20);
- sprintf(str, "%s+0x%lx", sec->name, offset);
+ sprint_name(str, sec->name, offset);
}
return str;
--
2.43.5
Powered by blists - more mailing lists