[Dwarf-discuss] DW_AT_MIPS_linkage_name

Chris Quenelle Chris.Quenelle
Fri Mar 25 13:35:22 GMT 2005


I haven't finished digging through your example to see if I can
fix it, but I wanted to clarify some of the terms we're using.

"weak reference"

     A symbol table entry with shndx==UNDEF and bind==WEAK

"weak definition"

     A symbol table entry with shndx==.text (for example) and bind==WEAK

I think we want to stay away from weak definitions.

In the dwarf scheme I am considering, there is no reason to create
weak definitions.  You only create weak references to hang your dwarf
relocations off of.  And (if possible) only if the variable or function is
not defined in the current object file.

When I compile your example on a SuSE box, I get a symbol in weak.o
with shndx==ABS and bind==WEAK.  When I look in user.o I see a symbol
with the same name with shndx==UNDEF and bind=GLOBAL.  So that's not
a weak reference.

I might be misreading your example, but I think we might be able to get
it working with some different symbol properties.  I attached the example
that I came up with in this email.  This example seems to demonstrate the
behavior I'm looking for on Solaris 10, and SuSE Linux (haven't tried
other systems yet).  It's just very very basic "pragma weak" style
functionality (as far I can tell).

 > The root of this still is the same: that ld can't
> distinguish between a reference where it's crucial that it find a strong
> definition if at all possible (e.g. a call) and one where the weak definition
> is just fine (e.g. a Dwarf reference).

I think the short answer here is that we want to stay away from "weak definitions"
and only use "weak references".

--chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: try1.tgz
Type: application/octet-stream
Size: 10188 bytes
Desc: not available
Url : http://mail.freestandards.org/pipermail/dwarf-discuss/attachments/20050325/e8d767be/try1.obj



More information about the Dwarf-discuss mailing list