summaryrefslogtreecommitdiff
path: root/tools/objtool/Build
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-03-12 09:34:42 +0100
committerPeter Zijlstra <peterz@infradead.org>2020-03-25 18:28:29 +0100
commit2a362ecc3ec9632aeea4b9a9062db91b2bd9975a (patch)
tree862c13b17b3b80cd22d5e7d82a9c16254720b494 /tools/objtool/Build
parentae358196fac3a0b4d2a7d47a4f401e3421027b03 (diff)
objtool: Optimize find_symbol_*() and read_symbols()
All of: read_symbols(), find_symbol_by_offset(), find_symbol_containing(), find_containing_func() do a linear search of the symbols. Add an RB tree to make it go faster. This about halves objtool runtime on vmlinux.o, from 34s to 18s. 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.499016559@infradead.org
Diffstat (limited to 'tools/objtool/Build')
-rw-r--r--tools/objtool/Build5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/objtool/Build b/tools/objtool/Build
index 8dc4f0848362..66f44f5cd2a6 100644
--- a/tools/objtool/Build
+++ b/tools/objtool/Build
@@ -11,6 +11,7 @@ objtool-y += objtool.o
objtool-y += libstring.o
objtool-y += libctype.o
objtool-y += str_error_r.o
+objtool-y += librbtree.o
CFLAGS += -I$(srctree)/tools/lib
@@ -25,3 +26,7 @@ $(OUTPUT)libctype.o: ../lib/ctype.c FORCE
$(OUTPUT)str_error_r.o: ../lib/str_error_r.c FORCE
$(call rule_mkdir)
$(call if_changed_dep,cc_o_c)
+
+$(OUTPUT)librbtree.o: ../lib/rbtree.c FORCE
+ $(call rule_mkdir)
+ $(call if_changed_dep,cc_o_c)