summaryrefslogtreecommitdiff
path: root/tools/dsymutil/MachOUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/dsymutil/MachOUtils.cpp')
-rw-r--r--tools/dsymutil/MachOUtils.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/dsymutil/MachOUtils.cpp b/tools/dsymutil/MachOUtils.cpp
index 8a730a1d0c8a..ea6f113e4fae 100644
--- a/tools/dsymutil/MachOUtils.cpp
+++ b/tools/dsymutil/MachOUtils.cpp
@@ -220,7 +220,7 @@ getSection(const object::MachOObjectFile &Obj,
// The function also tries to find a hole in the address map to fit the __DWARF
// segment of \a DwarfSegmentSize size. \a EndAddress is updated to point at the
// highest segment address.
-// When the __LINKEDIT segment is transfered, its offset and size are set resp.
+// When the __LINKEDIT segment is transferred, its offset and size are set resp.
// to \a LinkeditOffset and \a LinkeditSize.
template <typename SegmentTy>
static void transferSegmentAndSections(
@@ -236,6 +236,8 @@ static void transferSegmentAndSections(
if (StringRef("__LINKEDIT") == Segment.segname) {
Segment.fileoff = LinkeditOffset;
Segment.filesize = LinkeditSize;
+ // Resize vmsize by rounding to the page size.
+ Segment.vmsize = alignTo(LinkeditSize, 0x1000);
}
// Check if the end address of the last segment and our current