diff options
author | Kevin Enderby <enderby@apple.com> | 2011-09-08 20:53:44 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2011-09-08 20:53:44 +0000 |
commit | 7b46bb8e327d45598eb794e14fc87e8c2a55f65e (patch) | |
tree | 0c217be66b99b9bc9f0f5f48a29b03824d777859 /llvm/lib/MC/MachObjectWriter.cpp | |
parent | 47f43da19648d3ad33ca5afbce4467c9ca1a764a (diff) | |
download | llvm-7b46bb8e327d45598eb794e14fc87e8c2a55f65e.zip llvm-7b46bb8e327d45598eb794e14fc87e8c2a55f65e.tar.gz llvm-7b46bb8e327d45598eb794e14fc87e8c2a55f65e.tar.bz2 |
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.
llvm-svn: 139316
Diffstat (limited to 'llvm/lib/MC/MachObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/MachObjectWriter.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp index 7011916..ef0a93d 100644 --- a/llvm/lib/MC/MachObjectWriter.cpp +++ b/llvm/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; |