[LLVMdev] External names for LTO in gold plugin

Tom Roeder tmroeder at google.com
Mon Nov 10 14:33:04 PST 2014


Hi,

In my work applying -flto to Chrome, I need to set some names to be skipped
by the InternalizePass; otherwise, the linking stage fails (i.e., when
building the chrome binary). In the past, I had a tiny patch that I hadn't
submitted to LLVM: it was something like:

Index: Internalize.cpp
===================================================================
--- Internalize.cpp     (revision 221403)
+++ Internalize.cpp     (working copy)
@@ -87,6 +87,7 @@
         itr != ExportList.end(); itr++) {
     ExternalNames.insert(*itr);
   }
+  ExternalNames.insert(APIList.begin(), APIList.end());
 }


This adds the contents of the -internalize-public-api-list flag to the set
of external names for the internalize pass, even when there are already
some names being passed in the constructor.

Then I would pass, e.g., "-Wl,-internalize-public-api-list=__xstat64" to
the linking phase, and all would be well. However, since the gold plugin
has been changed significantly, this no longer works, since the flags from
Internalize.cpp don't get up to the gold plugin, and I don't know the new
gold plugin bits well enough to see immediately how to replace it. I could
go spelunking for the answer, but I wanted to ask here first.

Is there currently a way for me to give the gold plugin a list of names
that shouldn't be internalized?

Thanks,

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141110/c6af8a43/attachment.html>


More information about the llvm-dev mailing list