[PATCH] D29433: [dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 15:57:50 PST 2017

steven_wu created this revision.

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




Index: tools/dsymutil/MachOUtils.cpp
--- tools/dsymutil/MachOUtils.cpp
+++ tools/dsymutil/MachOUtils.cpp
@@ -236,6 +236,8 @@
   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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29433.86743.patch
Type: text/x-patch
Size: 502 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170201/c70f5980/attachment-0001.bin>

More information about the llvm-commits mailing list