OSDN Git Service

[AsmPrinter][TLOF] 32-bit MachO support for replacing GOT equivalents
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 6 Mar 2015 13:49:05 +0000 (13:49 +0000)
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>
Fri, 6 Mar 2015 13:49:05 +0000 (13:49 +0000)
commitdfc6383227eddbce311f428ddf591baf90d728d4
treed40f6860232932b5088c0d41a2bbcfb52763e934
parent66aa390799a7988c77317032567ecf7935c72834
[AsmPrinter][TLOF] 32-bit MachO support for replacing GOT equivalents

Add MachO 32-bit (i.e. arm and x86) support for replacing global GOT equivalent
symbol accesses. Unlike 64-bit targets, there's no GOTPCREL relocation, and
access through a non_lazy_symbol_pointers section is used instead.

-- before

    _extgotequiv:
       .long _extfoo

    _delta:
       .long _extgotequiv-_delta

-- after

    _delta:
       .long L_extfoo$non_lazy_ptr-_delta

       .section __IMPORT,__pointers,non_lazy_symbol_pointers
    L_extfoo$non_lazy_ptr:
       .indirect_symbol _extfoo
       .long 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231475 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/Target/TargetLoweringObjectFile.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/Target/AArch64/AArch64TargetObjectFile.cpp
lib/Target/AArch64/AArch64TargetObjectFile.h
lib/Target/X86/X86TargetObjectFile.cpp
lib/Target/X86/X86TargetObjectFile.h
test/MC/MachO/cstexpr-gotpcrel-32.ll [new file with mode: 0644]