<div dir="ltr">Attached patch fixes the issue.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 18, 2015 at 6:52 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">Hi,<br>
<br>
FYI<br>
<br>
LLD cannot handle ELF sections with non-unique names. An object file<br>
with such sections can be generated by the Clang since r234143. I am<br>
not sure that Clang works absolutely correct but bfd linker works<br>
fine.<br>
<br>
Right now I do not have a time to investigate this problem. If nobody<br>
take, I will try to solve it later.<br>
<br>
Here is the reproduction script for x86_64 host:<br>
<br>
$ cat test.cc<br>
template <class T><br>
void foo(T) {}<br>
<br>
int main() {<br>
  foo(0);<br>
  foo(1.0);<br>
}<br>
<br>
$ clang++ -c test.cc -fno-unique-section-names<br>
$ lld -flavor gnu -target x86_64 --hash-style=both --build-id \<br>
  --eh-frame-hdr -m elf_x86_64 \<br>
  -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out \<br>
  <bunch of regular linker arguments here><br>
$ ./a.out<br>
Illegal instruction<br>
<br>
$ clang++ -c test.cc -funique-section-names<br>
$ lld -flavor gnu -target x86_64 --hash-style=both --build-id \<br>
  --eh-frame-hdr -m elf_x86_64 \<br>
  -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out \<br>
  <bunch of regular linker arguments here><br>
$ ./a.out<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Simon Atanasyan<br>
</font></span></blockquote></div><br></div>