<div dir="ltr"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 20, 2014 at 1:41 AM, Rafael Auler <span dir="ltr"><<a href="mailto:rafaelauler@gmail.com" target="_blank">rafaelauler@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi ruiu, rafael, Bigcheese,<br>
<br>
When a shared lib has an undefined symbol that is defined in a regular object (the program), the final executable must export this symbol in the dynamic symbol table. However, in the current logic, lld only puts the symbol in the dynamic symbol table if the symbol is weak. This patch fixes lld to put the symbol in the dynamic symbol table regardless if it is weak or not.<br>
<br>
This caused a problem in FreeBSD10, whose programs link against a crt1.o that defines the symbol __progname, which is, in turn, undefined in libc.so.7 and will only be resolved in runtime.<br>
<br>
<a href="http://reviews.llvm.org/D5424" target="_blank">http://reviews.llvm.org/D5424</a><br>
<br>
Files:<br>
  include/lld/ReaderWriter/ELFLinkingContext.h<br>
  lib/ReaderWriter/ELF/ELFLinkingContext.cpp<br>
  lib/ReaderWriter/ELF/OutputELFWriter.h<br>
  test/elf/Inputs/defobj.o<br>
  test/elf/Inputs/libundef2.so<br>
  test/elf/undef-from-dso-to-main.test<br>
</blockquote></div><br></div>