]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Optimize find_symbol_by_index()
authorPeter Zijlstra <peterz@infradead.org>
Tue, 10 Mar 2020 17:39:45 +0000 (18:39 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 25 Mar 2020 17:28:28 +0000 (18:28 +0100)
commit201b8104e0f08ac69528a1828d97a6c70b4267d9
treee0fdb3bbce4da48058fd87271d2375d5ad68e5de
parent7da7266bea176a1dea1170a9fa380f6a9f23299e
objtool: Optimize find_symbol_by_index()

The symbol index is object wide, not per section, so it makes no sense
to have the symbol_hash be part of the section object. By moving it to
the elf object we avoid the linear sections iteration.

This reduces the runtime of objtool on vmlinux.o from over 3 hours (I
gave up) to a few minutes. The defconfig vmlinux.o has around 20k
sections.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Link: https://lkml.kernel.org/r/20200324160924.261852348@infradead.org
tools/objtool/elf.c
tools/objtool/elf.h