This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] change the condition preventing symbol replacement in snapshot_symbol()
On Fri, Jul 24, 2009 at 7:59 AM, Jan Beulich<JBeulich@novell.com> wrote:
>>>> "H.J. Lu" <email@example.com> 24.07.09 16:56 >>>
>>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.
>>> 2009-07-24 ?Jan Beulich ?<firstname.lastname@example.org>
>>> ? ? ? ?* 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
>>bar = foo
>>where foo is defined/global and bar is local. Will you replace foo with
> No, only the other way around: bar (non-global) can be replaced by foo.
That is what I meant and it is wrong. You can't replace a local symbol with
a global one.