summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetObjectFile.cpp
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-08-22 16:59:00 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2019-08-22 16:59:00 +0000
commit5b5ee61b5fa95327ed5a57b16f22e9e52a459129 (patch)
treef628ebcf3d8a8ea317d29ca65f77e67f1beeced0 /llvm/lib/Target/X86/X86TargetObjectFile.cpp
parent9a0f124f26437504c50fdb78401b73d820ed3991 (diff)
downloadbcm5719-llvm-5b5ee61b5fa95327ed5a57b16f22e9e52a459129.tar.gz
bcm5719-llvm-5b5ee61b5fa95327ed5a57b16f22e9e52a459129.zip
[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 llvm-svn: 369671
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetObjectFile.cpp')
-rw-r--r--llvm/lib/Target/X86/X86TargetObjectFile.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86TargetObjectFile.cpp b/llvm/lib/Target/X86/X86TargetObjectFile.cpp
index 92e0779c2e7..44185957686 100644
--- a/llvm/lib/Target/X86/X86TargetObjectFile.cpp
+++ b/llvm/lib/Target/X86/X86TargetObjectFile.cpp
@@ -47,8 +47,8 @@ MCSymbol *X86_64MachoTargetObjectFile::getCFIPersonalitySymbol(
}
const MCExpr *X86_64MachoTargetObjectFile::getIndirectSymViaGOTPCRel(
- const MCSymbol *Sym, const MCValue &MV, int64_t Offset,
- MachineModuleInfo *MMI, MCStreamer &Streamer) const {
+ const GlobalValue *GV, const MCSymbol *Sym, const MCValue &MV,
+ int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const {
// On Darwin/X86-64, we need to use foo@GOTPCREL+4 to access the got entry
// from a data section. In case there's an additional offset, then use
// foo@GOTPCREL+4+<offset>.
OpenPOWER on IntegriCloud