Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't try mmapping empty segments

It seems atos in xcode 4 has an empty segment named __RESTRICT.
May need further investigation.
  • Loading branch information...
commit 01472d772c5fb718bd7ef5e4c3190eabf75dfdfc 1 parent d0a83b9
@shinh authored
Showing with 3 additions and 0 deletions.
  1. +3 −0  ld-mac.cc
View
3  ld-mac.cc
@@ -399,6 +399,9 @@ class MachOLoader {
LOG << "mmap(file) " << mach.filename() << ' ' << name
<< ": " << (void*)vmaddr << "-" << (void*)(vmaddr + filesize)
<< " offset=" << mach.offset() + seg->fileoff << endl;
+ if (filesize == 0) {
+ continue;
+ }
void* mapped = mmap((void*)vmaddr, filesize, prot,
MAP_PRIVATE | MAP_FIXED,
mach.fd(), mach.offset() + seg->fileoff);
Please sign in to comment.
Something went wrong with that request. Please try again.