aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCObjectWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-24 21:22:02 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-24 21:22:02 +0000
commitfea753b397823c340608925eb7f3256a64a30017 (patch)
tree91016581c74485267516a02e4066ef865445cc0d /lib/MC/MCObjectWriter.cpp
parenta112087e4298ca8ec1bc8aef8a2b272e49faa7ac (diff)
Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We now
have a single point where targets test if a relocation is needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122549 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCObjectWriter.cpp')
-rw-r--r--lib/MC/MCObjectWriter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/MC/MCObjectWriter.cpp b/lib/MC/MCObjectWriter.cpp
index e5f5f70328..f7a790410c 100644
--- a/lib/MC/MCObjectWriter.cpp
+++ b/lib/MC/MCObjectWriter.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCObjectWriter.h"
#include "llvm/MC/MCSymbol.h"
@@ -54,9 +55,14 @@ MCObjectWriter::IsSymbolRefDifferenceFullyResolved(const MCAssembler &Asm,
const MCSymbol &SA = A->getSymbol();
const MCSymbol &SB = B->getSymbol();
- if (SA.isUndefined() || SB.isUndefined())
+ if (SA.AliasedSymbol().isUndefined() || SB.AliasedSymbol().isUndefined())
return false;
- // On ELF and COFF A - B is absolute if A and B are in the same section.
- return &SA.getSection() == &SB.getSection();
+ const MCSymbolData &DataA = Asm.getSymbolData(SA);
+ const MCSymbolData &DataB = Asm.getSymbolData(SB);
+
+ return IsSymbolRefDifferenceFullyResolvedImpl(Asm, DataA,
+ *DataB.getFragment(),
+ InSet,
+ false);
}