[objcopy] Fix quadratic-time when handling --redefine-syms
authorJiong Wang <jiong.wang@arm.com>
Wed, 5 Apr 2017 16:22:47 +0000 (17:22 +0100)
committerJiong Wang <jiong.wang@arm.com>
Thu, 6 Apr 2017 09:31:27 +0000 (10:31 +0100)
commit0f65a5d84d0a83e5594cf17d04e9f98ab66652a4
treead501422fdad0be04998024eb840220a24cc750c
parent9014582538e38055e438b6cce28d165a73abcc60
[objcopy] Fix quadratic-time when handling --redefine-syms

objcopy/
* objcopy.c (struct redefine_node): Delete the field "next".
(redefine_sym_list): Deleted.
(redefine_specific_htab): New hash table.
(redefine_specific_reverse_htab): Likewise.
(eq_string_redefnode): New function.
(htab_hash_redefnode): Likewise.
(create_symbol2redef_htab): Likewise.
(add_specific_symbol_node): Likewise.
(create_symbol_htabs): Create redefine_specific_htab and
redefine_specific_reverse_htab.
(lookup_sym_redefinition): Use hash table instead of list.
(redefine_list_append): Likewise, and rename to add_redefine_and_check.
(copy_main): Use redefine_specific_htab instead of redefine_sym_list.
Update comments.
binutils/ChangeLog
binutils/objcopy.c