[llvm] r293842 - [dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path

Steven Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 16:00:13 PST 2017

Author: steven_wu
Date: Wed Feb  1 18:00:13 2017
New Revision: 293842

URL: http://llvm.org/viewvc/llvm-project?rev=293842&view=rev
[dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path

dsymutil upgrade path can change the size of segment and it needs to update
the vmsize of the segment to reflect the size change.


Reviewers: friss

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D29433


Modified: llvm/trunk/tools/dsymutil/MachOUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/dsymutil/MachOUtils.cpp?rev=293842&r1=293841&r2=293842&view=diff
--- llvm/trunk/tools/dsymutil/MachOUtils.cpp (original)
+++ llvm/trunk/tools/dsymutil/MachOUtils.cpp Wed Feb  1 18:00:13 2017
@@ -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

More information about the llvm-commits mailing list