Skip to content

Commit

Permalink
[dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path
Browse files Browse the repository at this point in the history
Summary:
dsymutil upgrade path can change the size of segment and it needs to update
the vmsize of the segment to reflect the size change.

rdar://problem/30290714

Reviewers: friss

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293842 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
cachemeifyoucan committed Feb 2, 2017
1 parent 2e96f1d commit 9a41e59
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/dsymutil/MachOUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a41e59

Please sign in to comment.