[llvm] r267488 - ARM: put correct symbol index on indirect pointers in __thread_ptr.

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 25 15:36:07 PDT 2016


Author: tnorthover
Date: Mon Apr 25 17:36:07 2016
New Revision: 267488

URL: http://llvm.org/viewvc/llvm-project?rev=267488&view=rev
Log:
ARM: put correct symbol index on indirect pointers in __thread_ptr.

Otherwise the linker has no idea what should be resolved.

Modified:
    llvm/trunk/lib/MC/MachObjectWriter.cpp
    llvm/trunk/test/MC/ARM/tls-directives.s

Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=267488&r1=267487&r2=267488&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Mon Apr 25 17:36:07 2016
@@ -471,7 +471,8 @@ void MachObjectWriter::bindIndirectSymbo
          ie = Asm.indirect_symbol_end(); it != ie; ++it, ++IndirectIndex) {
     const MCSectionMachO &Section = cast<MCSectionMachO>(*it->Section);
 
-    if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS)
+    if (Section.getType() != MachO::S_NON_LAZY_SYMBOL_POINTERS &&
+        Section.getType() !=  MachO::S_THREAD_LOCAL_VARIABLE_POINTERS)
       continue;
 
     // Initialize the section indirect symbol base, if necessary.

Modified: llvm/trunk/test/MC/ARM/tls-directives.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/tls-directives.s?rev=267488&r1=267487&r2=267488&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/tls-directives.s (original)
+++ llvm/trunk/test/MC/ARM/tls-directives.s Mon Apr 25 17:36:07 2016
@@ -1,5 +1,9 @@
 @ RUN: llvm-mc -triple thumbv7-apple-ios -filetype=obj -o %t %s
-@ RUN: llvm-objdump -p %t | FileCheck %s
+@ RUN: llvm-objdump -macho -p -indirect-symbols %t | FileCheck %s
+
+@ CHECK: Indirect symbols for (__DATA,__thread_ptr)
+@ CHECK: 0x0000001c     5 _a
+
 
 @ CHECK: sectname __thread_data
 @ CHECK: segname __DATA




More information about the llvm-commits mailing list