diff options
Diffstat (limited to 'include/elf')
-rw-r--r-- | include/elf/ChangeLog | 197 | ||||
-rw-r--r-- | include/elf/alpha.h | 31 | ||||
-rw-r--r-- | include/elf/arm.h | 4 | ||||
-rw-r--r-- | include/elf/common.h | 41 | ||||
-rw-r--r-- | include/elf/dwarf2.h | 54 | ||||
-rw-r--r-- | include/elf/external.h | 4 | ||||
-rw-r--r-- | include/elf/h8.h | 96 | ||||
-rw-r--r-- | include/elf/ia64.h | 22 | ||||
-rw-r--r-- | include/elf/internal.h | 36 | ||||
-rw-r--r-- | include/elf/mips.h | 2 | ||||
-rw-r--r-- | include/elf/mmix.h | 168 | ||||
-rw-r--r-- | include/elf/or32.h | 62 | ||||
-rw-r--r-- | include/elf/ppc.h | 77 | ||||
-rw-r--r-- | include/elf/sh.h | 132 | ||||
-rw-r--r-- | include/elf/xstormy16.h | 53 |
15 files changed, 901 insertions, 78 deletions
diff --git a/include/elf/ChangeLog b/include/elf/ChangeLog index 13bcbb8d6..79f99ac64 100644 --- a/include/elf/ChangeLog +++ b/include/elf/ChangeLog @@ -1,6 +1,186 @@ +2002-02-09 Richard Henderson <rth@redhat.com> + + * alpha.h (R_ALPHA_BRSGP): New. + +2002-02-08 Alexandre Oliva <aoliva@redhat.com> + + Contribute sh64-elf. + 2002-01-23 Alexandre Oliva <aoliva@redhat.com> + * sh.h (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16, + R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16, + R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16, + R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16, + R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16, + R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16, + R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16, + R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, + R_SH_GOTPLT10BY8, R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, + R_SH_RELATIVE64): New relocs. + (R_SH_FIRST_INVALID_RELOC_4): Adjust. + 2001-05-16 Alexandre Oliva <aoliva@redhat.com> + * sh.h: Renumbered and renamed some SH5 relocations to match + official numbers and names; moved unmaching ones to the range + 0xf2-0xff. + 2001-01-06 Hans-Peter Nilsson <hpn@cygnus.com> + * sh.h (sh64_get_contents_type): Declare. + (sh64_address_is_shmedia): Likewise. + 2000-12-30 Hans-Peter Nilsson <hpn@cygnus.com> + * sh.h (sh64_elf_crange): New type. + (struct sh64_section_data): New. + (sh64_elf_section_data): New macro. + (EF_SH5): Rename back from EF_SH64. + 2000-12-18 Hans-Peter Nilsson <hpn@cygnus.com> + * sh.h (SHF_SH5_ISA32_MIXED, SHT_SH5_CR_SORTED, + SH64_CRANGES_SECTION_NAME, SH64_CRANGE_SIZE, + SH64_CRANGE_CR_ADDR_OFFSET, SH64_CRANGE_CR_SIZE_OFFSET, + SH64_CRANGE_CR_TYPE_OFFSET): New macros. + 2000-12-12 Hans-Peter Nilsson <hpn@cygnus.com> + * sh.h (EF_SH64): Don't define EF_SH64_ABI64. + 2000-11-27 Hans-Peter Nilsson <hpn@cygnus.com> + * sh.h (EF_SH64_32BIT_ABI, EF_SH64_64BIT_ABI): Delete. + (EF_SH64_ABI64): New. + 2000-11-23 Hans-Peter Nilsson <hpn@cygnus.com> + * sh.h (EF_SH64): Rename from EF_SH5. + (EF_SH64_32BIT_ABI): New. + (EF_SH64_64BIT_ABI): New. + (R_SH_PT_16, R_SH_SHMEDIA_CODE + R_SH_IMMU5, R_SH_IMMS6, R_SH_IMMU6, R_SH_IMMS10, R_SH_IMMS10BY2, + R_SH_IMMS10BY4, R_SH_IMMS10BY8, R_SH_IMMS16, R_SH_IMMU16, + R_SH_IMM_LOW16, R_SH_IMM_LOW16_PCREL, R_SH_IMM_MEDLOW16, + R_SH_IMM_MEDLOW16_PCREL, R_SH_IMM_MEDHI16, R_SH_IMM_MEDHI16_PCREL, + R_SH_IMM_HI16, R_SH_IMM_HI16_PCREL, R_SH_64, R_SH_64_PCREL): New + relocs. + 2000-09-01 Ben Elliston <bje@redhat.com> + * sh.h (EF_SH5): Define. + +2002-02-01 Hans-Peter Nilsson <hp@bitrange.com> + + * mmix.h: Tweak comments. + (MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME): New. + [BFD_ARCH_SIZE] (_bfd_mmix_prepare_linker_allocated_gregs, + _bfd_mmix_finalize_linker_allocated_gregs, + _bfd_mmix_check_all_relocs): Provide prototypes. + +2002-01-31 Ivan Guzvinec <ivang@opencores.org> + + * or32.h: New file. + * common.h: Add support for or32 targets. + +2002-01-28 Jason Merrill <jason@redhat.com> + + * dwarf2.h: Sync with gcc version. + +2002-01-16 Alan Modra <amodra@bigpond.net.au> + + * ppc.h (DT_PPC64_GLINK): Define. + +2002-01-15 Richard Earnshaw <rearnsha@arm.com> + + * arm.h (F_VFP_FLOAT, EF_ARM_VFP_FLOAT): Define. + +2002-01-09 Jason Thorpe <thorpej@wasabisystems.com> + + * common.h: Update copyright years. + (NT_NETBSDCORE_PROCINFO): Define. + (NT_NETBSDCORE_FIRSTMACH): Define. + +2002-01-06 Steve Ellcey <sje@cup.hp.com> + + * ia64.h (ELF_STRING_ia64_unwind_hdr): New Macro for HP-UX. + (SHT_IA_64_HP_OPT_ANOT): Ditto + (PT_IA_64_HP_OPT_ANOT): Ditto + (PT_IA_64_HP_HSL_ANOT): Ditto + (PT_IA_64_HP_STACK): Ditto + (SHN_IA_64_ANSI_COMMON): Ditto + +2001-12-17 Alan Modra <amodra@bigpond.net.au> + + * external.h (Elf_External_Sym_Shndx): Declare. + * internal.h (struct elf_internal_sym <st_shndx>): Make it an + unsigned int. + * common.h (SHN_BAD): Define. + +2001-12-13 Jakub Jelinek <jakub@redhat.com> + + * elf/common.h (PT_GNU_EH_FRAME): Define. + +2001-12-11 Alan Modra <amodra@bigpond.net.au> + + * common.h (SHN_XINDEX): Comment typo fix. + * internal.h (Elf_Internal_Ehdr): Change existing "unsigned short" + size, count and index fields to "unsigned int". + +2001-12-07 Geoffrey Keating <geoffk@redhat.com> + Richard Henderson <rth@redhat.com> + + * common.h (EM_XSTORMY16): Define. + * xstormy16.h: New file. + +2001-11-15 Alan Modra <amodra@bigpond.net.au> + + * common.h (NT_ARCH): Define. Remove incorrect comment. + +2001-11-11 Geoffrey Keating <geoffk@redhat.com> + + * dwarf2.h (dwarf_line_number_ops): Add DWARF 3 opcodes. + +2001-10-30 Hans-Peter Nilsson <hp@bitrange.com> + + * mmix.h: New file. + +2001-10-23 Alan Modra <amodra@bigpond.net.au> + + * internal.h: White space changes to keep lines under 80 chars. + +2001-10-16 Jeff Holcomb <jeffh@redhat.com> + + * internal.h (elf_internal_shdr): Make contents a unsigned char *. + +2001-09-18 Alan Modra <amodra@bigpond.net.au> + + * internal.h (elf_internal_rela): Make r_addend a bfd_vma. + +2001-09-13 Alexandre Oliva <aoliva@redhat.com> + + * common.h (EM_OPENRISC_OLD): Renamed the old EM_OPENRISC entry. + +2001-09-12 Alexandre Oliva <aoliva@redhat.com> + + * common.h (EM_AVR_OLD): Renamed from... + (EM_AVR): this, redefined as in the current ELF standard. + (EM_PJ_OLD): Renamed from... + (EM_PJ): this, redefined as in the current ELF standard. + (EM_R30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300, + EM_MN10200, EM_OPENRISC, EM_ARC_A5, EM_XTENSA): Defined as in + the current ELF standard. + (EM_CYGNUS_ARC): Removed, unused for a long time. + +2001-09-04 Richard Henderson <rth@redhat.com> + + * alpha.h (R_ALPHA_OP*, R_ALPHA_IMMED*, R_ALPHA_GPVALUE): Remove. + (R_ALPHA_GPREL16): Rename from R_ALPHA_IMMED_GP_16. + +2001-08-30 Eric Christopher <echristo@redhat.com> + + * mips.h: Remove E_MIPS_MACH_MIPS32_4K. + +2001-08-29 Jeff Law <law@redhat.com> + + * h8.h (EF_H8_MACH): New mask for encoded machine type. + (E_H8_MACH_H8300, E_H8_MACH_H8300H, E_H8_MACH_H8300S): New + machine types. + +2001-08-26 J"orn Rennecke <amylaar@redhat.com> + + * h8.h: New file. + +2001-08-27 Staffan Ulfberg <staffanu@swox.se> + + * ppc.h: Add relocs from the 64-bit PowerPC ELF ABI revision 1.2. + 2001-06-30 Daniel Berlin <dan@cgsoftware.com> - * dwarf2.h: Remerge with gcc version, + * dwarf2.h: Remerge with gcc version, including all new DWARF 2.1 extensions. 2001-06-29 James Cownie <jcownie@etnus.com> @@ -18,6 +198,11 @@ * common.h: Remove definition of EM_MIPS_RS4_BE. The constant was never in active use and is used otherwise by the ABI. +2001-05-11 Jakub Jelinek <jakub@redhat.com> + + * ia64.h (ELF_STRING_ia64_unwind_once): Define. + (ELF_STRING_ia64_unwind_info_once): Define. + 2001-05-07 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de> * external.h: Fix typo. @@ -45,7 +230,7 @@ 2001-04-20 Johan Rydberg <jrydberg@opencores.org> * openrisc.h: New file. - * common.h (EM_OPENRISC): New constant. + * common.h (EM_OPENRISC): New constant. 2001-04-23 Bo Thorsen <bo@suse.de> @@ -290,8 +475,8 @@ (ELFOSABI_MODESTO): Defined. (ELFOSABI_OPENBSD): Likewise. -Fri Apr 21 13:20:53 2000 Richard Henderson <rth@cygnus.com> - David Mosberger <davidm@hpl.hp.com> +2000-04-21 Richard Henderson <rth@cygnus.com> + David Mosberger <davidm@hpl.hp.com> * ia64.h: New file. @@ -325,7 +510,7 @@ Fri Apr 21 13:20:53 2000 Richard Henderson <rth@cygnus.com> (PF_ARM_PI): Define. (PF_ARM_ABS): Define. -Wed Apr 5 22:08:59 2000 J"orn Rennecke <amylaar@cygnus.co.uk> +2000-04-05 J"orn Rennecke <amylaar@cygnus.co.uk> * sh.h (R_SH_LOOP_START, R_SH_LOOP_END): New RELOC_NUMBERs. @@ -354,7 +539,7 @@ Wed Apr 5 22:08:59 2000 J"orn Rennecke <amylaar@cygnus.co.uk> * common.h (ELFOSABI_LINUX): Define. -Thu Feb 17 00:18:33 2000 J"orn Rennecke <amylaar@cygnus.co.uk> +2000-02-17 J"orn Rennecke <amylaar@cygnus.co.uk> * sh.h: (EF_SH_MACH_MASK, EF_SH_UNKNOWN, EF_SH1, EF_SH2): New macros. (EF_SH3, EF_SH_HAS_DSP, EF_SH_DSP, EF_SH3_DSP): Likewise. diff --git a/include/elf/alpha.h b/include/elf/alpha.h index 8bf67bd3d..e937b8147 100644 --- a/include/elf/alpha.h +++ b/include/elf/alpha.h @@ -80,28 +80,25 @@ START_RELOC_NUMBERS (elf_alpha_reloc_type) RELOC_NUMBER (R_ALPHA_SREL32, 10) /* PC relative 32 bit */ RELOC_NUMBER (R_ALPHA_SREL64, 11) /* PC relative 64 bit */ -/* Inherited these from ECOFF, but they are not particularly useful - and are depreciated. And not implemented in the BFD, btw. */ - RELOC_NUMBER (R_ALPHA_OP_PUSH, 12) /* OP stack push */ - RELOC_NUMBER (R_ALPHA_OP_STORE, 13) /* OP stack pop and store */ - RELOC_NUMBER (R_ALPHA_OP_PSUB, 14) /* OP stack subtract */ - RELOC_NUMBER (R_ALPHA_OP_PRSHIFT, 15) /* OP stack right shift */ - - RELOC_NUMBER (R_ALPHA_GPVALUE, 16) - RELOC_NUMBER (R_ALPHA_GPRELHIGH, 17) - RELOC_NUMBER (R_ALPHA_GPRELLOW, 18) - RELOC_NUMBER (R_ALPHA_IMMED_GP_16, 19) - RELOC_NUMBER (R_ALPHA_IMMED_GP_HI32, 20) - RELOC_NUMBER (R_ALPHA_IMMED_SCN_HI32, 21) - RELOC_NUMBER (R_ALPHA_IMMED_BR_HI32, 22) - RELOC_NUMBER (R_ALPHA_IMMED_LO32, 23) - -/* These relocations are specific to shared libraries. */ + /* Skip 12 - 16; deprecated ECOFF relocs. */ + + RELOC_NUMBER (R_ALPHA_GPRELHIGH, 17) /* GP relative 32 bit, high 16 bits */ + RELOC_NUMBER (R_ALPHA_GPRELLOW, 18) /* GP relative 32 bit, low 16 bits */ + RELOC_NUMBER (R_ALPHA_GPREL16, 19) /* GP relative 16 bit */ + + /* Skip 20 - 23; deprecated ECOFF relocs. */ + + /* These relocations are specific to shared libraries. */ RELOC_NUMBER (R_ALPHA_COPY, 24) /* Copy symbol at runtime */ RELOC_NUMBER (R_ALPHA_GLOB_DAT, 25) /* Create GOT entry */ RELOC_NUMBER (R_ALPHA_JMP_SLOT, 26) /* Create PLT entry */ RELOC_NUMBER (R_ALPHA_RELATIVE, 27) /* Adjust by program base */ + /* Like BRADDR, but assert that the source and target object file + share the same GP value, and adjust the target address for + STO_ALPHA_STD_GPLOAD. */ + RELOC_NUMBER (R_ALPHA_BRSGP, 28) + END_RELOC_NUMBERS (R_ALPHA_max) #endif /* _ELF_ALPHA_H */ diff --git a/include/elf/arm.h b/include/elf/arm.h index 89dffe15d..269a225dd 100644 --- a/include/elf/arm.h +++ b/include/elf/arm.h @@ -1,5 +1,5 @@ /* ARM ELF support for BFD. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -33,6 +33,7 @@ #define EF_ARM_NEW_ABI 0x80 #define EF_ARM_OLD_ABI 0x100 #define EF_ARM_SOFT_FLOAT 0x200 +#define EF_ARM_VFP_FLOAT 0x400 /* Other constants defined in the ARM ELF spec. version B-01. */ #define EF_ARM_SYMSARESORTED 0x04 /* NB conflicts with EF_INTERWORK */ @@ -51,6 +52,7 @@ #define F_APCS_FLOAT EF_ARM_APCS_FLOAT #define F_PIC EF_ARM_PIC #define F_SOFT_FLOAT EF_ARM_SOFT_FLOAT +#define F_VFP_FLOAT EF_ARM_VFP_FLOAT /* Additional symbol types for Thumb. */ #define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ diff --git a/include/elf/common.h b/include/elf/common.h index e0b80e466..d6e45fcc5 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 + 2001, 2002 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published @@ -162,6 +162,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ #define EM_HUANY 81 /* Harvard's machine-independent format */ #define EM_PRISM 82 /* SiTera Prism */ +#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ +#define EM_FR30 84 /* Fujitsu FR30 */ +#define EM_D10V 85 /* Mitsubishi D10V */ +#define EM_D30V 86 /* Mitsubishi D30V */ +#define EM_V850 87 /* NEC v850 */ +#define EM_M32R 88 /* Mitsubishi M32R */ +#define EM_MN10300 89 /* Matsushita MN10300 */ +#define EM_MN10200 90 /* Matsushita MN10200 */ +#define EM_PJ 91 /* picoJava */ +#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ +#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ +#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ /* If it is necessary to assign new unofficial EM_* values, please pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the chances of collision @@ -175,7 +187,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ unofficial e_machine number should eventually ask registry@sco.com for an officially blessed number to be added to the list above. */ -#define EM_PJ 99 /* picoJava */ +#define EM_PJ_OLD 99 /* picoJava */ /* Cygnus PowerPC ELF backend. Written in the absence of an ABI. */ #define EM_CYGNUS_POWERPC 0x9025 @@ -187,8 +199,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Old version of PowerPC, this should be removed shortly. */ #define EM_PPC_OLD 17 -/* Cygnus ARC ELF backend. Written in the absence of an ABI. */ -#define EM_CYGNUS_ARC 0x9040 +/* (Depreciated) Temporary number for the OpenRISC processor. */ +#define EM_OR32 0x8472 /* Cygnus M32R ELF backend. Written in the absence of an ABI. */ #define EM_CYGNUS_M32R 0x9041 @@ -218,11 +230,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* AVR magic number Written in the absense of an ABI. */ -#define EM_AVR 0x1057 +#define EM_AVR_OLD 0x1057 /* OpenRISC magic number Written in the absense of an ABI. */ -#define EM_OPENRISC 0x3426 +#define EM_OPENRISC_OLD 0x3426 + +#define EM_XSTORMY16 0xad45 /* See the above comment before you add a new EM_* value here. */ @@ -245,6 +259,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PT_LOPROC 0x70000000 /* Processor-specific */ #define PT_HIPROC 0x7FFFFFFF /* Processor-specific */ +#define PT_GNU_EH_FRAME (PT_LOOS + 0x474e550) + /* Program segment permissions, in program header p_flags field. */ #define PF_X (1 << 0) /* Segment is executable */ @@ -329,10 +345,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NT_LWPSINFO 17 /* Has a struct lwpsinfo_t */ #define NT_WIN32PSTATUS 18 /* Has a struct win32_pstatus */ + +/* Note segments for core files on NetBSD systems. Note name + must start with "NetBSD-CORE". */ + +#define NT_NETBSDCORE_PROCINFO 1 /* Has a struct procinfo */ +#define NT_NETBSDCORE_FIRSTMACH 32 /* start of machdep note types */ + + /* Values of note segment descriptor types for object files. */ -/* (Only for hppa right now. Should this be moved elsewhere?) */ #define NT_VERSION 1 /* Contains a version string. */ +#define NT_ARCH 2 /* Contains an architecture string. */ /* These three macros disassemble and assemble a symbol table st_info field, which contains the symbol binding and symbol type. The STB_ and STT_ @@ -394,8 +418,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SHN_HIOS 0xFF3F /* OS specific semantics, hi */ #define SHN_ABS 0xFFF1 /* Associated symbol is absolute */ #define SHN_COMMON 0xFFF2 /* Associated symbol is in common */ -#define SHN_XINDEX 0xFFFF /* Section index it held elsewhere */ +#define SHN_XINDEX 0xFFFF /* Section index is held elsewhere */ #define SHN_HIRESERVE 0xFFFF /* End range of reserved indices */ +#define SHN_BAD ((unsigned) -1) /* Used internally by bfd */ /* The following constants control how a symbol may be accessed once it has become part of an executable or shared library. */ diff --git a/include/elf/dwarf2.h b/include/elf/dwarf2.h index d7c164088..53eb65561 100644 --- a/include/elf/dwarf2.h +++ b/include/elf/dwarf2.h @@ -1,6 +1,6 @@ /* Declarations and definitions of codes relating to the DWARF2 symbolic debugging information format. - Copyright 1992, 1993, 1995, 1996, 1999, 2000, 2001 + Copyright (C) 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Gary Funck (gary@intrepid.com) The Ada Joint Program @@ -10,21 +10,22 @@ Derived from the DWARF 1 implementation written by Ron Guilmette (rfg@netcom.com), November 1990. -This file is part of GNU CC. +This file is part of GCC. -GNU CC 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 2, or (at your option) any -later version. +GCC 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 2, or (at your option) any later +version. -GNU CC is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +GCC 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 GNU CC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ /* This file is derived from the DWARF specification (a public document) Revision 2.0.0 (July 27, 1993) developed by the UNIX International @@ -32,7 +33,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * by UNIX International. Copies of this specification are available from UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054. - This file also now contains definitions from the DWARF 2.1 specification. */ + This file also now contains definitions from the DWARF 3 specification. */ /* This file is shared between GCC and GDB, and should not contain prototypes. */ @@ -177,7 +178,7 @@ enum dwarf_tag DW_TAG_variant_part = 0x33, DW_TAG_variable = 0x34, DW_TAG_volatile_type = 0x35, - /* DWARF 2.1. */ + /* DWARF 3. */ DW_TAG_dwarf_procedure = 0x36, DW_TAG_restrict_type = 0x37, DW_TAG_interface_type = 0x38, @@ -190,8 +191,8 @@ enum dwarf_tag DW_TAG_MIPS_loop = 0x4081, /* GNU extensions. */ DW_TAG_format_label = 0x4101, /* For FORTRAN 77 and Fortran 90. */ - DW_TAG_function_template = 0x4102, /* for C++ */ - DW_TAG_class_template = 0x4103, /* for C++ */ + DW_TAG_function_template = 0x4102, /* For C++. */ + DW_TAG_class_template = 0x4103, /* For C++. */ DW_TAG_GNU_BINCL = 0x4104, DW_TAG_GNU_EINCL = 0x4105 }; @@ -295,7 +296,7 @@ enum dwarf_attribute DW_AT_variable_parameter = 0x4b, DW_AT_virtuality = 0x4c, DW_AT_vtable_elem_location = 0x4d, - /* DWARF 2.1 values. */ + /* DWARF 3 values. */ DW_AT_allocated = 0x4e, DW_AT_associated = 0x4f, DW_AT_data_location = 0x50, @@ -326,7 +327,9 @@ enum dwarf_attribute DW_AT_mac_info = 0x2103, DW_AT_src_coords = 0x2104, DW_AT_body_begin = 0x2105, - DW_AT_body_end = 0x2106 + DW_AT_body_end = 0x2106, + /* VMS Extensions. */ + DW_AT_VMS_rtnbeg_pd_address = 0x2201 }; #define DW_AT_lo_user 0x2000 /* Implementation-defined range start. */ @@ -480,10 +483,10 @@ enum dwarf_location_atom DW_OP_deref_size = 0x94, DW_OP_xderef_size = 0x95, DW_OP_nop = 0x96, - /* DWARF 2.1 extensions. */ + /* DWARF 3 extensions. */ DW_OP_push_object_address = 0x97, - DW_OP_call2 = 0x98, /* 1 2-byte offset of DIE. */ - DW_OP_call4 = 0x99, /* 1 4-byte offset of DIE. */ + DW_OP_call2 = 0x98, + DW_OP_call4 = 0x99, DW_OP_calli = 0x9a }; @@ -502,7 +505,7 @@ enum dwarf_type DW_ATE_signed_char = 0x6, DW_ATE_unsigned = 0x7, DW_ATE_unsigned_char = 0x8, - /* DWARF 2.1. */ + /* DWARF 3. */ DW_ATE_imaginary_float = 0x9 }; @@ -588,7 +591,11 @@ enum dwarf_line_number_ops DW_LNS_negate_stmt = 6, DW_LNS_set_basic_block = 7, DW_LNS_const_add_pc = 8, - DW_LNS_fixed_advance_pc = 9 + DW_LNS_fixed_advance_pc = 9, + /* DWARF 3. */ + DW_LNS_set_prologue_end = 10, + DW_LNS_set_epilogue_begin = 11, + DW_LNS_set_isa = 12 }; /* Line number extended opcodes. */ @@ -620,9 +627,10 @@ enum dwarf_call_frame_info DW_CFA_def_cfa = 0x0c, DW_CFA_def_cfa_register = 0x0d, DW_CFA_def_cfa_offset = 0x0e, + + /* DWARF 3. */ DW_CFA_def_cfa_expression = 0x0f, DW_CFA_expression = 0x10, - /* Dwarf 2.1. */ DW_CFA_offset_extended_sf = 0x11, DW_CFA_def_cfa_sf = 0x12, DW_CFA_def_cfa_offset_sf = 0x13, @@ -662,7 +670,7 @@ enum dwarf_source_language DW_LANG_Pascal83 = 0x0009, DW_LANG_Modula2 = 0x000a, DW_LANG_Java = 0x000b, - /* DWARF 2.1. */ + /* DWARF 3. */ DW_LANG_C99 = 0x000c, DW_LANG_Ada95 = 0x000d, DW_LANG_Fortran95 = 0x000e, diff --git a/include/elf/external.h b/include/elf/external.h index 38e6596de..403ee622b 100644 --- a/include/elf/external.h +++ b/include/elf/external.h @@ -143,6 +143,10 @@ typedef struct { unsigned char st_size[8]; /* Associated symbol size */ } Elf64_External_Sym; +typedef struct { + unsigned char est_shndx[4]; /* Section index */ +} Elf_External_Sym_Shndx; + /* Note segments */ typedef struct { diff --git a/include/elf/h8.h b/include/elf/h8.h new file mode 100644 index 000000000..ac9db566a --- /dev/null +++ b/include/elf/h8.h @@ -0,0 +1,96 @@ +/* H8300/h8500 ELF support for BFD. + Copyright 2001 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _ELF_H8_H +#define _ELF_H8_H + +#include "elf/reloc-macros.h" + +/* Relocations. */ +/* Relocations 59..63 are GNU extensions. */ +START_RELOC_NUMBERS (elf_h8_reloc_type) + RELOC_NUMBER (R_H8_NONE, 0) + RELOC_NUMBER (R_H8_DIR32, 1) + RELOC_NUMBER (R_H8_DIR32_28, 2) + RELOC_NUMBER (R_H8_DIR32_24, 3) + RELOC_NUMBER (R_H8_DIR32_16, 4) + RELOC_NUMBER (R_H8_DIR32U, 6) + RELOC_NUMBER (R_H8_DIR32U_28, 7) + RELOC_NUMBER (R_H8_DIR32U_24, 8) + RELOC_NUMBER (R_H8_DIR32U_20, 9) + RELOC_NUMBER (R_H8_DIR32U_16, 10) + RELOC_NUMBER (R_H8_DIR24, 11) + RELOC_NUMBER (R_H8_DIR24_20, 12) + RELOC_NUMBER (R_H8_DIR24_16, 13) + RELOC_NUMBER (R_H8_DIR24U, 14) + RELOC_NUMBER (R_H8_DIR24U_20, 15) + RELOC_NUMBER (R_H8_DIR24U_16, 16) + RELOC_NUMBER (R_H8_DIR16, 17) + RELOC_NUMBER (R_H8_DIR16U, 18) + RELOC_NUMBER (R_H8_DIR16S_32, 19) + RELOC_NUMBER (R_H8_DIR16S_28, 20) + RELOC_NUMBER (R_H8_DIR16S_24, 21) + RELOC_NUMBER (R_H8_DIR16S_20, 22) + RELOC_NUMBER (R_H8_DIR16S, 23) + RELOC_NUMBER (R_H8_DIR8, 24) + RELOC_NUMBER (R_H8_DIR8U, 25) + RELOC_NUMBER (R_H8_DIR8Z_32, 26) + RELOC_NUMBER (R_H8_DIR8Z_28, 27) + RELOC_NUMBER (R_H8_DIR8Z_24, 28) + RELOC_NUMBER (R_H8_DIR8Z_20, 29) + RELOC_NUMBER (R_H8_DIR8Z_16, 30) + RELOC_NUMBER (R_H8_PCREL16, 31) + RELOC_NUMBER (R_H8_PCREL8, 32) + RELOC_NUMBER (R_H8_BPOS, 33) + FAKE_RELOC (R_H8_FIRST_INVALID_DIR_RELOC, 34) + FAKE_RELOC (R_H8_LAST_INVALID_DIR_RELOC, 58) + RELOC_NUMBER (R_H8_DIR16A8, 59) + RELOC_NUMBER (R_H8_DIR16R8, 60) + RELOC_NUMBER (R_H8_DIR24A8, 61) + RELOC_NUMBER (R_H8_DIR24R8, 62) + RELOC_NUMBER (R_H8_DIR32A16, 63) + RELOC_NUMBER (R_H8_ABS32, 65) + RELOC_NUMBER (R_H8_ABS32A16, 127) + RELOC_NUMBER (R_H8_SYM, 128) + RELOC_NUMBER (R_H8_OPneg, 129) + RELOC_NUMBER (R_H8_OPadd, 130) + RELOC_NUMBER (R_H8_OPsub, 131) + RELOC_NUMBER (R_H8_OPmul, 132) + RELOC_NUMBER (R_H8_OPdiv, 133) + RELOC_NUMBER (R_H8_OPshla, 134) + RELOC_NUMBER (R_H8_OPshra, 135) + RELOC_NUMBER (R_H8_OPsctsize, 136) + RELOC_NUMBER (R_H8_OPhword, 137) + RELOC_NUMBER (R_H8_OPlword, 138) + RELOC_NUMBER (R_H8_OPhigh, 139) + RELOC_NUMBER (R_H8_OPlow, 140) + RELOC_NUMBER (R_H8_OPscttop, 141) +END_RELOC_NUMBERS (R_H8_max) + +/* Machine variant if we know it. This field was invented at Cygnus, + but it is hoped that other vendors will adopt it. If some standard + is developed, this code should be changed to follow it. */ + +#define EF_H8_MACH 0x00FF0000 + +#define E_H8_MACH_H8300 0x00800000 +#define E_H8_MACH_H8300H 0x00810000 +#define E_H8_MACH_H8300S 0x00820000 + +#endif diff --git a/include/elf/ia64.h b/include/elf/ia64.h index edfc7c5b5..5e632ed01 100644 --- a/include/elf/ia64.h +++ b/include/elf/ia64.h @@ -49,6 +49,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ELF_STRING_ia64_unwind_info ".IA_64.unwind_info" #define ELF_STRING_ia64_unwind_once ".gnu.linkonce.ia64unw." #define ELF_STRING_ia64_unwind_info_once ".gnu.linkonce.ia64unwi." +/* .IA_64.unwind_hdr is only used by HP-UX. */ +#define ELF_STRING_ia64_unwind_hdr ".IA_64.unwind_hdr" /* Bits in the sh_flags field of Elf64_Shdr: */ @@ -60,6 +62,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ #define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ +/* SHT_IA_64_HP_OPT_ANOT is only generated by HPUX compilers for its + optimization annotation section. GCC does not generate it but we + want readelf to know what they are. Do not use two capital Ns in + annotate or sed will turn it into 32 or 64 during the build. */ +#define SHT_IA_64_HP_OPT_ANOT 0x60000004 + /* Bits in the p_flags field of Elf64_Phdr: */ #define PF_IA_64_NORECOV 0x80000000 @@ -69,10 +77,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ #define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ +/* HP-UX specific values for p_type in Elf64_Phdr. + These values are currently just used to make + readelf more usable on HP-UX. */ + +#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) +#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) +#define PT_IA_64_HP_STACK (PT_LOOS + 0x14) + /* Possible values for d_tag in Elf64_Dyn: */ #define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) +/* This section only used by HP-UX, The HP linker gives weak symbols + precedence over regular common symbols. We want common to override + weak. Using this common instead of SHN_COMMON does that. */ + +#define SHN_IA_64_ANSI_COMMON 0xFF00 + /* ia64-specific relocation types: */ /* Relocs apply to specific instructions within a bundle. The least diff --git a/include/elf/internal.h b/include/elf/internal.h index eb79917f1..5d39d3ae7 100644 --- a/include/elf/internal.h +++ b/include/elf/internal.h @@ -1,5 +1,5 @@ /* ELF support for BFD. - Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000 + Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published @@ -42,20 +42,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define EI_NIDENT 16 /* Size of e_ident[] */ typedef struct elf_internal_ehdr { - unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */ - bfd_vma e_entry; /* Entry point virtual address */ - bfd_size_type e_phoff; /* Program header table file offset */ - bfd_size_type e_shoff; /* Section header table file offset */ - unsigned long e_version; /* Identifies object file version */ - unsigned long e_flags; /* Processor-specific flags */ - unsigned short e_type; /* Identifies object file type */ - unsigned short e_machine; /* Specifies required architecture */ - unsigned short e_ehsize; /* ELF header size in bytes */ - unsigned short e_phentsize; /* Program header table entry size */ - unsigned short e_phnum; /* Program header table entry count */ - unsigned short e_shentsize; /* Section header table entry size */ - unsigned short e_shnum; /* Section header table entry count */ - unsigned short e_shstrndx; /* Section header string table index */ + unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */ + bfd_vma e_entry; /* Entry point virtual address */ + bfd_size_type e_phoff; /* Program header table file offset */ + bfd_size_type e_shoff; /* Section header table file offset */ + unsigned long e_version; /* Identifies object file version */ + unsigned long e_flags; /* Processor-specific flags */ + unsigned short e_type; /* Identifies object file type */ + unsigned short e_machine; /* Specifies required architecture */ + unsigned int e_ehsize; /* ELF header size in bytes */ + unsigned int e_phentsize; /* Program header table entry size */ + unsigned int e_phnum; /* Program header table entry count */ + unsigned int e_shentsize; /* Section header table entry size */ + unsigned int e_shnum; /* Section header table entry count */ + unsigned int e_shstrndx; /* Section header string table index */ } Elf_Internal_Ehdr; #define elf32_internal_ehdr elf_internal_ehdr @@ -98,7 +98,7 @@ typedef struct elf_internal_shdr { /* The internal rep also has some cached info associated with it. */ asection * bfd_section; /* Associated BFD section. */ - PTR contents; /* Section contents. */ + unsigned char *contents; /* Section contents. */ } Elf_Internal_Shdr; #define elf32_internal_shdr elf_internal_shdr @@ -114,7 +114,7 @@ struct elf_internal_sym { unsigned long st_name; /* Symbol name, index in string tbl */ unsigned char st_info; /* Type and binding attributes */ unsigned char st_other; /* Visibilty, and target specific */ - unsigned short st_shndx; /* Associated section index */ + unsigned int st_shndx; /* Associated section index */ }; typedef struct elf_internal_sym Elf_Internal_Sym; @@ -153,7 +153,7 @@ typedef struct elf_internal_rel { typedef struct elf_internal_rela { bfd_vma r_offset; /* Location at which to apply the action */ bfd_vma r_info; /* Index and Type of relocation */ - bfd_signed_vma r_addend; /* Constant addend used to compute value */ + bfd_vma r_addend; /* Constant addend used to compute value */ } Elf_Internal_Rela; #define elf32_internal_rela elf_internal_rela diff --git a/include/elf/mips.h b/include/elf/mips.h index 6ad8d5b96..3b6fe99ec 100644 --- a/include/elf/mips.h +++ b/include/elf/mips.h @@ -172,12 +172,10 @@ END_RELOC_NUMBERS (R_MIPS_maxext) the rest are open. */ #define E_MIPS_MACH_3900 0x00810000 - #define E_MIPS_MACH_4010 0x00820000 #define E_MIPS_MACH_4100 0x00830000 #define E_MIPS_MACH_4650 0x00850000 #define E_MIPS_MACH_4111 0x00880000 -#define E_MIPS_MACH_MIPS32_4K 0x00890000 #define E_MIPS_MACH_SB1 0x008a0000 /* Processor specific section indices. These sections do not actually diff --git a/include/elf/mmix.h b/include/elf/mmix.h new file mode 100644 index 000000000..e3be26b0f --- /dev/null +++ b/include/elf/mmix.h @@ -0,0 +1,168 @@ +/* MMIX support for BFD. + Copyright (C) 2001, 2002 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* This file holds definitions specific to the MMIX ELF ABI. */ +#ifndef ELF_MMIX_H +#define ELF_MMIX_H + +#include "elf/reloc-macros.h" + +/* Relocations. */ +START_RELOC_NUMBERS (elf_mmix_reloc_type) + RELOC_NUMBER (R_MMIX_NONE, 0) + + /* Standard absolute relocations. */ + RELOC_NUMBER (R_MMIX_8, 1) + RELOC_NUMBER (R_MMIX_16, 2) + RELOC_NUMBER (R_MMIX_24, 3) + RELOC_NUMBER (R_MMIX_32, 4) + RELOC_NUMBER (R_MMIX_64, 5) + + /* Standard relative relocations. */ + RELOC_NUMBER (R_MMIX_PC_8, 6) + RELOC_NUMBER (R_MMIX_PC_16, 7) + RELOC_NUMBER (R_MMIX_PC_24, 8) + RELOC_NUMBER (R_MMIX_PC_32, 9) + RELOC_NUMBER (R_MMIX_PC_64, 10) + + /* GNU extensions for C++ vtables. */ + RELOC_NUMBER (R_MMIX_GNU_VTINHERIT, 11) + RELOC_NUMBER (R_MMIX_GNU_VTENTRY, 12) + + /* A GETA instruction. */ + RELOC_NUMBER (R_MMIX_GETA, 13) + RELOC_NUMBER (R_MMIX_GETA_1, 14) + RELOC_NUMBER (R_MMIX_GETA_2, 15) + RELOC_NUMBER (R_MMIX_GETA_3, 16) + + /* A conditional branch instruction. */ + RELOC_NUMBER (R_MMIX_CBRANCH, 17) + RELOC_NUMBER (R_MMIX_CBRANCH_J, 18) + RELOC_NUMBER (R_MMIX_CBRANCH_1, 19) + RELOC_NUMBER (R_MMIX_CBRANCH_2, 20) + RELOC_NUMBER (R_MMIX_CBRANCH_3, 21) + + /* A PUSHJ instruction. */ + RELOC_NUMBER (R_MMIX_PUSHJ, 22) + RELOC_NUMBER (R_MMIX_PUSHJ_1, 23) + RELOC_NUMBER (R_MMIX_PUSHJ_2, 24) + RELOC_NUMBER (R_MMIX_PUSHJ_3, 25) + + /* A JMP instruction. */ + RELOC_NUMBER (R_MMIX_JMP, 26) + RELOC_NUMBER (R_MMIX_JMP_1, 27) + RELOC_NUMBER (R_MMIX_JMP_2, 28) + RELOC_NUMBER (R_MMIX_JMP_3, 29) + + /* A relative address such as in a GETA or a branch. */ + RELOC_NUMBER (R_MMIX_ADDR19, 30) + + /* A relative address such as in a JMP (only). */ + RELOC_NUMBER (R_MMIX_ADDR27, 31) + + /* A general register or a number 0..255. */ + RELOC_NUMBER (R_MMIX_REG_OR_BYTE, 32) + + /* A general register. */ + RELOC_NUMBER (R_MMIX_REG, 33) + + /* A global register and an offset, the global register (allocated at + link time) contents plus the offset made equivalent to the relocation + expression at link time. The relocation must point at the Y field of + an instruction. */ + RELOC_NUMBER (R_MMIX_BASE_PLUS_OFFSET, 34) + + /* A LOCAL assertion. */ + RELOC_NUMBER (R_MMIX_LOCAL, 35) +END_RELOC_NUMBERS (R_MMIX_max) + + +/* Section Attributes. */ +/* A section containing necessary information for relaxation. */ +#define SHF_MMIX_CANRELAX 0x80000000 + +/* Symbol attributes. */ +/* A symbol with this section-index is a register. */ +#define SHN_REGISTER SHN_LOPROC + +/* This section holds contents for each initialized register, at VMA + regno*8. A symbol relative to this section will be transformed to an + absolute symbol with the value corresponding to the register number at + final link time. A symbol with a value outside the inclusive range + 32*8 .. 254*8 is an error. It is highly recommended to only use an + upper bound of 253*8 or lower as specified in the (currently + unspecified) ABI. */ +#define MMIX_REG_CONTENTS_SECTION_NAME ".MMIX.reg_contents" + +/* At link time, a section by this name is created, expected to be + included in MMIX_REG_CONTENTS_SECTION_NAME in the output. */ +#define MMIX_LD_ALLOCATED_REG_CONTENTS_SECTION_NAME \ + ".MMIX.reg_contents.linker_allocated" + +/* This is a faked section holding symbols with SHN_REGISTER. Don't + confuse it with MMIX_REG_CONTENTS_SECTION_NAME; this one has no + contents, just values. It is an error for a value in this section to + be outside the range 32..255 and it must never become an actual section + in an object file. */ +#define MMIX_REG_SECTION_NAME "*REG*" + +/* Appended with a number N=0..65535, this is a representation of the + mmixal "BSPEC N" ... "ESPEC" directive pair; the contents go into an + ELF section by name ".MMIX.spec_data.N". */ +#define MMIX_OTHER_SPEC_SECTION_PREFIX ".MMIX.spec_data." + +/* A section SECNAME is noted to start at "__.MMIX.start.SECNAME" by the + presence of this symbol. Currently only implemented for ".text" + through the symbol "__.MMIX.start..text". */ +#define MMIX_LOC_SECTION_START_SYMBOL_PREFIX "__.MMIX.start." + +/* This symbol is always a function. */ +#define MMIX_START_SYMBOL_NAME "Main" + + +/* We smuggle in a few MMO specifics here. We don't make a specific MMO + file, since we can't reasonably support MMO without ELF; we have to + include this file anyway. */ + +#define MMO_TEXT_SECTION_NAME ".text" +#define MMO_DATA_SECTION_NAME ".data" + +/* A definition for the flags we put in spec data in files. A copy of our + own of some flags to keep immune to BFD flag changes. See section.c of + 2001-07-18 for flag documentation. */ +#define MMO_SEC_ALLOC 0x001 +#define MMO_SEC_LOAD 0x002 +#define MMO_SEC_RELOC 0x004 +#define MMO_SEC_READONLY 0x010 +#define MMO_SEC_CODE 0x020 +#define MMO_SEC_DATA 0x040 +#define MMO_SEC_NEVER_LOAD 0x400 +#define MMO_SEC_IS_COMMON 0x8000 +#define MMO_SEC_DEBUGGING 0x10000 + +#ifdef BFD_ARCH_SIZE +extern boolean _bfd_mmix_prepare_linker_allocated_gregs + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_mmix_finalize_linker_allocated_gregs + PARAMS ((bfd *, struct bfd_link_info *)); +extern boolean _bfd_mmix_check_all_relocs + PARAMS ((bfd *, struct bfd_link_info *)); +#endif + +#endif /* ELF_MMIX_H */ diff --git a/include/elf/or32.h b/include/elf/or32.h new file mode 100644 index 000000000..14884f330 --- /dev/null +++ b/include/elf/or32.h @@ -0,0 +1,62 @@ +/* OR1K ELF support for BFD. Derived from ppc.h. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Ivan Guzvinec <ivang@opencores.org> + + 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _ELF_OR1K_H +#define _ELF_OR1K_H + +#include "elf/reloc-macros.h" + +/* Relocations. */ +START_RELOC_NUMBERS (elf_or32_reloc_type) + RELOC_NUMBER (R_OR32_NONE, 0) + RELOC_NUMBER (R_OR32_32, 1) + RELOC_NUMBER (R_OR32_16, 2) + RELOC_NUMBER (R_OR32_8, 3) + RELOC_NUMBER (R_OR32_CONST, 4) + RELOC_NUMBER (R_OR32_CONSTH, 5) + RELOC_NUMBER (R_OR32_JUMPTARG, 6) + RELOC_NUMBER (R_OR32_GNU_VTENTRY, 7) + RELOC_NUMBER (R_OR32_GNU_VTINHERIT, 8) +END_RELOC_NUMBERS (R_OR32_max) + +/* Four bit OR32 machine type field. */ +#define EF_OR32_MACH 0x0000000f + +/* Various CPU types. */ +#define E_OR32_MACH_BASE 0x00000000 +#define E_OR32_MACH_UNUSED1 0x00000001 +#define E_OR32_MACH_UNUSED2 0x00000002 +#define E_OR32_MACH_UNUSED4 0x00000003 + +/* Processor specific section headers, sh_type field */ +#define SHT_ORDERED SHT_HIPROC /* Link editor is to sort the \ + entries in this section \ + based on the address \ + specified in the associated \ + symbol table entry. */ + +/* Processor specific section flags, sh_flags field */ +#define SHF_EXCLUDE 0x80000000 /* Link editor is to exclude \ + this section from executable \ + and shared objects that it \ + builds when those objects \ + are not to be furhter \ + relocated. */ +#endif /* _ELF_OR1K_H */ diff --git a/include/elf/ppc.h b/include/elf/ppc.h index 426961e09..8e4af62fb 100644 --- a/include/elf/ppc.h +++ b/include/elf/ppc.h @@ -1,5 +1,5 @@ /* PPC ELF support for BFD. - Copyright 1995, 1996, 1998, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc. By Michael Meissner, Cygnus Support, <meissner@cygnus.com>, from information in the System V Application Binary Interface, PowerPC Processor Supplement @@ -68,6 +68,40 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) RELOC_NUMBER (R_PPC_SECTOFF_LO, 34) RELOC_NUMBER (R_PPC_SECTOFF_HI, 35) RELOC_NUMBER (R_PPC_SECTOFF_HA, 36) + RELOC_NUMBER (R_PPC_ADDR30, 37) + +/* The following relocs are from the 64-bit PowerPC ELF ABI. */ + RELOC_NUMBER (R_PPC64_ADDR64, 38) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHER, 39) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHERA, 40) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHEST, 41) + RELOC_NUMBER (R_PPC64_ADDR16_HIGHESTA, 42) + RELOC_NUMBER (R_PPC64_UADDR64, 43) + RELOC_NUMBER (R_PPC64_REL64, 44) + RELOC_NUMBER (R_PPC64_PLT64, 45) + RELOC_NUMBER (R_PPC64_PLTREL64, 46) + RELOC_NUMBER (R_PPC64_TOC16, 47) + RELOC_NUMBER (R_PPC64_TOC16_LO, 48) + RELOC_NUMBER (R_PPC64_TOC16_HI, 49) + RELOC_NUMBER (R_PPC64_TOC16_HA, 50) + RELOC_NUMBER (R_PPC64_TOC, 51) + RELOC_NUMBER (R_PPC64_PLTGOT16, 52) + RELOC_NUMBER (R_PPC64_PLTGOT16_LO, 53) + RELOC_NUMBER (R_PPC64_PLTGOT16_HI, 54) + RELOC_NUMBER (R_PPC64_PLTGOT16_HA, 55) + +/* The following relocs were added in the 64-bit PowerPC ELF ABI revision 1.2. */ + RELOC_NUMBER (R_PPC64_ADDR16_DS, 56) + RELOC_NUMBER (R_PPC64_ADDR16_LO_DS, 57) + RELOC_NUMBER (R_PPC64_GOT16_DS, 58) + RELOC_NUMBER (R_PPC64_GOT16_LO_DS, 59) + RELOC_NUMBER (R_PPC64_PLT16_LO_DS, 60) + RELOC_NUMBER (R_PPC64_SECTOFF_DS, 61) + RELOC_NUMBER (R_PPC64_SECTOFF_LO_DS, 62) + RELOC_NUMBER (R_PPC64_TOC16_DS, 63) + RELOC_NUMBER (R_PPC64_TOC16_LO_DS, 64) + RELOC_NUMBER (R_PPC64_PLTGOT16_DS, 65) + RELOC_NUMBER (R_PPC64_PLTGOT16_LO_DS, 66) /* The remaining relocs are from the Embedded ELF ABI, and are not in the SVR4 ELF ABI. */ @@ -98,6 +132,47 @@ START_RELOC_NUMBERS (elf_ppc_reloc_type) END_RELOC_NUMBERS (R_PPC_max) +/* Aliases for R_PPC64-relocs. */ +#define R_PPC64_NONE R_PPC_NONE +#define R_PPC64_ADDR32 R_PPC_ADDR32 +#define R_PPC64_ADDR24 R_PPC_ADDR24 +#define R_PPC64_ADDR16 R_PPC_ADDR16 +#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO +#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI +#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA +#define R_PPC64_ADDR14 R_PPC_ADDR14 +#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN +#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN +#define R_PPC64_REL24 R_PPC_REL24 +#define R_PPC64_REL14 R_PPC_REL14 +#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN +#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN +#define R_PPC64_GOT16 R_PPC_GOT16 +#define R_PPC64_GOT16_LO R_PPC_GOT16_LO +#define R_PPC64_GOT16_HI R_PPC_GOT16_HI +#define R_PPC64_GOT16_HA R_PPC_GOT16_HA +#define R_PPC64_COPY R_PPC_COPY +#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT +#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT +#define R_PPC64_RELATIVE R_PPC_RELATIVE +#define R_PPC64_UADDR32 R_PPC_UADDR32 +#define R_PPC64_UADDR16 R_PPC_UADDR16 +#define R_PPC64_REL32 R_PPC_REL32 +#define R_PPC64_PLT32 R_PPC_PLT32 +#define R_PPC64_PLTREL32 R_PPC_PLTREL32 +#define R_PPC64_PLT16_LO R_PPC_PLT16_LO +#define R_PPC64_PLT16_HI R_PPC_PLT16_HI +#define R_PPC64_PLT16_HA R_PPC_PLT16_HA +#define R_PPC64_SECTOFF R_PPC_SECTOFF +#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO +#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI +#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA +#define R_PPC64_ADDR30 R_PPC_ADDR30 +#define R_PPC64_GNU_VTINHERIT R_PPC_GNU_VTINHERIT +#define R_PPC64_GNU_VTENTRY R_PPC_GNU_VTENTRY + +/* Specify the start of the .glink section. */ +#define DT_PPC64_GLINK DT_LOPROC /* Processor specific flags for the ELF header e_flags field. */ diff --git a/include/elf/sh.h b/include/elf/sh.h index 700ca3ec9..1480f490b 100644 --- a/include/elf/sh.h +++ b/include/elf/sh.h @@ -1,5 +1,5 @@ /* SH ELF support for BFD. - Copyright 1998, 2000 Free Software Foundation, Inc. + Copyright 1998, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -34,6 +34,9 @@ #define EF_SH3E 8 #define EF_SH4 9 +/* This one can only mix in objects from other EF_SH5 objects. */ +#define EF_SH5 10 + #define EF_SH_MERGE_MACH(mach1, mach2) \ (((((mach1) == EF_SH3 || (mach1) == EF_SH_UNKNOWN) && (mach2) == EF_SH_DSP) \ || ((mach1) == EF_SH_DSP \ @@ -47,6 +50,77 @@ ? EF_SH4 \ : ((mach1) > (mach2) ? (mach1) : (mach2))) +/* Flags for the st_other symbol field. + Keep away from the STV_ visibility flags (bit 0..1). */ + +/* A reference to this symbol should by default add 1. */ +#define STO_SH5_ISA32 (1 << 2) + +/* Section contains only SHmedia code (no SHcompact code). */ +#define SHF_SH5_ISA32 0x40000000 + +/* Section contains both SHmedia and SHcompact code, and possibly also + constants. */ +#define SHF_SH5_ISA32_MIXED 0x20000000 + +/* If applied to a .cranges section, marks that the section is sorted by + increasing cr_addr values. */ +#define SHT_SH5_CR_SORTED 0x80000001 + +/* Symbol should be handled as DataLabel (attached to global SHN_UNDEF + symbols). */ +#define STT_DATALABEL STT_LOPROC + +#define SH64_CRANGES_SECTION_NAME ".cranges" +enum sh64_elf_cr_type { + CRT_NONE = 0, + CRT_DATA = 1, + CRT_SH5_ISA16 = 2, + CRT_SH5_ISA32 = 3 +}; + +/* The official definition is this: + + typedef struct { + Elf32_Addr cr_addr; + Elf32_Word cr_size; + Elf32_Half cr_type; + } Elf32_CRange; + + but we have no use for that exact type. Instead we use this struct for + the internal representation. */ +typedef struct { + bfd_vma cr_addr; + bfd_size_type cr_size; + enum sh64_elf_cr_type cr_type; +} sh64_elf_crange; + +#define SH64_CRANGE_SIZE (4 + 4 + 2) +#define SH64_CRANGE_CR_ADDR_OFFSET 0 +#define SH64_CRANGE_CR_SIZE_OFFSET 4 +#define SH64_CRANGE_CR_TYPE_OFFSET (4 + 4) + +/* Get the contents type of an arbitrary address, or return CRT_NONE. */ +extern enum sh64_elf_cr_type sh64_get_contents_type + PARAMS ((asection *, bfd_vma, sh64_elf_crange *)); + +/* Simpler interface. + FIXME: This seems redundant now that we export the interface above. */ +extern boolean sh64_address_is_shmedia PARAMS ((asection *, bfd_vma)); + +/* We put this in elf_section_data (section)->tdata. */ +struct sh64_section_data +{ + flagword contents_flags; + + /* Only used in the cranges section, but we don't have an official + backend-specific bfd field. */ + bfd_size_type cranges_growth; +}; + +#define sh64_elf_section_data(sec) \ + ((struct sh64_section_data *) ((elf_section_data (sec))->tdata)) + #include "elf/reloc-macros.h" /* Relocations. */ @@ -79,7 +153,16 @@ START_RELOC_NUMBERS (elf_sh_reloc_type) RELOC_NUMBER (R_SH_LOOP_START, 36) RELOC_NUMBER (R_SH_LOOP_END, 37) FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_2, 38) - FAKE_RELOC (R_SH_LAST_INVALID_RELOC_2, 159) + FAKE_RELOC (R_SH_LAST_INVALID_RELOC_2, 44) + RELOC_NUMBER (R_SH_DIR5U, 45) + RELOC_NUMBER (R_SH_DIR6U, 46) + RELOC_NUMBER (R_SH_DIR6S, 47) + RELOC_NUMBER (R_SH_DIR10S, 48) + RELOC_NUMBER (R_SH_DIR10SW, 49) + RELOC_NUMBER (R_SH_DIR10SL, 50) + RELOC_NUMBER (R_SH_DIR10SQ, 51) + FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_3, 52) + FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 159) RELOC_NUMBER (R_SH_GOT32, 160) RELOC_NUMBER (R_SH_PLT32, 161) RELOC_NUMBER (R_SH_COPY, 162) @@ -88,6 +171,51 @@ START_RELOC_NUMBERS (elf_sh_reloc_type) RELOC_NUMBER (R_SH_RELATIVE, 165) RELOC_NUMBER (R_SH_GOTOFF, 166) RELOC_NUMBER (R_SH_GOTPC, 167) + RELOC_NUMBER (R_SH_GOTPLT32, 168) + RELOC_NUMBER (R_SH_GOT_LOW16, 169) + RELOC_NUMBER (R_SH_GOT_MEDLOW16, 170) + RELOC_NUMBER (R_SH_GOT_MEDHI16, 171) + RELOC_NUMBER (R_SH_GOT_HI16, 172) + RELOC_NUMBER (R_SH_GOTPLT_LOW16, 173) + RELOC_NUMBER (R_SH_GOTPLT_MEDLOW16, 174) + RELOC_NUMBER (R_SH_GOTPLT_MEDHI16, 175) + RELOC_NUMBER (R_SH_GOTPLT_HI16, 176) + RELOC_NUMBER (R_SH_PLT_LOW16, 177) + RELOC_NUMBER (R_SH_PLT_MEDLOW16, 178) + RELOC_NUMBER (R_SH_PLT_MEDHI16, 179) + RELOC_NUMBER (R_SH_PLT_HI16, 180) + RELOC_NUMBER (R_SH_GOTOFF_LOW16, 181) + RELOC_NUMBER (R_SH_GOTOFF_MEDLOW16, 182) + RELOC_NUMBER (R_SH_GOTOFF_MEDHI16, 183) + RELOC_NUMBER (R_SH_GOTOFF_HI16, 184) + RELOC_NUMBER (R_SH_GOTPC_LOW16, 185) + RELOC_NUMBER (R_SH_GOTPC_MEDLOW16, 186) + RELOC_NUMBER (R_SH_GOTPC_MEDHI16, 187) + RELOC_NUMBER (R_SH_GOTPC_HI16, 188) + RELOC_NUMBER (R_SH_GOT10BY4, 189) + RELOC_NUMBER (R_SH_GOTPLT10BY4, 190) + RELOC_NUMBER (R_SH_GOT10BY8, 191) + RELOC_NUMBER (R_SH_GOTPLT10BY8, 192) + RELOC_NUMBER (R_SH_COPY64, 193) + RELOC_NUMBER (R_SH_GLOB_DAT64, 194) + RELOC_NUMBER (R_SH_JMP_SLOT64, 195) + RELOC_NUMBER (R_SH_RELATIVE64, 196) + FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 197) + FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 241) + RELOC_NUMBER (R_SH_SHMEDIA_CODE, 242) + RELOC_NUMBER (R_SH_PT_16, 243) + RELOC_NUMBER (R_SH_IMMS16, 244) + RELOC_NUMBER (R_SH_IMMU16, 245) + RELOC_NUMBER (R_SH_IMM_LOW16, 246) + RELOC_NUMBER (R_SH_IMM_LOW16_PCREL, 247) + RELOC_NUMBER (R_SH_IMM_MEDLOW16, 248) + RELOC_NUMBER (R_SH_IMM_MEDLOW16_PCREL, 249) + RELOC_NUMBER (R_SH_IMM_MEDHI16, 250) + RELOC_NUMBER (R_SH_IMM_MEDHI16_PCREL, 251) + RELOC_NUMBER (R_SH_IMM_HI16, 252) + RELOC_NUMBER (R_SH_IMM_HI16_PCREL, 253) + RELOC_NUMBER (R_SH_64, 254) + RELOC_NUMBER (R_SH_64_PCREL, 255) END_RELOC_NUMBERS (R_SH_max) #endif diff --git a/include/elf/xstormy16.h b/include/elf/xstormy16.h new file mode 100644 index 000000000..ee6c551a0 --- /dev/null +++ b/include/elf/xstormy16.h @@ -0,0 +1,53 @@ +/* XSTORMY16 ELF support for BFD. + Copyright (C) 2001 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 2 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., +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _ELF_XSTORMY16_H +#define _ELF_XSTORMY16_H + +#include "elf/reloc-macros.h" + +/* Relocations. */ +START_RELOC_NUMBERS (elf_xstormy16_reloc_type) + RELOC_NUMBER (R_XSTORMY16_NONE, 0) + + RELOC_NUMBER (R_XSTORMY16_32, 1) + RELOC_NUMBER (R_XSTORMY16_16, 2) + RELOC_NUMBER (R_XSTORMY16_8, 3) + RELOC_NUMBER (R_XSTORMY16_PC32, 4) + RELOC_NUMBER (R_XSTORMY16_PC16, 5) + RELOC_NUMBER (R_XSTORMY16_PC8, 6) + + RELOC_NUMBER (R_XSTORMY16_REL_12, 7) + RELOC_NUMBER (R_XSTORMY16_24, 8) + RELOC_NUMBER (R_XSTORMY16_FPTR16, 9) + + RELOC_NUMBER (R_XSTORMY16_GNU_VTINHERIT, 128) + RELOC_NUMBER (R_XSTORMY16_GNU_VTENTRY, 129) +END_RELOC_NUMBERS (R_XSTORMY16_max) + +/* Define the data & instruction memory discriminator. In a linked + executable, an symbol should be deemed to point to an instruction + if ((address & XSTORMY16_INSN_MASK) == XSTORMY16_INSN_VALUE), and similarly + for the data space. See also `ld/emulparams/elf32xstormy16.sh'. */ +#define XSTORMY16_DATA_MASK 0xffc00000 +#define XSTORMY16_DATA_VALUE 0x00000000 +#define XSTORMY16_INSN_MASK 0xffc00000 +#define XSTORMY16_INSN_VALUE 0x00400000 + +#endif /* _ELF_XSTORMY16_H */ |