diff options
author | Peter Zijlstra <peterz@infradead.org> | 2020-04-17 23:15:00 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-06-18 17:36:33 +0200 |
commit | 2b10be23ac0f8e107fd575397361ddbaebc2944b (patch) | |
tree | 315aa11c90cdba7d5789ddfd9ace91910d5c099b /tools/objtool/check.c | |
parent | b3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff) |
objtool: Clean up elf_write() condition
With there being multiple ways to change the ELF data, let's more
concisely track modification.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r-- | tools/objtool/check.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 5fbb90a80d23..91a67db26165 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2740,7 +2740,7 @@ int check(const char *_objname, bool orc) objname = _objname; - file.elf = elf_open_read(objname, orc ? O_RDWR : O_RDONLY); + file.elf = elf_open_read(objname, O_RDWR); if (!file.elf) return 1; @@ -2801,7 +2801,9 @@ int check(const char *_objname, bool orc) ret = create_orc_sections(&file); if (ret < 0) goto out; + } + if (file.elf->changed) { ret = elf_write(file.elf); if (ret < 0) goto out; |