Changeset 63
- Timestamp:
- Oct 30, 2013, 3:00:14 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/k/kLdrFmts/mach-o.h
r56 r63 500 500 */ 501 501 /** Section type mask. */ 502 #define SECTION_TYPE KU32_C(0x000000ff)502 #define SECTION_TYPE KU32_C(0x000000ff) 503 503 /** Regular section. */ 504 #define S_REGULAR 0x0504 #define S_REGULAR 0x00 505 505 /** Zero filled section. */ 506 #define S_ZEROFILL 0x1506 #define S_ZEROFILL 0x01 507 507 /** C literals. */ 508 #define S_CSTRING_LITERALS 0x2508 #define S_CSTRING_LITERALS 0x02 509 509 /** 4 byte literals. */ 510 #define S_4BYTE_LITERALS 0x3510 #define S_4BYTE_LITERALS 0x03 511 511 /** 8 byte literals. */ 512 #define S_8BYTE_LITERALS 0x4512 #define S_8BYTE_LITERALS 0x04 513 513 /** Pointer to literals. */ 514 #define S_LITERAL_POINTERS 0x5514 #define S_LITERAL_POINTERS 0x05 515 515 /** Section containing non-lazy symbol pointers. 516 516 * Reserved1 == start index in the indirect symbol table. */ 517 #define S_NON_LAZY_SYMBOL_POINTERS 0x6517 #define S_NON_LAZY_SYMBOL_POINTERS 0x06 518 518 /** Section containing lazy symbol pointers. 519 519 * Reserved1 == start index in the indirect symbol table. */ 520 #define S_LAZY_SYMBOL_POINTERS 0x7520 #define S_LAZY_SYMBOL_POINTERS 0x07 521 521 /** Section containing symbol stubs. 522 522 * Reserved2 == stub size. */ 523 #define S_SYMBOL_STUBS 0x8523 #define S_SYMBOL_STUBS 0x08 524 524 /** Section containing function pointers for module initialization. . */ 525 #define S_MOD_INIT_FUNC_POINTERS 0x9525 #define S_MOD_INIT_FUNC_POINTERS 0x09 526 526 /** Section containing function pointers for module termination. . */ 527 #define S_MOD_TERM_FUNC_POINTERS 0xa527 #define S_MOD_TERM_FUNC_POINTERS 0x0a 528 528 /** Section containing symbols that are to be coalesced. */ 529 #define S_COALESCED 0xb529 #define S_COALESCED 0x0b 530 530 /** Zero filled section that be larger than 4GB. */ 531 #define S_GB_ZEROFILL 0xc531 #define S_GB_ZEROFILL 0x0c 532 532 /** Section containing pairs of function pointers for interposing. */ 533 #define S_INTERPOSING 0xd533 #define S_INTERPOSING 0x0d 534 534 /** 16 byte literals. */ 535 #define S_16BYTE_LITERALS 0xe 535 #define S_16BYTE_LITERALS 0x0e 536 /** DTrace byte code / definitions (DOF = DTrace object format). */ 537 #define S_DTRACE_DOF 0x0f 538 /** Section containing pointers to symbols in lazily loaded dylibs. */ 539 #define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 536 540 537 541 /** Section attribute mask. */ -
trunk/kLdr/kLdrModMachO.c
r62 r63 739 739 case S_NON_LAZY_SYMBOL_POINTERS: \ 740 740 case S_LAZY_SYMBOL_POINTERS: \ 741 case S_LAZY_DYLIB_SYMBOL_POINTERS: \ 741 742 /* (reserved 1 = is indirect symbol table index) */ \ 742 743 KLDRMODMACHO_CHECK_RETURN(!pSect->reserved2, KLDR_ERR_MACHO_BAD_SECTION); \ … … 759 760 \ 760 761 case S_LITERAL_POINTERS: \ 762 case S_DTRACE_DOF: \ 763 KLDRMODMACHO_CHECK_RETURN(!pSect->reserved1, KLDR_ERR_MACHO_BAD_SECTION); \ 764 KLDRMODMACHO_CHECK_RETURN(!pSect->reserved2, KLDR_ERR_MACHO_BAD_SECTION); \ 765 fFileBits = 1; \ 766 break; \ 767 \ 761 768 case S_INTERPOSING: \ 762 769 case S_GB_ZEROFILL: \ … … 780 787 KLDRMODMACHO_CHECK_RETURN(pSect->align < 31, \ 781 788 KLDR_ERR_MACHO_BAD_SECTION); \ 789 /* Workaround for buggy ld64 (or as, llvm, ++) that produces a misaligned __TEXT.__unwind_info. */ \ 790 /* Seen: pSect->align = 4, pSect->addr = 0x5ebe14. Just adjust the alignment down. */ \ 791 if ( ((K_BIT32(pSect->align) - KU32_C(1)) & pSect->addr) \ 792 && pSect->align == 4 \ 793 && kHlpStrComp(pSect->sectname, "__unwind_info") == 0) \ 794 pSect->align = 2; \ 782 795 KLDRMODMACHO_CHECK_RETURN(!((K_BIT32(pSect->align) - KU32_C(1)) & pSect->addr), \ 783 796 KLDR_ERR_MACHO_BAD_SECTION); \ … … 1025 1038 if (!(fOpenFlags & KLDRMOD_OPEN_FLAGS_FOR_INFO)) 1026 1039 KLDRMODMACHO_FAILED_RETURN(KLDR_ERR_MACHO_UNSUPPORTED_LOAD_COMMAND); 1040 *pfCanLoad = K_FALSE; 1027 1041 break; 1028 1042
Note:
See TracChangeset
for help on using the changeset viewer.