diff options
Diffstat (limited to 'include')
30 files changed, 1106 insertions, 773 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 4ad0de858..7a747a7cc 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,66 +1,3 @@ -2012-08-02 Sean Keys <skeys@ipdatasys.com> - - * elf/m68hc11.h: #define E_M68HC11_NO_BANK_WARNING - 0x000000200 - -2012-07-24 Stephan McCamant <smcc@cs.berkeley.edu> - Dr David Alan Gilbert <dave@treblig.org> - - PR binutils/13135 - * dis-asm.h (fprintf_ftype): Add ATTRIBUTE_FPTR_PRINTF_2. - -2012-07-13 Doug Evans <dje@google.com> - - * filenames.h: #include "hashtab.h". - (filename_hash, filename_eq): Declare. - -2012-07-13 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> - - * elf/s390.h (START_RELOC_NUMBERS): Define R_390_IRELATIVE reloc. - -2012-07-05 Sean Keys <skeys@ipdatasys.com> - - * opcode/xgate.h: Changed the format string for mode - XGATE_OP_DYA_MON. - -2012-06-18 Doug Evans <dje@google.com> - - * dwarf2.def (DW_OP): Add DW_OP_GNU_const_index. - -2012-06-12 Rafael Ávila de Espíndola <respindola@mozilla.com> - - * plugin-api.h (ld_plugin_output_file_type): Add LDPO_PIE. - -2012-06-08 Jakub Jelinek <jakub@redhat.com> - - * dwarf2.def (DW_FORM_GNU_ref_alt, DW_FORM_GNU_strp_alt): New - forms. - * dwarf2.h (enum dwarf_macro_record_type): Add - DW_MACRO_GNU_define_indirect_alt, DW_MACRO_GNU_undef_indirect_alt - and DW_MACRO_GNU_transparent_include_alt. - -2012-05-23 Doug Evans <dje@google.com> - - * leb128.h: #include stdint.h, inttypes.h. - (read_uleb128_to_uint64): Renamed from read_uleb128_to_ull. - Change to take a uint64_t * argument instead of unsigned long long. - (read_sleb128_to_uint64): Renamed from read_sleb128_to_ll. - Change to take an int64_t * argument instead of long long. - -2012-05-22 Doug Evans <dje@google.com> - - * leb128.h: New file. - -2012-05-19 Gary Funck <gary@intrepid.com> - - * dwarf2.def: Update comment re: UPC extensions to reference - DWARF4 specification. - -2012-05-15 James Murray <jsm@jsm-net.demon.co.uk> - - * dis-asm.h (print_insn_m9s12x): Prototype. - (print_insn_m9s12xg): Prototype. - 2012-05-03 Sean Keys <skeys@ipdatasys.com> * dis-asm.h (print_insn_xgate): Define. diff --git a/include/dis-asm.h b/include/dis-asm.h index 661e7cf58..203b11366 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -35,7 +35,7 @@ extern "C" { #include <stdio.h> #include "bfd.h" - typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2; + typedef int (*fprintf_ftype) (void *, const char*, ...) /*ATTRIBUTE_FPTR_PRINTF_2*/; enum dis_insn_type { @@ -260,8 +260,6 @@ extern int print_insn_m32c (bfd_vma, disassemble_info *); extern int print_insn_m32r (bfd_vma, disassemble_info *); extern int print_insn_m68hc11 (bfd_vma, disassemble_info *); extern int print_insn_m68hc12 (bfd_vma, disassemble_info *); -extern int print_insn_m9s12x (bfd_vma, disassemble_info *); -extern int print_insn_m9s12xg (bfd_vma, disassemble_info *); extern int print_insn_m68k (bfd_vma, disassemble_info *); extern int print_insn_m88k (bfd_vma, disassemble_info *); extern int print_insn_mcore (bfd_vma, disassemble_info *); diff --git a/include/dwarf2.def b/include/dwarf2.def index 3c3dfccf3..e36ae919b 100644 --- a/include/dwarf2.def +++ b/include/dwarf2.def @@ -167,7 +167,7 @@ DW_TAG (DW_TAG_GNU_formal_parameter_pack, 0x4108) are properly part of DWARF 5. */ DW_TAG (DW_TAG_GNU_call_site, 0x4109) DW_TAG (DW_TAG_GNU_call_site_parameter, 0x410a) -/* Extensions for UPC. See: http://dwarfstd.org/doc/DWARF4.pdf. */ +/* Extensions for UPC. See: http://upc.gwu.edu/~upc. */ DW_TAG (DW_TAG_upc_shared_type, 0x8765) DW_TAG (DW_TAG_upc_strict_type, 0x8766) DW_TAG (DW_TAG_upc_relaxed_type, 0x8767) @@ -205,10 +205,6 @@ DW_FORM (DW_FORM_ref_sig8, 0x20) /* Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ DW_FORM (DW_FORM_GNU_addr_index, 0x1f01) DW_FORM (DW_FORM_GNU_str_index, 0x1f02) -/* Extensions for DWZ multifile. - See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */ -DW_FORM (DW_FORM_GNU_ref_alt, 0x1f20) -DW_FORM (DW_FORM_GNU_strp_alt, 0x1f21) DW_END_FORM DW_FIRST_AT (DW_AT_sibling, 0x01) @@ -588,7 +584,6 @@ DW_OP (DW_OP_GNU_reinterpret, 0xf9) DW_OP (DW_OP_GNU_parameter_ref, 0xfa) /* Extension for Fission. See http://gcc.gnu.org/wiki/DebugFission. */ DW_OP (DW_OP_GNU_addr_index, 0xfb) -DW_OP (DW_OP_GNU_const_index, 0xfc) /* HP extensions. */ DW_OP_DUP (DW_OP_HP_unknown, 0xe0) /* Ouch, the same as GNU_push_tls_address. */ DW_OP (DW_OP_HP_is_value, 0xe1) diff --git a/include/dwarf2.h b/include/dwarf2.h index 2c1aeb6b9..0be7a99c8 100644 --- a/include/dwarf2.h +++ b/include/dwarf2.h @@ -333,11 +333,6 @@ enum dwarf_macro_record_type DW_MACRO_GNU_define_indirect = 5, DW_MACRO_GNU_undef_indirect = 6, DW_MACRO_GNU_transparent_include = 7, - /* Extensions for DWZ multifile. - See http://www.dwarfstd.org/ShowIssue.php?issue=120604.1&type=open . */ - DW_MACRO_GNU_define_indirect_alt = 8, - DW_MACRO_GNU_undef_indirect_alt = 9, - DW_MACRO_GNU_transparent_include_alt = 10, DW_MACRO_GNU_lo_user = 0xe0, DW_MACRO_GNU_hi_user = 0xff }; diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index ef84aa36a..ab9b2deae 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,55 +1,3 @@ -2012-06-28 Iain Sandoe <iain@codesourcery.com> - - * common.h (AT_L1I_CACHESHAPE, AT_L1D_CACHESHAPE, - AT_L2_CACHESHAPE, AT_L3_CACHESHAPE): New defines. - -2012-05-16 Georg-Johann Lay <avr@gjlay.de> - - PR target/13503 - * avr.h (RELOC_NUMBERS): Rename R_AVR_8_HHI8 to R_AVR_8_HLO8. - -2012-05-15 James Murray <jsm@jsm-net.demon.co.uk> - - * m68hc11.h (R_M68HC12_16B, R_M68HC12_PCREL_9, R_M68HC12_PCREL_10) - R_M68HC12_HI8XG, R_M68HC12_LO8XG): New relocations. - (E_M68HC11_XGATE_RAMOFFSET): Define. - -2012-05-14 James Lemke <jwlemke@codesourcery.com> - * ppc.h (SEC_PPC_VLE): Remove. - -2012-05-14 Catherine Moore <clm@codesourcery.com> - James Lemke <jwlemke@codesourcery.com> - - * ppc.h (R_PPC_VLE_REL8): New reloction. - (R_PPC_VLE_REL15): Likewise. - (R_PPC_VLE_REL24): Likewise. - (R_PPC_VLE_LO16A): Likewise. - (R_PPC_VLE_LO16D): Likewise. - (R_PPC_VLE_HI16A): Likewise. - (R_PPC_VLE_HI16D): Likewise. - (R_PPC_VLE_HA16A): Likewise. - (R_PPC_VLE_HA16D): Likewise. - (R_PPC_VLE_SDA21): Likewise. - (R_PPC_VLE_SDA21_LO): Likewise. - (R_PPC_VLE_SDAREL_LO16A): Likewise. - (R_PPC_VLE_SDAREL_LO16D): Likewise. - (R_PPC_VLE_SDAREL_HI16A): Likewise. - (R_PPC_VLE_SDAREL_HI16D): Likewise. - (R_PPC_VLE_SDAREL_HA16A): Likewise. - (R_PPC_VLE_SDAREL_HA16D): Likewise. - (SEC_PPC_VLE): Remove. - (PF_PPC_VLE): New program header flag. - (SHF_PPC_VLE): New section header flag. - (vle_opcodes, vle_num_opcodes): New. - (VLE_OP): New macro. - (VLE_OP_TO_SEG): New macro. - -2012-05-11 Georg-Johann Lay <avr@gjlay.de - - PR target/13503 - * elf/avr.h (RELOC_NUMBERS): Add values for R_AVR_8_LO8, - R_AVR_8_HI8, R_AVR_8_HHI8. - 2012-05-03 Sean Keys <skeys@ipdatasys.com> * xgate.h: Mininal file to support XGATE relocations. diff --git a/include/elf/avr.h b/include/elf/avr.h index b45d902d2..11d43f966 100644 --- a/include/elf/avr.h +++ b/include/elf/avr.h @@ -1,6 +1,5 @@ /* AVR ELF support for BFD. - Copyright 1999, 2000, 2004, 2006, 2010, 2012 - Free Software Foundation, Inc. + Copyright 1999, 2000, 2004, 2006, 2010 Free Software Foundation, Inc. Contributed by Denis Chertykov <denisc@overta.ru> This file is part of BFD, the Binary File Descriptor library. @@ -31,16 +30,16 @@ as reference for the relocations so that linker relaxation is possible. */ #define EF_AVR_LINKRELAX_PREPARED 0x80 -#define E_AVR_MACH_AVR1 1 -#define E_AVR_MACH_AVR2 2 -#define E_AVR_MACH_AVR25 25 -#define E_AVR_MACH_AVR3 3 -#define E_AVR_MACH_AVR31 31 -#define E_AVR_MACH_AVR35 35 -#define E_AVR_MACH_AVR4 4 -#define E_AVR_MACH_AVR5 5 -#define E_AVR_MACH_AVR51 51 -#define E_AVR_MACH_AVR6 6 +#define E_AVR_MACH_AVR1 1 +#define E_AVR_MACH_AVR2 2 +#define E_AVR_MACH_AVR25 25 +#define E_AVR_MACH_AVR3 3 +#define E_AVR_MACH_AVR31 31 +#define E_AVR_MACH_AVR35 35 +#define E_AVR_MACH_AVR4 4 +#define E_AVR_MACH_AVR5 5 +#define E_AVR_MACH_AVR51 51 +#define E_AVR_MACH_AVR6 6 #define E_AVR_MACH_XMEGA1 101 #define E_AVR_MACH_XMEGA2 102 #define E_AVR_MACH_XMEGA3 103 @@ -78,9 +77,6 @@ START_RELOC_NUMBERS (elf_avr_reloc_type) RELOC_NUMBER (R_AVR_LO8_LDI_GS, 24) RELOC_NUMBER (R_AVR_HI8_LDI_GS, 25) RELOC_NUMBER (R_AVR_8, 26) - RELOC_NUMBER (R_AVR_8_LO8, 27) - RELOC_NUMBER (R_AVR_8_HI8, 28) - RELOC_NUMBER (R_AVR_8_HLO8, 29) END_RELOC_NUMBERS (R_AVR_max) #endif /* _ELF_AVR_H */ diff --git a/include/elf/common.h b/include/elf/common.h index 58e489afe..5cddc0bef 100644 --- a/include/elf/common.h +++ b/include/elf/common.h @@ -1,6 +1,6 @@ /* ELF support for BFD. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published @@ -935,18 +935,6 @@ #define AT_SYSINFO 32 #define AT_SYSINFO_EHDR 33 /* Pointer to ELF header of system-supplied DSO. */ -/* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the - value is -1, then the cache doesn't exist. Otherwise: - - bit 0-3: Cache set-associativity; 0 means fully associative. - bit 4-7: Log2 of cacheline size. - bit 8-31: Size of the entire cache >> 8. */ - -#define AT_L1I_CACHESHAPE 34 -#define AT_L1D_CACHESHAPE 35 -#define AT_L2_CACHESHAPE 36 -#define AT_L3_CACHESHAPE 37 - #define AT_SUN_UID 2000 /* Effective user ID. */ #define AT_SUN_RUID 2001 /* Real user ID. */ #define AT_SUN_GID 2002 /* Effective group ID. */ diff --git a/include/elf/m68hc11.h b/include/elf/m68hc11.h index 58d882088..ca325d981 100644 --- a/include/elf/m68hc11.h +++ b/include/elf/m68hc11.h @@ -1,5 +1,5 @@ /* m68hc11 & m68hc12 ELF support for BFD. - Copyright 1999, 2000, 2001, 2002, 2010, 2012 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2010 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -42,12 +42,6 @@ START_RELOC_NUMBERS (elf_m68hc11_reloc_type) RELOC_NUMBER (R_M68HC11_LO16, 12) RELOC_NUMBER (R_M68HC11_PAGE, 13) - RELOC_NUMBER (R_M68HC12_16B, 15) - RELOC_NUMBER (R_M68HC12_PCREL_9, 16) - RELOC_NUMBER (R_M68HC12_PCREL_10, 17) - RELOC_NUMBER (R_M68HC12_HI8XG, 18) - RELOC_NUMBER (R_M68HC12_LO8XG, 19) - /* GNU extension for linker relaxation. Mark beginning of a jump instruction (any form). */ RELOC_NUMBER (R_M68HC11_RL_JUMP, 20) @@ -70,12 +64,6 @@ END_RELOC_NUMBERS (R_M68HC11_max) /* Uses 68HC12 memory banks. */ #define E_M68HC12_BANKS 0x000000004 -/* XGATE ram offsetting. */ -#define E_M68HC11_XGATE_RAMOFFSET 0x000000100 - -/* Suppress warnings */ -#define E_M68HC11_NO_BANK_WARNING 0x000000200 - #define EF_M68HC11_MACH_MASK 0xF0 #define EF_M68HC11_GENERIC 0x00 /* Generic 68HC12/backward compatibility. */ #define EF_M68HC12_MACH 0x10 /* 68HC12 microcontroller. */ @@ -98,10 +86,10 @@ END_RELOC_NUMBERS (R_M68HC11_max) /* Special values for the st_other field in the symbol table. These are used for 68HC12 to identify far functions (must be called with 'call' and returns with 'rtc'). */ -#define STO_M68HC12_FAR 0x80 +#define STO_M68HC12_FAR 0x80 /* Identify interrupt handlers. This is used by the debugger to correctly compute the stack frame. */ -#define STO_M68HC12_INTERRUPT 0x40 +#define STO_M68HC12_INTERRUPT 0x40 #endif diff --git a/include/elf/ppc.h b/include/elf/ppc.h index f80a1e8a3..8e27855be 100644 --- a/include/elf/ppc.h +++ b/include/elf/ppc.h @@ -131,25 +131,6 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) RELOC_NUMBER (R_PPC_EMB_BIT_FLD, 115) RELOC_NUMBER (R_PPC_EMB_RELSDA, 116) -/* PowerPC VLE relocations. */ - RELOC_NUMBER (R_PPC_VLE_REL8, 216) - RELOC_NUMBER (R_PPC_VLE_REL15, 217) - RELOC_NUMBER (R_PPC_VLE_REL24, 218) - RELOC_NUMBER (R_PPC_VLE_LO16A, 219) - RELOC_NUMBER (R_PPC_VLE_LO16D, 220) - RELOC_NUMBER (R_PPC_VLE_HI16A, 221) - RELOC_NUMBER (R_PPC_VLE_HI16D, 222) - RELOC_NUMBER (R_PPC_VLE_HA16A, 223) - RELOC_NUMBER (R_PPC_VLE_HA16D, 224) - RELOC_NUMBER (R_PPC_VLE_SDA21, 225) - RELOC_NUMBER (R_PPC_VLE_SDA21_LO, 226) - RELOC_NUMBER (R_PPC_VLE_SDAREL_LO16A, 227) - RELOC_NUMBER (R_PPC_VLE_SDAREL_LO16D, 228) - RELOC_NUMBER (R_PPC_VLE_SDAREL_HI16A, 229) - RELOC_NUMBER (R_PPC_VLE_SDAREL_HI16D, 230) - RELOC_NUMBER (R_PPC_VLE_SDAREL_HA16A, 231) - RELOC_NUMBER (R_PPC_VLE_SDAREL_HA16D, 232) - /* Support STT_GNU_IFUNC plt calls. */ RELOC_NUMBER (R_PPC_IRELATIVE, 248) @@ -185,11 +166,9 @@ END_RELOC_NUMBERS (R_PPC_max) #define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag. */ #define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib flag. */ -/* Processor specific program headers, p_flags field. */ -#define PF_PPC_VLE 0x10000000 /* PowerPC VLE. */ - -/* Processor specific section headers, sh_flags field. */ -#define SHF_PPC_VLE 0x10000000 /* PowerPC VLE text section. */ +/* This bit is reserved by BFD for processor specific stuff. Name + it properly so that we can easily stay consistent elsewhere. */ +#define SEC_PPC_VLE SEC_TIC54X_BLOCK /* Processor specific section headers, sh_type field. */ diff --git a/include/elf/s390.h b/include/elf/s390.h index a5b4217bc..807b7e8e0 100644 --- a/include/elf/s390.h +++ b/include/elf/s390.h @@ -119,7 +119,6 @@ START_RELOC_NUMBERS (elf_s390_reloc_type) RELOC_NUMBER (R_390_GOTPLT20, 59) /* 20 bit offset to jump slot. */ RELOC_NUMBER (R_390_TLS_GOTIE20, 60)/* 20 bit GOT offset for statis TLS block offset. */ - RELOC_NUMBER (R_390_IRELATIVE, 61) /* IFUNC relocation. */ /* These are GNU extensions to enable C++ vtable garbage collection. */ RELOC_NUMBER (R_390_GNU_VTINHERIT, 250) RELOC_NUMBER (R_390_GNU_VTENTRY, 251) diff --git a/include/filenames.h b/include/filenames.h index e799a51b6..75ec3302d 100644 --- a/include/filenames.h +++ b/include/filenames.h @@ -26,8 +26,6 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FILENAMES_H #define FILENAMES_H -#include "hashtab.h" /* for hashval_t */ - #ifdef __cplusplus extern "C" { #endif @@ -86,10 +84,6 @@ extern int filename_cmp (const char *s1, const char *s2); extern int filename_ncmp (const char *s1, const char *s2, size_t n); -extern hashval_t filename_hash (const void *s); - -extern int filename_eq (const void *s1, const void *s2); - #ifdef __cplusplus } #endif diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog index 833f913ff..cb8df1cba 100644 --- a/include/gdb/ChangeLog +++ b/include/gdb/ChangeLog @@ -1,19 +1,3 @@ -2012-06-23 Doug Evans <dje@google.com> - - * gdb-index.h: New file. - -2012-05-24 Pedro Alves <palves@redhat.com> - - PR gdb/7205 - - Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout. - -2012-05-24 Pedro Alves <palves@redhat.com> - - PR gdb/7205 - - Replace target_signal with gdb_signal throughout. - 2012-04-12 Mike Frysinger <vapier@gentoo.org> * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define. diff --git a/include/gdb/callback.h b/include/gdb/callback.h index d8d14727d..5c0d2db74 100644 --- a/include/gdb/callback.h +++ b/include/gdb/callback.h @@ -314,7 +314,7 @@ int cb_target_to_host_open (host_callback *, int); int cb_target_to_host_signal (host_callback *, int); /* Translate host signal number to target. */ -int cb_host_to_gdb_signal (host_callback *, int); +int cb_host_to_target_signal (host_callback *, int); /* Translate host stat struct to target. If stat struct ptr is NULL, just compute target stat struct size. diff --git a/include/gdb/gdb-index.h b/include/gdb/gdb-index.h deleted file mode 100644 index 92c3398b9..000000000 --- a/include/gdb/gdb-index.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Public attributes of the .gdb_index section. - Copyright 2012 Free Software Foundation, Inc. - - This file is part of GDB. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* This file contains values for understanding the .gdb_index section - needed by more than just GDB, e.g. readelf. */ - -#ifndef GDB_INDEX_H -#define GDB_INDEX_H - -/* Each symbol in .gdb_index refers to a set of CUs that defines the symbol. - Each CU is represented by a 32 bit number that is the index of the CU in - the CU table, plus some attributes of the use of the symbol in that CU. - - The values are defined such that if all the bits are zero, then no - special meaning is assigned to any of them. This is done to preserve - compatibility with older indices. The way this is done is to specify - that if the GDB_INDEX_SYMBOL_KIND value is zero then all other attribute - bits must be zero. - - 0-23 CU index - 24-27 reserved - 28-30 symbol kind - 31 0 == global, 1 == static - - Bits 24-27 are reserved because it's easier to relax restrictions than - it is to impose them after the fact. At present 24 bits to represent - the CU index is plenty. If we need more bits for the CU index or for - attributes then we have them. */ - -/* Whether the symbol is in GLOBAL_BLOCK (== 0) or STATIC_BLOCK (== 1). */ -#define GDB_INDEX_SYMBOL_STATIC_SHIFT 31 -#define GDB_INDEX_SYMBOL_STATIC_MASK 1 -#define GDB_INDEX_SYMBOL_STATIC_VALUE(cu_index) \ - (((cu_index) >> GDB_INDEX_SYMBOL_STATIC_SHIFT) & GDB_INDEX_SYMBOL_STATIC_MASK) -#define GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) \ - do { \ - (cu_index) |= (((value) & GDB_INDEX_SYMBOL_STATIC_MASK) \ - << GDB_INDEX_SYMBOL_STATIC_SHIFT); \ - } while (0) - -/* The kind of the symbol. - We don't use GDB's internal values as these numbers are published - so that other tools can build and read .gdb_index. */ - -typedef enum { - /* Special value to indicate no attributes are present. */ - GDB_INDEX_SYMBOL_KIND_NONE = 0, - GDB_INDEX_SYMBOL_KIND_TYPE = 1, - GDB_INDEX_SYMBOL_KIND_VARIABLE = 2, - GDB_INDEX_SYMBOL_KIND_FUNCTION = 3, - GDB_INDEX_SYMBOL_KIND_OTHER = 4, - /* We currently allocate 3 bits to record the symbol kind. - Give the unused bits a value so gdb will print them sensibly. */ - GDB_INDEX_SYMBOL_KIND_UNUSED5 = 5, - GDB_INDEX_SYMBOL_KIND_UNUSED6 = 6, - GDB_INDEX_SYMBOL_KIND_UNUSED7 = 7, -} gdb_index_symbol_kind; - -#define GDB_INDEX_SYMBOL_KIND_SHIFT 28 -#define GDB_INDEX_SYMBOL_KIND_MASK 7 -#define GDB_INDEX_SYMBOL_KIND_VALUE(cu_index) \ - ((gdb_index_symbol_kind) (((cu_index) >> GDB_INDEX_SYMBOL_KIND_SHIFT) \ - & GDB_INDEX_SYMBOL_KIND_MASK)) -#define GDB_INDEX_SYMBOL_KIND_SET_VALUE(cu_index, value) \ - do { \ - (cu_index) |= (((value) & GDB_INDEX_SYMBOL_KIND_MASK) \ - << GDB_INDEX_SYMBOL_KIND_SHIFT); \ - } while (0) - -#define GDB_INDEX_RESERVED_SHIFT 24 -#define GDB_INDEX_RESERVED_MASK 15 -#define GDB_INDEX_RESERVED_VALUE(cu_index) \ - (((cu_index) >> GDB_INDEX_RESERVED_SHIFT) & GDB_INDEX_RESERVED_MASK) - -/* CU index. */ -#define GDB_INDEX_CU_BITSIZE 24 -#define GDB_INDEX_CU_MASK ((1 << GDB_INDEX_CU_BITSIZE) - 1) -#define GDB_INDEX_CU_VALUE(cu_index) ((cu_index) & GDB_INDEX_CU_MASK) -#define GDB_INDEX_CU_SET_VALUE(cu_index, value) \ - do { \ - (cu_index) |= (value) & GDB_INDEX_CU_MASK; \ - } while (0) - -#endif /* GDB_INDEX_H */ diff --git a/include/gdb/signals.def b/include/gdb/signals.def index ef4c8d4ee..c01895ae5 100644 --- a/include/gdb/signals.def +++ b/include/gdb/signals.def @@ -18,173 +18,173 @@ /* Used some places (e.g. stop_signal) to record the concept that there is no signal. */ -SET (GDB_SIGNAL_0, 0, "0", "Signal 0") -#define GDB_SIGNAL_FIRST GDB_SIGNAL_0 -SET (GDB_SIGNAL_HUP, 1, "SIGHUP", "Hangup") -SET (GDB_SIGNAL_INT, 2, "SIGINT", "Interrupt") -SET (GDB_SIGNAL_QUIT, 3, "SIGQUIT", "Quit") -SET (GDB_SIGNAL_ILL, 4, "SIGILL", "Illegal instruction") -SET (GDB_SIGNAL_TRAP, 5, "SIGTRAP", "Trace/breakpoint trap") -SET (GDB_SIGNAL_ABRT, 6, "SIGABRT", "Aborted") -SET (GDB_SIGNAL_EMT, 7, "SIGEMT", "Emulation trap") -SET (GDB_SIGNAL_FPE, 8, "SIGFPE", "Arithmetic exception") -SET (GDB_SIGNAL_KILL, 9, "SIGKILL", "Killed") -SET (GDB_SIGNAL_BUS, 10, "SIGBUS", "Bus error") -SET (GDB_SIGNAL_SEGV, 11, "SIGSEGV", "Segmentation fault") -SET (GDB_SIGNAL_SYS, 12, "SIGSYS", "Bad system call") -SET (GDB_SIGNAL_PIPE, 13, "SIGPIPE", "Broken pipe") -SET (GDB_SIGNAL_ALRM, 14, "SIGALRM", "Alarm clock") -SET (GDB_SIGNAL_TERM, 15, "SIGTERM", "Terminated") -SET (GDB_SIGNAL_URG, 16, "SIGURG", "Urgent I/O condition") -SET (GDB_SIGNAL_STOP, 17, "SIGSTOP", "Stopped (signal)") -SET (GDB_SIGNAL_TSTP, 18, "SIGTSTP", "Stopped (user)") -SET (GDB_SIGNAL_CONT, 19, "SIGCONT", "Continued") -SET (GDB_SIGNAL_CHLD, 20, "SIGCHLD", "Child status changed") -SET (GDB_SIGNAL_TTIN, 21, "SIGTTIN", "Stopped (tty input)") -SET (GDB_SIGNAL_TTOU, 22, "SIGTTOU", "Stopped (tty output)") -SET (GDB_SIGNAL_IO, 23, "SIGIO", "I/O possible") -SET (GDB_SIGNAL_XCPU, 24, "SIGXCPU", "CPU time limit exceeded") -SET (GDB_SIGNAL_XFSZ, 25, "SIGXFSZ", "File size limit exceeded") -SET (GDB_SIGNAL_VTALRM, 26, "SIGVTALRM", "Virtual timer expired") -SET (GDB_SIGNAL_PROF, 27, "SIGPROF", "Profiling timer expired") -SET (GDB_SIGNAL_WINCH, 28, "SIGWINCH", "Window size changed") -SET (GDB_SIGNAL_LOST, 29, "SIGLOST", "Resource lost") -SET (GDB_SIGNAL_USR1, 30, "SIGUSR1", "User defined signal 1") -SET (GDB_SIGNAL_USR2, 31, "SIGUSR2", "User defined signal 2") -SET (GDB_SIGNAL_PWR, 32, "SIGPWR", "Power fail/restart") +SET (TARGET_SIGNAL_0, 0, "0", "Signal 0") +#define TARGET_SIGNAL_FIRST TARGET_SIGNAL_0 +SET (TARGET_SIGNAL_HUP, 1, "SIGHUP", "Hangup") +SET (TARGET_SIGNAL_INT, 2, "SIGINT", "Interrupt") +SET (TARGET_SIGNAL_QUIT, 3, "SIGQUIT", "Quit") +SET (TARGET_SIGNAL_ILL, 4, "SIGILL", "Illegal instruction") +SET (TARGET_SIGNAL_TRAP, 5, "SIGTRAP", "Trace/breakpoint trap") +SET (TARGET_SIGNAL_ABRT, 6, "SIGABRT", "Aborted") +SET (TARGET_SIGNAL_EMT, 7, "SIGEMT", "Emulation trap") +SET (TARGET_SIGNAL_FPE, 8, "SIGFPE", "Arithmetic exception") +SET (TARGET_SIGNAL_KILL, 9, "SIGKILL", "Killed") +SET (TARGET_SIGNAL_BUS, 10, "SIGBUS", "Bus error") +SET (TARGET_SIGNAL_SEGV, 11, "SIGSEGV", "Segmentation fault") +SET (TARGET_SIGNAL_SYS, 12, "SIGSYS", "Bad system call") +SET (TARGET_SIGNAL_PIPE, 13, "SIGPIPE", "Broken pipe") +SET (TARGET_SIGNAL_ALRM, 14, "SIGALRM", "Alarm clock") +SET (TARGET_SIGNAL_TERM, 15, "SIGTERM", "Terminated") +SET (TARGET_SIGNAL_URG, 16, "SIGURG", "Urgent I/O condition") +SET (TARGET_SIGNAL_STOP, 17, "SIGSTOP", "Stopped (signal)") +SET (TARGET_SIGNAL_TSTP, 18, "SIGTSTP", "Stopped (user)") +SET (TARGET_SIGNAL_CONT, 19, "SIGCONT", "Continued") +SET (TARGET_SIGNAL_CHLD, 20, "SIGCHLD", "Child status changed") +SET (TARGET_SIGNAL_TTIN, 21, "SIGTTIN", "Stopped (tty input)") +SET (TARGET_SIGNAL_TTOU, 22, "SIGTTOU", "Stopped (tty output)") +SET (TARGET_SIGNAL_IO, 23, "SIGIO", "I/O possible") +SET (TARGET_SIGNAL_XCPU, 24, "SIGXCPU", "CPU time limit exceeded") +SET (TARGET_SIGNAL_XFSZ, 25, "SIGXFSZ", "File size limit exceeded") +SET (TARGET_SIGNAL_VTALRM, 26, "SIGVTALRM", "Virtual timer expired") +SET (TARGET_SIGNAL_PROF, 27, "SIGPROF", "Profiling timer expired") +SET (TARGET_SIGNAL_WINCH, 28, "SIGWINCH", "Window size changed") +SET (TARGET_SIGNAL_LOST, 29, "SIGLOST", "Resource lost") +SET (TARGET_SIGNAL_USR1, 30, "SIGUSR1", "User defined signal 1") +SET (TARGET_SIGNAL_USR2, 31, "SIGUSR2", "User defined signal 2") +SET (TARGET_SIGNAL_PWR, 32, "SIGPWR", "Power fail/restart") /* Similar to SIGIO. Perhaps they should have the same number. */ -SET (GDB_SIGNAL_POLL, 33, "SIGPOLL", "Pollable event occurred") -SET (GDB_SIGNAL_WIND, 34, "SIGWIND", "SIGWIND") -SET (GDB_SIGNAL_PHONE, 35, "SIGPHONE", "SIGPHONE") -SET (GDB_SIGNAL_WAITING, 36, "SIGWAITING", "Process's LWPs are blocked") -SET (GDB_SIGNAL_LWP, 37, "SIGLWP", "Signal LWP") -SET (GDB_SIGNAL_DANGER, 38, "SIGDANGER", "Swap space dangerously low") -SET (GDB_SIGNAL_GRANT, 39, "SIGGRANT", "Monitor mode granted") -SET (GDB_SIGNAL_RETRACT, 40, "SIGRETRACT", +SET (TARGET_SIGNAL_POLL, 33, "SIGPOLL", "Pollable event occurred") +SET (TARGET_SIGNAL_WIND, 34, "SIGWIND", "SIGWIND") +SET (TARGET_SIGNAL_PHONE, 35, "SIGPHONE", "SIGPHONE") +SET (TARGET_SIGNAL_WAITING, 36, "SIGWAITING", "Process's LWPs are blocked") +SET (TARGET_SIGNAL_LWP, 37, "SIGLWP", "Signal LWP") +SET (TARGET_SIGNAL_DANGER, 38, "SIGDANGER", "Swap space dangerously low") +SET (TARGET_SIGNAL_GRANT, 39, "SIGGRANT", "Monitor mode granted") +SET (TARGET_SIGNAL_RETRACT, 40, "SIGRETRACT", "Need to relinquish monitor mode") -SET (GDB_SIGNAL_MSG, 41, "SIGMSG", "Monitor mode data available") -SET (GDB_SIGNAL_SOUND, 42, "SIGSOUND", "Sound completed") -SET (GDB_SIGNAL_SAK, 43, "SIGSAK", "Secure attention") -SET (GDB_SIGNAL_PRIO, 44, "SIGPRIO", "SIGPRIO") -SET (GDB_SIGNAL_REALTIME_33, 45, "SIG33", "Real-time event 33") -SET (GDB_SIGNAL_REALTIME_34, 46, "SIG34", "Real-time event 34") -SET (GDB_SIGNAL_REALTIME_35, 47, "SIG35", "Real-time event 35") -SET (GDB_SIGNAL_REALTIME_36, 48, "SIG36", "Real-time event 36") -SET (GDB_SIGNAL_REALTIME_37, 49, "SIG37", "Real-time event 37") -SET (GDB_SIGNAL_REALTIME_38, 50, "SIG38", "Real-time event 38") -SET (GDB_SIGNAL_REALTIME_39, 51, "SIG39", "Real-time event 39") -SET (GDB_SIGNAL_REALTIME_40, 52, "SIG40", "Real-time event 40") -SET (GDB_SIGNAL_REALTIME_41, 53, "SIG41", "Real-time event 41") -SET (GDB_SIGNAL_REALTIME_42, 54, "SIG42", "Real-time event 42") -SET (GDB_SIGNAL_REALTIME_43, 55, "SIG43", "Real-time event 43") -SET (GDB_SIGNAL_REALTIME_44, 56, "SIG44", "Real-time event 44") -SET (GDB_SIGNAL_REALTIME_45, 57, "SIG45", "Real-time event 45") -SET (GDB_SIGNAL_REALTIME_46, 58, "SIG46", "Real-time event 46") -SET (GDB_SIGNAL_REALTIME_47, 59, "SIG47", "Real-time event 47") -SET (GDB_SIGNAL_REALTIME_48, 60, "SIG48", "Real-time event 48") -SET (GDB_SIGNAL_REALTIME_49, 61, "SIG49", "Real-time event 49") -SET (GDB_SIGNAL_REALTIME_50, 62, "SIG50", "Real-time event 50") -SET (GDB_SIGNAL_REALTIME_51, 63, "SIG51", "Real-time event 51") -SET (GDB_SIGNAL_REALTIME_52, 64, "SIG52", "Real-time event 52") -SET (GDB_SIGNAL_REALTIME_53, 65, "SIG53", "Real-time event 53") -SET (GDB_SIGNAL_REALTIME_54, 66, "SIG54", "Real-time event 54") -SET (GDB_SIGNAL_REALTIME_55, 67, "SIG55", "Real-time event 55") -SET (GDB_SIGNAL_REALTIME_56, 68, "SIG56", "Real-time event 56") -SET (GDB_SIGNAL_REALTIME_57, 69, "SIG57", "Real-time event 57") -SET (GDB_SIGNAL_REALTIME_58, 70, "SIG58", "Real-time event 58") -SET (GDB_SIGNAL_REALTIME_59, 71, "SIG59", "Real-time event 59") -SET (GDB_SIGNAL_REALTIME_60, 72, "SIG60", "Real-time event 60") -SET (GDB_SIGNAL_REALTIME_61, 73, "SIG61", "Real-time event 61") -SET (GDB_SIGNAL_REALTIME_62, 74, "SIG62", "Real-time event 62") -SET (GDB_SIGNAL_REALTIME_63, 75, "SIG63", "Real-time event 63") +SET (TARGET_SIGNAL_MSG, 41, "SIGMSG", "Monitor mode data available") +SET (TARGET_SIGNAL_SOUND, 42, "SIGSOUND", "Sound completed") +SET (TARGET_SIGNAL_SAK, 43, "SIGSAK", "Secure attention") +SET (TARGET_SIGNAL_PRIO, 44, "SIGPRIO", "SIGPRIO") +SET (TARGET_SIGNAL_REALTIME_33, 45, "SIG33", "Real-time event 33") +SET (TARGET_SIGNAL_REALTIME_34, 46, "SIG34", "Real-time event 34") +SET (TARGET_SIGNAL_REALTIME_35, 47, "SIG35", "Real-time event 35") +SET (TARGET_SIGNAL_REALTIME_36, 48, "SIG36", "Real-time event 36") +SET (TARGET_SIGNAL_REALTIME_37, 49, "SIG37", "Real-time event 37") +SET (TARGET_SIGNAL_REALTIME_38, 50, "SIG38", "Real-time event 38") +SET (TARGET_SIGNAL_REALTIME_39, 51, "SIG39", "Real-time event 39") +SET (TARGET_SIGNAL_REALTIME_40, 52, "SIG40", "Real-time event 40") +SET (TARGET_SIGNAL_REALTIME_41, 53, "SIG41", "Real-time event 41") +SET (TARGET_SIGNAL_REALTIME_42, 54, "SIG42", "Real-time event 42") +SET (TARGET_SIGNAL_REALTIME_43, 55, "SIG43", "Real-time event 43") +SET (TARGET_SIGNAL_REALTIME_44, 56, "SIG44", "Real-time event 44") +SET (TARGET_SIGNAL_REALTIME_45, 57, "SIG45", "Real-time event 45") +SET (TARGET_SIGNAL_REALTIME_46, 58, "SIG46", "Real-time event 46") +SET (TARGET_SIGNAL_REALTIME_47, 59, "SIG47", "Real-time event 47") +SET (TARGET_SIGNAL_REALTIME_48, 60, "SIG48", "Real-time event 48") +SET (TARGET_SIGNAL_REALTIME_49, 61, "SIG49", "Real-time event 49") +SET (TARGET_SIGNAL_REALTIME_50, 62, "SIG50", "Real-time event 50") +SET (TARGET_SIGNAL_REALTIME_51, 63, "SIG51", "Real-time event 51") +SET (TARGET_SIGNAL_REALTIME_52, 64, "SIG52", "Real-time event 52") +SET (TARGET_SIGNAL_REALTIME_53, 65, "SIG53", "Real-time event 53") +SET (TARGET_SIGNAL_REALTIME_54, 66, "SIG54", "Real-time event 54") +SET (TARGET_SIGNAL_REALTIME_55, 67, "SIG55", "Real-time event 55") +SET (TARGET_SIGNAL_REALTIME_56, 68, "SIG56", "Real-time event 56") +SET (TARGET_SIGNAL_REALTIME_57, 69, "SIG57", "Real-time event 57") +SET (TARGET_SIGNAL_REALTIME_58, 70, "SIG58", "Real-time event 58") +SET (TARGET_SIGNAL_REALTIME_59, 71, "SIG59", "Real-time event 59") +SET (TARGET_SIGNAL_REALTIME_60, 72, "SIG60", "Real-time event 60") +SET (TARGET_SIGNAL_REALTIME_61, 73, "SIG61", "Real-time event 61") +SET (TARGET_SIGNAL_REALTIME_62, 74, "SIG62", "Real-time event 62") +SET (TARGET_SIGNAL_REALTIME_63, 75, "SIG63", "Real-time event 63") /* Used internally by Solaris threads. See signal(5) on Solaris. */ -SET (GDB_SIGNAL_CANCEL, 76, "SIGCANCEL", "LWP internal signal") +SET (TARGET_SIGNAL_CANCEL, 76, "SIGCANCEL", "LWP internal signal") /* Yes, this pains me, too. But LynxOS didn't have SIG32, and now GNU/Linux does, and we can't disturb the numbering, since it's part of the remote protocol. Note that in some GDB's - GDB_SIGNAL_REALTIME_32 is number 76. */ -SET (GDB_SIGNAL_REALTIME_32, 77, "SIG32", "Real-time event 32") + TARGET_SIGNAL_REALTIME_32 is number 76. */ +SET (TARGET_SIGNAL_REALTIME_32, 77, "SIG32", "Real-time event 32") /* Yet another pain, IRIX 6 has SIG64. */ -SET (GDB_SIGNAL_REALTIME_64, 78, "SIG64", "Real-time event 64") +SET (TARGET_SIGNAL_REALTIME_64, 78, "SIG64", "Real-time event 64") /* Yet another pain, GNU/Linux MIPS might go up to 128. */ -SET (GDB_SIGNAL_REALTIME_65, 79, "SIG65", "Real-time event 65") -SET (GDB_SIGNAL_REALTIME_66, 80, "SIG66", "Real-time event 66") -SET (GDB_SIGNAL_REALTIME_67, 81, "SIG67", "Real-time event 67") -SET (GDB_SIGNAL_REALTIME_68, 82, "SIG68", "Real-time event 68") -SET (GDB_SIGNAL_REALTIME_69, 83, "SIG69", "Real-time event 69") -SET (GDB_SIGNAL_REALTIME_70, 84, "SIG70", "Real-time event 70") -SET (GDB_SIGNAL_REALTIME_71, 85, "SIG71", "Real-time event 71") -SET (GDB_SIGNAL_REALTIME_72, 86, "SIG72", "Real-time event 72") -SET (GDB_SIGNAL_REALTIME_73, 87, "SIG73", "Real-time event 73") -SET (GDB_SIGNAL_REALTIME_74, 88, "SIG74", "Real-time event 74") -SET (GDB_SIGNAL_REALTIME_75, 89, "SIG75", "Real-time event 75") -SET (GDB_SIGNAL_REALTIME_76, 90, "SIG76", "Real-time event 76") -SET (GDB_SIGNAL_REALTIME_77, 91, "SIG77", "Real-time event 77") -SET (GDB_SIGNAL_REALTIME_78, 92, "SIG78", "Real-time event 78") -SET (GDB_SIGNAL_REALTIME_79, 93, "SIG79", "Real-time event 79") -SET (GDB_SIGNAL_REALTIME_80, 94, "SIG80", "Real-time event 80") -SET (GDB_SIGNAL_REALTIME_81, 95, "SIG81", "Real-time event 81") -SET (GDB_SIGNAL_REALTIME_82, 96, "SIG82", "Real-time event 82") -SET (GDB_SIGNAL_REALTIME_83, 97, "SIG83", "Real-time event 83") -SET (GDB_SIGNAL_REALTIME_84, 98, "SIG84", "Real-time event 84") -SET (GDB_SIGNAL_REALTIME_85, 99, "SIG85", "Real-time event 85") -SET (GDB_SIGNAL_REALTIME_86, 100, "SIG86", "Real-time event 86") -SET (GDB_SIGNAL_REALTIME_87, 101, "SIG87", "Real-time event 87") -SET (GDB_SIGNAL_REALTIME_88, 102, "SIG88", "Real-time event 88") -SET (GDB_SIGNAL_REALTIME_89, 103, "SIG89", "Real-time event 89") -SET (GDB_SIGNAL_REALTIME_90, 104, "SIG90", "Real-time event 90") -SET (GDB_SIGNAL_REALTIME_91, 105, "SIG91", "Real-time event 91") -SET (GDB_SIGNAL_REALTIME_92, 106, "SIG92", "Real-time event 92") -SET (GDB_SIGNAL_REALTIME_93, 107, "SIG93", "Real-time event 93") -SET (GDB_SIGNAL_REALTIME_94, 108, "SIG94", "Real-time event 94") -SET (GDB_SIGNAL_REALTIME_95, 109, "SIG95", "Real-time event 95") -SET (GDB_SIGNAL_REALTIME_96, 110, "SIG96", "Real-time event 96") -SET (GDB_SIGNAL_REALTIME_97, 111, "SIG97", "Real-time event 97") -SET (GDB_SIGNAL_REALTIME_98, 112, "SIG98", "Real-time event 98") -SET (GDB_SIGNAL_REALTIME_99, 113, "SIG99", "Real-time event 99") -SET (GDB_SIGNAL_REALTIME_100, 114, "SIG100", "Real-time event 100") -SET (GDB_SIGNAL_REALTIME_101, 115, "SIG101", "Real-time event 101") -SET (GDB_SIGNAL_REALTIME_102, 116, "SIG102", "Real-time event 102") -SET (GDB_SIGNAL_REALTIME_103, 117, "SIG103", "Real-time event 103") -SET (GDB_SIGNAL_REALTIME_104, 118, "SIG104", "Real-time event 104") -SET (GDB_SIGNAL_REALTIME_105, 119, "SIG105", "Real-time event 105") -SET (GDB_SIGNAL_REALTIME_106, 120, "SIG106", "Real-time event 106") -SET (GDB_SIGNAL_REALTIME_107, 121, "SIG107", "Real-time event 107") -SET (GDB_SIGNAL_REALTIME_108, 122, "SIG108", "Real-time event 108") -SET (GDB_SIGNAL_REALTIME_109, 123, "SIG109", "Real-time event 109") -SET (GDB_SIGNAL_REALTIME_110, 124, "SIG110", "Real-time event 110") -SET (GDB_SIGNAL_REALTIME_111, 125, "SIG111", "Real-time event 111") -SET (GDB_SIGNAL_REALTIME_112, 126, "SIG112", "Real-time event 112") -SET (GDB_SIGNAL_REALTIME_113, 127, "SIG113", "Real-time event 113") -SET (GDB_SIGNAL_REALTIME_114, 128, "SIG114", "Real-time event 114") -SET (GDB_SIGNAL_REALTIME_115, 129, "SIG115", "Real-time event 115") -SET (GDB_SIGNAL_REALTIME_116, 130, "SIG116", "Real-time event 116") -SET (GDB_SIGNAL_REALTIME_117, 131, "SIG117", "Real-time event 117") -SET (GDB_SIGNAL_REALTIME_118, 132, "SIG118", "Real-time event 118") -SET (GDB_SIGNAL_REALTIME_119, 133, "SIG119", "Real-time event 119") -SET (GDB_SIGNAL_REALTIME_120, 134, "SIG120", "Real-time event 120") -SET (GDB_SIGNAL_REALTIME_121, 135, "SIG121", "Real-time event 121") -SET (GDB_SIGNAL_REALTIME_122, 136, "SIG122", "Real-time event 122") -SET (GDB_SIGNAL_REALTIME_123, 137, "SIG123", "Real-time event 123") -SET (GDB_SIGNAL_REALTIME_124, 138, "SIG124", "Real-time event 124") -SET (GDB_SIGNAL_REALTIME_125, 139, "SIG125", "Real-time event 125") -SET (GDB_SIGNAL_REALTIME_126, 140, "SIG126", "Real-time event 126") -SET (GDB_SIGNAL_REALTIME_127, 141, "SIG127", "Real-time event 127") +SET (TARGET_SIGNAL_REALTIME_65, 79, "SIG65", "Real-time event 65") +SET (TARGET_SIGNAL_REALTIME_66, 80, "SIG66", "Real-time event 66") +SET (TARGET_SIGNAL_REALTIME_67, 81, "SIG67", "Real-time event 67") +SET (TARGET_SIGNAL_REALTIME_68, 82, "SIG68", "Real-time event 68") +SET (TARGET_SIGNAL_REALTIME_69, 83, "SIG69", "Real-time event 69") +SET (TARGET_SIGNAL_REALTIME_70, 84, "SIG70", "Real-time event 70") +SET (TARGET_SIGNAL_REALTIME_71, 85, "SIG71", "Real-time event 71") +SET (TARGET_SIGNAL_REALTIME_72, 86, "SIG72", "Real-time event 72") +SET (TARGET_SIGNAL_REALTIME_73, 87, "SIG73", "Real-time event 73") +SET (TARGET_SIGNAL_REALTIME_74, 88, "SIG74", "Real-time event 74") +SET (TARGET_SIGNAL_REALTIME_75, 89, "SIG75", "Real-time event 75") +SET (TARGET_SIGNAL_REALTIME_76, 90, "SIG76", "Real-time event 76") +SET (TARGET_SIGNAL_REALTIME_77, 91, "SIG77", "Real-time event 77") +SET (TARGET_SIGNAL_REALTIME_78, 92, "SIG78", "Real-time event 78") +SET (TARGET_SIGNAL_REALTIME_79, 93, "SIG79", "Real-time event 79") +SET (TARGET_SIGNAL_REALTIME_80, 94, "SIG80", "Real-time event 80") +SET (TARGET_SIGNAL_REALTIME_81, 95, "SIG81", "Real-time event 81") +SET (TARGET_SIGNAL_REALTIME_82, 96, "SIG82", "Real-time event 82") +SET (TARGET_SIGNAL_REALTIME_83, 97, "SIG83", "Real-time event 83") +SET (TARGET_SIGNAL_REALTIME_84, 98, "SIG84", "Real-time event 84") +SET (TARGET_SIGNAL_REALTIME_85, 99, "SIG85", "Real-time event 85") +SET (TARGET_SIGNAL_REALTIME_86, 100, "SIG86", "Real-time event 86") +SET (TARGET_SIGNAL_REALTIME_87, 101, "SIG87", "Real-time event 87") +SET (TARGET_SIGNAL_REALTIME_88, 102, "SIG88", "Real-time event 88") +SET (TARGET_SIGNAL_REALTIME_89, 103, "SIG89", "Real-time event 89") +SET (TARGET_SIGNAL_REALTIME_90, 104, "SIG90", "Real-time event 90") +SET (TARGET_SIGNAL_REALTIME_91, 105, "SIG91", "Real-time event 91") +SET (TARGET_SIGNAL_REALTIME_92, 106, "SIG92", "Real-time event 92") +SET (TARGET_SIGNAL_REALTIME_93, 107, "SIG93", "Real-time event 93") +SET (TARGET_SIGNAL_REALTIME_94, 108, "SIG94", "Real-time event 94") +SET (TARGET_SIGNAL_REALTIME_95, 109, "SIG95", "Real-time event 95") +SET (TARGET_SIGNAL_REALTIME_96, 110, "SIG96", "Real-time event 96") +SET (TARGET_SIGNAL_REALTIME_97, 111, "SIG97", "Real-time event 97") +SET (TARGET_SIGNAL_REALTIME_98, 112, "SIG98", "Real-time event 98") +SET (TARGET_SIGNAL_REALTIME_99, 113, "SIG99", "Real-time event 99") +SET (TARGET_SIGNAL_REALTIME_100, 114, "SIG100", "Real-time event 100") +SET (TARGET_SIGNAL_REALTIME_101, 115, "SIG101", "Real-time event 101") +SET (TARGET_SIGNAL_REALTIME_102, 116, "SIG102", "Real-time event 102") +SET (TARGET_SIGNAL_REALTIME_103, 117, "SIG103", "Real-time event 103") +SET (TARGET_SIGNAL_REALTIME_104, 118, "SIG104", "Real-time event 104") +SET (TARGET_SIGNAL_REALTIME_105, 119, "SIG105", "Real-time event 105") +SET (TARGET_SIGNAL_REALTIME_106, 120, "SIG106", "Real-time event 106") +SET (TARGET_SIGNAL_REALTIME_107, 121, "SIG107", "Real-time event 107") +SET (TARGET_SIGNAL_REALTIME_108, 122, "SIG108", "Real-time event 108") +SET (TARGET_SIGNAL_REALTIME_109, 123, "SIG109", "Real-time event 109") +SET (TARGET_SIGNAL_REALTIME_110, 124, "SIG110", "Real-time event 110") +SET (TARGET_SIGNAL_REALTIME_111, 125, "SIG111", "Real-time event 111") +SET (TARGET_SIGNAL_REALTIME_112, 126, "SIG112", "Real-time event 112") +SET (TARGET_SIGNAL_REALTIME_113, 127, "SIG113", "Real-time event 113") +SET (TARGET_SIGNAL_REALTIME_114, 128, "SIG114", "Real-time event 114") +SET (TARGET_SIGNAL_REALTIME_115, 129, "SIG115", "Real-time event 115") +SET (TARGET_SIGNAL_REALTIME_116, 130, "SIG116", "Real-time event 116") +SET (TARGET_SIGNAL_REALTIME_117, 131, "SIG117", "Real-time event 117") +SET (TARGET_SIGNAL_REALTIME_118, 132, "SIG118", "Real-time event 118") +SET (TARGET_SIGNAL_REALTIME_119, 133, "SIG119", "Real-time event 119") +SET (TARGET_SIGNAL_REALTIME_120, 134, "SIG120", "Real-time event 120") +SET (TARGET_SIGNAL_REALTIME_121, 135, "SIG121", "Real-time event 121") +SET (TARGET_SIGNAL_REALTIME_122, 136, "SIG122", "Real-time event 122") +SET (TARGET_SIGNAL_REALTIME_123, 137, "SIG123", "Real-time event 123") +SET (TARGET_SIGNAL_REALTIME_124, 138, "SIG124", "Real-time event 124") +SET (TARGET_SIGNAL_REALTIME_125, 139, "SIG125", "Real-time event 125") +SET (TARGET_SIGNAL_REALTIME_126, 140, "SIG126", "Real-time event 126") +SET (TARGET_SIGNAL_REALTIME_127, 141, "SIG127", "Real-time event 127") -SET (GDB_SIGNAL_INFO, 142, "SIGINFO", "Information request") +SET (TARGET_SIGNAL_INFO, 142, "SIGINFO", "Information request") /* Some signal we don't know about. */ -SET (GDB_SIGNAL_UNKNOWN, 143, NULL, "Unknown signal") +SET (TARGET_SIGNAL_UNKNOWN, 143, NULL, "Unknown signal") /* Use whatever signal we use when one is not specifically specified (for passing to proceed and so on). */ -SET (GDB_SIGNAL_DEFAULT, 144, NULL, - "Internal error: printing GDB_SIGNAL_DEFAULT") +SET (TARGET_SIGNAL_DEFAULT, 144, NULL, + "Internal error: printing TARGET_SIGNAL_DEFAULT") /* Mach exceptions. In versions of GDB before 5.2, these were just before - GDB_SIGNAL_INFO if you were compiling on a Mach host (and missing + TARGET_SIGNAL_INFO if you were compiling on a Mach host (and missing otherwise). */ SET (TARGET_EXC_BAD_ACCESS, 145, "EXC_BAD_ACCESS", "Could not access memory") SET (TARGET_EXC_BAD_INSTRUCTION, 146, "EXC_BAD_INSTRUCTION", @@ -197,4 +197,4 @@ SET (TARGET_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint") /* If you are adding a new signal, add it just above this comment. */ /* Last and unused enum value, for sizing arrays, etc. */ -SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_MAGIC") +SET (TARGET_SIGNAL_LAST, 151, NULL, "TARGET_SIGNAL_MAGIC") diff --git a/include/gdb/signals.h b/include/gdb/signals.h index a59d3b5c6..67902c617 100644 --- a/include/gdb/signals.h +++ b/include/gdb/signals.h @@ -45,9 +45,9 @@ etc. are doing to address these issues. */ /* For an explanation of what each signal means, see - gdb_signal_to_string. */ + target_signal_to_string. */ -enum gdb_signal +enum target_signal { #define SET(symbol, constant, name, string) \ symbol = constant, diff --git a/include/leb128.h b/include/leb128.h deleted file mode 100644 index f584f72e5..000000000 --- a/include/leb128.h +++ /dev/null @@ -1,136 +0,0 @@ -/* Utilities for reading leb128 values. - Copyright (C) 2012 Free Software Foundation, Inc. - -This file is part of the libiberty library. -Libiberty is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -Libiberty is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with libiberty; see the file COPYING.LIB. If not, write -to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, -Boston, MA 02110-1301, USA. */ - -/* The functions defined here can be speed critical. - Since they are all pretty small we keep things simple and just define - them all as "static inline". - - WARNING: This file is used by GDB which is stuck at C90. :-( - Though it can use stdint.h, inttypes.h. - Therefore if you want to add support for "long long" you need - to wrap it in #ifdef CC_HAS_LONG_LONG. */ - -#ifndef LEB128_H -#define LEB128_H - -/* Get a definition for inline. */ -#include "ansidecl.h" - -/* Get a definition for NULL, size_t. */ -#include <stddef.h> - -#ifdef HAVE_STDINT_H -#include <stdint.h> -#endif -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#endif - -/* Decode the unsigned LEB128 constant at BUF into the variable pointed to - by R, and return the number of bytes read. - If we read off the end of the buffer, zero is returned, - and nothing is stored in R. - - Note: The result is an int instead of a pointer to the next byte to be - read to avoid const-vs-non-const problems. */ - -static inline size_t -read_uleb128_to_uint64 (const unsigned char *buf, const unsigned char *buf_end, - uint64_t *r) -{ - const unsigned char *p = buf; - unsigned int shift = 0; - uint64_t result = 0; - unsigned char byte; - - while (1) - { - if (p >= buf_end) - return 0; - - byte = *p++; - result |= ((uint64_t) (byte & 0x7f)) << shift; - if ((byte & 0x80) == 0) - break; - shift += 7; - } - - *r = result; - return p - buf; -} - -/* Decode the signed LEB128 constant at BUF into the variable pointed to - by R, and return the number of bytes read. - If we read off the end of the buffer, zero is returned, - and nothing is stored in R. - - Note: The result is an int instead of a pointer to the next byte to be - read to avoid const-vs-non-const problems. */ - -static inline size_t -read_sleb128_to_int64 (const unsigned char *buf, const unsigned char *buf_end, - int64_t *r) -{ - const unsigned char *p = buf; - unsigned int shift = 0; - int64_t result = 0; - unsigned char byte; - - while (1) - { - if (p >= buf_end) - return 0; - - byte = *p++; - result |= ((uint64_t) (byte & 0x7f)) << shift; - shift += 7; - if ((byte & 0x80) == 0) - break; - } - if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0) - result |= -(((uint64_t) 1) << shift); - - *r = result; - return p - buf; -} - -/* Return the number of bytes to read to skip past an LEB128 number in BUF. - If the end isn't found before reaching BUF_END, return zero. - - Note: The result is an int instead of a pointer to the next byte to be - read to avoid const-vs-non-const problems. */ - -static inline size_t -skip_leb128 (const unsigned char *buf, const unsigned char *buf_end) -{ - const unsigned char *p = buf; - unsigned char byte; - - while (1) - { - if (p == buf_end) - return 0; - - byte = *p++; - if ((byte & 0x80) == 0) - return p - buf; - } -} - -#endif /* LEB128_H */ diff --git a/include/mach-o/ChangeLog b/include/mach-o/ChangeLog new file mode 100644 index 000000000..19eacd0c5 --- /dev/null +++ b/include/mach-o/ChangeLog @@ -0,0 +1,51 @@ +2012-02-23 Iain Sandoe <idsandoe@googlemail.com> + + * external.h: Add comments about relocations fields. Add macros + for non-scattered relocations. Move scattered relocation macros to + here. + * reloc.h: Remove macros related to external representation of reloc + fields. + +2012-01-12 Iain Sandoe <idsandoe@googlemail.com> + + * loader.h (BFD_MACH_O_INDIRECT_SYM_LOCAL): New. + (BFD_MACH_O_INDIRECT_SYM_ABS): New + +2012-01-04 Tristan Gingold <gingold@adacore.com> + + * external.h (mach_o_fvmlib_command_external): New structure. + +2012-01-04 Tristan Gingold <gingold@adacore.com> + + * loader.h: Update copyright year. + (bfd_mach_o_cpu_subtype): Add ARM subtypes. + +2012-01-04 Tristan Gingold <gingold@adacore.com> + + * external.h: Update copyright year. + (mach_o_symtab_command_external): Add comments. + (mach_o_encryption_info_command_external): New structure. + +2011-12-16 Tristan Gingold <gingold@adacore.com> + + * codesign.h: New file. + +2011-08-08 Tristan Gingold <gingold@adacore.com> + + * loader.h (bfd_mach_o_load_command_type): Add + BFD_MACH_O_LC_LOAD_UPWARD_DYLIB, BFD_MACH_O_LC_VERSION_MIN_MACOSX, + BFD_MACH_O_LC_VERSION_MIN_IPHONEOS, BFD_MACH_O_LC_FUNCTION_STARTS, + and BFD_MACH_O_LC_DYLD_ENVIRONMENT. + * external.h (mach_o_version_min_command_external): New structure. + +2011-08-08 Tristan Gingold <gingold@adacore.com> + + * loader.h: Reorder declarations. + * x86-64.h: New file. + * external.h: New file. + * reloc.h: New file. + +2011-07-06 Tristan Gingold <gingold@adacore.com> + + * loader.h: New file. + diff --git a/include/mach-o/codesign.h b/include/mach-o/codesign.h new file mode 100644 index 000000000..ee2f792ac --- /dev/null +++ b/include/mach-o/codesign.h @@ -0,0 +1,85 @@ +/* Mach-O support for BFD. + Copyright 2011 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_CODESIGN_H +#define _MACH_O_CODESIGN_H + +/* Codesign blob magics. */ + +/* Superblob containing all the components. */ +#define BFD_MACH_O_CS_MAGIC_EMBEDDED_SIGNATURE 0xfade0cc0 + +/* Individual code requirement. */ +#define BFD_MACH_O_CS_MAGIC_REQUIREMENT 0xfade0c00 + +/* Collection of code requirements, indexed by type. */ +#define BFD_MACH_O_CS_MAGIC_REQUIREMENTS 0xfade0c01 + +/* Directory. */ +#define BFD_MACH_O_CS_MAGIC_CODEDIRECTORY 0xfade0c02 + +/* Entitlements blob. */ +#define BFD_MACH_O_CS_MAGIC_EMBEDDED_ENTITLEMENTS 0xfade7171 + +/* Blob container. */ +#define BFD_MACH_O_CS_MAGIC_BLOB_WRAPPER 0xfade0b01 + +struct mach_o_codesign_codedirectory_external_v1 +{ + /* All the fields are in network byte order (big endian). */ + unsigned char version[4]; + unsigned char flags[4]; + unsigned char hash_offset[4]; + unsigned char ident_offset[4]; + unsigned char nbr_special_slots[4]; + unsigned char nbr_code_slots[4]; + unsigned char code_limit[4]; + unsigned char hash_size[1]; + unsigned char hash_type[1]; + unsigned char spare1[1]; + unsigned char page_size[1]; + unsigned char spare2[4]; +}; + +struct mach_o_codesign_codedirectory_v1 +{ + unsigned int version; + unsigned int flags; + unsigned int hash_offset; + unsigned int ident_offset; + unsigned int nbr_special_slots; + unsigned int nbr_code_slots; + unsigned int code_limit; + unsigned char hash_size; + unsigned char hash_type; + unsigned char spare1; + unsigned char page_size; + unsigned int spare2; +}; + +/* Value for hash_type. */ +#define BFD_MACH_O_CS_NO_HASH 0 +#define BFD_MACH_O_CS_HASH_SHA1 1 +#define BFD_MACH_O_CS_HASH_SHA256 2 +#define BFD_MACH_O_CS_HASH_PRESTANDARD_SKEIN_160x256 32 /* Skein, 160 bits */ +#define BFD_MACH_O_CS_HASH_PRESTANDARD_SKEIN_256x512 33 /* Skein, 256 bits */ + +#endif /* _MACH_O_CODESIGN_H */ diff --git a/include/mach-o/external.h b/include/mach-o/external.h new file mode 100644 index 000000000..41a293250 --- /dev/null +++ b/include/mach-o/external.h @@ -0,0 +1,326 @@ +/* Mach-O support for BFD. + Copyright 2011, 2012 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_EXTERNAL_H +#define _MACH_O_EXTERNAL_H + +struct mach_o_header_external +{ + unsigned char magic[4]; /* Magic number. */ + unsigned char cputype[4]; /* CPU that this object is for. */ + unsigned char cpusubtype[4]; /* CPU subtype. */ + unsigned char filetype[4]; /* Type of file. */ + unsigned char ncmds[4]; /* Number of load commands. */ + unsigned char sizeofcmds[4]; /* Total size of load commands. */ + unsigned char flags[4]; /* Flags. */ + unsigned char reserved[4]; /* Reserved (on 64-bit version only). */ +}; + +#define BFD_MACH_O_HEADER_SIZE 28 +#define BFD_MACH_O_HEADER_64_SIZE 32 + +/* 32-bit section header. */ + +struct mach_o_section_32_external +{ + unsigned char sectname[16]; /* Section name. */ + unsigned char segname[16]; /* Segment that the section belongs to. */ + unsigned char addr[4]; /* Address of this section in memory. */ + unsigned char size[4]; /* Size in bytes of this section. */ + unsigned char offset[4]; /* File offset of this section. */ + unsigned char align[4]; /* log2 of this section's alignment. */ + unsigned char reloff[4]; /* File offset of this section's relocs. */ + unsigned char nreloc[4]; /* Number of relocs for this section. */ + unsigned char flags[4]; /* Section flags/attributes. */ + unsigned char reserved1[4]; + unsigned char reserved2[4]; +}; +#define BFD_MACH_O_SECTION_SIZE 68 + +/* 64-bit section header. */ + +struct mach_o_section_64_external +{ + unsigned char sectname[16]; /* Section name. */ + unsigned char segname[16]; /* Segment that the section belongs to. */ + unsigned char addr[8]; /* Address of this section in memory. */ + unsigned char size[8]; /* Size in bytes of this section. */ + unsigned char offset[4]; /* File offset of this section. */ + unsigned char align[4]; /* log2 of this section's alignment. */ + unsigned char reloff[4]; /* File offset of this section's relocs. */ + unsigned char nreloc[4]; /* Number of relocs for this section. */ + unsigned char flags[4]; /* Section flags/attributes. */ + unsigned char reserved1[4]; + unsigned char reserved2[4]; + unsigned char reserved3[4]; +}; +#define BFD_MACH_O_SECTION_64_SIZE 80 + +struct mach_o_load_command_external +{ + unsigned char cmd[4]; /* The type of load command. */ + unsigned char cmdsize[4]; /* Size in bytes of entire command. */ +}; +#define BFD_MACH_O_LC_SIZE 8 + +struct mach_o_segment_command_32_external +{ + unsigned char segname[16]; /* Name of this segment. */ + unsigned char vmaddr[4]; /* Virtual memory address of this segment. */ + unsigned char vmsize[4]; /* Size there, in bytes. */ + unsigned char fileoff[4]; /* Offset in bytes of the data to be mapped. */ + unsigned char filesize[4]; /* Size in bytes on disk. */ + unsigned char maxprot[4]; /* Maximum permitted vm protection. */ + unsigned char initprot[4]; /* Initial vm protection. */ + unsigned char nsects[4]; /* Number of sections in this segment. */ + unsigned char flags[4]; /* Flags that affect the loading. */ +}; +#define BFD_MACH_O_LC_SEGMENT_SIZE 56 /* Include the header. */ + +struct mach_o_segment_command_64_external +{ + unsigned char segname[16]; /* Name of this segment. */ + unsigned char vmaddr[8]; /* Virtual memory address of this segment. */ + unsigned char vmsize[8]; /* Size there, in bytes. */ + unsigned char fileoff[8]; /* Offset in bytes of the data to be mapped. */ + unsigned char filesize[8]; /* Size in bytes on disk. */ + unsigned char maxprot[4]; /* Maximum permitted vm protection. */ + unsigned char initprot[4]; /* Initial vm protection. */ + unsigned char nsects[4]; /* Number of sections in this segment. */ + unsigned char flags[4]; /* Flags that affect the loading. */ +}; +#define BFD_MACH_O_LC_SEGMENT_64_SIZE 72 /* Include the header. */ + +struct mach_o_reloc_info_external +{ + unsigned char r_address[4]; + unsigned char r_symbolnum[4]; +}; +#define BFD_MACH_O_RELENT_SIZE 8 + +/* Relocations are based on 'address' being a section offset and an assumption + that sections are never more than 2^24-1 bytes in size. Relocation data + also carry information on type/size/PC-relative/extern and whether scattered + or not [stored in the MSB of the r_address]. */ + +#define BFD_MACH_O_SR_SCATTERED 0x80000000 + +/* For a non-scattered reloc, the relocation info is found in r_symbolnum. + Bytes 1 to 3 contain the symbol number (0xffffff, in a non-scattered PAIR). + Byte 4 contains the relocation info - but with differing bit-positions + dependent on target endian-ness - as below. */ + +#define BFD_MACH_O_LE_PCREL 0x01 +#define BFD_MACH_O_LE_LENGTH_SHIFT 1 +#define BFD_MACH_O_LE_EXTERN 0x08 +#define BFD_MACH_O_LE_TYPE_SHIFT 4 + +#define BFD_MACH_O_BE_PCREL 0x80 +#define BFD_MACH_O_BE_LENGTH_SHIFT 5 +#define BFD_MACH_O_BE_EXTERN 0x10 +#define BFD_MACH_O_BE_TYPE_SHIFT 0 + +/* The field sizes are the same for both BE and LE. */ +#define BFD_MACH_O_LENGTH_MASK 0x03 +#define BFD_MACH_O_TYPE_MASK 0x0f + +/* For a scattered reloc entry the info is contained in r_address. There + is no need to discriminate on target endian-ness, since the design was + arranged to produce the same layout on both. Scattered relocations are + only used for local items, therefore there is no 'extern' field. */ + +#define BFD_MACH_O_SR_PCREL 0x40000000 +#define BFD_MACH_O_GET_SR_LENGTH(s) (((s) >> 28) & 0x3) +#define BFD_MACH_O_GET_SR_TYPE(s) (((s) >> 24) & 0x0f) +#define BFD_MACH_O_GET_SR_ADDRESS(s) ((s) & 0x00ffffff) +#define BFD_MACH_O_SET_SR_LENGTH(l) (((l) & 0x3) << 28) +#define BFD_MACH_O_SET_SR_TYPE(t) (((t) & 0xf) << 24) +#define BFD_MACH_O_SET_SR_ADDRESS(s) ((s) & 0x00ffffff) + +struct mach_o_symtab_command_external +{ + unsigned char symoff[4]; /* File offset of the symbol table. */ + unsigned char nsyms[4]; /* Number of symbols. */ + unsigned char stroff[4]; /* File offset of the string table. */ + unsigned char strsize[4]; /* String table size. */ +}; + +struct mach_o_nlist_external +{ + unsigned char n_strx[4]; + unsigned char n_type[1]; + unsigned char n_sect[1]; + unsigned char n_desc[2]; + unsigned char n_value[4]; +}; +#define BFD_MACH_O_NLIST_SIZE 12 + +struct mach_o_nlist_64_external +{ + unsigned char n_strx[4]; + unsigned char n_type[1]; + unsigned char n_sect[1]; + unsigned char n_desc[2]; + unsigned char n_value[8]; +}; +#define BFD_MACH_O_NLIST_64_SIZE 16 + +struct mach_o_thread_command_external +{ + unsigned char flavour[4]; + unsigned char count[4]; +}; + +/* For commands that just have a string or a path. */ +struct mach_o_str_command_external +{ + unsigned char str[4]; +}; + +struct mach_o_dylib_command_external +{ + unsigned char name[4]; + unsigned char timestamp[4]; + unsigned char current_version[4]; + unsigned char compatibility_version[4]; +}; + +struct mach_o_dysymtab_command_external +{ + unsigned char ilocalsym[4]; /* Index of. */ + unsigned char nlocalsym[4]; /* Number of. */ + unsigned char iextdefsym[4]; + unsigned char nextdefsym[4]; + unsigned char iundefsym[4]; + unsigned char nundefsym[4]; + unsigned char tocoff[4]; + unsigned char ntoc[4]; + unsigned char modtaboff[4]; + unsigned char nmodtab[4]; + unsigned char extrefsymoff[4]; + unsigned char nextrefsyms[4]; + unsigned char indirectsymoff[4]; + unsigned char nindirectsyms[4]; + unsigned char extreloff[4]; + unsigned char nextrel[4]; + unsigned char locreloff[4]; + unsigned char nlocrel[4]; +}; + +struct mach_o_dylib_module_external +{ + unsigned char module_name[4]; + unsigned char iextdefsym[4]; + unsigned char nextdefsym[4]; + unsigned char irefsym[4]; + unsigned char nrefsym[4]; + unsigned char ilocalsym[4]; + unsigned char nlocalsym[4]; + unsigned char iextrel[4]; + unsigned char nextrel[4]; + unsigned char iinit_iterm[4]; + unsigned char ninit_nterm[4]; + unsigned char objc_module_info_addr[4]; + unsigned char objc_module_info_size[4]; +}; +#define BFD_MACH_O_DYLIB_MODULE_SIZE 52 + +struct mach_o_dylib_module_64_external +{ + unsigned char module_name[4]; + unsigned char iextdefsym[4]; + unsigned char nextdefsym[4]; + unsigned char irefsym[4]; + unsigned char nrefsym[4]; + unsigned char ilocalsym[4]; + unsigned char nlocalsym[4]; + unsigned char iextrel[4]; + unsigned char nextrel[4]; + unsigned char iinit_iterm[4]; + unsigned char ninit_nterm[4]; + unsigned char objc_module_info_size[4]; + unsigned char objc_module_info_addr[8]; +}; +#define BFD_MACH_O_DYLIB_MODULE_64_SIZE 56 + +struct mach_o_dylib_table_of_contents_external +{ + unsigned char symbol_index[4]; + unsigned char module_index[4]; +}; +#define BFD_MACH_O_TABLE_OF_CONTENT_SIZE 8 + +struct mach_o_linkedit_data_command_external +{ + unsigned char dataoff[4]; + unsigned char datasize[4]; +}; + +struct mach_o_dyld_info_command_external +{ + unsigned char rebase_off[4]; + unsigned char rebase_size[4]; + unsigned char bind_off[4]; + unsigned char bind_size[4]; + unsigned char weak_bind_off[4]; + unsigned char weak_bind_size[4]; + unsigned char lazy_bind_off[4]; + unsigned char lazy_bind_size[4]; + unsigned char export_off[4]; + unsigned char export_size[4]; +}; + +struct mach_o_version_min_command_external +{ + unsigned char version[4]; + unsigned char reserved[4]; +}; + +struct mach_o_encryption_info_command_external +{ + unsigned char cryptoff[4]; /* File offset of the encrypted area. */ + unsigned char cryptsize[4]; /* Size of the encrypted area. */ + unsigned char cryptid[4]; /* Encryption method. */ +}; + +struct mach_o_fvmlib_command_external +{ + unsigned char name[4]; /* Offset of the name. */ + unsigned char minor_version[4]; + unsigned char header_addr[4]; +}; + +struct mach_o_fat_header_external +{ + unsigned char magic[4]; + unsigned char nfat_arch[4]; /* Number of components. */ +}; + +struct mach_o_fat_arch_external +{ + unsigned char cputype[4]; + unsigned char cpusubtype[4]; + unsigned char offset[4]; /* File offset of the member. */ + unsigned char size[4]; /* Size of the member. */ + unsigned char align[4]; /* Power of 2. */ +}; + +#endif /* _MACH_O_EXTERNAL_H */ diff --git a/include/mach-o/loader.h b/include/mach-o/loader.h new file mode 100644 index 000000000..1b9b15efe --- /dev/null +++ b/include/mach-o/loader.h @@ -0,0 +1,360 @@ +/* Mach-O support for BFD. + Copyright 2011, 2012 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_LOADER_H +#define _MACH_O_LOADER_H + +/* Constants for header. */ + +typedef enum bfd_mach_o_mach_header_magic +{ + BFD_MACH_O_MH_MAGIC = 0xfeedface, + BFD_MACH_O_MH_CIGAM = 0xcefaedfe, + BFD_MACH_O_MH_MAGIC_64 = 0xfeedfacf, + BFD_MACH_O_MH_CIGAM_64 = 0xcffaedfe +} +bfd_mach_o_mach_header_magic; + +#define BFD_MACH_O_CPU_IS64BIT 0x1000000 + +typedef enum bfd_mach_o_cpu_type +{ + BFD_MACH_O_CPU_TYPE_VAX = 1, + BFD_MACH_O_CPU_TYPE_MC680x0 = 6, + BFD_MACH_O_CPU_TYPE_I386 = 7, + BFD_MACH_O_CPU_TYPE_MIPS = 8, + BFD_MACH_O_CPU_TYPE_MC98000 = 10, + BFD_MACH_O_CPU_TYPE_HPPA = 11, + BFD_MACH_O_CPU_TYPE_ARM = 12, + BFD_MACH_O_CPU_TYPE_MC88000 = 13, + BFD_MACH_O_CPU_TYPE_SPARC = 14, + BFD_MACH_O_CPU_TYPE_I860 = 15, + BFD_MACH_O_CPU_TYPE_ALPHA = 16, + BFD_MACH_O_CPU_TYPE_POWERPC = 18, + BFD_MACH_O_CPU_TYPE_POWERPC_64 = (BFD_MACH_O_CPU_TYPE_POWERPC | BFD_MACH_O_CPU_IS64BIT), + BFD_MACH_O_CPU_TYPE_X86_64 = (BFD_MACH_O_CPU_TYPE_I386 | BFD_MACH_O_CPU_IS64BIT) +} +bfd_mach_o_cpu_type; + +typedef enum bfd_mach_o_cpu_subtype +{ + /* i386. */ + BFD_MACH_O_CPU_SUBTYPE_X86_ALL = 3, + + /* arm. */ + BFD_MACH_O_CPU_SUBTYPE_ARM_ALL = 0, + BFD_MACH_O_CPU_SUBTYPE_ARM_V4T = 5, + BFD_MACH_O_CPU_SUBTYPE_ARM_V6 = 6, + BFD_MACH_O_CPU_SUBTYPE_ARM_V5TEJ = 7, + BFD_MACH_O_CPU_SUBTYPE_ARM_XSCALE = 8, + BFD_MACH_O_CPU_SUBTYPE_ARM_V7 = 9 +} +bfd_mach_o_cpu_subtype; + +typedef enum bfd_mach_o_filetype +{ + BFD_MACH_O_MH_OBJECT = 0x01, + BFD_MACH_O_MH_EXECUTE = 0x02, + BFD_MACH_O_MH_FVMLIB = 0x03, + BFD_MACH_O_MH_CORE = 0x04, + BFD_MACH_O_MH_PRELOAD = 0x05, + BFD_MACH_O_MH_DYLIB = 0x06, + BFD_MACH_O_MH_DYLINKER = 0x07, + BFD_MACH_O_MH_BUNDLE = 0x08, + BFD_MACH_O_MH_DYLIB_STUB = 0x09, + BFD_MACH_O_MH_DSYM = 0x0a, + BFD_MACH_O_MH_KEXT_BUNDLE = 0x0b +} +bfd_mach_o_filetype; + +typedef enum bfd_mach_o_header_flags +{ + BFD_MACH_O_MH_NOUNDEFS = 0x0000001, + BFD_MACH_O_MH_INCRLINK = 0x0000002, + BFD_MACH_O_MH_DYLDLINK = 0x0000004, + BFD_MACH_O_MH_BINDATLOAD = 0x0000008, + BFD_MACH_O_MH_PREBOUND = 0x0000010, + BFD_MACH_O_MH_SPLIT_SEGS = 0x0000020, + BFD_MACH_O_MH_LAZY_INIT = 0x0000040, + BFD_MACH_O_MH_TWOLEVEL = 0x0000080, + BFD_MACH_O_MH_FORCE_FLAT = 0x0000100, + BFD_MACH_O_MH_NOMULTIDEFS = 0x0000200, + BFD_MACH_O_MH_NOFIXPREBINDING = 0x0000400, + BFD_MACH_O_MH_PREBINDABLE = 0x0000800, + BFD_MACH_O_MH_ALLMODSBOUND = 0x0001000, + BFD_MACH_O_MH_SUBSECTIONS_VIA_SYMBOLS = 0x0002000, + BFD_MACH_O_MH_CANONICAL = 0x0004000, + BFD_MACH_O_MH_WEAK_DEFINES = 0x0008000, + BFD_MACH_O_MH_BINDS_TO_WEAK = 0x0010000, + BFD_MACH_O_MH_ALLOW_STACK_EXECUTION = 0x0020000, + BFD_MACH_O_MH_ROOT_SAFE = 0x0040000, + BFD_MACH_O_MH_SETUID_SAFE = 0x0080000, + BFD_MACH_O_MH_NO_REEXPORTED_DYLIBS = 0x0100000, + BFD_MACH_O_MH_PIE = 0x0200000, + BFD_MACH_O_MH_DEAD_STRIPPABLE_DYLIB = 0x0400000, + BFD_MACH_O_MH_HAS_TLV_DESCRIPTORS = 0x0800000, + BFD_MACH_O_MH_NO_HEAP_EXECUTION = 0x1000000 +} +bfd_mach_o_header_flags; + +/* Load command constants. */ +#define BFD_MACH_O_LC_REQ_DYLD 0x80000000 + +typedef enum bfd_mach_o_load_command_type +{ + BFD_MACH_O_LC_SEGMENT = 0x1, /* File segment to be mapped. */ + BFD_MACH_O_LC_SYMTAB = 0x2, /* Link-edit stab symbol table info (obsolete). */ + BFD_MACH_O_LC_SYMSEG = 0x3, /* Link-edit gdb symbol table info. */ + BFD_MACH_O_LC_THREAD = 0x4, /* Thread. */ + BFD_MACH_O_LC_UNIXTHREAD = 0x5, /* UNIX thread (includes a stack). */ + BFD_MACH_O_LC_LOADFVMLIB = 0x6, /* Load a fixed VM shared library. */ + BFD_MACH_O_LC_IDFVMLIB = 0x7, /* Fixed VM shared library id. */ + BFD_MACH_O_LC_IDENT = 0x8, /* Object identification information (obsolete). */ + BFD_MACH_O_LC_FVMFILE = 0x9, /* Fixed VM file inclusion. */ + BFD_MACH_O_LC_PREPAGE = 0xa, /* Prepage command (internal use). */ + BFD_MACH_O_LC_DYSYMTAB = 0xb, /* Dynamic link-edit symbol table info. */ + BFD_MACH_O_LC_LOAD_DYLIB = 0xc, /* Load a dynamically linked shared library. */ + BFD_MACH_O_LC_ID_DYLIB = 0xd, /* Dynamically linked shared lib identification. */ + BFD_MACH_O_LC_LOAD_DYLINKER = 0xe, /* Load a dynamic linker. */ + BFD_MACH_O_LC_ID_DYLINKER = 0xf, /* Dynamic linker identification. */ + BFD_MACH_O_LC_PREBOUND_DYLIB = 0x10, /* Modules prebound for a dynamically. */ + BFD_MACH_O_LC_ROUTINES = 0x11, /* Image routines. */ + BFD_MACH_O_LC_SUB_FRAMEWORK = 0x12, /* Sub framework. */ + BFD_MACH_O_LC_SUB_UMBRELLA = 0x13, /* Sub umbrella. */ + BFD_MACH_O_LC_SUB_CLIENT = 0x14, /* Sub client. */ + BFD_MACH_O_LC_SUB_LIBRARY = 0x15, /* Sub library. */ + BFD_MACH_O_LC_TWOLEVEL_HINTS = 0x16, /* Two-level namespace lookup hints. */ + BFD_MACH_O_LC_PREBIND_CKSUM = 0x17, /* Prebind checksum. */ + /* Load a dynamically linked shared library that is allowed to be + missing (weak). */ + BFD_MACH_O_LC_LOAD_WEAK_DYLIB = 0x18, + BFD_MACH_O_LC_SEGMENT_64 = 0x19, /* 64-bit segment of this file to be + mapped. */ + BFD_MACH_O_LC_ROUTINES_64 = 0x1a, /* Address of the dyld init routine + in a dylib. */ + BFD_MACH_O_LC_UUID = 0x1b, /* 128-bit UUID of the executable. */ + BFD_MACH_O_LC_RPATH = 0x1c, /* Run path addiions. */ + BFD_MACH_O_LC_CODE_SIGNATURE = 0x1d, /* Local of code signature. */ + BFD_MACH_O_LC_SEGMENT_SPLIT_INFO = 0x1e, /* Local of info to split seg. */ + BFD_MACH_O_LC_REEXPORT_DYLIB = 0x1f, /* Load and re-export lib. */ + BFD_MACH_O_LC_LAZY_LOAD_DYLIB = 0x20, /* Delay load of lib until use. */ + BFD_MACH_O_LC_ENCRYPTION_INFO = 0x21, /* Encrypted segment info. */ + BFD_MACH_O_LC_DYLD_INFO = 0x22, /* Compressed dyld information. */ + BFD_MACH_O_LC_LOAD_UPWARD_DYLIB = 0x23, /* Load upward dylib. */ + BFD_MACH_O_LC_VERSION_MIN_MACOSX = 0x24, /* Minimal MacOSX version. */ + BFD_MACH_O_LC_VERSION_MIN_IPHONEOS = 0x25, /* Minimal IOS version. */ + BFD_MACH_O_LC_FUNCTION_STARTS = 0x26, /* Compressed table of func start. */ + BFD_MACH_O_LC_DYLD_ENVIRONMENT = 0x27 /* Env variable string for dyld. */ +} +bfd_mach_o_load_command_type; + +/* Section constants. */ +/* Constants for the type of a section. */ + +typedef enum bfd_mach_o_section_type +{ + /* Regular section. */ + BFD_MACH_O_S_REGULAR = 0x0, + + /* Zero fill on demand section. */ + BFD_MACH_O_S_ZEROFILL = 0x1, + + /* Section with only literal C strings. */ + BFD_MACH_O_S_CSTRING_LITERALS = 0x2, + + /* Section with only 4 byte literals. */ + BFD_MACH_O_S_4BYTE_LITERALS = 0x3, + + /* Section with only 8 byte literals. */ + BFD_MACH_O_S_8BYTE_LITERALS = 0x4, + + /* Section with only pointers to literals. */ + BFD_MACH_O_S_LITERAL_POINTERS = 0x5, + + /* For the two types of symbol pointers sections and the symbol stubs + section they have indirect symbol table entries. For each of the + entries in the section the indirect symbol table entries, in + corresponding order in the indirect symbol table, start at the index + stored in the reserved1 field of the section structure. Since the + indirect symbol table entries correspond to the entries in the + section the number of indirect symbol table entries is inferred from + the size of the section divided by the size of the entries in the + section. For symbol pointers sections the size of the entries in + the section is 4 bytes and for symbol stubs sections the byte size + of the stubs is stored in the reserved2 field of the section + structure. */ + + /* Section with only non-lazy symbol pointers. */ + BFD_MACH_O_S_NON_LAZY_SYMBOL_POINTERS = 0x6, + + /* Section with only lazy symbol pointers. */ + BFD_MACH_O_S_LAZY_SYMBOL_POINTERS = 0x7, + + /* Section with only symbol stubs, byte size of stub in the reserved2 + field. */ + BFD_MACH_O_S_SYMBOL_STUBS = 0x8, + + /* Section with only function pointers for initialization. */ + BFD_MACH_O_S_MOD_INIT_FUNC_POINTERS = 0x9, + + /* Section with only function pointers for termination. */ + BFD_MACH_O_S_MOD_FINI_FUNC_POINTERS = 0xa, + + /* Section contains symbols that are coalesced by the linkers. */ + BFD_MACH_O_S_COALESCED = 0xb, + + /* Zero fill on demand section (possibly larger than 4 GB). */ + BFD_MACH_O_S_GB_ZEROFILL = 0xc, + + /* Section with only pairs of function pointers for interposing. */ + BFD_MACH_O_S_INTERPOSING = 0xd, + + /* Section with only 16 byte literals. */ + BFD_MACH_O_S_16BYTE_LITERALS = 0xe, + + /* Section contains DTrace Object Format. */ + BFD_MACH_O_S_DTRACE_DOF = 0xf, + + /* Section with only lazy symbol pointers to lazy loaded dylibs. */ + BFD_MACH_O_S_LAZY_DYLIB_SYMBOL_POINTERS = 0x10 +} +bfd_mach_o_section_type; + +/* The flags field of a section structure is separated into two parts a section + type and section attributes. The section types are mutually exclusive (it + can only have one type) but the section attributes are not (it may have more + than one attribute). */ + +#define BFD_MACH_O_SECTION_TYPE_MASK 0x000000ff + +/* Constants for the section attributes part of the flags field of a section + structure. */ +#define BFD_MACH_O_SECTION_ATTRIBUTES_MASK 0xffffff00 +/* System setable attributes. */ +#define BFD_MACH_O_SECTION_ATTRIBUTES_SYS 0x00ffff00 +/* User attributes. */ +#define BFD_MACH_O_SECTION_ATTRIBUTES_USR 0xff000000 + +typedef enum bfd_mach_o_section_attribute +{ + /* Section has no specified attibutes. */ + BFD_MACH_O_S_ATTR_NONE = 0, + + /* Section has local relocation entries. */ + BFD_MACH_O_S_ATTR_LOC_RELOC = 0x00000100, + + /* Section has external relocation entries. */ + BFD_MACH_O_S_ATTR_EXT_RELOC = 0x00000200, + + /* Section contains some machine instructions. */ + BFD_MACH_O_S_ATTR_SOME_INSTRUCTIONS = 0x00000400, + + /* A debug section. */ + BFD_MACH_O_S_ATTR_DEBUG = 0x02000000, + + /* Used with i386 stubs. */ + BFD_MACH_O_S_SELF_MODIFYING_CODE = 0x04000000, + + /* Blocks are live if they reference live blocks. */ + BFD_MACH_O_S_ATTR_LIVE_SUPPORT = 0x08000000, + + /* No dead stripping. */ + BFD_MACH_O_S_ATTR_NO_DEAD_STRIP = 0x10000000, + + /* Section symbols can be stripped in files with MH_DYLDLINK flag. */ + BFD_MACH_O_S_ATTR_STRIP_STATIC_SYMS = 0x20000000, + + /* Section contains coalesced symbols that are not to be in the TOC of an + archive. */ + BFD_MACH_O_S_ATTR_NO_TOC = 0x40000000, + + /* Section contains only true machine instructions. */ + BFD_MACH_O_S_ATTR_PURE_INSTRUCTIONS = 0x80000000 +} +bfd_mach_o_section_attribute; + +/* Symbol constants. */ + +/* Symbol n_type values. */ +#define BFD_MACH_O_N_STAB 0xe0 /* If any of these bits set, a symbolic debugging entry. */ +#define BFD_MACH_O_N_PEXT 0x10 /* Private external symbol bit. */ +#define BFD_MACH_O_N_TYPE 0x0e /* Mask for the type bits. */ +#define BFD_MACH_O_N_EXT 0x01 /* External symbol bit, set for external symbols. */ +#define BFD_MACH_O_N_UNDF 0x00 /* Undefined, n_sect == NO_SECT. */ +#define BFD_MACH_O_N_ABS 0x02 /* Absolute, n_sect == NO_SECT. */ +#define BFD_MACH_O_N_INDR 0x0a /* Indirect. */ +#define BFD_MACH_O_N_PBUD 0x0c /* Prebound undefined (defined in a dylib). */ +#define BFD_MACH_O_N_SECT 0x0e /* Defined in section number n_sect. */ + +#define BFD_MACH_O_NO_SECT 0 /* Symbol not in any section of the image. */ + +/* Symbol n_desc reference flags. */ +#define BFD_MACH_O_REFERENCE_MASK 0x0f +#define BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_NON_LAZY 0x00 +#define BFD_MACH_O_REFERENCE_FLAG_UNDEFINED_LAZY 0x01 +#define BFD_MACH_O_REFERENCE_FLAG_DEFINED 0x02 +#define BFD_MACH_O_REFERENCE_FLAG_PRIVATE_DEFINED 0x03 +#define BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 0x04 +#define BFD_MACH_O_REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 0x05 + +#define BFD_MACH_O_REFERENCED_DYNAMICALLY 0x10 +#define BFD_MACH_O_N_DESC_DISCARDED 0x20 +#define BFD_MACH_O_N_NO_DEAD_STRIP 0x20 +#define BFD_MACH_O_N_WEAK_REF 0x40 +#define BFD_MACH_O_N_WEAK_DEF 0x80 + +#define BFD_MACH_O_INDIRECT_SYM_LOCAL 0x80000000 +#define BFD_MACH_O_INDIRECT_SYM_ABS 0x40000000 + +/* Thread constants. */ + +typedef enum bfd_mach_o_ppc_thread_flavour +{ + BFD_MACH_O_PPC_THREAD_STATE = 1, + BFD_MACH_O_PPC_FLOAT_STATE = 2, + BFD_MACH_O_PPC_EXCEPTION_STATE = 3, + BFD_MACH_O_PPC_VECTOR_STATE = 4, + BFD_MACH_O_PPC_THREAD_STATE64 = 5, + BFD_MACH_O_PPC_EXCEPTION_STATE64 = 6, + BFD_MACH_O_PPC_THREAD_STATE_NONE = 7 +} +bfd_mach_o_ppc_thread_flavour; + +/* Defined in <mach/i386/thread_status.h> */ +typedef enum bfd_mach_o_i386_thread_flavour +{ + BFD_MACH_O_x86_THREAD_STATE32 = 1, + BFD_MACH_O_x86_FLOAT_STATE32 = 2, + BFD_MACH_O_x86_EXCEPTION_STATE32 = 3, + BFD_MACH_O_x86_THREAD_STATE64 = 4, + BFD_MACH_O_x86_FLOAT_STATE64 = 5, + BFD_MACH_O_x86_EXCEPTION_STATE64 = 6, + BFD_MACH_O_x86_THREAD_STATE = 7, + BFD_MACH_O_x86_FLOAT_STATE = 8, + BFD_MACH_O_x86_EXCEPTION_STATE = 9, + BFD_MACH_O_x86_DEBUG_STATE32 = 10, + BFD_MACH_O_x86_DEBUG_STATE64 = 11, + BFD_MACH_O_x86_DEBUG_STATE = 12, + BFD_MACH_O_x86_THREAD_STATE_NONE = 13 +} +bfd_mach_o_i386_thread_flavour; + +#endif /* _MACH_O_LOADER_H */ diff --git a/include/mach-o/reloc.h b/include/mach-o/reloc.h new file mode 100644 index 000000000..bab31efeb --- /dev/null +++ b/include/mach-o/reloc.h @@ -0,0 +1,33 @@ +/* Mach-O support for BFD. + Copyright 2011, 2012 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_RELOC_H +#define _MACH_O_RELOC_H + +/* Generic relocation types (used by i386). */ +#define BFD_MACH_O_GENERIC_RELOC_VANILLA 0 +#define BFD_MACH_O_GENERIC_RELOC_PAIR 1 +#define BFD_MACH_O_GENERIC_RELOC_SECTDIFF 2 +#define BFD_MACH_O_GENERIC_RELOC_PB_LA_PTR 3 +#define BFD_MACH_O_GENERIC_RELOC_LOCAL_SECTDIFF 4 +#define BFD_MACH_O_GENERIC_RELOC_TLV 5 + +#endif /* _MACH_O_RELOC_H */ diff --git a/include/mach-o/x86-64.h b/include/mach-o/x86-64.h new file mode 100644 index 000000000..d06bc26a7 --- /dev/null +++ b/include/mach-o/x86-64.h @@ -0,0 +1,37 @@ +/* Mach-O support for BFD. + Copyright 2011 + Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, + MA 02110-1301, USA. */ + +#ifndef _MACH_O_X86_64_H +#define _MACH_O_X86_64_H + +/* X86-64 relocations. */ +#define BFD_MACH_O_X86_64_RELOC_UNSIGNED 0 /* Absolute addresses. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED 1 /* 32-bit disp. */ +#define BFD_MACH_O_X86_64_RELOC_BRANCH 2 /* 32-bit pcrel disp. */ +#define BFD_MACH_O_X86_64_RELOC_GOT_LOAD 3 /* Movq load of a GOT entry. */ +#define BFD_MACH_O_X86_64_RELOC_GOT 4 /* GOT reference. */ +#define BFD_MACH_O_X86_64_RELOC_SUBTRACTOR 5 /* Symbol difference. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED_1 6 /* 32-bit signed disp -1. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED_2 7 /* 32-bit signed disp -2. */ +#define BFD_MACH_O_X86_64_RELOC_SIGNED_4 8 /* 32-bit signed disp -4. */ +#define BFD_MACH_O_X86_64_RELOC_TLV 9 /* Thread local variables. */ + +#endif /* _MACH_O_X86_64_H */ diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog index 1091973b2..af70340d6 100644 --- a/include/opcode/ChangeLog +++ b/include/opcode/ChangeLog @@ -1,48 +1,3 @@ -2012-07-31 Chao-Ying Fu <fu@mips.com> - Catherine Moore <clm@codesourcery.com> - Maciej W. Rozycki <macro@codesourcery.com> - - * mips.h: Document microMIPS DSP ASE usage. - (MICROMIPSOP_MASK_DSPACC, MICROMIPSOP_SH_DSPACC): Update for - microMIPS DSP ASE support. - (MICROMIPSOP_MASK_DSPSFT, MICROMIPSOP_SH_DSPSFT): Likewise. - (MICROMIPSOP_MASK_SA3, MICROMIPSOP_SH_SA3): Likewise. - (MICROMIPSOP_MASK_SA4, MICROMIPSOP_SH_SA4): Likewise. - (MICROMIPSOP_MASK_IMM8, MICROMIPSOP_SH_IMM8): Likewise. - (MICROMIPSOP_MASK_IMM10, MICROMIPSOP_SH_IMM10): Likewise. - (MICROMIPSOP_MASK_WRDSP, MICROMIPSOP_SH_WRDSP): Likewise. - (MICROMIPSOP_MASK_BP, MICROMIPSOP_SH_BP): Likewise. - -2012-07-06 Maciej W. Rozycki <macro@codesourcery.com> - - * mips.h: Fix a typo in description. - -2012-06-07 Georg-Johann Lay <avr@gjlay.de> - - * avr.h: (AVR_ISA_XCH): New define. - (AVR_ISA_XMEGA): Use it. - (XCH, LAS, LAT, LAC): New XMEGA opcodes. - -2012-05-15 James Murray <jsm@jsm-net.demon.co.uk> - - * m68hc11.h: Add XGate definitions. - (struct m68hc11_opcode): Add xg_mask field. - -2012-05-14 Catherine Moore <clm@codesourcery.com> - Maciej W. Rozycki <macro@codesourcery.com> - Rhonda Wittels <rhonda@codesourcery.com> - - * ppc.h (PPC_OPCODE_VLE): New definition. - (PPC_OP_SA): New macro. - (PPC_OP_SE_VLE): New macro. - (PPC_OP): Use a variable shift amount. - (powerpc_operand): Update comments. - (PPC_OPSHIFT_INV): New macro. - (PPC_OPERAND_CR): Replace with... - (PPC_OPERAND_CR_BIT): ...this and - (PPC_OPERAND_CR_REG): ...this. - - 2012-05-03 Sean Keys <skeys@ipdatasys.com> * xgate.h: Header file for XGATE assembler. diff --git a/include/opcode/avr.h b/include/opcode/avr.h index 6e86c07ba..a6d7b478d 100644 --- a/include/opcode/avr.h +++ b/include/opcode/avr.h @@ -1,6 +1,6 @@ /* Opcode table for the Atmel AVR micro controllers. - Copyright 2000, 2001, 2004, 2006, 2008, 2010, 2012 Free Software Foundation, Inc. + Copyright 2000, 2001, 2004, 2006, 2008, 2010 Free Software Foundation, Inc. Contributed by Denis Chertykov <denisc@overta.ru> This program is free software; you can redistribute it and/or modify @@ -33,7 +33,6 @@ #define AVR_ISA_MOVW 0x1000 /* device has MOVW */ #define AVR_ISA_SPMX 0x2000 /* device has SPM Z[+] */ #define AVR_ISA_DES 0x4000 /* device has DES */ -#define AVR_ISA_XCH 0x8000 /* device has XCH, LAC, LAS, LAT */ #define AVR_ISA_TINY1 (AVR_ISA_1200 | AVR_ISA_LPM) #define AVR_ISA_2xxx (AVR_ISA_TINY1 | AVR_ISA_SRAM) @@ -53,7 +52,7 @@ #define AVR_ISA_M323 (AVR_ISA_M161 | AVR_ISA_BRK) #define AVR_ISA_M128 (AVR_ISA_M323 | AVR_ISA_ELPM | AVR_ISA_ELPMX) #define AVR_ISA_M256 (AVR_ISA_M128 | AVR_ISA_EIND) -#define AVR_ISA_XMEGA (AVR_ISA_M256 | AVR_ISA_SPMX | AVR_ISA_DES | AVR_ISA_XCH) +#define AVR_ISA_XMEGA (AVR_ISA_M256 | AVR_ISA_SPMX | AVR_ISA_DES) #define AVR_ISA_AVR1 AVR_ISA_TINY1 #define AVR_ISA_AVR2 AVR_ISA_2xxx @@ -125,6 +124,7 @@ 0x0001...0x00ff (255) (known to be decoded as `nop' by the old core) "100100xxxxxxx011" (128) 0x9[0-3][0-9a-f][3b] "100100xxxxxx1000" (64) 0x9[0-3][0-9a-f]8 + "1001001xxxxx01xx" (128) 0x9[23][0-9a-f][4-7] "1001010xxxxx0100" (32) 0x9[45][0-9a-f]4 "1001010x001x1001" (4) 0x9[45][23]9 "1001010x01xx1001" (8) 0x9[45][4-7]9 @@ -265,12 +265,6 @@ AVR_INSN (push, "r", "1001001rrrrr1111", 1, AVR_ISA_2xxx, 0x920f) AVR_INSN (ror, "r", "1001010rrrrr0111", 1, AVR_ISA_1200, 0x9407) AVR_INSN (swap, "r", "1001010rrrrr0010", 1, AVR_ISA_1200, 0x9402) - /* Atomic memory operations for XMEGA. List before `sts'. */ -AVR_INSN (xch, "z,r", "1001001rrrrr0100", 1, AVR_ISA_XCH, 0x9204) -AVR_INSN (las, "z,r", "1001001rrrrr0101", 1, AVR_ISA_XCH, 0x9205) -AVR_INSN (lac, "z,r", "1001001rrrrr0110", 1, AVR_ISA_XCH, 0x9206) -AVR_INSN (lat, "z,r", "1001001rrrrr0111", 1, AVR_ISA_XCH, 0x9207) - /* Known to be decoded as `nop' by the old core. */ AVR_INSN (movw, "v,v", "00000001ddddrrrr", 1, AVR_ISA_MOVW, 0x0100) AVR_INSN (muls, "d,d", "00000010ddddrrrr", 1, AVR_ISA_MUL, 0x0200) diff --git a/include/opcode/m68hc11.h b/include/opcode/m68hc11.h index 1a002008c..83f5a9a65 100644 --- a/include/opcode/m68hc11.h +++ b/include/opcode/m68hc11.h @@ -1,6 +1,5 @@ /* m68hc11.h -- Header file for Motorola 68HC11 & 68HC12 opcode table - Copyright 1999, 2000, 2002, 2003, 2010, 2012 - Free Software Foundation, Inc. + Copyright 1999, 2000, 2002, 2003, 2010 Free Software Foundation, Inc. Written by Stephane Carrez (stcarrez@nerim.fr) This file is part of GDB, GAS, and the GNU binutils. @@ -38,7 +37,8 @@ of the M6811_INIT register. At init time, the I/O registers are mapped at 0x1000. Address of registers is then: - 0x1000 + M6811_xxx. */ + 0x1000 + M6811_xxx +*/ #define M6811_PORTA 0x00 /* Port A register */ #define M6811__RES1 0x01 /* Unused/Reserved */ #define M6811_PIOC 0x02 /* Parallel I/O Control register */ @@ -364,26 +364,6 @@ #define M6812_INDEXED 0x20000000 /* n,r n = 5, 9 or 16-bits */ #define M6812_OP_IDX_P2 0x40000000 -/* XGATE defines. - These overlap with HC11/12 as above but not used at the same time. */ -#define M68XG_OP_NONE 0x0001 -#define M68XG_OP_IMM3 0x0002 -#define M68XG_OP_R 0x0004 -#define M68XG_OP_R_R 0x0008 -#define M68XG_OP_R_IMM4 0x0010 -#define M68XG_OP_R_R_R 0x0020 -#define M68XG_OP_REL9 0x0040 -#define M68XG_OP_REL10 0x0080 -#define M68XG_OP_R_R_OFFS5 0x0100 -#define M68XG_OP_RD_RB_RI 0x0200 -#define M68XG_OP_RD_RB_RIp 0x0400 -#define M68XG_OP_RD_RB_mRI 0x0800 -#define M68XG_OP_R_IMM8 0x1000 -#define M68XG_OP_R_IMM16 0x2000 -#define M68XG_OP_REG 0x4000 /* Register operand 1. */ -#define M68XG_OP_REG_2 0x8000 /* Register operand 2. */ -#define M68XG_MAX_OPERANDS 3 /* Max operands of triadic r1, r2, r3. */ - /* Markers to identify some instructions. */ #define M6812_OP_EXG_MARKER 0x01000000 /* exg r1,r2 */ #define M6812_OP_TFR_MARKER 0x02000000 /* tfr r1,r2 */ @@ -394,43 +374,35 @@ #define M6812_OP_IBCC_MARKER 0x02000000 /* ibeq/ibne */ #define M6812_OP_TBCC_MARKER 0x01000000 -/* XGATE markers. */ -#define M68XG_OP_B_MARKER 0x04000000 /* bXX rel9 */ -#define M68XG_OP_BRA_MARKER 0x02000000 /* bra rel10 */ - #define M6812_OP_TRAP_ID 0x80000000 /* trap #N */ #define M6811_OP_HIGH_ADDR 0x01000000 /* Used internally by gas. */ #define M6811_OP_LOW_ADDR 0x02000000 -#define M68HC12_BANK_VIRT 0x010000 -#define M68HC12_BANK_MASK 0x00003fff -#define M68HC12_BANK_BASE 0x00008000 -#define M68HC12_BANK_SHIFT 14 -#define M68HC12_BANK_PAGE_MASK 0x0ff +#define M68HC12_BANK_VIRT 0x010000 +#define M68HC12_BANK_MASK 0x00003fff +#define M68HC12_BANK_BASE 0x00008000 +#define M68HC12_BANK_SHIFT 14 +#define M68HC12_BANK_PAGE_MASK 0x0ff /* CPU identification. */ #define cpu6811 0x01 #define cpu6812 0x02 #define cpu6812s 0x04 -#define cpu9s12x 0x08 /* 9S12X main cpu. */ -#define cpuxgate 0x10 /* The XGATE module itself. */ /* The opcode table is an array of struct m68hc11_opcode. */ -struct m68hc11_opcode -{ - const char * name; /* Op-code name. */ +struct m68hc11_opcode { + const char* name; /* Op-code name */ long format; unsigned char size; - unsigned int opcode; + unsigned char opcode; unsigned char cycles_low; unsigned char cycles_high; unsigned char set_flags_mask; unsigned char clr_flags_mask; unsigned char chg_flags_mask; unsigned char arch; - unsigned int xg_mask; /* Mask with zero in register place for xgate. */ }; /* Alias definition for 68HC12. */ diff --git a/include/opcode/mips.h b/include/opcode/mips.h index 857fc7173..fb9094c26 100644 --- a/include/opcode/mips.h +++ b/include/opcode/mips.h @@ -1494,24 +1494,6 @@ extern const int bfd_mips16_num_opcodes; #define MICROMIPSOP_MASK_IMMY 0x1ff #define MICROMIPSOP_SH_IMMY 1 -/* MIPS DSP ASE */ -#define MICROMIPSOP_MASK_DSPACC 0x3 -#define MICROMIPSOP_SH_DSPACC 14 -#define MICROMIPSOP_MASK_DSPSFT 0x3f -#define MICROMIPSOP_SH_DSPSFT 16 -#define MICROMIPSOP_MASK_SA3 0x7 -#define MICROMIPSOP_SH_SA3 13 -#define MICROMIPSOP_MASK_SA4 0xf -#define MICROMIPSOP_SH_SA4 12 -#define MICROMIPSOP_MASK_IMM8 0xff -#define MICROMIPSOP_SH_IMM8 13 -#define MICROMIPSOP_MASK_IMM10 0x3ff -#define MICROMIPSOP_SH_IMM10 16 -#define MICROMIPSOP_MASK_WRDSP 0x3f -#define MICROMIPSOP_SH_WRDSP 14 -#define MICROMIPSOP_MASK_BP 0x3 -#define MICROMIPSOP_SH_BP 14 - /* Placeholders for fields that only exist in the traditional 32-bit instruction encoding; see the comment above for details. */ #define MICROMIPSOP_MASK_CODE20 0 @@ -1526,12 +1508,28 @@ extern const int bfd_mips16_num_opcodes; #define MICROMIPSOP_SH_VECBYTE 0 #define MICROMIPSOP_MASK_VECALIGN 0 #define MICROMIPSOP_SH_VECALIGN 0 +#define MICROMIPSOP_MASK_DSPACC 0 +#define MICROMIPSOP_SH_DSPACC 0 #define MICROMIPSOP_MASK_DSPACC_S 0 #define MICROMIPSOP_SH_DSPACC_S 0 +#define MICROMIPSOP_MASK_DSPSFT 0 +#define MICROMIPSOP_SH_DSPSFT 0 #define MICROMIPSOP_MASK_DSPSFT_7 0 #define MICROMIPSOP_SH_DSPSFT_7 0 +#define MICROMIPSOP_MASK_SA3 0 +#define MICROMIPSOP_SH_SA3 0 +#define MICROMIPSOP_MASK_SA4 0 +#define MICROMIPSOP_SH_SA4 0 +#define MICROMIPSOP_MASK_IMM8 0 +#define MICROMIPSOP_SH_IMM8 0 +#define MICROMIPSOP_MASK_IMM10 0 +#define MICROMIPSOP_SH_IMM10 0 +#define MICROMIPSOP_MASK_WRDSP 0 +#define MICROMIPSOP_SH_WRDSP 0 #define MICROMIPSOP_MASK_RDDSP 0 #define MICROMIPSOP_SH_RDDSP 0 +#define MICROMIPSOP_MASK_BP 0 +#define MICROMIPSOP_SH_BP 0 #define MICROMIPSOP_MASK_MT_U 0 #define MICROMIPSOP_SH_MT_U 0 #define MICROMIPSOP_MASK_MT_H 0 @@ -1648,7 +1646,7 @@ extern const int bfd_mips16_num_opcodes; "y" 5-bit source 3 register for ALNV.PS (MICROMIPSOP_*_RS3) "z" must be zero register "C" 23-bit coprocessor function code (MICROMIPSOP_*_COPZ) - "B" 10-bit syscall/wait function code (MICROMIPSOP_*_CODE10) + "B" 8-bit syscall/wait function code (MICROMIPSOP_*_CODE10) "K" 5-bit Hardware Register (RDHWR instruction) (MICROMIPSOP_*_RS) "+A" 5-bit INS/EXT/DINS/DEXT/DINSM/DEXTM position, which becomes @@ -1704,18 +1702,6 @@ extern const int bfd_mips16_num_opcodes; "f" 32-bit floating point constant "l" 32-bit floating point constant in .lit4 - DSP ASE usage: - "2" 2-bit unsigned immediate for byte align (MICROMIPSOP_*_BP) - "3" 3-bit unsigned immediate (MICROMIPSOP_*_SA3) - "4" 4-bit unsigned immediate (MICROMIPSOP_*_SA4) - "5" 8-bit unsigned immediate (MICROMIPSOP_*_IMM8) - "6" 5-bit unsigned immediate (MICROMIPSOP_*_RS) - "7" 2-bit DSP accumulator register (MICROMIPSOP_*_DSPACC) - "8" 6-bit unsigned immediate (MICROMIPSOP_*_WRDSP) - "0" 6-bit signed immediate (MICROMIPSOP_*_DSPSFT) - "@" 10-bit signed immediate (MICROMIPSOP_*_IMM10) - "^" 5-bit unsigned immediate (MICROMIPSOP_*_RD) - Other: "()" parens surrounding optional value "," separates operands @@ -1723,8 +1709,8 @@ extern const int bfd_mips16_num_opcodes; "m" start of microMIPS extension sequence Characters used so far, for quick reference when adding more: - "12345678 0" - "<>(),+.@\^|~" + "1234567890" + "<>(),+.\|~" "ABCDEFGHI KLMN RST V " "abcd f hijklmnopqrstuvw yz" diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h index 2e789d6ff..e672502e3 100644 --- a/include/opcode/ppc.h +++ b/include/opcode/ppc.h @@ -65,8 +65,6 @@ struct powerpc_opcode instructions. */ extern const struct powerpc_opcode powerpc_opcodes[]; extern const int powerpc_num_opcodes; -extern const struct powerpc_opcode vle_opcodes[]; -extern const int vle_num_opcodes; /* Values defined for the flags field of a struct powerpc_opcode. */ @@ -185,20 +183,8 @@ extern const int vle_num_opcodes; /* Opcode is supported by Thread management APU */ #define PPC_OPCODE_TMR 0x800000000ull -/* Opcode which is supported by the VLE extension. */ -#define PPC_OPCODE_VLE 0x1000000000ull - /* A macro to extract the major opcode from an instruction. */ #define PPC_OP(i) (((i) >> 26) & 0x3f) - -/* A macro to determine if the instruction is a 2-byte VLE insn. */ -#define PPC_OP_SE_VLE(m) ((m) <= 0xffff) - -/* A macro to extract the major opcode from a VLE instruction. */ -#define VLE_OP(i,m) (((i) >> ((m) <= 0xffff ? 10 : 26)) & 0x3f) - -/* A macro to convert a VLE opcode to a VLE opcode segment. */ -#define VLE_OP_TO_SEG(i) ((i) >> 1) /* The operands table is an array of struct powerpc_operand. */ @@ -207,22 +193,16 @@ struct powerpc_operand /* A bitmask of bits in the operand. */ unsigned int bitm; - /* The shift operation to be applied to the operand. No shift - is made if this is zero. For positive values, the operand - is shifted left by SHIFT. For negative values, the operand - is shifted right by -SHIFT. Use PPC_OPSHIFT_INV to indicate - that BITM and SHIFT cannot be used to determine where the - operand goes in the insn. */ + /* How far the operand is left shifted in the instruction. + -1 to indicate that BITM and SHIFT cannot be used to determine + where the operand goes in the insn. */ int shift; /* Insertion function. This is used by the assembler. To insert an operand value into an instruction, check this field. If it is NULL, execute - if (o->shift >= 0) - i |= (op & o->bitm) << o->shift; - else - i |= (op & o->bitm) >> -o->shift; + i |= (op & o->bitm) << o->shift; (i is the instruction which we are filling in, o is a pointer to this structure, and op is the operand value). @@ -240,10 +220,7 @@ struct powerpc_operand extract this operand type from an instruction, check this field. If it is NULL, compute - if (o->shift >= 0) - op = (i >> o->shift) & o->bitm; - else - op = (i << -o->shift) & o->bitm; + op = (i >> o->shift) & o->bitm; if ((o->flags & PPC_OPERAND_SIGNED) != 0) sign_extend (op); (i is the instruction, o is a pointer to this structure, and op @@ -267,11 +244,6 @@ struct powerpc_operand extern const struct powerpc_operand powerpc_operands[]; extern const unsigned int num_powerpc_operands; -/* Use with the shift field of a struct powerpc_operand to indicate - that BITM and SHIFT cannot be used to determine where the operand - goes in the insn. */ -#define PPC_OPSHIFT_INV (-1 << 31) - /* Values defined for the flags field of a struct powerpc_operand. */ /* This operand takes signed values. */ @@ -305,7 +277,7 @@ extern const unsigned int num_powerpc_operands; cr4 4 cr5 5 cr6 6 cr7 7 These may be combined arithmetically, as in cr2*4+gt. These are only supported on the PowerPC, not the POWER. */ -#define PPC_OPERAND_CR_BIT (0x10) +#define PPC_OPERAND_CR (0x10) /* This operand names a register. The disassembler uses this to print register names with a leading 'r'. */ @@ -370,9 +342,6 @@ extern const unsigned int num_powerpc_operands; /* This operand names a vector-scalar unit register. The disassembler prints these with a leading 'vs'. */ #define PPC_OPERAND_VSR (0x100000) - -/* This is a CR FIELD that does not use symbolic names. */ -#define PPC_OPERAND_CR_REG (0x200000) /* The POWER and PowerPC assemblers use a few macros. We keep them with the operands table for simplicity. The macro table is an diff --git a/include/opcode/xgate.h b/include/opcode/xgate.h index 77a521f83..c51673342 100644 --- a/include/opcode/xgate.h +++ b/include/opcode/xgate.h @@ -77,7 +77,7 @@ #define XGATE_OP_IDO5 "r,r,i5" #define XGATE_OP_REL9 "b9" #define XGATE_OP_REL10 "ba" -#define XGATE_OP_DYA_MON "=r" +#define XGATE_OP_DYA_MON "=r,r" /* Macro definitions. */ #define XGATE_OP_IMM16mADD "r,if; addl addh" #define XGATE_OP_IMM16mAND "r,if; andl andh" diff --git a/include/plugin-api.h b/include/plugin-api.h index 3220142dd..122424c6c 100644 --- a/include/plugin-api.h +++ b/include/plugin-api.h @@ -66,8 +66,7 @@ enum ld_plugin_output_file_type { LDPO_REL, LDPO_EXEC, - LDPO_DYN, - LDPO_PIE + LDPO_DYN }; /* An input file managed by the plugin library. */ |