[lld] r261838 - [ELF2] - Basic implementation of -r/--relocatable

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 08:14:38 PST 2016


>> > I believe that the resulting object files with this patch contains some linker-synthesized symbols such as __init_array_start or __start_<section-name>. Is this expected?
>>
>> So, returning to this,
>> gold also generates __start_/_end_?<section-name> for relocatable output.
>
>That sounds like a bug to me. I would strongly expect them to be *not*
>generated and wouldn't be surprised if it creates problems down the
>line.
>
>Joerg

I was not very correct here.
If we have:
_start:
	call __start_foo
        call __start_foo111

then gold output is
Symbol table '.symtab' contains 4 entries:
   Num:    Value          Size Type    Bind   Vis      Ndx Name
.. 
     1: 0000000000000000     0 NOTYPE  GLOBAL HIDDEN   UND __start_foo
     2: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  UND __start_foo111

So gold just sets the visibility to hidden here. It does not do that for other common undefined symbols.
So it not generates the values for them. Not sure is it a bug or not, I think not. As it just knows that
these symbols exist and can be used with that visibility.

George.


More information about the llvm-commits mailing list