VirtualBox

Changeset 41050 in vbox


Ignore:
Timestamp:
Apr 25, 2012 10:10:16 AM (12 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Runtime
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/include/internal/ldrMach-O.h

    r37560 r41050  
    55
    66/*
    7  * Copyright (C) 2011 Oracle Corporation
     7 * Copyright (C) 2011-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    248248#define MH_BINDS_TO_WEAK            UINT32_C(0x00010000)
    249249#define MH_ALLOW_STACK_EXECUTION    UINT32_C(0x00020000)
    250 #define MH_VALID_FLAGS              UINT32_C(0x0003ffff)
     250#define MH_ROOT_SAFE                UINT32_C(0x00040000)
     251#define MH_SETUID_SAFE              UINT32_C(0x00080000)
     252#define MH_NO_REEXPORTED_DYLIBS     UINT32_C(0x00100000)
     253#define MH_PIE                      UINT32_C(0x00200000)
     254#define MH_DEAD_STRIPPABLE_DYLIB    UINT32_C(0x00400000)
     255#define MH_HAS_TLV_DESCRIPTORS      UINT32_C(0x00800000)
     256#define MH_NO_HEAP_EXECUTION        UINT32_C(0x01000000)
     257#define MH_VALID_FLAGS              UINT32_C(0x02ffffff)
    251258
    252259
     
    282289#define LC_TWOLEVEL_HINTS           UINT32_C(0x16)
    283290#define LC_PREBIND_CKSUM            UINT32_C(0x17)
    284 #define LC_LOAD_WEAK_DYLIB (        UINT32_C(0x18) | LC_REQ_DYLD)
     291#define LC_LOAD_WEAK_DYLIB         (UINT32_C(0x18) | LC_REQ_DYLD)
    285292#define LC_SEGMENT_64               UINT32_C(0x19)
    286293#define LC_ROUTINES_64              UINT32_C(0x1a)
    287294#define LC_UUID                     UINT32_C(0x1b)
     295#define LC_RPATH                   (UINT32_C(0x1c) | LC_REQ_DYLD)
     296#define LC_CODE_SIGNATURE           UINT32_C(0x1d)
     297#define LC_SEGMENT_SPLIT_INFO       UINT32_C(0x1e)
     298#define LC_REEXPORT_DYLIB          (UINT32_C(0x1f) | LC_REQ_DYLD)
     299#define LC_LAZY_LOAD_DYLIB          UINT32_C(0x20)
     300#define LC_ENCRYPTION_INFO          UINT32_C(0x21)
     301#define LC_DYLD_INFO                UINT32_C(0x22)
     302#define LC_DYLD_INFO_ONLY          (UINT32_C(0x22) | LC_REQ_DYLD)
     303#define LC_LOAD_UPWARD_DYLIB       (UINT32_C(0x23) | LC_REQ_DYLD)
     304#define LC_VERSION_MIN_MACOSX       UINT32_C(0x24)
     305#define LC_VERSION_MIN_IPHONEOS     UINT32_C(0x25)
     306#define LC_FUNCTION_STARTS          UINT32_C(0x26)
     307#define LC_DYLD_ENVIRONMENT         UINT32_C(0x27)
     308#define LC_MAIN                    (UINT32_C(0x28) | LC_REQ_DYLD)
     309#define LC_DATA_IN_CODE             UINT32_C(0x29)
     310#define LC_SOURCE_VERSION           UINT32_C(0x2a)
     311#define LC_DYLIB_CODE_SIGN_DRS      UINT32_C(0x2b)
    288312
    289313
  • 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
  • trunk/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp

    r40856 r41050  
    55
    66/*
    7  * Copyright (C) 2011 Oracle Corporation
     7 * Copyright (C) 2011-2012 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4646        "dtrace_register",
    4747        "dtrace_suspend",
     48        "kext_alloc",
     49        "kext_free",
     50        "vm_map_protect"
    4851    };
    4952    for (unsigned i = 0; i < RT_ELEMENTS(s_apszSyms); i++)
Note: See TracChangeset for help on using the changeset viewer.

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