[llvm-commits] [llvm] r78872 - /llvm/trunk/lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
Chris Lattner
clattner at apple.com
Sun Aug 23 14:15:46 PDT 2009
On Aug 23, 2009, at 2:10 PM, Chris Lattner wrote:
>
> On Aug 23, 2009, at 12:01 PM, Nick Kledzik wrote:
>
>>>>
>>>> I suppose. There are some in the gcc testsuite. I was asked not
>>>> to run it anymore but somebody should be; it's the best tests we
>>>> have for ObjC metadata.
>>>>
>>>>> Do ppc/arm need a similar fix?
>>>>
>>>> Probably, good catch, I'll look at it.
>>>>
>>>
>>> I still don't understand what this is doing. "l" labels are not
>>> visible outside of their translation unit. Why could they possibly
>>> need to be marked as weak definitions? They can't be overridden
>>> by other translation units, so it doesn't make sense (to me) for
>>> them to have to be weak.
>>
>> Chris, it is 'L' labels that are visible on in their translation
>> unit. 'l' labels are visible throughout the linkage unit. Making
>> these weak-hidden enables the linker to coalesce duplicates.
>
> Aha, that makes perfect sense. I'll update the documentation.
> Thanks Nick.
Actually, one more question Nick :).
I was going to update the docs to say:
<dt><tt><b><a name="linkage_linker_private">linker_private</a></b></
tt>: </dt>
<dd>Similar to private, but the symbol is passed through the
assembler and
removed by the linker after evaluation. Note that (unlike
private
symbols) linker_private symbols are subject to coalescing by
the linker:
weak symbols get merged and redefinitions are rejected.
However, unlike
normal strong symbols, they are removed by the linker from the
final
linked image (executable or dynamic library).</dd>
However, it looks like the linker doesn't reject two .o files that
contain redefinitions of the same label with either -r or -dylib. I
tried linking together two .o files that contained this .s file:
lFoo:
.byte 1
Shouldn't I get a redefinition error? Is the weak merging semantics
just a special case magic behavior that is unlike normal strong symbols?
-Chris
More information about the llvm-commits
mailing list