This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] change the condition preventing symbol replacement in snapshot_symbol()
>>> "H.J. Lu" <hjl.tools@gmail.com> 24.07.09 17:45 >>>
>>>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?
>>
>> 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.
Why? A non-global equate just serves as an alias. And remember, the
change fixes a problem (you just didn't cover all of the possible cases with
your ltoff22x tests) - how would you suggest addressing that otherwise?
Also, the logic in resolve_symbol_values() does just that - replace
relocations using non-global (and erroneously as I think also global ones
at present) equates by their global underlying symbols.
Jan