VirtualBox

Ignore:
Timestamp:
Apr 25, 2012 10:10:16 AM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77614
Message:

Made dbgkrnlinfo-r0drv-darwin.cpp work with 10.8 preview 3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp

    r40856 r41050  
    590590        const char *pszSym = &pThis->pachStrTab[(uint32_t)pSym->n_un.n_strx];
    591591#ifdef IN_RING3
    592         RTAssertMsg2("%05i: %02x:%08x %02x %04x %s\n", iSym, pSym->n_sect, pSym->n_value, pSym->n_type, pSym->n_desc, pszSym);
     592        RTAssertMsg2("%05i: %02x:%08llx %02x %04x %s\n", iSym, pSym->n_sect, (uint64_t)pSym->n_value, pSym->n_type, pSym->n_desc, pszSym);
    593593#endif
    594594
     
    607607                    if (pSym->n_desc & ~(REFERENCED_DYNAMICALLY))
    608608                        RETURN_VERR_BAD_EXE_FORMAT;
    609                     if (pSym->n_value < pThis->apSections[pSym->n_sect - 1]->addr)
     609                    if (   pSym->n_value < pThis->apSections[pSym->n_sect - 1]->addr
     610                        && strcmp(pszSym, "__mh_execute_header"))    /* in 10.8 it's no longer absolute (PIE?). */
    610611                        RETURN_VERR_BAD_EXE_FORMAT;
    611                     if (   pSym->n_value - pThis->apSections[pSym->n_sect - 1]->addr
    612                         > pThis->apSections[pSym->n_sect - 1]->size)
     612                    if (      pSym->n_value - pThis->apSections[pSym->n_sect - 1]->addr
     613                           > pThis->apSections[pSym->n_sect - 1]->size
     614                        && strcmp(pszSym, "__mh_execute_header"))    /* see above. */
    613615                        RETURN_VERR_BAD_EXE_FORMAT;
    614616                    break;
    615617
    616618                case MACHO_N_ABS:
    617 #if 0 /* Spec say MACHO_NO_SECT, __mh_execute_header has 1 with 10.7/amd64 */
    618                     if (pSym->n_sect != MACHO_NO_SECT)
    619 #else
    620                     if (pSym->n_sect > pThis->cSections)
    621 #endif
     619                    if (   pSym->n_sect != MACHO_NO_SECT
     620                        && (   strcmp(pszSym, "__mh_execute_header") /* n_sect=1 in 10.7/amd64 */
     621                            || pSym->n_sect > pThis->cSections) )
    622622                        RETURN_VERR_BAD_EXE_FORMAT;
    623623                    if (pSym->n_desc & ~(REFERENCED_DYNAMICALLY))
     
    828828            case LC_DYSYMTAB:
    829829            case LC_UNIXTHREAD:
     830            case LC_CODE_SIGNATURE:
     831            case LC_VERSION_MIN_MACOSX:
     832            case LC_FUNCTION_STARTS:
     833            case LC_MAIN:
     834            case LC_DATA_IN_CODE:
     835            case LC_SOURCE_VERSION:
    830836                break;
    831837
     
    847853            case LC_TWOLEVEL_HINTS:
    848854            case LC_PREBIND_CKSUM:
     855            case LC_SEGMENT_SPLIT_INFO:
     856            case LC_ENCRYPTION_INFO:
     857                RETURN_VERR_LDR_UNEXPECTED;
     858
     859            /* no phones here yet */
     860            case LC_VERSION_MIN_IPHONEOS:
    849861                RETURN_VERR_LDR_UNEXPECTED;
    850862
     
    860872            case LC_SUB_CLIENT:
    861873            case LC_SUB_LIBRARY:
     874            case LC_RPATH:
     875            case LC_REEXPORT_DYLIB:
     876            case LC_LAZY_LOAD_DYLIB:
     877            case LC_DYLD_INFO:
     878            case LC_DYLD_INFO_ONLY:
     879            case LC_LOAD_UPWARD_DYLIB:
     880            case LC_DYLD_ENVIRONMENT:
     881            case LC_DYLIB_CODE_SIGN_DRS:
    862882                RETURN_VERR_LDR_UNEXPECTED;
    863883
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette