+void MCObjectStreamer::flushPendingLabels(MCFragment *F, uint64_t FOffset) {
+ if (PendingLabels.size()) {
+ if (!F) {
+ F = new MCDataFragment();
+ MCSection *CurSection = getCurrentSectionOnly();
+ CurSection->getFragmentList().insert(CurInsertionPoint, F);
+ F->setParent(CurSection);
+ }
+ for (MCSymbol *Sym : PendingLabels) {
+ Sym->setFragment(F);
+ Sym->setOffset(FOffset);
+ }
+ PendingLabels.clear();
+ }
+}
+
+void MCObjectStreamer::emitAbsoluteSymbolDiff(const MCSymbol *Hi,
+ const MCSymbol *Lo,
+ unsigned Size) {
+ // 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);
+}
+