Changeset 56


Ignore:
Timestamp:
Oct 11, 2013, 4:07:22 AM (12 years ago)
Author:
bird
Message:

More mach-o debug info loading adjustments.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/k/kLdrFmts/mach-o.h

    r55 r56  
    370370#define LC_ROUTINES_64      KU32_C(0x1a)  /**< Image routines (64-bit). See routines_command_32. */
    371371#define LC_UUID             KU32_C(0x1b)  /**< The UUID of the object module. See uuid_command.  */
    372 #define LC_RPATH            KU32_C(0x1c | LC_REQ_DYLD) /**< Runpth additions. See rpath_command. */
     372#define LC_RPATH           (KU32_C(0x1c) | LC_REQ_DYLD) /**< Runpth additions. See rpath_command. */
    373373#define LC_CODE_SIGNATURE   KU32_C(0x1d)  /**< Code signature location. See linkedit_data_command. */
    374374#define LC_SEGMENT_SPLIT_INFO KU32_C(0x1e)/**< Segment split info location. See linkedit_data_command. */
    375 #define LC_REEXPORT_DYLIB   KU32_C(0x1f | LC_REQ_DYLD)/**< Load and re-export the given dylib - DLL forwarding. See dylib_command. */
     375#define LC_REEXPORT_DYLIB  (KU32_C(0x1f) | LC_REQ_DYLD)/**< Load and re-export the given dylib - DLL forwarding. See dylib_command. */
    376376#define LC_LAZY_LOAD_DYLIB  KU32_C(0x20)  /**< Delays loading of the given dylib until used. See dylib_command? */
    377377#define LC_ENCRYPTION_INFO  KU32_C(0x21)  /**< Segment encryption information. See encryption_info_command. */
    378378#define LC_DYLD_INFO        KU32_C(0x22)  /**< Compressed dylib relocation information, alternative present. See dyld_info_command. */
    379 #define LC_DYLD_INFO_ONLY   KU32_C(0x22 | LC_REQ_DYLD) /**< Compressed dylib relocation information, no alternative. See dyld_info_command. */
     379#define LC_DYLD_INFO_ONLY  (KU32_C(0x22) | LC_REQ_DYLD) /**< Compressed dylib relocation information, no alternative. See dyld_info_command. */
    380380#define LC_LOAD_UPWARD_DYLIB KU32_C(0x23) /**< ???? */
    381381#define LC_VERSION_MIN_MACOSX KU32_C(0x24)   /**< The image requires the given Mac OS X version. See version_min_command. */
    382382#define LC_VERSION_MIN_IPHONEOS KU32_C(0x25) /**< The image requires the given iOS version. See version_min_command. */
    383383#define LC_FUNCTION_STARTS  KU32_C(0x26)  /**< Where to find the compress function start addresses. See linkedit_data_command. */
    384 #define LC_DYLD_ENVIRONMENT KU32_C(0x26)  /**< Environment variable for the dynamic linker. See dylinker_command. */
     384#define LC_DYLD_ENVIRONMENT KU32_C(0x27)  /**< Environment variable for the dynamic linker. See dylinker_command. */
     385#define LC_MAIN            (KU32_C(0x28) | LC_REQ_DYLD) /**< Simpler alternative to LC_UNIXTHREAD. */
     386#define LC_DATA_IN_CODE     KU32_C(0x29)  /**< Table of data in the the text section. */
     387#define LC_SOURCE_VERSION   KU32_C(0x2a)  /**< Source code revision / version hint. */
     388#define LC_DYLIB_CODE_SIGN_DRS KU32_C(0x2b) /**< Code signing designated requirements copied from dylibs prequisites. */
    385389/** @} */
    386390
  • trunk/kLdr/kLdrModMachO.c

    r55 r56  
    857857                        case S_SYMBOL_STUBS:
    858858                            if (   pSect->reserved1
    859                                 || pSect->reserved2 < 1  /* stub size.*/
    860                                 || pSect->reserved2 > 64 )
     859                                || pSect->reserved2 > 64 /* stub size. 0 has been seen (corecrypto.kext) */ )
    861860                                return KLDR_ERR_MACHO_BAD_SECTION;
    862861                            fFileBits = 1;
     
    10551054                break;
    10561055
     1056            case LC_SOURCE_VERSION:     /* Harmless. It just gives a clue regarding the source code revision/version. */
     1057            case LC_DATA_IN_CODE:       /* Ignore */
     1058            case LC_DYLIB_CODE_SIGN_DRS:/* Ignore */
     1059                /** @todo valid command size. */
     1060                break;
     1061
     1062            case LC_ID_DYLIB:           /** @todo dylib */
     1063            case LC_LOAD_DYLIB:         /** @todo dylib */
     1064            case LC_LOAD_DYLINKER:      /** @todo dylib */
     1065            case LC_TWOLEVEL_HINTS:     /** @todo dylib */
     1066            case LC_LOAD_WEAK_DYLIB:    /** @todo dylib */
     1067            case LC_ID_DYLINKER:        /** @todo dylib */
     1068            case LC_DYLD_ENVIRONMENT:   /** @todo dylib */
     1069            case LC_MAIN: /** @todo parse this and find and entry point or smth. */
     1070                /** @todo valid command size. */
     1071                if (!(fOpenFlags & KLDRMOD_OPEN_FLAGS_FOR_INFO))
     1072                    return KLDR_ERR_MACHO_UNSUPPORTED_LOAD_COMMAND;
     1073                break;
     1074
    10571075            case LC_LOADFVMLIB:
    10581076            case LC_IDFVMLIB:
     
    10601078            case LC_FVMFILE:
    10611079            case LC_PREPAGE:
    1062             case LC_LOAD_DYLIB:
    1063             case LC_ID_DYLIB:
    1064             case LC_LOAD_DYLINKER:
    1065             case LC_ID_DYLINKER:
    10661080            case LC_PREBOUND_DYLIB:
    10671081            case LC_ROUTINES:
     
    10711085            case LC_SUB_CLIENT:
    10721086            case LC_SUB_LIBRARY:
    1073             case LC_TWOLEVEL_HINTS:
    10741087            case LC_PREBIND_CKSUM:
    1075             case LC_LOAD_WEAK_DYLIB:
    10761088            case LC_SYMSEG:
    10771089                return KLDR_ERR_MACHO_UNSUPPORTED_LOAD_COMMAND;
Note: See TracChangeset for help on using the changeset viewer.