History

objtool: Convert elf iterator macros to use 'struct elf'

'struct objtool_file' is specific to the check code and doesn't belong in the elf code which is supposed to be objtool_file-agnostic. Convert the elf iterator macros to use 'struct elf' instead.

Josh Poimboeuf committed 1 year ago

Commit 96eceff1 parent 72e4b6b3 files · +17 −17Browse files

Showing the changes to tools/objtool/include (1 of 3 files). Show all

Unified · Split

tools/objtool/include/objtool/elf.h+4−4
@@ -325,16 +325,16 @@ static inline void set_sym_next_reloc(struct reloc *reloc, struct reloc *next) · 324 unmodified lines
325325 reloc->_sym_next_reloc = (unsigned long)next | bit;
326326 }
327327
328−#define for_each_sec(file, sec) \
329− list_for_each_entry(sec, &file->elf->sections, list)
328+#define for_each_sec(elf, sec) \
329+ list_for_each_entry(sec, &elf->sections, list)
330330
331331 #define sec_for_each_sym(sec, sym) \
332332 list_for_each_entry(sym, &sec->symbol_list, list)
333333
334−#define for_each_sym(file, sym) \
334+#define for_each_sym(elf, sym) \
335335 for (struct section *__sec, *__fake = (struct section *)1; \
336336 __fake; __fake = NULL) \
337− for_each_sec(file, __sec) \
337+ for_each_sec(elf, __sec) \
338338 sec_for_each_sym(__sec, sym)
339339
340340 #define for_each_reloc(rsec, reloc) \