]> granicus.if.org Git - llvm/commit
[MachO][TLOF] Use hasLocalLinkage to determine if indirect symbol is local
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Thu, 22 Aug 2019 16:59:00 +0000 (16:59 +0000)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Thu, 22 Aug 2019 16:59:00 +0000 (16:59 +0000)
commit3e85a683888ef55d611353c2349e489ab7864dd2
tree504154bb0738290c99d9dd4e6324a809acbfb000
parent911f2ef3eafbedac7a22dce456402eb62e64e326
[MachO][TLOF] Use hasLocalLinkage to determine if indirect symbol is local

Local symbols in the indirect symbol table contain the value
`INDIRECT_SYMBOL_LOCAL` and the corresponding __pointers entry must
contain the address of the target.

In r349060, I added support for local symbols in the indirect symbol
table, which was checking if the symbol `isDefined` && `!isExternal` to
determine if the symbol is local or not.

It turns out that `isDefined` will return false if the user of the
symbol comes before its definition, and we'll again generate .long 0
which will be the symbol at the adress 0x0.

Instead of doing that, use GlobalValue::hasLocalLinkage() to check if
the symbol is local.

Differential Revision: https://reviews.llvm.org/D66563

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369671 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