From 5afc19002e7a6b949619a5073d8c746985e8d6f2 Mon Sep 17 00:00:00 2001 From: Kevin Enderby Date: Thu, 8 Sep 2011 20:53:44 +0000 Subject: Fix a Darwin x86_64 special case of a jmp to a temporary symbol from an atom without a base symbol that must not have a relocation entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139316 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MachObjectWriter.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/MC/MachObjectWriter.cpp') diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp index 7011916770..ef0a93d93b 100644 --- a/lib/MC/MachObjectWriter.cpp +++ b/lib/MC/MachObjectWriter.cpp @@ -590,6 +590,16 @@ IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm, return false; return true; } + // For Darwin x86_64, there is one special case when the reference IsPCRel. + // If the fragment with the reference does not have a base symbol but meets + // the simple way of dealing with this, in that it is a temporary symbol in + // the same atom then it is assumed to be fully resolved. This is needed so + // a relocation entry is not created and so the staitic linker does not + // mess up the reference later. + else if(!FB.getAtom() && + SA.isTemporary() && SA.isInSection() && &SecA == &SecB){ + return true; + } } else { if (!TargetObjectWriter->useAggressiveSymbolFolding()) return false; -- cgit v1.2.3-18-g5258