This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFA:] Fix DEFINED in ld scripts.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Fri, 10 Oct 2003 22:22:10 +0930
- Subject: Re: [RFA:] Fix DEFINED in ld scripts.
- References: <Pine.BSF.4.44.0310100411150.56594-100000@dair.pair.com>
On Fri, Oct 10, 2003 at 04:12:39AM -0400, Hans-Peter Nilsson wrote:
> + /* The value "3" is ad-hoc, somewhat related to the expected number of
> + DEFINED expressions in a linker script. For most default linker
> + scripts, there are none. */
> + if (bfd_hash_table_init_n (&lang_definedness_table,
> + lang_definedness_newfunc, 3) != TRUE)
So why bother with a hash table? Wouldn't a simple list do?
> ! Callers of exp_fold_tree need to increment
> ! lang_statement_iteration before starting to iterate over the
> ! statement list. We need to do it before each call instead of
> ! in lang_do_assignments because we can't tell the root call
> ! from its recursions. */
Split out the body of lang_do_assignments to lang_do_assignments_1.
Then you can twiddle your iteration count in lang_do_assignments.
--
Alan Modra
IBM OzLabs - Linux Technology Centre