This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] change the condition preventing symbol replacement in snapshot_symbol()

On Fri, Jul 24, 2009 at 8:59 AM, Jan Beulich<> wrote:
>>>> "H.J. Lu" <> 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
>>> 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?

Global symbol may be overridden by another definition. You
can't change relocation against a local symbol to a global

> 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.

A testcase?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]