<div dir="ltr">This seems to have broken self hosting on Linux. Can you verify?</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 9:34 AM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Please check in the source code of the so file and leave a comment how to build it.</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 29, 2016 at 9:23 AM, Rafael Espindola via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rafael<br>
Date: Fri Apr 29 11:23:31 2016<br>
New Revision: 268060<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268060&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=268060&view=rev</a><br>
Log:<br>
Fix producing undefined reference to __progname.<br>
<br>
We were not producing them if the library had version info.<br>
<br>
Added:<br>
lld/trunk/test/ELF/Inputs/progname-ver.so (with props)<br>
Modified:<br>
lld/trunk/ELF/InputFiles.cpp<br>
lld/trunk/test/ELF/progname.s<br>
<br>
Modified: lld/trunk/ELF/InputFiles.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=268060&r1=268059&r2=268060&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=268060&r1=268059&r2=268060&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/ELF/InputFiles.cpp (original)<br>
+++ lld/trunk/ELF/InputFiles.cpp Fri Apr 29 11:23:31 2016<br>
@@ -490,6 +490,12 @@ template <class ELFT> void SharedFile<EL<br>
uint32_t NumSymbols = std::distance(Syms.begin(), Syms.end());<br>
SymbolBodies.reserve(NumSymbols);<br>
for (const Elf_Sym &Sym : Syms) {<br>
+ StringRef Name = check(Sym.getName(this->StringTable));<br>
+ if (Sym.isUndefined()) {<br>
+ Undefs.push_back(Name);<br>
+ continue;<br>
+ }<br>
+<br>
unsigned VersymIndex = 0;<br>
if (Versym) {<br>
VersymIndex = Versym->vs_index;<br>
@@ -498,11 +504,7 @@ template <class ELFT> void SharedFile<EL<br>
if (VersymIndex == 0 || (VersymIndex & VERSYM_HIDDEN))<br>
continue;<br>
}<br>
- StringRef Name = check(Sym.getName(this->StringTable));<br>
- if (Sym.isUndefined())<br>
- Undefs.push_back(Name);<br>
- else<br>
- SymbolBodies.emplace_back(this, Name, Sym, Verdefs[VersymIndex]);<br>
+ SymbolBodies.emplace_back(this, Name, Sym, Verdefs[VersymIndex]);<br>
}<br>
}<br>
<br>
<br>
Added: lld/trunk/test/ELF/Inputs/progname-ver.so<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/progname-ver.so?rev=268060&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/progname-ver.so?rev=268060&view=auto</a><br>
==============================================================================<br>
Binary files lld/trunk/test/ELF/Inputs/progname-ver.so (added) and lld/trunk/test/ELF/Inputs/progname-ver.so Fri Apr 29 11:23:31 2016 differ<br>
<br>
Propchange: lld/trunk/test/ELF/Inputs/progname-ver.so<br>
------------------------------------------------------------------------------<br>
svn:executable = *<br>
<br>
Modified: lld/trunk/test/ELF/progname.s<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/progname.s?rev=268060&r1=268059&r2=268060&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/progname.s?rev=268060&r1=268059&r2=268060&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/test/ELF/progname.s (original)<br>
+++ lld/trunk/test/ELF/progname.s Fri Apr 29 11:23:31 2016<br>
@@ -5,6 +5,9 @@<br>
// RUN: ld.lld -o %t %t.o %t2.so<br>
// RUN: llvm-readobj -dyn-symbols %t | FileCheck %s<br>
<br>
+// RUN: ld.lld -o %t %t.o %p/Inputs/progname-ver.so<br>
+// RUN: llvm-readobj -dyn-symbols %t | FileCheck %s<br>
+<br>
// CHECK: Name: __progname@<br>
// CHECK-NEXT: Value: 0x11000<br>
// CHECK-NEXT: Size: 0<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>