<div dir="ltr">I think that there's no reason to add that symbol to .dynsym. If it is causing a problem, we should remove that.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 8, 2016 at 6:22 AM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When LLD builds a shared library for x86_64 it puts<br>
_GLOBAL_OFFSET_TABLE_ to the both .symtab and .dynsym and defines it<br>
as a GLOBAL symbol. If later this shared library participates in<br>
executable file linking and GNU BFD linked is used for that, this<br>
linker shows an error:<br>
<br>
/usr/bin/ld: a.out: hidden symbol `_GLOBAL_OFFSET_TABLE_' in<br>
/usr/lib/x86_64-linux-gnu/crt1.o is referenced by DSO<br>
<br>
Gold linker does not show any error, but it is anyway strange that we<br>
make _GLOBAL_OFFSET_TABLE_ globally visible and add it to dynamic<br>
symbol table.<br>
<br>
Both BFD and Gold linker do not put _GLOBAL_OFFSET_TABLE_ to the<br>
dynamic symbol table and defines this symbol as follows:<br>
<br>
BFD:<br>
Num:    Value          Size Type    Bind   Vis      Ndx Name<br>
 42: 0000000000200990     0 OBJECT  LOCAL  DEFAULT  ABS _GLOBAL_OFFSET_TABLE_<br>
<br>
Gold:<br>
Num:    Value          Size Type    Bind   Vis      Ndx Name<br>
 19: 0000000000001a18    40 OBJECT  LOCAL  HIDDEN    19 _GLOBAL_OFFSET_TABLE_<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Simon Atanasyan<br>
</font></span></blockquote></div><br></div>