Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Shinichiro Hamaji authored December 28, 2011

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  ld-mac.cc
3  ld-mac.cc
@@ -399,6 +399,9 @@ class MachOLoader {
399 399
       LOG << "mmap(file) " << mach.filename() << ' ' << name
400 400
           << ": " << (void*)vmaddr << "-" << (void*)(vmaddr + filesize)
401 401
           << " offset=" << mach.offset() + seg->fileoff << endl;
  402
+      if (filesize == 0) {
  403
+        continue;
  404
+      }
402 405
       void* mapped = mmap((void*)vmaddr, filesize, prot,
403 406
                           MAP_PRIVATE | MAP_FIXED,
404 407
                           mach.fd(), mach.offset() + seg->fileoff);

0 notes on commit 01472d7

Please sign in to comment.
Something went wrong with that request. Please try again.