aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-01-18 21:54:12 +0000
committerJim Grosbach <grosbach@apple.com>2012-01-18 21:54:12 +0000
commitec4ceb797a963b2d24b02d40fad6cc456fac3e5b (patch)
treef77eeedbb86d4f12d1b469dd6e49b0dc1cecc5e9 /lib/MC
parenta2ee0fa3ee4ae46c3dc655a5a57e9db539912e14 (diff)
downloadexternal_llvm-ec4ceb797a963b2d24b02d40fad6cc456fac3e5b.zip
external_llvm-ec4ceb797a963b2d24b02d40fad6cc456fac3e5b.tar.gz
external_llvm-ec4ceb797a963b2d24b02d40fad6cc456fac3e5b.tar.bz2
MCAssembler tweak for determining when a symbol difference is resolved.
If the two fragments are in the same Atom, then the difference expression is resolvable at compile time. Previously we were checking that they were in the same fragment, but that breaks down in the presence of instruction relaxation which has multiple fragments in the same atom. rdar://10711829 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MachObjectWriter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index ce222b7..a344521 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/lib/MC/MachObjectWriter.cpp
@@ -591,7 +591,8 @@ IsSymbolRefDifferenceFullyResolvedImpl(const MCAssembler &Asm,
if (!Asm.getBackend().hasReliableSymbolDifference()) {
if (!SA.isInSection() || &SecA != &SecB ||
- (!SA.isTemporary() && &FB != Asm.getSymbolData(SA).getFragment()))
+ (!SA.isTemporary() &&
+ FB.getAtom() != Asm.getSymbolData(SA).getFragment()->getAtom()))
return false;
return true;
}