'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.
Showing the changes to tools/objtool/include (1 of 3 files). Show all
Unified · Split
| @@ -325,16 +325,16 @@ static inline void set_sym_next_reloc(struct reloc *reloc, struct reloc *next) · 324 unmodified lines | |||
| 325 | reloc->_sym_next_reloc = (unsigned long)next | bit; | 325 | reloc->_sym_next_reloc = (unsigned long)next | bit; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | #define for_each_sec(file, sec) \ | 328 | #define for_each_sec(elf, sec) \ |
| 329 | list_for_each_entry(sec, &file->elf->sections, list) | 329 | list_for_each_entry(sec, &elf->sections, list) |
| 330 | 330 | ||
| 331 | #define sec_for_each_sym(sec, sym) \ | 331 | #define sec_for_each_sym(sec, sym) \ |
| 332 | list_for_each_entry(sym, &sec->symbol_list, list) | 332 | list_for_each_entry(sym, &sec->symbol_list, list) |
| 333 | 333 | ||
| 334 | #define for_each_sym(file, sym) \ | 334 | #define for_each_sym(elf, sym) \ |
| 335 | for (struct section *__sec, *__fake = (struct section *)1; \ | 335 | for (struct section *__sec, *__fake = (struct section *)1; \ |
| 336 | __fake; __fake = NULL) \ | 336 | __fake; __fake = NULL) \ |
| 337 | for_each_sec(file, __sec) \ | 337 | for_each_sec(elf, __sec) \ |
| 338 | sec_for_each_sym(__sec, sym) | 338 | sec_for_each_sym(__sec, sym) |
| 339 | 339 | ||
| 340 | #define for_each_reloc(rsec, reloc) \ | 340 | #define for_each_reloc(rsec, reloc) \ |