aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/objtool/include
diff options
context:
space:
mode:
authorJosh Poimboeuf <jpoimboe@kernel.org>2023-05-30 10:20:58 -0700
committerJosh Poimboeuf <jpoimboe@kernel.org>2023-06-07 10:03:16 -0700
commitff4082730c2aaff3706232266e09d1ae4b350521 (patch)
tree6a09f7b452ad09c0668d20670f21abc406c7e3ef /tools/objtool/include
parentobjtool: Fix reloc_hash size (diff)
downloadwireguard-linux-ff4082730c2aaff3706232266e09d1ae4b350521.tar.xz
wireguard-linux-ff4082730c2aaff3706232266e09d1ae4b350521.zip
objtool: Add mark_sec_changed()
Ensure elf->changed always gets set when sec->changed gets set. Link: https://lore.kernel.org/r/9a810a8d2e28af6ba07325362d0eb4703bb09d3a.1685464332.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Diffstat (limited to 'tools/objtool/include')
-rw-r--r--tools/objtool/include/objtool/elf.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/objtool/include/objtool/elf.h b/tools/objtool/include/objtool/elf.h
index b81d78b35126..56b66ff91943 100644
--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -39,7 +39,7 @@ struct section {
Elf_Data *data;
char *name;
int idx;
- bool changed, text, rodata, noinstr, init, truncate;
+ bool _changed, text, rodata, noinstr, init, truncate;
struct reloc *reloc_data;
};
@@ -164,6 +164,18 @@ static inline bool is_reloc_sec(struct section *sec)
return sec->sh.sh_type == SHT_RELA || sec->sh.sh_type == SHT_REL;
}
+static inline bool sec_changed(struct section *sec)
+{
+ return sec->_changed;
+}
+
+static inline void mark_sec_changed(struct elf *elf, struct section *sec,
+ bool changed)
+{
+ sec->_changed = changed;
+ elf->changed |= changed;
+}
+
#define for_each_sec(file, sec) \
list_for_each_entry(sec, &file->elf->sections, list)