diff options
Diffstat (limited to 'include/mach-o')
-rw-r--r-- | include/mach-o/ChangeLog | 4 | ||||
-rw-r--r-- | include/mach-o/loader.h | 57 |
2 files changed, 61 insertions, 0 deletions
diff --git a/include/mach-o/ChangeLog b/include/mach-o/ChangeLog index 0f2721a..7adbc49 100644 --- a/include/mach-o/ChangeLog +++ b/include/mach-o/ChangeLog @@ -1,5 +1,9 @@ 2014-04-16 Tristan Gingold <gingold@adacore.com> + * loader.h: Add macros for rebase, bind and export constants. + +2014-04-16 Tristan Gingold <gingold@adacore.com> + * loader.h (BFD_MACH_O_CPU_ARCH_MASK, BFD_MACH_O_CPU_ARCH_ABI64) (BFD_MACH_O_CPU_SUBTYPE_MASK, BFD_MACH_O_CPU_SUBTYPE_LIB64): Define. diff --git a/include/mach-o/loader.h b/include/mach-o/loader.h index 20cfe42..ff794a3 100644 --- a/include/mach-o/loader.h +++ b/include/mach-o/loader.h @@ -342,6 +342,63 @@ bfd_mach_o_section_attribute; #define BFD_MACH_O_INDIRECT_SYM_LOCAL 0x80000000 #define BFD_MACH_O_INDIRECT_SYM_ABS 0x40000000 +/* Constants for dyld info rebase. */ +#define BFD_MACH_O_REBASE_OPCODE_MASK 0xf0 +#define BFD_MACH_O_REBASE_IMMEDIATE_MASK 0x0f + +/* The rebase opcodes. */ +#define BFD_MACH_O_REBASE_OPCODE_DONE 0x00 +#define BFD_MACH_O_REBASE_OPCODE_SET_TYPE_IMM 0x10 +#define BFD_MACH_O_REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20 +#define BFD_MACH_O_REBASE_OPCODE_ADD_ADDR_ULEB 0x30 +#define BFD_MACH_O_REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40 +#define BFD_MACH_O_REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50 +#define BFD_MACH_O_REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60 +#define BFD_MACH_O_REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70 +#define BFD_MACH_O_REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80 + +/* The rebase type. */ +#define BFD_MACH_O_REBASE_TYPE_POINTER 1 +#define BFD_MACH_O_REBASE_TYPE_TEXT_ABSOLUTE32 2 +#define BFD_MACH_O_REBASE_TYPE_TEXT_PCREL32 3 + +/* Constants for dyld info bind. */ +#define BFD_MACH_O_BIND_OPCODE_MASK 0xf0 +#define BFD_MACH_O_BIND_IMMEDIATE_MASK 0x0f + +/* The bind opcodes. */ +#define BFD_MACH_O_BIND_OPCODE_DONE 0x00 +#define BFD_MACH_O_BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10 +#define BFD_MACH_O_BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20 +#define BFD_MACH_O_BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30 +#define BFD_MACH_O_BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40 +#define BFD_MACH_O_BIND_OPCODE_SET_TYPE_IMM 0x50 +#define BFD_MACH_O_BIND_OPCODE_SET_ADDEND_SLEB 0x60 +#define BFD_MACH_O_BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70 +#define BFD_MACH_O_BIND_OPCODE_ADD_ADDR_ULEB 0x80 +#define BFD_MACH_O_BIND_OPCODE_DO_BIND 0x90 +#define BFD_MACH_O_BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xa0 +#define BFD_MACH_O_BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xb0 +#define BFD_MACH_O_BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xc0 + +/* The bind types. */ +#define BFD_MACH_O_BIND_TYPE_POINTER 1 +#define BFD_MACH_O_BIND_TYPE_TEXT_ABSOLUTE32 2 +#define BFD_MACH_O_BIND_TYPE_TEXT_PCREL32 3 + +/* The special dylib. */ +#define BFD_MACH_O_BIND_SPECIAL_DYLIB_SELF 0 +#define BFD_MACH_O_BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1 +#define BFD_MACH_O_BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2 + +/* Constants for dyld info export. */ +#define BFD_MACH_O_EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03 +#define BFD_MACH_O_EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00 +#define BFD_MACH_O_EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01 +#define BFD_MACH_O_EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04 +#define BFD_MACH_O_EXPORT_SYMBOL_FLAGS_REEXPORT 0x08 +#define BFD_MACH_O_EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10 + /* Constants for DATA_IN_CODE entries. */ typedef enum bfd_mach_o_data_in_code_entry_kind { |