This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch, objcopy] Fix objcopy quadratic-time when handling --redefine-syms
- From: Alan Modra <amodra at gmail dot com>
- To: Jiong Wang <jiong dot wang at foss dot arm dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Thu, 6 Apr 2017 18:48:42 +0930
- Subject: Re: [Patch, objcopy] Fix objcopy quadratic-time when handling --redefine-syms
- Authentication-results: sourceware.org; auth=none
- References: <65d8aa4f-2138-629b-e89c-f04946bd1d50@foss.arm.com>
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