Re: [RFC][PATCH 12/16] objtool: Optimize read_sections()

From: Josh Poimboeuf
Date: Sun Mar 15 2020 - 13:01:56 EST


On Thu, Mar 12, 2020 at 02:41:19PM +0100, Peter Zijlstra wrote:
> +++ b/tools/objtool/elf.h
> @@ -25,6 +25,8 @@
> #define ELF_C_READ_MMAP ELF_C_READ
> #endif
>
> +struct elf;
> +
> struct section {
> struct list_head list;
> struct hlist_node hash;
> @@ -33,7 +35,7 @@ struct section {
> struct rb_root symbol_tree;
> struct list_head symbol_list;
> struct list_head rela_list;
> - DECLARE_HASHTABLE(rela_hash, 16);
> + struct elf *elf;

Instead of adding 'elf' here I'd rather just add it as an argument to
the find_rela_by_dest*() functions.

--
Josh