]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Improve reloc hash size guestimate
authorPeter Zijlstra <peterz@infradead.org>
Fri, 11 Jun 2021 06:33:36 +0000 (08:33 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 14 Jun 2021 12:05:36 +0000 (14:05 +0200)
commit8755bd4db728f93ac55e6a6c98d829b71c6441cf
treec1ea88952eeffb4a3b2967108fe769e7369f7f36
parentef78709a91fea2e60e8c5c3936c4bf648f73b2ca
objtool: Improve reloc hash size guestimate

Nathan reported that LLVM ThinLTO builds have a performance regression
with commit df6a5d7ae9c3 ("objtool: Rewrite hashtable sizing"). Sami
was quick to note that this is due to their use of -ffunction-sections.

As a result the .text section is small and basing the number of relocs
off of that no longer works. Instead have read_sections() compute the
sum of all SHF_EXECINSTR sections and use that.

Fixes: df6a5d7ae9c3 ("objtool: Rewrite hashtable sizing")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Debugged-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lkml.kernel.org/r/YMJpGLuGNsGtA5JJ@hirez.programming.kicks-ass.net
tools/objtool/elf.c
tools/objtool/include/objtool/elf.h