mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
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. llvm-svn: 267582
This commit is contained in:
parent
d509cf68e7
commit
c247e8effd
@ -471,7 +471,8 @@ void MachObjectWriter::bindIndirectSymbols(MCAssembler &Asm) {
|
||||
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.
|
||||
|
@ -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
|
||||
|
@ -343,7 +343,7 @@ static void PrintIndirectSymbolTable(MachOObjectFile *O, bool verbose,
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user