MC/Mach-O: Fix address compution for zero fill sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97984 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/MC/MCAssembler.cpp b/lib/MC/MCAssembler.cpp
index 3f40a6d..1ec1d81 100644
--- a/lib/MC/MCAssembler.cpp
+++ b/lib/MC/MCAssembler.cpp
@@ -1049,8 +1049,8 @@
// Align the fragment offset; it is safe to adjust the offset freely since
// this is only in virtual sections.
- uint64_t Aligned = RoundUpToAlignment(Address, ZFF.getAlignment());
- F.setOffset(Aligned - SD.getAddress());
+ Address = RoundUpToAlignment(Address, ZFF.getAlignment());
+ F.setOffset(Address - SD.getAddress());
// FIXME: This is misnamed.
F.setFileSize(ZFF.getSize());