diff options
| author | Alexandre Chartre <alexandre.chartre@oracle.com> | 2025-11-21 12:53:19 +0300 |
|---|---|---|
| committer | Peter Zijlstra <peterz@infradead.org> | 2025-11-21 17:30:09 +0300 |
| commit | de0248fbbf999d0fd3ca2aa5ba515ab78703d129 (patch) | |
| tree | 78bde3a967eab926a3cf1e39e3909b38b3352904 | |
| parent | a0e5bf9fd6a048a8dc65f672e625674cd167d172 (diff) | |
| download | linux-de0248fbbf999d0fd3ca2aa5ba515ab78703d129.tar.xz | |
objtool: Record symbol name max length
Keep track of the maximum length of symbol names. This will help
formatting the code flow between different functions.
Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Link: https://patch.msgid.link/20251121095340.464045-10-alexandre.chartre@oracle.com
| -rw-r--r-- | tools/objtool/check.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 6573056a49fe..0fbf0eb37051 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -37,6 +37,8 @@ static struct cfi_state init_cfi; static struct cfi_state func_cfi; static struct cfi_state force_undefined_cfi; +static size_t sym_name_max_len; + struct instruction *find_insn(struct objtool_file *file, struct section *sec, unsigned long offset) { @@ -2463,6 +2465,7 @@ static bool is_profiling_func(const char *name) static int classify_symbols(struct objtool_file *file) { struct symbol *func; + size_t len; for_each_sym(file->elf, func) { if (is_notype_sym(func) && strstarts(func->name, ".L")) @@ -2489,6 +2492,10 @@ static int classify_symbols(struct objtool_file *file) if (is_profiling_func(func->name)) func->profiling_func = true; + + len = strlen(func->name); + if (len > sym_name_max_len) + sym_name_max_len = len; } return 0; |
