PATCH: Check symbol type for symbol alias
Fri Jul 20 13:07:00 GMT 2007
On Fri, Jul 20, 2007 at 10:12:42AM +0100, Richard Sandiford wrote:
> "H.J. Lu" <email@example.com> writes:
> > Here is a patch to add a testcase and check symbol type for symbol
> > alias.
> In case anyone's in any doubt, this really doesn't fix my original
> problem. Although the strong symbol in the test's shared library was
> defined by the linker script, that was mostly for test convenience.
> We can still have a situation in which an object symbol "bar" in a
> shared library is overridden by an assignment "PROVIDE (bar = .);" in
> the linker script of an object being linked against the shared library.
> (And as I said in the covering note, we do handle that situation
> correctly; we use relocations against the original weak symbol instead.)
> I can adjust the testcase in the obvious way if this patch goes in.
The problem is linker creates a wrong symbol alias for a dynamic
object. We don't have a reliable way to tell if a symbol is an aliase
in a shared library. It can lead to many problems. Can we use
STT_SECTION for linker created symbols? Gabi says
The symbol is associated with a section. Symbol table entries of
this type exist primarily for relocation and normally have STB_LOCAL
It doesn't forbid STB_GLOBAL binding. At least, we won't make a weak
symbol an alias of linker created symbols.
More information about the Binutils