summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2017-02-02 00:00:13 +0000
committerSteven Wu <stevenwu@apple.com>2017-02-02 00:00:13 +0000
commitedd57e8eb03c7481682f1320124d61cb0ba94755 (patch)
tree2db874ef68c9ba2197357461887fd73cae3dd52a /llvm/tools
parent5362216c36e095d5fef86534f78aaf7ff44dc830 (diff)
downloadbcm5719-llvm-edd57e8eb03c7481682f1320124d61cb0ba94755.tar.gz
bcm5719-llvm-edd57e8eb03c7481682f1320124d61cb0ba94755.zip
[dsymutil] Fix __LINKEDIT vmsize in dsymutil upgrade path
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 llvm-svn: 293842
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/dsymutil/MachOUtils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/dsymutil/MachOUtils.cpp b/llvm/tools/dsymutil/MachOUtils.cpp
index 8a730a1d0c8..c1422f6eaab 100644
--- a/llvm/tools/dsymutil/MachOUtils.cpp
+++ b/llvm/tools/dsymutil/MachOUtils.cpp
@@ -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
OpenPOWER on IntegriCloud