[llvm] r267582 - Reapply: "ARM: put correct symbol index on indirect pointers in __thread_ptr.""
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 26 11:29:16 PDT 2016
Author: tnorthover
Date: Tue Apr 26 13:29:16 2016
New Revision: 267582
URL: http://llvm.org/viewvc/llvm-project?rev=267582&view=rev
Log:
Reapply: "ARM: put correct symbol index on indirect pointers in __thread_ptr.""
A latent bug in llvm-objdump used the wrong format specifier on 32-bit
targets, causing the test to fail. This fixes the issue.
Modified:
llvm/trunk/lib/MC/MachObjectWriter.cpp
llvm/trunk/test/MC/ARM/tls-directives.s
llvm/trunk/tools/llvm-objdump/MachODump.cpp
Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=267582&r1=267581&r2=267582&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/MachObjectWriter.cpp Tue Apr 26 13:29:16 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=267582&r1=267581&r2=267582&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/tls-directives.s (original)
+++ llvm/trunk/test/MC/ARM/tls-directives.s Tue Apr 26 13:29:16 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
Modified: llvm/trunk/tools/llvm-objdump/MachODump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?rev=267582&r1=267581&r2=267582&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/MachODump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/MachODump.cpp Tue Apr 26 13:29:16 2016
@@ -343,7 +343,7 @@ static void PrintIndirectSymbolTable(Mac
if (cputype & MachO::CPU_ARCH_ABI64)
outs() << format("0x%016" PRIx64, addr + j * stride) << " ";
else
- outs() << format("0x%08" PRIx32, addr + j * stride) << " ";
+ outs() << format("0x%08" PRIx32, (uint32_t)addr + j * stride) << " ";
MachO::dysymtab_command Dysymtab = O->getDysymtabLoadCommand();
uint32_t indirect_symbol = O->getIndirectSymbolTableEntry(Dysymtab, n + j);
if (indirect_symbol == MachO::INDIRECT_SYMBOL_LOCAL) {
More information about the llvm-commits
mailing list