This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Bad patch for gas
On Wed, May 23, 2001 at 03:25:28PM -0700, H . J . Lu wrote:
>
> I am afraid that patch has to be reverted. There are 2 problems:
>
> 1. finalize_syms used to be initialized to 1 and resolve_symbol_value
> had many "if (finalize)". Initialize finalize_syms to 0 and change
> "if (finalize)" to "if (finalize_syms)" don't look right to me.
This change was deliberate. The intent is to prevent all symbol
and expression resolution until after relaxation has completed. See
http://sources.redhat.com/ml/binutils/2001-05/msg00315.html, and
notice the values shown in the symbol table for "len", "tble" and "l2".
The incorrect values are a direct result of ".set" resolving the
expression "tble-l2" too early.
> 2. There are at least 3 places where resolve_symbol_value was called
> with
>
> xxx = resolve_symbol_value (frag->fr_symbol, 0);
>
> Your changes won't work in those cases.
The three places are dwarf2dbg.c:dwarf2dbg_estimate_size_before_relax,
ehopt.c:eh_frame_estimate_size_before_relax, and write.c:relax_segment.
All of these are before relaxation is complete, so finalize_syms is
zero.
I can well imagine there may be some nasty code in some of the
back-ends that fail due to my change. Can you be a little more
explicit in describing the problems you are seeing? Let's fix
the back-end code rather than reverting my change.
--
Alan Modra