[lld] r218090 - [PECOFF] __tls_used is _tls_used on x64.

Rui Ueyama ruiu at google.com
Thu Sep 18 17:22:22 PDT 2014


Author: ruiu
Date: Thu Sep 18 19:22:22 2014
New Revision: 218090

URL: http://llvm.org/viewvc/llvm-project?rev=218090&view=rev
Log:
[PECOFF] __tls_used is _tls_used on x64.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp

Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=218090&r1=218089&r2=218090&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Thu Sep 18 19:22:22 2014
@@ -936,9 +936,11 @@ void groupAtoms(const PECOFFLinkingConte
   }
 }
 
-static const DefinedAtom *findTLSUsedSymbol(const File &file) {
+static const DefinedAtom *findTLSUsedSymbol(const PECOFFLinkingContext &ctx,
+                                            const File &file) {
+  StringRef sym = ctx.decorateSymbol("_tls_used");
   for (const DefinedAtom *atom : file.defined())
-    if (atom->name() == "__tls_used")
+    if (atom->name() == sym)
       return atom;
   return nullptr;
 }
@@ -1030,9 +1032,9 @@ void PECOFFWriter::build(const File &lin
                               section->getVirtualAddress(), section->size());
   }
 
-  if (const DefinedAtom *atom = findTLSUsedSymbol(linkedFile)) {
-    dataDirectory->setField(DataDirectoryIndex::TLS_TABLE,
-                            _atomRva[atom], 0x18);
+  if (const DefinedAtom *atom = findTLSUsedSymbol(_ctx, linkedFile)) {
+    dataDirectory->setField(DataDirectoryIndex::TLS_TABLE, _atomRva[atom],
+                            0x18);
   }
 
   // Now that we know the size and file offset of sections. Set the file





More information about the llvm-commits mailing list