summaryrefslogtreecommitdiffstats
path: root/tools/objtool/elf.c
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@redhat.com>2022-04-18 09:50:43 -0700
committerPeter Zijlstra <peterz@infradead.org>2022-04-22 12:32:05 +0200
commit753da4179d08b625d8df72e97724e22749969fd3 (patch)
tree8a0e9ab8379a11f6e78506a8deeba66a339e4a54 /tools/objtool/elf.c
parent489e355b42255c5536a0ea3083a66b54a5e235c3 (diff)
downloadlinux-753da4179d08b625d8df72e97724e22749969fd3.tar.bz2
objtool: Remove --lto and --vmlinux in favor of --link
The '--lto' option is a confusing way of telling objtool to do stack validation despite it being a linked object. It's no longer needed now that an explicit '--stackval' option exists. The '--vmlinux' option is also redundant. Remove both options in favor of a straightforward '--link' option which identifies a linked object. Also, implicitly set '--link' with a warning if the user forgets to do so and we can tell that it's a linked object. This makes it easier for manual vmlinux runs. Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Link: https://lkml.kernel.org/r/dcd3ceffd15a54822c6183e5766d21ad06082b45.1650300597.git.jpoimboe@redhat.com
Diffstat (limited to 'tools/objtool/elf.c')
-rw-r--r--tools/objtool/elf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index 0f6fa372e10e..583a3ec987b5 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -377,6 +377,9 @@ static void elf_add_symbol(struct elf *elf, struct symbol *sym)
sym->type = GELF_ST_TYPE(sym->sym.st_info);
sym->bind = GELF_ST_BIND(sym->sym.st_info);
+ if (sym->type == STT_FILE)
+ elf->num_files++;
+
sym->offset = sym->sym.st_value;
sym->len = sym->sym.st_size;