[LLVMdev] External names for LTO in gold plugin

Tom Roeder tmroeder at google.com
Tue Nov 11 11:54:25 PST 2014


On Mon, Nov 10, 2014 at 4:21 PM, Duncan P. N. Exon Smith <
dexonsmith at apple.com> wrote:

>
> > On 2014-Nov-10, at 14:53, Rafael EspĂ­ndola <rafael.espindola at gmail.com>
> wrote:
> >
> > On 10 November 2014 17:33, Tom Roeder <tmroeder at google.com> wrote:
>
> >> Is there currently a way for me to give the gold plugin a list of names
> that
> >> shouldn't be internalized?
> >
> > The current plugin doesn't even use internalize. It depends on the
> > linker's decision of what should be kept. Given that, your best option
> > is convincing the linker that the symbol is needed. One way to do it
> > is with the -u option:
> >
> > $ ./build/bin/clang  test.o -flto -o test -Wl,-plugin-opt=save-temps
> > -Wl,-u -Wl,f
>
> If you're able to modify IR, you should also be able to keep `@f` around
> by adding it to `@llvm.used`.
>
> For the record, the "-Wl,-u", "-Wl,name" method worked perfectly for me,
so I didn't need to try modifying the IR in this case. Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141111/db87ab70/attachment.html>


More information about the llvm-dev mailing list