-void MCObjectStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue) {
- // FIXME: A MCFillFragment would be more memory efficient but MCExpr has
- // problems evaluating expressions across multiple fragments.
- getOrCreateDataFragment()->getContents().append(NumBytes, FillValue);
+bool MCObjectStreamer::EmitRelocDirective(const MCExpr &Offset, StringRef Name,
+ const MCExpr *Expr, SMLoc Loc) {
+ int64_t OffsetValue;
+ if (!Offset.evaluateAsAbsolute(OffsetValue))
+ llvm_unreachable("Offset is not absolute");
+
+ MCDataFragment *DF = getOrCreateDataFragment();
+ flushPendingLabels(DF, DF->getContents().size());
+
+ MCFixupKind Kind;
+ if (!Assembler->getBackend().getFixupKind(Name, Kind))
+ return true;
+
+ if (Expr == nullptr)
+ Expr =
+ MCSymbolRefExpr::create(getContext().createTempSymbol(), getContext());
+ DF->getFixups().push_back(MCFixup::create(OffsetValue, Expr, Kind, Loc));
+ return false;