[PATCH] change the condition preventing symbol replacement in snapshot_symbol()
H.J. Lu
hjl.tools@gmail.com
Fri Jul 24 14:58:00 GMT 2009
On Fri, Jul 24, 2009 at 7:35 AM, Jan Beulich<JBeulich@novell.com> wrote:
> As the new ltoff22x-6 test shows, using the defined-ness of a symbol to
> decide whether to replace it is not correct - whether the symbol gets
> defined before or after the use shouldn't matter. What does matter is
> whether the symbol is global (and hence can, e.g. with ELF, be
> overridden) - it's that case where replacement should be avoided in
> order to not screw up the resulting relocations.
>
> ltoff22x-7 exposes another issue (mailed about yesterday) in that for
> equates of undefined global symbols resolve_symbol_value() will still
> cause the referenced symbol to be used rather than the original one,
> regardless of whether the original symbol is externally visible. The
> test therefore is an xfail for the time being, until I hear back on
> that issue.
>
> gas/
> 2009-07-24 Jan Beulich <jbeulich@novell.com>
>
> * symbols.c (snapshot_symbol): Check whether the to be replaced
> symbol is global, rather than whether the replacement symbol is
> defined.
>
I think it may be wrong. We can have
.globl foo
bar = foo
where foo is defined/global and bar is local. Will you replace foo with
bar?
--
H.J.
More information about the Binutils
mailing list