diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-03-08 18:30:13 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-03-15 12:32:32 +0300 |
commit | f2d3a250897133cc36c13a641bd6a9b4dd5ad234 (patch) | |
tree | dda16098a471e59ff9c7a2d80859bab1f9cb2681 /tools/objtool/elf.c | |
parent | b44544fe0298ee2224960a31f795e317029e2a60 (diff) | |
download | linux-f2d3a250897133cc36c13a641bd6a9b4dd5ad234.tar.xz |
objtool: Add --dry-run
Add a --dry-run argument to skip writing the modifications. This is
convenient for debugging.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lore.kernel.org/r/20220308154317.282720146@infradead.org
Diffstat (limited to 'tools/objtool/elf.c')
-rw-r--r-- | tools/objtool/elf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c index 4b384c907027..456ac2206404 100644 --- a/tools/objtool/elf.c +++ b/tools/objtool/elf.c @@ -1019,6 +1019,9 @@ int elf_write(struct elf *elf) struct section *sec; Elf_Scn *s; + if (dryrun) + return 0; + /* Update changed relocation sections and section headers: */ list_for_each_entry(sec, &elf->sections, list) { if (sec->changed) { |