Subzero: Support non-IRT immediate calls with -filetype=iasm.
This is done by emitting the following:
.byte 0xe8
.long __Sz_AbsoluteZero -4 - .
The linker is passed an argument like
--defsym=__Sz_AbsoluteZero=0
to force the symbol's value to 0.
This special symbol is needed due to an llvm-mc parsing bug.
BUG= none
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/1027593002
diff --git a/src/assembler.cpp b/src/assembler.cpp
index d131426..931998e 100644
--- a/src/assembler.cpp
+++ b/src/assembler.cpp
@@ -136,9 +136,9 @@
Str << "\n";
}
Str << "\t.long ";
- NextFixup->emit(Ctx);
+ NextFixup->emit(Ctx, buffer_.Load<RelocOffsetT>(NextFixupLoc));
if (fixupIsPCRel(NextFixup->kind()))
- Str << " - (. + " << FixupSize << ")";
+ Str << " - .";
Str << "\n";
CurPosition = NextFixupLoc + FixupSize;
assert(CurPosition <= EndPosition);