[llvm-commits] [patch][gold plugin] Don't internalize symbols in objects that we will use as pass-through

Rafael Espindola espindola at google.com
Mon Jun 21 19:34:28 PDT 2010


Cary, the patch is for LLVM, but I am ccing you in case you think this
should be done in gold somehow.

This is hopefully the last patch is the libgcc and its dependencies saga.

The last remaining issue that i know is that gold can ask us to load a
file because it is used only on the IR. We then internalize the
symbols in that file and run codegen. Codegen can then create new
undefined references to those files that forces gold to fetch them
again (from the native code this time).

There are a number of problem with this
*) Gold doesn't implement this all that well. It still has in its
symbol table that it loaded a file defining that symbol.
*) We would end up with multiple copies of some symbols.
*) LLVM can use smaller chunks of files than gold. Consider the case
of a file defining functions foo and bar. Function foo is used from
elf, and so we don't internalize it. Function bar is not used at that
time and we drop it. Now codegen introduces an undefined reference to
bar. What should gold do? Bringing in that file will fail because we
will have two visible definitions of foo. Not doing so will fail
because there is no where else to find bar.

The best solution I could find is to disable internalize for any
functions defined in a library that is passed through. The attached
patch does this. It can be optimized, but I am not sure if that is
worth it, since normally there are only two libraries being passed
through (libgcc and libc).

Cheers,
-- 
Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ironly.patch
Type: text/x-patch
Size: 1812 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100621/35bd9093/attachment.bin>


More information about the llvm-commits mailing list