]> git.saurik.com Git - apple/dyld.git/blobdiff - src/dyldInitialization.cpp
dyld-519.2.1.tar.gz
[apple/dyld.git] / src / dyldInitialization.cpp
index 50d758da233013f0bd0c139e1a47bf8e13620342..692b271ec703d06e4660ebc4f5e9fe161ce420c6 100644 (file)
@@ -115,7 +115,7 @@ static uintptr_t slideOfMainExecutable(const struct macho_header* mh)
        for (uint32_t i = 0; i < cmd_count; ++i) {
                if ( cmd->cmd == LC_SEGMENT_COMMAND ) {
                        const struct macho_segment_command* segCmd = (struct macho_segment_command*)cmd;
-                       if ( strcmp(segCmd->segname, "__TEXT") == 0 ) {
+                       if ( (segCmd->fileoff == 0) && (segCmd->filesize != 0)) {
                                return (uintptr_t)mh - segCmd->vmaddr;
                        }
                }