aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MachObjectWriter.cpp
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2011-09-08 20:53:44 +0000
committerKevin Enderby <enderby@apple.com>2011-09-08 20:53:44 +0000
commit5afc19002e7a6b949619a5073d8c746985e8d6f2 (patch)
tree4edc3461a38b5ebb19cc1420232967e04ad4d8ce /lib/MC/MachObjectWriter.cpp
parent0fcab076f0358890e2f1b213f4303c780e05d99d (diff)
downloadexternal_llvm-5afc19002e7a6b949619a5073d8c746985e8d6f2.zip
external_llvm-5afc19002e7a6b949619a5073d8c746985e8d6f2.tar.gz
external_llvm-5afc19002e7a6b949619a5073d8c746985e8d6f2.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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139316 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MachObjectWriter.cpp')
-rw-r--r--lib/MC/MachObjectWriter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index 7011916..ef0a93d 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;