llvm-mc/Mach-O: Support .o emission for .org and .align.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79684 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp
index 0ad0327..316051c 100644
--- a/lib/MC/MCMachOStreamer.cpp
+++ b/lib/MC/MCMachOStreamer.cpp
@@ -150,6 +150,8 @@
void MCMachOStreamer::EmitValueToAlignment(unsigned ByteAlignment,
int64_t Value, unsigned ValueSize,
unsigned MaxBytesToEmit) {
+ if (MaxBytesToEmit == 0)
+ MaxBytesToEmit = ByteAlignment;
new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit,
CurSectionData);
@@ -160,7 +162,7 @@
void MCMachOStreamer::EmitValueToOffset(const MCValue &Offset,
unsigned char Value) {
- new MCOrgFragment(Offset, Value, 1, CurSectionData);
+ new MCOrgFragment(Offset, Value, CurSectionData);
}
void MCMachOStreamer::EmitInstruction(const MCInst &Inst) {