diff options
Diffstat (limited to 'lib/MC/MCObjectStreamer.cpp')
-rw-r--r-- | lib/MC/MCObjectStreamer.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/MC/MCObjectStreamer.cpp b/lib/MC/MCObjectStreamer.cpp index 6de02bcb02d8..a73c171bd1c0 100644 --- a/lib/MC/MCObjectStreamer.cpp +++ b/lib/MC/MCObjectStreamer.cpp @@ -54,21 +54,18 @@ void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) { } } -bool MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, +void MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) { - // Must both be assigned to the same (valid) fragment. - if (!Hi->getFragment() || Hi->getFragment() != Lo->getFragment()) - return false; - - // Must be a data fragment. - if (!isa<MCDataFragment>(Hi->getFragment())) - return false; + // If not assigned to the same (valid) fragment, fallback. + if (!Hi->getFragment() || Hi->getFragment() != Lo->getFragment()) { + MCStreamer::emitAbsoluteSymbolDiff(Hi, Lo, Size); + return; + } assert(Hi->getOffset() >= Lo->getOffset() && "Expected Hi to be greater than Lo"); EmitIntValue(Hi->getOffset() - Lo->getOffset(), Size); - return true; } void MCObjectStreamer::reset() { |