summaryrefslogtreecommitdiffstats
path: root/ldid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ldid.cpp')
-rw-r--r--ldid.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/ldid.cpp b/ldid.cpp
index 027ca42..8aa0b4e 100644
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -1068,10 +1068,17 @@ int main(int argc, const char *argv[]) {
signature->dataoff = mach_header.Swap(align);
signature->datasize = mach_header.Swap(allocation.alloc_);
- _foreach (segment, mach_header.GetSegments("__LINKEDIT"))
- segment->filesize = mach_header.Swap(align + allocation.alloc_ - mach_header.Swap(segment->fileoff));
- _foreach (segment, mach_header.GetSegments64("__LINKEDIT"))
- segment->filesize = mach_header.Swap(align + allocation.alloc_ - mach_header.Swap(segment->fileoff));
+ _foreach (segment, mach_header.GetSegments("__LINKEDIT")) {
+ size_t size(mach_header.Swap(align + allocation.alloc_ - mach_header.Swap(segment->fileoff)));
+ segment->filesize = size;
+ segment->vmsize = Align(size, 0x1000);
+ }
+
+ _foreach (segment, mach_header.GetSegments64("__LINKEDIT")) {
+ size_t size(mach_header.Swap(align + allocation.alloc_ - mach_header.Swap(segment->fileoff)));
+ segment->filesize = size;
+ segment->vmsize = Align(size, 0x1000);
+ }
}
}