This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, objcopy] Fix objcopy quadratic-time when handling --redefine-syms

On Thu, Apr 06, 2017 at 09:43:15AM +0100, Jiong Wang wrote:
>         * 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.

OK, except

> +static hashval_t
> +htab_hash_redefnode (const PTR p)

please replace PTR with void *,

> +/* Like add_specific_symbol, but the element type is PTR.  */
> +
> +static void
> +add_specific_symbol_node (const PTR node, htab_t htab)
> +{
> +  *htab_find_slot (htab, node, INSERT) = (PTR) node;

and here.

Alan Modra
Australia Development Lab, IBM

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]