Changeset 41050 in vbox
- Timestamp:
- Apr 25, 2012 10:10:16 AM (12 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 edited
-
include/internal/ldrMach-O.h (modified) (3 diffs)
-
r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp (modified) (5 diffs)
-
testcase/tstRTDarwinMachKernel.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/ldrMach-O.h
r37560 r41050 5 5 6 6 /* 7 * Copyright (C) 2011 Oracle Corporation7 * Copyright (C) 2011-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 248 248 #define MH_BINDS_TO_WEAK UINT32_C(0x00010000) 249 249 #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) 251 258 252 259 … … 282 289 #define LC_TWOLEVEL_HINTS UINT32_C(0x16) 283 290 #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) 285 292 #define LC_SEGMENT_64 UINT32_C(0x19) 286 293 #define LC_ROUTINES_64 UINT32_C(0x1a) 287 294 #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) 288 312 289 313 -
trunk/src/VBox/Runtime/r0drv/darwin/dbgkrnlinfo-r0drv-darwin.cpp
r40856 r41050 590 590 const char *pszSym = &pThis->pachStrTab[(uint32_t)pSym->n_un.n_strx]; 591 591 #ifdef IN_RING3 592 RTAssertMsg2("%05i: %02x:%08 x %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); 593 593 #endif 594 594 … … 607 607 if (pSym->n_desc & ~(REFERENCED_DYNAMICALLY)) 608 608 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?). */ 610 611 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. */ 613 615 RETURN_VERR_BAD_EXE_FORMAT; 614 616 break; 615 617 616 618 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) ) 622 622 RETURN_VERR_BAD_EXE_FORMAT; 623 623 if (pSym->n_desc & ~(REFERENCED_DYNAMICALLY)) … … 828 828 case LC_DYSYMTAB: 829 829 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: 830 836 break; 831 837 … … 847 853 case LC_TWOLEVEL_HINTS: 848 854 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: 849 861 RETURN_VERR_LDR_UNEXPECTED; 850 862 … … 860 872 case LC_SUB_CLIENT: 861 873 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: 862 882 RETURN_VERR_LDR_UNEXPECTED; 863 883 -
trunk/src/VBox/Runtime/testcase/tstRTDarwinMachKernel.cpp
r40856 r41050 5 5 6 6 /* 7 * Copyright (C) 2011 Oracle Corporation7 * Copyright (C) 2011-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 46 46 "dtrace_register", 47 47 "dtrace_suspend", 48 "kext_alloc", 49 "kext_free", 50 "vm_map_protect" 48 51 }; 49 52 for (unsigned i = 0; i < RT_ELEMENTS(s_apszSyms); i++)
Note:
See TracChangeset
for help on using the changeset viewer.

