summaryrefslogtreecommitdiff
path: root/devel/llvm60/files/lld/patch-head-r331731.diff
diff options
context:
space:
mode:
Diffstat (limited to 'devel/llvm60/files/lld/patch-head-r331731.diff')
-rw-r--r--devel/llvm60/files/lld/patch-head-r331731.diff67
1 files changed, 67 insertions, 0 deletions
diff --git a/devel/llvm60/files/lld/patch-head-r331731.diff b/devel/llvm60/files/lld/patch-head-r331731.diff
new file mode 100644
index 000000000000..6b162d89f6be
--- /dev/null
+++ b/devel/llvm60/files/lld/patch-head-r331731.diff
@@ -0,0 +1,67 @@
+r331731 | dim | 2018-03-29 15:55:23 +0200 (Thu, 29 Mar 2018) | 22 lines
+
+Pull in r328738 from upstream lld trunk (by Rafael Espindola):
+
+ Strip @VER suffices from the LTO output.
+
+ This fixes pr36623.
+
+ The problem is that we have to parse versions out of names before LTO
+ so that LTO can use that information.
+
+ When we get the LTO produced .o files, we replace the previous symbols
+ with the LTO produced ones, but they still have @ in their names.
+
+ We could just trim the name directly, but calling parseSymbolVersion
+ to do it is simpler.
+
+This is a follow-up to r331366, since we discovered that lld could
+append version strings to symbols twice, when using Link Time
+Optimization.
+
+MFC after: 3 months
+X-MFC-With: r327952
+
+Index: tools/lld/ELF/InputFiles.cpp
+===================================================================
+--- tools/lld/ELF/InputFiles.cpp (revision 331730)
++++ tools/lld/ELF/InputFiles.cpp (revision 331731)
+@@ -281,6 +281,10 @@ template <class ELFT> ArrayRef<Symbol *> ObjFile<E
+ return makeArrayRef(this->Symbols).slice(1, this->FirstNonLocal - 1);
+ }
+
++template <class ELFT> ArrayRef<Symbol *> ObjFile<ELFT>::getGlobalSymbols() {
++ return makeArrayRef(this->Symbols).slice(this->FirstNonLocal);
++}
++
+ template <class ELFT>
+ void ObjFile<ELFT>::parse(DenseSet<CachedHashStringRef> &ComdatGroups) {
+ // Read section and symbol tables.
+Index: tools/lld/ELF/InputFiles.h
+===================================================================
+--- tools/lld/ELF/InputFiles.h (revision 331730)
++++ tools/lld/ELF/InputFiles.h (revision 331731)
+@@ -167,6 +167,7 @@ template <class ELFT> class ObjFile : public ELFFi
+ static bool classof(const InputFile *F) { return F->kind() == Base::ObjKind; }
+
+ ArrayRef<Symbol *> getLocalSymbols();
++ ArrayRef<Symbol *> getGlobalSymbols();
+
+ ObjFile(MemoryBufferRef M, StringRef ArchiveName);
+ void parse(llvm::DenseSet<llvm::CachedHashStringRef> &ComdatGroups);
+Index: tools/lld/ELF/SymbolTable.cpp
+===================================================================
+--- tools/lld/ELF/SymbolTable.cpp (revision 331730)
++++ tools/lld/ELF/SymbolTable.cpp (revision 331731)
+@@ -130,7 +130,10 @@ template <class ELFT> void SymbolTable::addCombine
+
+ for (InputFile *File : LTO->compile()) {
+ DenseSet<CachedHashStringRef> DummyGroups;
+- cast<ObjFile<ELFT>>(File)->parse(DummyGroups);
++ auto *Obj = cast<ObjFile<ELFT>>(File);
++ Obj->parse(DummyGroups);
++ for (Symbol *Sym : Obj->getGlobalSymbols())
++ Sym->parseSymbolVersion();
+ ObjectFiles.push_back(File);
+ }
+ }