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

llvm-svn: 148423
This commit is contained in:
Jim Grosbach 2012-01-18 21:54:12 +00:00
parent 9ab3d8be4e
commit d4dbd09d85
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}