From 670387a18a22cf299c750186efe8ca24cebb7e05 Mon Sep 17 00:00:00 2001 From: obrien Date: Fri, 22 Feb 2002 04:18:42 +0000 Subject: Import of Binutils from the FSF 2.12 branch (pre-.0 release). These bits are taken from the FSF anoncvs repo on 21-Feburary-2002 20:15 PST. --- contrib/binutils/include/elf/ChangeLog | 103 +++++++++++++++++++++++-- contrib/binutils/include/elf/alpha.h | 5 ++ contrib/binutils/include/elf/common.h | 3 + contrib/binutils/include/elf/dwarf2.h | 50 +++++++------ contrib/binutils/include/elf/m68k.h | 1 + contrib/binutils/include/elf/mmix.h | 21 +++++- contrib/binutils/include/elf/or32.h | 62 ++++++++++++++++ contrib/binutils/include/elf/ppc.h | 4 + contrib/binutils/include/elf/sh.h | 132 ++++++++++++++++++++++++++++++++- 9 files changed, 349 insertions(+), 32 deletions(-) create mode 100644 contrib/binutils/include/elf/or32.h (limited to 'contrib/binutils/include/elf') diff --git a/contrib/binutils/include/elf/ChangeLog b/contrib/binutils/include/elf/ChangeLog index a0b4f71..e70f7fd 100644 --- a/contrib/binutils/include/elf/ChangeLog +++ b/contrib/binutils/include/elf/ChangeLog @@ -1,7 +1,91 @@ +2002-02-13 Matt Fredette + + * m68k.h (EF_M68000): Define. + +2002-02-12 Alan Modra + + * ppc.h (DT_PPC64_OPD, DT_PPC64_OPDSZ): Define. + +2002-02-09 Richard Henderson + + * alpha.h (R_ALPHA_BRSGP): New. + +2002-02-08 Alexandre Oliva + + Contribute sh64-elf. + 2002-01-23 Alexandre Oliva + * 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 + * 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 + * sh.h (sh64_get_contents_type): Declare. + (sh64_address_is_shmedia): Likewise. + 2000-12-30 Hans-Peter Nilsson + * 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 + * 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 + * sh.h (EF_SH64): Don't define EF_SH64_ABI64. + 2000-11-27 Hans-Peter Nilsson + * sh.h (EF_SH64_32BIT_ABI, EF_SH64_64BIT_ABI): Delete. + (EF_SH64_ABI64): New. + 2000-11-23 Hans-Peter Nilsson + * 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 + * sh.h (EF_SH5): Define. + +2002-02-01 Hans-Peter Nilsson + + * 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 + + * or32.h: New file. + * common.h: Add support for or32 targets. + +2002-01-28 Jason Merrill + + * dwarf2.h: Sync with gcc version. + 2002-01-16 Alan Modra * ppc.h (DT_PPC64_GLINK): Define. +2002-01-15 Richard Earnshaw + + * arm.h (F_VFP_FLOAT, EF_ARM_VFP_FLOAT): Define. + 2002-01-09 Jason Thorpe * common.h: Update copyright years. @@ -24,6 +108,10 @@ unsigned int. * common.h (SHN_BAD): Define. +2001-12-13 Jakub Jelinek + + * elf/common.h (PT_GNU_EH_FRAME): Define. + 2001-12-11 Alan Modra * common.h (SHN_XINDEX): Comment typo fix. @@ -90,7 +178,7 @@ (E_H8_MACH_H8300, E_H8_MACH_H8300H, E_H8_MACH_H8300S): New machine types. -Tue Aug 26 23:32:34 2001 J"orn Rennecke +2001-08-26 J"orn Rennecke * h8.h: New file. @@ -118,6 +206,11 @@ Tue Aug 26 23:32:34 2001 J"orn Rennecke * 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 + + * ia64.h (ELF_STRING_ia64_unwind_once): Define. + (ELF_STRING_ia64_unwind_info_once): Define. + 2001-05-07 Thiemo Seufer * external.h: Fix typo. @@ -390,8 +483,8 @@ Tue Aug 26 23:32:34 2001 J"orn Rennecke (ELFOSABI_MODESTO): Defined. (ELFOSABI_OPENBSD): Likewise. -Fri Apr 21 13:20:53 2000 Richard Henderson - David Mosberger +2000-04-21 Richard Henderson + David Mosberger * ia64.h: New file. @@ -425,7 +518,7 @@ Fri Apr 21 13:20:53 2000 Richard Henderson (PF_ARM_PI): Define. (PF_ARM_ABS): Define. -Wed Apr 5 22:08:59 2000 J"orn Rennecke +2000-04-05 J"orn Rennecke * sh.h (R_SH_LOOP_START, R_SH_LOOP_END): New RELOC_NUMBERs. @@ -454,7 +547,7 @@ Wed Apr 5 22:08:59 2000 J"orn Rennecke * common.h (ELFOSABI_LINUX): Define. -Thu Feb 17 00:18:33 2000 J"orn Rennecke +2000-02-17 J"orn Rennecke * 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/contrib/binutils/include/elf/alpha.h b/contrib/binutils/include/elf/alpha.h index ab429d4..e937b81 100644 --- a/contrib/binutils/include/elf/alpha.h +++ b/contrib/binutils/include/elf/alpha.h @@ -94,6 +94,11 @@ START_RELOC_NUMBERS (elf_alpha_reloc_type) 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/contrib/binutils/include/elf/common.h b/contrib/binutils/include/elf/common.h index 289d3f2..d6e45fc 100644 --- a/contrib/binutils/include/elf/common.h +++ b/contrib/binutils/include/elf/common.h @@ -199,6 +199,9 @@ 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 +/* (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 diff --git a/contrib/binutils/include/elf/dwarf2.h b/contrib/binutils/include/elf/dwarf2.h index a99dca7..53eb655 100644 --- a/contrib/binutils/include/elf/dwarf2.h +++ b/contrib/binutils/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 }; @@ -589,7 +592,7 @@ enum dwarf_line_number_ops DW_LNS_set_basic_block = 7, DW_LNS_const_add_pc = 8, DW_LNS_fixed_advance_pc = 9, - /* DWARF 3 */ + /* DWARF 3. */ DW_LNS_set_prologue_end = 10, DW_LNS_set_epilogue_begin = 11, DW_LNS_set_isa = 12 @@ -624,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, @@ -666,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/contrib/binutils/include/elf/m68k.h b/contrib/binutils/include/elf/m68k.h index 03bf465..7769c59 100644 --- a/contrib/binutils/include/elf/m68k.h +++ b/contrib/binutils/include/elf/m68k.h @@ -53,5 +53,6 @@ START_RELOC_NUMBERS (elf_m68k_reloc_type) END_RELOC_NUMBERS (R_68K_max) #define EF_CPU32 0x00810000 +#define EF_M68000 0x01000000 #endif diff --git a/contrib/binutils/include/elf/mmix.h b/contrib/binutils/include/elf/mmix.h index fa367e5..e3be26b 100644 --- a/contrib/binutils/include/elf/mmix.h +++ b/contrib/binutils/include/elf/mmix.h @@ -1,5 +1,5 @@ /* MMIX support for BFD. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -82,7 +82,10 @@ START_RELOC_NUMBERS (elf_mmix_reloc_type) /* A general register. */ RELOC_NUMBER (R_MMIX_REG, 33) - /* A global register and an offset, equivalent of the expression. */ + /* 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. */ @@ -107,6 +110,11 @@ END_RELOC_NUMBERS (R_MMIX_max) 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 @@ -148,4 +156,13 @@ END_RELOC_NUMBERS (R_MMIX_max) #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/contrib/binutils/include/elf/or32.h b/contrib/binutils/include/elf/or32.h new file mode 100644 index 0000000..14884f3 --- /dev/null +++ b/contrib/binutils/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 + + 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/contrib/binutils/include/elf/ppc.h b/contrib/binutils/include/elf/ppc.h index 8e4af62f..dfb43f4 100644 --- a/contrib/binutils/include/elf/ppc.h +++ b/contrib/binutils/include/elf/ppc.h @@ -174,6 +174,10 @@ END_RELOC_NUMBERS (R_PPC_max) /* Specify the start of the .glink section. */ #define DT_PPC64_GLINK DT_LOPROC +/* Specify the start and size of the .opd section. */ +#define DT_PPC64_OPD (DT_LOPROC + 1) +#define DT_PPC64_OPDSZ (DT_LOPROC + 2) + /* Processor specific flags for the ELF header e_flags field. */ #define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag. */ diff --git a/contrib/binutils/include/elf/sh.h b/contrib/binutils/include/elf/sh.h index 700ca3e..1480f49 100644 --- a/contrib/binutils/include/elf/sh.h +++ b/contrib/binutils/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 -- cgit v1.1