diff options
author | Jan Beulich <jbeulich@suse.com> | 2022-06-27 11:11:46 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2022-06-27 11:11:46 +0200 |
commit | ddd7bf3e2881aa339dc3ad4a36efc8ee3c3f7192 (patch) | |
tree | 5252bf3fabc71eeaf15f4d5334281f79b7f40f13 /bfd | |
parent | 2d1388e73c700f689b23d53b504e0991fe196596 (diff) | |
download | gdb-ddd7bf3e2881aa339dc3ad4a36efc8ee3c3f7192.zip gdb-ddd7bf3e2881aa339dc3ad4a36efc8ee3c3f7192.tar.gz gdb-ddd7bf3e2881aa339dc3ad4a36efc8ee3c3f7192.tar.bz2 |
drop XC16x bits
Commit 04f096fb9e25 ("Move the xc16x target to the obsolete list") moved
the architecture from the "obsolete but still available" to the
"obsolete / support removed" list in config.bfd, making the architecture
impossible to enable (except maybe via "enable everything" options").
Note that I didn't touch */po/*.po{,t} on the assumption that these
would be updated by some (half)automatic means.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/Makefile.am | 4 | ||||
-rw-r--r-- | bfd/Makefile.in | 6 | ||||
-rw-r--r-- | bfd/archures.c | 6 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 10 | ||||
-rw-r--r-- | bfd/config.bfd | 4 | ||||
-rwxr-xr-x | bfd/configure | 1 | ||||
-rw-r--r-- | bfd/configure.ac | 1 | ||||
-rw-r--r-- | bfd/cpu-xc16x.c | 53 | ||||
-rw-r--r-- | bfd/elf32-xc16x.c | 487 | ||||
-rw-r--r-- | bfd/libbfd.h | 4 | ||||
-rw-r--r-- | bfd/po/SRC-POTFILES.in | 2 | ||||
-rw-r--r-- | bfd/reloc.c | 11 | ||||
-rw-r--r-- | bfd/targets.c | 3 |
13 files changed, 0 insertions, 592 deletions
diff --git a/bfd/Makefile.am b/bfd/Makefile.am index 92ff15b..670e059 100644 --- a/bfd/Makefile.am +++ b/bfd/Makefile.am @@ -171,7 +171,6 @@ ALL_MACHINES = \ cpu-vax.lo \ cpu-visium.lo \ cpu-wasm32.lo \ - cpu-xc16x.lo \ cpu-xgate.lo \ cpu-xstormy16.lo \ cpu-xtensa.lo \ @@ -255,7 +254,6 @@ ALL_MACHINES_CFILES = \ cpu-vax.c \ cpu-visium.c \ cpu-wasm32.c \ - cpu-xc16x.c \ cpu-xgate.c \ cpu-xstormy16.c \ cpu-xtensa.c \ @@ -352,7 +350,6 @@ BFD32_BACKENDS = \ elf32-vax.lo \ elf32-visium.lo \ elf32-wasm32.lo \ - elf32-xc16x.lo \ elf32-xgate.lo \ elf32-xstormy16.lo \ elf32-xtensa.lo \ @@ -485,7 +482,6 @@ BFD32_BACKENDS_CFILES = \ elf32-vax.c \ elf32-visium.c \ elf32-wasm32.c \ - elf32-xc16x.c \ elf32-xgate.c \ elf32-xstormy16.c \ elf32-xtensa.c \ diff --git a/bfd/Makefile.in b/bfd/Makefile.in index 741e08d..d3ef4c2 100644 --- a/bfd/Makefile.in +++ b/bfd/Makefile.in @@ -633,7 +633,6 @@ ALL_MACHINES = \ cpu-vax.lo \ cpu-visium.lo \ cpu-wasm32.lo \ - cpu-xc16x.lo \ cpu-xgate.lo \ cpu-xstormy16.lo \ cpu-xtensa.lo \ @@ -717,7 +716,6 @@ ALL_MACHINES_CFILES = \ cpu-vax.c \ cpu-visium.c \ cpu-wasm32.c \ - cpu-xc16x.c \ cpu-xgate.c \ cpu-xstormy16.c \ cpu-xtensa.c \ @@ -815,7 +813,6 @@ BFD32_BACKENDS = \ elf32-vax.lo \ elf32-visium.lo \ elf32-wasm32.lo \ - elf32-xc16x.lo \ elf32-xgate.lo \ elf32-xstormy16.lo \ elf32-xtensa.lo \ @@ -948,7 +945,6 @@ BFD32_BACKENDS_CFILES = \ elf32-vax.c \ elf32-visium.c \ elf32-wasm32.c \ - elf32-xc16x.c \ elf32-xgate.c \ elf32-xstormy16.c \ elf32-xtensa.c \ @@ -1549,7 +1545,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-vax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-visium.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-wasm32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xc16x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xgate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xstormy16.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu-xtensa.Plo@am__quote@ @@ -1632,7 +1627,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-vax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-visium.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-wasm32.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xc16x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xgate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xstormy16.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf32-xtensa.Plo@am__quote@ diff --git a/bfd/archures.c b/bfd/archures.c index bcd2b1c..c67bacd 100644 --- a/bfd/archures.c +++ b/bfd/archures.c @@ -487,10 +487,6 @@ DESCRIPTION .#define bfd_mach_msp46 46 .#define bfd_mach_msp47 47 .#define bfd_mach_msp54 54 -. bfd_arch_xc16x, {* Infineon's XC16X Series. *} -.#define bfd_mach_xc16x 1 -.#define bfd_mach_xc16xl 2 -.#define bfd_mach_xc16xs 3 . bfd_arch_xgate, {* Freescale XGATE. *} .#define bfd_mach_xgate 1 . bfd_arch_xtensa, {* Tensilica's Xtensa cores. *} @@ -698,7 +694,6 @@ extern const bfd_arch_info_type bfd_visium_arch; extern const bfd_arch_info_type bfd_wasm32_arch; extern const bfd_arch_info_type bfd_xstormy16_arch; extern const bfd_arch_info_type bfd_xtensa_arch; -extern const bfd_arch_info_type bfd_xc16x_arch; extern const bfd_arch_info_type bfd_xgate_arch; extern const bfd_arch_info_type bfd_z80_arch; extern const bfd_arch_info_type bfd_z8k_arch; @@ -785,7 +780,6 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_wasm32_arch, &bfd_xstormy16_arch, &bfd_xtensa_arch, - &bfd_xc16x_arch, &bfd_xgate_arch, &bfd_z80_arch, &bfd_z8k_arch, diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 14d3763..4e1182e 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -1824,10 +1824,6 @@ enum bfd_architecture #define bfd_mach_msp46 46 #define bfd_mach_msp47 47 #define bfd_mach_msp54 54 - bfd_arch_xc16x, /* Infineon's XC16X Series. */ -#define bfd_mach_xc16x 1 -#define bfd_mach_xc16xl 2 -#define bfd_mach_xc16xs 3 bfd_arch_xgate, /* Freescale XGATE. */ #define bfd_mach_xgate 1 bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ @@ -5028,12 +5024,6 @@ then it may be truncated to 8 bits. */ BFD_RELOC_RELC, -/* Infineon Relocations. */ - BFD_RELOC_XC16X_PAG, - BFD_RELOC_XC16X_POF, - BFD_RELOC_XC16X_SEG, - BFD_RELOC_XC16X_SOF, - /* Relocations used by VAX ELF. */ BFD_RELOC_VAX_GLOB_DAT, BFD_RELOC_VAX_JMP_SLOT, diff --git a/bfd/config.bfd b/bfd/config.bfd index 2a6aec2..8dcb4e0 100644 --- a/bfd/config.bfd +++ b/bfd/config.bfd @@ -1431,10 +1431,6 @@ case "${targ}" in targ_selvecs="wasm_vec" ;; - xc16x-*-elf) - targ_defvec=xc16x_elf32_vec - ;; - xgate-*-*) targ_defvec=xgate_elf32_vec targ_selvecs="xgate_elf32_vec" diff --git a/bfd/configure b/bfd/configure index 3d26562..33ef765 100755 --- a/bfd/configure +++ b/bfd/configure @@ -13587,7 +13587,6 @@ do x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; x86_64_pe_big_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; - xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;; xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;; xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; diff --git a/bfd/configure.ac b/bfd/configure.ac index 8ad0e05..aad4f3c 100644 --- a/bfd/configure.ac +++ b/bfd/configure.ac @@ -665,7 +665,6 @@ do x86_64_pe_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; x86_64_pe_big_vec) tb="$tb pe-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; x86_64_pei_vec) tb="$tb pei-x86_64.lo pex64igen.lo $coff"; target_size=64 ;; - xc16x_elf32_vec) tb="$tb elf32-xc16x.lo elf32.lo $elf" ;; xgate_elf32_vec) tb="$tb elf32-xgate.lo elf32.lo $elf" ;; xstormy16_elf32_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; xtensa_elf32_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; diff --git a/bfd/cpu-xc16x.c b/bfd/cpu-xc16x.c deleted file mode 100644 index bd10242..0000000 --- a/bfd/cpu-xc16x.c +++ /dev/null @@ -1,53 +0,0 @@ -/* BFD support for the Infineon XC16X Microcontroller. - Copyright (C) 2006-2022 Free Software Foundation, Inc. - Contributed by KPIT Cummins Infosystems - - This file is part of BFD, the Binary File Descriptor library. - Contributed by Anil Paranjpe(anilp1@kpitcummins.com) - - 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, 51 Franklin Street - Fifth Floor, Boston, MA - 02110-1301, USA. */ - -#include "sysdep.h" -#include "bfd.h" -#include "libbfd.h" - -#define N(BITS_ADDR, NUMBER, PRINT, DEFAULT, NEXT) \ - { \ - 16, /* Bits in a word. */ \ - BITS_ADDR, /* Bits in an address. */ \ - 8, /* Bits in a byte. */ \ - bfd_arch_xc16x, \ - NUMBER, \ - "xc16x", \ - PRINT, \ - 1, /* Section alignment power. */ \ - DEFAULT, \ - bfd_default_compatible, \ - bfd_default_scan, \ - bfd_arch_default_fill, \ - NEXT, \ - 0 /* Maximum offset of a reloc from the start of an insn. */ \ - } - -const bfd_arch_info_type xc16xs_info_struct = - N (16, bfd_mach_xc16xs, "xc16xs", false, NULL); - -const bfd_arch_info_type xc16xl_info_struct = - N (32, bfd_mach_xc16xl, "xc16xl", false, & xc16xs_info_struct); - -const bfd_arch_info_type bfd_xc16x_arch = - N (16, bfd_mach_xc16x, "xc16x", true, & xc16xl_info_struct); - diff --git a/bfd/elf32-xc16x.c b/bfd/elf32-xc16x.c deleted file mode 100644 index 99cba14..0000000 --- a/bfd/elf32-xc16x.c +++ /dev/null @@ -1,487 +0,0 @@ -/* Infineon XC16X-specific support for 16-bit ELF. - Copyright (C) 2006-2022 Free Software Foundation, Inc. - Contributed by KPIT Cummins Infosystems - - 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, 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include "sysdep.h" -#include "bfd.h" -#include "libbfd.h" -#include "elf-bfd.h" -#include "elf/xc16x.h" -#include "dwarf2.h" -#include "libiberty.h" - -static reloc_howto_type xc16x_elf_howto_table [] = -{ - /* This reloc does nothing. */ - HOWTO (R_XC16X_NONE, /* type */ - 0, /* rightshift */ - 0, /* size */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ - - /* An 8 bit absolute relocation. */ - HOWTO (R_XC16X_ABS_8, /* type */ - 0, /* rightshift */ - 1, /* size */ - 8, /* bitsize */ - false, /* pc_relative */ - 8, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_ABS_8", /* name */ - true, /* partial_inplace */ - 0x0000, /* src_mask */ - 0x00ff, /* dst_mask */ - false), /* pcrel_offset */ - - /* A 16 bit absolute relocation. */ - HOWTO (R_XC16X_ABS_16, /* type */ - 0, /* rightshift */ - 2, /* size */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_ABS_16", /* name */ - true, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO (R_XC16X_ABS_32, /* type */ - 0, /* rightshift */ - 4, /* size */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_ABS_32", /* name */ - true, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ - - - /* A PC relative 8 bit relocation. */ - HOWTO (R_XC16X_8_PCREL, /* type */ - 0, /* rightshift */ - 1, /* size */ - 8, /* bitsize */ - true, /* pc_relative */ - 8, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_8_PCREL", /* name */ - false, /* partial_inplace */ - 0x0000, /* src_mask */ - 0x00ff, /* dst_mask */ - true), /* pcrel_offset */ - - /* Relocation regarding page number. */ - HOWTO (R_XC16X_PAG, /* type */ - 0, /* rightshift */ - 2, /* size */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_PAG", /* name */ - true, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - - /* Relocation regarding page number. */ - HOWTO (R_XC16X_POF, /* type */ - 0, /* rightshift */ - 2, /* size */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_POF", /* name */ - true, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - - /* Relocation regarding segment number. */ - HOWTO (R_XC16X_SEG, /* type */ - 0, /* rightshift */ - 2, /* size */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_SEG", /* name */ - true, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ - - /* Relocation regarding segment offset. */ - HOWTO (R_XC16X_SOF, /* type */ - 0, /* rightshift */ - 2, /* size */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_XC16X_SOF", /* name */ - true, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x0000ffff, /* dst_mask */ - false) /* pcrel_offset */ -}; - - -/* Map BFD reloc types to XC16X ELF reloc types. */ - -struct xc16x_reloc_map -{ - bfd_reloc_code_real_type bfd_reloc_val; - unsigned int xc16x_reloc_val; -}; - -static const struct xc16x_reloc_map xc16x_reloc_map [] = -{ - { BFD_RELOC_NONE, R_XC16X_NONE }, - { BFD_RELOC_8, R_XC16X_ABS_8 }, - { BFD_RELOC_16, R_XC16X_ABS_16 }, - { BFD_RELOC_32, R_XC16X_ABS_32 }, - { BFD_RELOC_8_PCREL, R_XC16X_8_PCREL }, - { BFD_RELOC_XC16X_PAG, R_XC16X_PAG}, - { BFD_RELOC_XC16X_POF, R_XC16X_POF}, - { BFD_RELOC_XC16X_SEG, R_XC16X_SEG}, - { BFD_RELOC_XC16X_SOF, R_XC16X_SOF}, -}; - - -/* This function is used to search for correct relocation type from - howto structure. */ - -static reloc_howto_type * -xc16x_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, - bfd_reloc_code_real_type code) -{ - unsigned int i; - - for (i = ARRAY_SIZE (xc16x_reloc_map); --i;) - if (xc16x_reloc_map [i].bfd_reloc_val == code) - return & xc16x_elf_howto_table [xc16x_reloc_map[i].xc16x_reloc_val]; - - return NULL; -} - -static reloc_howto_type * -xc16x_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, - const char *r_name) -{ - unsigned int i; - - for (i = 0; i < ARRAY_SIZE (xc16x_elf_howto_table); i++) - if (xc16x_elf_howto_table[i].name != NULL - && strcasecmp (xc16x_elf_howto_table[i].name, r_name) == 0) - return &xc16x_elf_howto_table[i]; - - return NULL; -} - -static reloc_howto_type * -elf32_xc16x_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED, unsigned r_type) -{ - if (r_type < ARRAY_SIZE (xc16x_elf_howto_table)) - return & xc16x_elf_howto_table[r_type]; - - return NULL; -} - -/* For a particular operand this function is - called to finalise the type of relocation. */ - -static bool -elf32_xc16x_info_to_howto (bfd *abfd, arelent *bfd_reloc, - Elf_Internal_Rela *elf_reloc) -{ - unsigned int r; - unsigned int i; - - r = ELF32_R_TYPE (elf_reloc->r_info); - for (i = 0; i < ARRAY_SIZE (xc16x_elf_howto_table); i++) - if (xc16x_elf_howto_table[i].type == r) - { - bfd_reloc->howto = &xc16x_elf_howto_table[i]; - return true; - } - /* xgettext:c-format */ - _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, r); - bfd_set_error (bfd_error_bad_value); - return false; -} - -static bfd_reloc_status_type -elf32_xc16x_final_link_relocate (unsigned long r_type, - bfd *input_bfd, - bfd *output_bfd ATTRIBUTE_UNUSED, - asection *input_section ATTRIBUTE_UNUSED, - bfd_byte *contents, - bfd_vma offset, - bfd_vma value, - bfd_vma addend, - struct bfd_link_info *info ATTRIBUTE_UNUSED, - asection *sym_sec ATTRIBUTE_UNUSED, - int is_local ATTRIBUTE_UNUSED) -{ - bfd_byte *hit_data = contents + offset; - bfd_vma val1; - - switch (r_type) - { - case R_XC16X_NONE: - return bfd_reloc_ok; - - case R_XC16X_ABS_16: - value += addend; - bfd_put_16 (input_bfd, value, hit_data); - return bfd_reloc_ok; - - case R_XC16X_8_PCREL: - bfd_put_8 (input_bfd, value, hit_data); - return bfd_reloc_ok; - - /* Following case is to find page number from actual - address for this divide value by 16k i.e. page size. */ - - case R_XC16X_PAG: - value += addend; - value /= 0x4000; - bfd_put_16 (input_bfd, value, hit_data); - return bfd_reloc_ok; - - /* Following case is to find page offset from actual address - for this take modulo of value by 16k i.e. page size. */ - - case R_XC16X_POF: - value += addend; - value %= 0x4000; - bfd_put_16 (input_bfd, value, hit_data); - return bfd_reloc_ok; - - /* Following case is to find segment number from actual - address for this divide value by 64k i.e. segment size. */ - - case R_XC16X_SEG: - value += addend; - value /= 0x10000; - bfd_put_16 (input_bfd, value, hit_data); - return bfd_reloc_ok; - - /* Following case is to find segment offset from actual address - for this take modulo of value by 64k i.e. segment size. */ - - case R_XC16X_SOF: - value += addend; - value %= 0x10000; - bfd_put_16 (input_bfd, value, hit_data); - return bfd_reloc_ok; - - case R_XC16X_ABS_32: - if (!strstr (input_section->name,".debug")) - { - value += addend; - val1 = value; - value %= 0x4000; - val1 /= 0x4000; - val1 = val1 << 16; - value += val1; - bfd_put_32 (input_bfd, value, hit_data); - } - else - { - value += addend; - bfd_put_32 (input_bfd, value, hit_data); - } - return bfd_reloc_ok; - - default: - return bfd_reloc_notsupported; - } -} - -static int -elf32_xc16x_relocate_section (bfd *output_bfd, - struct bfd_link_info *info, - bfd *input_bfd, - asection *input_section, - bfd_byte *contents, - Elf_Internal_Rela *relocs, - Elf_Internal_Sym *local_syms, - asection **local_sections) -{ - Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes; - Elf_Internal_Rela *rel, *relend; - - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - sym_hashes = elf_sym_hashes (input_bfd); - - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) - { - unsigned int r_type; - unsigned long r_symndx; - Elf_Internal_Sym *sym; - asection *sec; - struct elf_link_hash_entry *h; - bfd_vma relocation; - - /* This is a final link. */ - r_symndx = ELF32_R_SYM (rel->r_info); - r_type = ELF32_R_TYPE (rel->r_info); - h = NULL; - sym = NULL; - sec = NULL; - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); - } - else - { - bool unresolved_reloc, warned, ignored; - - RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, - r_symndx, symtab_hdr, sym_hashes, - h, sec, relocation, - unresolved_reloc, warned, ignored); - } - - if (sec != NULL && discarded_section (sec)) - { - /* For relocs against symbols from removed linkonce sections, - or sections discarded by a linker script, we just want the - section contents cleared. Avoid any special processing. */ - reloc_howto_type *howto; - howto = elf32_xc16x_rtype_to_howto (input_bfd, r_type); - RELOC_AGAINST_DISCARDED_SECTION (info, input_bfd, input_section, - rel, 1, relend, howto, 0, contents); - } - - if (bfd_link_relocatable (info)) - continue; - - elf32_xc16x_final_link_relocate (r_type, input_bfd, output_bfd, - input_section, - contents, rel->r_offset, - relocation, rel->r_addend, - info, sec, h == NULL); - } - - return true; -} - - -static bool -elf32_xc16x_final_write_processing (bfd *abfd) -{ - unsigned long val; - - switch (bfd_get_mach (abfd)) - { - default: - case bfd_mach_xc16x: - val = 0x1000; - break; - - case bfd_mach_xc16xl: - val = 0x1001; - break; - - case bfd_mach_xc16xs: - val = 0x1002; - break; - } - - elf_elfheader (abfd)->e_flags |= val; - return _bfd_elf_final_write_processing (abfd); -} - -static unsigned long -elf32_xc16x_mach (flagword flags) -{ - switch (flags) - { - case 0x1000: - default: - return bfd_mach_xc16x; - - case 0x1001: - return bfd_mach_xc16xl; - - case 0x1002: - return bfd_mach_xc16xs; - } -} - - -static bool -elf32_xc16x_object_p (bfd *abfd) -{ - bfd_default_set_arch_mach (abfd, bfd_arch_xc16x, - elf32_xc16x_mach (elf_elfheader (abfd)->e_flags)); - return true; -} - - -#define ELF_ARCH bfd_arch_xc16x -#define ELF_MACHINE_CODE EM_XC16X -#define ELF_MAXPAGESIZE 0x100 - -#define TARGET_LITTLE_SYM xc16x_elf32_vec -#define TARGET_LITTLE_NAME "elf32-xc16x" -#define elf_backend_final_write_processing elf32_xc16x_final_write_processing -#define elf_backend_object_p elf32_xc16x_object_p -#define elf_backend_can_gc_sections 1 -#define bfd_elf32_bfd_reloc_type_lookup xc16x_reloc_type_lookup -#define bfd_elf32_bfd_reloc_name_lookup xc16x_reloc_name_lookup -#define elf_info_to_howto elf32_xc16x_info_to_howto -#define elf_info_to_howto_rel elf32_xc16x_info_to_howto -#define elf_backend_relocate_section elf32_xc16x_relocate_section -#define elf_backend_rela_normal 1 - -#include "elf32-target.h" diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 4a3020c..29e8187 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -2791,10 +2791,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_XSTORMY16_FPTR16", "BFD_RELOC_RELC", - "BFD_RELOC_XC16X_PAG", - "BFD_RELOC_XC16X_POF", - "BFD_RELOC_XC16X_SEG", - "BFD_RELOC_XC16X_SOF", "BFD_RELOC_VAX_GLOB_DAT", "BFD_RELOC_VAX_JMP_SLOT", "BFD_RELOC_VAX_RELATIVE", diff --git a/bfd/po/SRC-POTFILES.in b/bfd/po/SRC-POTFILES.in index 59251e3..2a8187d 100644 --- a/bfd/po/SRC-POTFILES.in +++ b/bfd/po/SRC-POTFILES.in @@ -122,7 +122,6 @@ cpu-v850_rh850.c cpu-vax.c cpu-visium.c cpu-wasm32.c -cpu-xc16x.c cpu-xgate.c cpu-xstormy16.c cpu-xtensa.c @@ -231,7 +230,6 @@ elf32-v850.h elf32-vax.c elf32-visium.c elf32-wasm32.c -elf32-xc16x.c elf32-xgate.c elf32-xstormy16.c elf32-xtensa.c diff --git a/bfd/reloc.c b/bfd/reloc.c index eb8dba3..36999fe 100644 --- a/bfd/reloc.c +++ b/bfd/reloc.c @@ -6290,17 +6290,6 @@ ENUMDOC COMMENT ENUM - BFD_RELOC_XC16X_PAG -ENUMX - BFD_RELOC_XC16X_POF -ENUMX - BFD_RELOC_XC16X_SEG -ENUMX - BFD_RELOC_XC16X_SOF -ENUMDOC - Infineon Relocations. - -ENUM BFD_RELOC_VAX_GLOB_DAT ENUMX BFD_RELOC_VAX_JMP_SLOT diff --git a/bfd/targets.c b/bfd/targets.c index f44b5c6..3284bb8 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -933,7 +933,6 @@ extern const bfd_target x86_64_mach_o_vec; extern const bfd_target x86_64_pe_vec; extern const bfd_target x86_64_pe_big_vec; extern const bfd_target x86_64_pei_vec; -extern const bfd_target xc16x_elf32_vec; extern const bfd_target xgate_elf32_vec; extern const bfd_target xstormy16_elf32_vec; extern const bfd_target xtensa_elf32_be_vec; @@ -1344,8 +1343,6 @@ static const bfd_target * const _bfd_target_vector[] = &x86_64_pei_vec, #endif - &xc16x_elf32_vec, - &xgate_elf32_vec, &xstormy16_elf32_vec, |