sanitize-vr5400 -> sanitize-cygnus

This commit is contained in:
Ken Raeburn 1998-08-12 02:18:03 +00:00
parent b3bd5b1511
commit 1a85826ebc
5 changed files with 189 additions and 114 deletions

View file

@ -470,23 +470,23 @@ else
done
fi
vr5400_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
if ( echo $* | grep keep\-vr5400 > /dev/null ) ; then
for i in $vr5400_files ; do
if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
cygnus_files="ChangeLog ChangeLog-9697 archures.c bfd-in2.h bfd-in.h cpu-mips.c elf32-mips.c"
if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
for i in $cygnus_files ; do
if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
if [ -n "${verbose}" ] ; then
echo Keeping vr5400 stuff in $i
echo Keeping Cygnus stuff in $i
fi
fi
done
else
for i in $vr5400_files ; do
if test ! -d $i && (grep sanitize-vr5400 $i > /dev/null) ; then
for i in $cygnus_files ; do
if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
if [ -n "${verbose}" ] ; then
echo Removing traces of \"vr5400\" from $i...
echo Removing traces of \"cygnus\" from $i...
fi
cp $i new
sed '/start\-sanitize\-vr5400/,/end-\sanitize\-vr5400/d' < $i > new
sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
if [ -n "${verbose}" ] ; then
echo Caching $i in .Recover...

View file

@ -70,6 +70,14 @@ DESCRIPTION
. bfd_arch_unknown, {* File arch not known *}
. bfd_arch_obscure, {* Arch known, not one of these *}
. bfd_arch_m68k, {* Motorola 68xxx *}
.#define bfd_mach_m68000 1
.#define bfd_mach_m68008 2
.#define bfd_mach_m68010 3
.#define bfd_mach_m68020 4
.#define bfd_mach_m68030 5
.#define bfd_mach_m68040 6
.#define bfd_mach_m68060 7
.#define bfd_mach_cpu32 8
. bfd_arch_vax, {* DEC Vax *}
. bfd_arch_i960, {* Intel 960 *}
. {* The order of the following is important.
@ -97,8 +105,9 @@ DESCRIPTION
.#define bfd_mach_sparc_sparclite 3
.#define bfd_mach_sparc_v8plus 4
.#define bfd_mach_sparc_v8plusa 5 {* with ultrasparc add'ns *}
.#define bfd_mach_sparc_v9 6
.#define bfd_mach_sparc_v9a 7 {* with ultrasparc add'ns *}
.#define bfd_mach_sparc_sparclite_le 6
.#define bfd_mach_sparc_v9 7
.#define bfd_mach_sparc_v9a 8 {* with ultrasparc add'ns *}
.{* Nonzero if MACH has the v9 instruction set. *}
.#define bfd_mach_sparc_v9_p(mach) \
. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a)
@ -122,9 +131,9 @@ DESCRIPTION
.#define bfd_mach_mips4900 4900
. {* end-sanitize-tx49 *}
.#define bfd_mach_mips5000 5000
. {* start-sanitize-vr5400 *}
. {* start-sanitize-cygnus *} {* CYGNUS LOCAL vr5400/raeburn *}
.#define bfd_mach_mips5400 5400
. {* end-sanitize-vr5400 *}
. {* end-sanitize-cygnus *}
. {* start-sanitize-r5900 *}
.#define bfd_mach_mips5900 5900
. {* end-sanitize-r5900 *}
@ -159,9 +168,7 @@ DESCRIPTION
. bfd_arch_rs6000, {* IBM RS/6000 *}
. bfd_arch_hppa, {* HP PA RISC *}
. bfd_arch_d10v, {* Mitsubishi D10V *}
. {* start-sanitize-d30v *}
. bfd_arch_d30v, {* Mitsubishi D30V *}
. {* end-sanitize-d30v *}
. bfd_arch_z8k, {* Zilog Z8000 *}
.#define bfd_mach_z8001 1
.#define bfd_mach_z8002 2
@ -170,9 +177,7 @@ DESCRIPTION
.#define bfd_mach_sh 0
.#define bfd_mach_sh3 0x30
.#define bfd_mach_sh3e 0x3e
. {* start-sanitize-sh4 *}
.#define bfd_mach_sh4 0x40
. {* end-sanitize-sh4 *}
. bfd_arch_alpha, {* Dec Alpha *}
. bfd_arch_arm, {* Advanced Risc Machines ARM *}
.#define bfd_mach_arm_2 1
@ -202,6 +207,10 @@ DESCRIPTION
. {* end-sanitize-m32rx *}
. bfd_arch_mn10200, {* Matsushita MN10200 *}
. bfd_arch_mn10300, {* Matsushita MN10300 *}
.#define bfd_mach_mn10300 300
. {* start-sanitize-am33 *}
.#define bfd_mach_am33 330
. {* end-sanitize-am33 *}
. bfd_arch_last
. };
@ -245,9 +254,7 @@ extern const bfd_arch_info_type bfd_alpha_arch;
extern const bfd_arch_info_type bfd_arc_arch;
extern const bfd_arch_info_type bfd_arm_arch;
extern const bfd_arch_info_type bfd_d10v_arch;
/* start-sanitize-d30v */
extern const bfd_arch_info_type bfd_d30v_arch;
/* end-sanitize-d30v */
extern const bfd_arch_info_type bfd_h8300_arch;
extern const bfd_arch_info_type bfd_h8500_arch;
extern const bfd_arch_info_type bfd_hppa_arch;
@ -285,9 +292,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] =
&bfd_arc_arch,
&bfd_arm_arch,
&bfd_d10v_arch,
/* start-sanitize-d30v */
&bfd_d30v_arch,
/* end-sanitize-d30v */
&bfd_h8300_arch,
&bfd_h8500_arch,
&bfd_hppa_arch,
@ -700,18 +705,20 @@ bfd_default_scan (info, string)
{
int strlen_arch_name = strlen (info->arch_name);
if (strncasecmp (string, info->arch_name, strlen_arch_name) == 0)
if (string[strlen_arch_name] == ':')
{
if (strcasecmp (string + strlen_arch_name + 1,
info->printable_name) == 0)
return true;
}
else
{
if (strcasecmp (string + strlen_arch_name,
info->printable_name) == 0)
return true;
}
{
if (string[strlen_arch_name] == ':')
{
if (strcasecmp (string + strlen_arch_name + 1,
info->printable_name) == 0)
return true;
}
else
{
if (strcasecmp (string + strlen_arch_name,
info->printable_name) == 0)
return true;
}
}
}
/* Given that PRINTABLE_NAME has the form: <arch> ":" <mach>;
@ -756,7 +763,7 @@ bfd_default_scan (info, string)
}
number = 0;
while (isdigit(*ptr_src))
while (isdigit ((unsigned char) *ptr_src))
{
number = number * 10 + *ptr_src - '0';
ptr_src++;
@ -767,14 +774,34 @@ bfd_default_scan (info, string)
switch (number)
{
case 68010:
case 68020:
case 68030:
case 68040:
case 68332:
case 68050:
/* FIXME: These are needed to parse IEEE objects. */
case 68000:
arch = bfd_arch_m68k;
arch = bfd_arch_m68k;
number = bfd_mach_m68000;
break;
case 68010:
arch = bfd_arch_m68k;
number = bfd_mach_m68010;
break;
case 68020:
arch = bfd_arch_m68k;
number = bfd_mach_m68020;
break;
case 68030:
arch = bfd_arch_m68k;
number = bfd_mach_m68030;
break;
case 68040:
arch = bfd_arch_m68k;
number = bfd_mach_m68040;
break;
case 68060:
arch = bfd_arch_m68k;
number = bfd_mach_m68060;
break;
case 68332:
arch = bfd_arch_m68k;
number = bfd_mach_cpu32;
break;
case 32000:

View file

@ -1246,9 +1246,9 @@ enum bfd_architecture
#define bfd_mach_mips4900 4900
/* end-sanitize-tx49 */
#define bfd_mach_mips5000 5000
/* start-sanitize-vr5400 */
/* start-sanitize-cygnus */ /* CYGNUS LOCAL vr5400/raeburn */
#define bfd_mach_mips5400 5400
/* end-sanitize-vr5400 */
/* end-sanitize-cygnus */
/* start-sanitize-r5900 */
#define bfd_mach_mips5900 5900
/* end-sanitize-r5900 */
@ -1722,7 +1722,7 @@ relocation types already defined. */
BFD_RELOC_SPARC_REGISTER,
/* SPARC little endian relocation */
BFD_RELOC_SPARC_32LE,
BFD_RELOC_SPARC_REV32,
/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or
"addend" in some special way.

View file

@ -1,5 +1,5 @@
/* bfd back-end for mips support
Copyright (C) 1990, 91-96, 1998 Free Software Foundation, Inc.
Copyright (C) 1990, 91-97, 1998 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@ -38,65 +38,90 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
NEXT, \
}
enum {
I_mips3000,
I_mips3900,
I_mips4000,
I_mips4010,
I_mips4100,
I_mips4300,
I_mips4400,
I_mips4600,
I_mips4650,
I_mips5000,
I_mips6000,
I_mips8000,
I_mips10000,
/* start-sanitize-tx19 */
I_mips1900,
/* end-sanitize-tx19 */
/* start-sanitize-vr4320 */
I_mips4320,
/* end-sanitize-vr4320 */
/* start-sanitize-tx49 */
I_mips4900,
/* end-sanitize-tx49 */
/* start-sanitize-cygnus */
/* CYGNUS LOCAL vr5400/raeburn */
I_mips5400,
/* end-sanitize-cygnus */
/* start-sanitize-r5900 */
I_mips5900,
/* end-sanitize-r5900 */
/* start-sanitize-sky */
I_dvp_dma,
I_dvp_vif,
I_dvp_vu,
I_dvp_gif,
/* end-sanitize-sky */
I_mips16
};
#define A 0
#define B 0
#define C 0
#define D 0
#define NN(index) (&arch_info_struct[(index)+1])
static const bfd_arch_info_type arch_info_struct[] =
{
N (32, 32, bfd_mach_mips3000, "mips:3000", false, &arch_info_struct[1]),
N (32, 32, bfd_mach_mips3900, "mips:3900", false, &arch_info_struct[2]),
N (64, 64, bfd_mach_mips4000, "mips:4000", false, &arch_info_struct[3]),
N (64, 64, bfd_mach_mips4010, "mips:4010", false, &arch_info_struct[4]),
N (64, 64, bfd_mach_mips4100, "mips:4100", false, &arch_info_struct[5]),
N (64, 64, bfd_mach_mips4300, "mips:4300", false, &arch_info_struct[6]),
N (64, 64, bfd_mach_mips4400, "mips:4400", false, &arch_info_struct[7]),
N (64, 64, bfd_mach_mips4600, "mips:4600", false, &arch_info_struct[8]),
N (64, 64, bfd_mach_mips4650, "mips:4650", false, &arch_info_struct[9]),
N (64, 64, bfd_mach_mips5000, "mips:5000", false, &arch_info_struct[10]),
N (32, 32, bfd_mach_mips6000, "mips:6000", false, &arch_info_struct[11]),
N (64, 64, bfd_mach_mips8000, "mips:8000", false, &arch_info_struct[12]),
N (64, 64, bfd_mach_mips10000, "mips:10000", false, &arch_info_struct[13]),
N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)),
N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)),
N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)),
N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)),
N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)),
N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)),
N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)),
N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)),
N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)),
N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)),
N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)),
N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)),
N (64, 64, bfd_mach_mips10000, "mips:10000", false, NN(I_mips10000)),
/* start-sanitize-tx19 */
#undef A
#define A 1
N (32, 32, bfd_mach_mips1900, "mips:1900", false, &arch_info_struct[13+A]),
N (32, 32, bfd_mach_mips1900, "mips:1900", false, NN(I_mips1900)),
/* end-sanitize-tx19 */
/* start-sanitize-vr4320 */
N (64, 64, bfd_mach_mips4320, "mips:4320", false, NN(I_mips4320)),
/* end-sanitize-vr4320 */
/* start-sanitize-tx49 */
#undef B
#define B 1
N (64, 64, bfd_mach_mips4900, "mips:4900", false, &arch_info_struct[13+A+B]),
N (64, 64, bfd_mach_mips4900, "mips:4900", false, NN(I_mips4900)),
/* end-sanitize-tx49 */
/* start-sanitize-vr5400 */
#undef C
#define C 1
N (64, 64, bfd_mach_mips5400, "mips:5400", false, &arch_info_struct[13+A+B+C]),
/* end-sanitize-vr5400 */
/* start-sanitize-cygnus */
/* CYGNUS LOCAL vr5400/raeburn */
N (64, 64, bfd_mach_mips5400, "mips:5400", false, NN(I_mips5400)),
/* end-sanitize-cygnus */
/* start-sanitize-r5900 */
#undef D
#define D 1
N (64, 32, bfd_mach_mips5900, "mips:5900", false, &arch_info_struct[13+A+B+C+D]),
N (64, 32, bfd_mach_mips5900, "mips:5900", false, NN(I_mips5900)),
/* end-sanitize-r5900 */
/* start-sanitize-sky */
#undef E
#define E (A+B+C+D)
N (32, 32, bfd_mach_dvp_dma, "dvp:dma", false, &arch_info_struct[13+E+1]),
N (32, 32, bfd_mach_dvp_pke, "dvp:pke", false, &arch_info_struct[13+E+2]),
N (32, 32, bfd_mach_dvp_vu, "dvp:vu", false, &arch_info_struct[13+E+3]),
N (32, 32, bfd_mach_dvp_gpuif, "dvp:gpuif", false, &arch_info_struct[13+E+4]),
N (32, 32, bfd_mach_dvp_dma, "dvp:dma", false, NN(I_dvp_dma)),
N (32, 32, bfd_mach_dvp_vif, "dvp:vif", false, NN(I_dvp_vif)),
N (32, 32, bfd_mach_dvp_vu, "dvp:vu", false, NN(I_dvp_vu)),
N (32, 32, bfd_mach_dvp_gif, "dvp:gif", false, NN(I_dvp_gif)),
/* end-sanitize-sky */
N (64, 64, bfd_mach_mips16, "mips:16", false, 0),
};
#undef A
#undef B
#undef C
#undef D
/* The default architecture is mips:3000, but with a machine number of
zero. This lets the linker distinguish between a default setting
of mips, and an explicit setting of mips:3000. */

View file

@ -675,22 +675,11 @@ static reloc_howto_type elf_mips_howto_table[] =
0x0000ffff, /* dst_mask */
false), /* pcrel_offset */
/* start-sanitize-r5900 */
HOWTO (R_MIPS15_S3, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
6, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MIPS15_S3", /* name */
true, /* partial_inplace */
0x001fffc0, /* src_mask */
0x001fffc0, /* dst_mask */
false) /* pcrel_offset */
/* end-sanitize-r5900 */
{ R_MIPS_SCN_DISP },
{ R_MIPS_REL16 },
{ R_MIPS_ADD_IMMEDIATE },
{ R_MIPS_PJUMP },
{ R_MIPS_RELGOT }
};
/* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link. This
@ -748,6 +737,23 @@ static reloc_howto_type elf_mips16_gprel_howto =
0xffff, /* dst_mask */
false); /* pcrel_offset */
/* start-sanitize-r5900 */
static reloc_howto_type elf_mips15_s3_howto =
HOWTO (R_MIPS15_S3, /* type */
3, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
15, /* bitsize */
false, /* pc_relative */
6, /* bitpos */
complain_overflow_bitfield, /* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_MIPS15_S3", /* name */
true, /* partial_inplace */
0x001fffc0, /* src_mask */
0x001fffc0, /* dst_mask */
false); /* pcrel_offset */
/* end-sanitize-r5900 */
/* start-sanitize-sky */
/* DVP relocations.
Note that partial_inplace and pcrel_offset are backwards from the
@ -1664,11 +1670,12 @@ elf_mips_mach (flags)
case E_MIPS_MACH_4900:
return bfd_mach_mips4900;
/* end-sanitize-tx49 */
/* start-sanitize-vr5400 */
/* start-sanitize-cygnus */
/* CYGNUS LOCAL vr5400/raeburn */
case E_MIPS_MACH_5400:
return bfd_mach_mips5400;
/* end-sanitize-vr5400 */
/* end-sanitize-cygnus */
/* start-sanitize-r5900 */
case E_MIPS_MACH_5900:
@ -1725,10 +1732,7 @@ static CONST struct elf_reloc_map mips_reloc_map[] =
{ BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
{ BFD_RELOC_MIPS_GOT_LO16, R_MIPS_GOT_LO16 },
{ BFD_RELOC_MIPS_CALL_HI16, R_MIPS_CALL_HI16 },
{ BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 },
/* start-sanitize-r5900 */
{ BFD_RELOC_MIPS15_S3, R_MIPS15_S3 },
/* end-sanitize-r5900 */
{ BFD_RELOC_MIPS_CALL_LO16, R_MIPS_CALL_LO16 }
};
/* Given a BFD reloc type, return a howto structure. */
@ -1748,6 +1752,10 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
switch (code)
{
default:
bfd_set_error (bfd_error_bad_value);
return NULL;
case BFD_RELOC_CTOR:
/* We need to handle BFD_RELOC_CTOR specially.
Select the right relocation (R_MIPS_32 or R_MIPS_64) based on the
@ -1761,6 +1769,10 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
return &elf_mips16_jump_howto;
case BFD_RELOC_MIPS16_GPREL:
return &elf_mips16_gprel_howto;
/* start-sanitize-r5900 */
case BFD_RELOC_MIPS15_S3:
return &elf_mips15_s3_howto;
/* end-sanitize-r5900 */
/* start-sanitize-sky */
case BFD_RELOC_MIPS_DVP_11_PCREL:
return &elf_mips_dvp_11_pcrel_howto;
@ -1776,8 +1788,6 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
case BFD_RELOC_VTABLE_ENTRY:
return &elf_mips_gnu_vtentry_howto;
}
return NULL;
}
/* Given a MIPS reloc type, fill in an arelent structure. */
@ -1799,6 +1809,11 @@ mips_info_to_howto_rel (abfd, cache_ptr, dst)
case R_MIPS16_GPREL:
cache_ptr->howto = &elf_mips16_gprel_howto;
break;
/* start-sanitize-r5900 */
case R_MIPS15_S3:
cache_ptr->howto = &elf_mips15_s3_howto;
break;
/* end-sanitize-r5900 */
/* start-sanitize-sky */
case R_MIPS_DVP_11_PCREL:
cache_ptr->howto = &elf_mips_dvp_11_pcrel_howto;
@ -2100,12 +2115,13 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
val = E_MIPS_ARCH_3 | E_MIPS_MACH_4900;
break;
/* end-sanitize-tx49 */
/* start-sanitize-vr5400 */
/* start-sanitize-cygnus */
/* CYGNUS LOCAL vr5400/raeburn */
case bfd_mach_mips5400:
val = E_MIPS_ARCH_3 | E_MIPS_MACH_5400;
break;
/* end-sanitize-vr5400 */
/* end-sanitize-cygnus */
/* start-sanitize-r5900 */
case bfd_mach_mips5900:
@ -2397,7 +2413,7 @@ _bfd_mips_elf_section_from_shdr (abfd, hdr, name)
switch (hdr->sh_type)
{
case SHT_MIPS_LIBLIST:
if (strcmp (name, _(".liblist")) != 0)
if (strcmp (name, ".liblist") != 0)
return false;
break;
case SHT_MIPS_MSYM:
@ -4928,6 +4944,9 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
|| r_type == R_MIPS_GNU_VTENTRY)
continue;
if ((r_type < 0 || r_type >= (int) R_MIPS_max)
/* start-sanitize-r5900 */
&& r_type != R_MIPS15_S3
/* end-sanitize-r5900 */
/* start-sanitize-sky */
&& r_type != R_MIPS_DVP_11_PCREL
&& r_type != R_MIPS_DVP_27_S4
@ -4944,6 +4963,10 @@ mips_elf_relocate_section (output_bfd, info, input_bfd, input_section,
howto = &elf_mips16_jump_howto;
else if (r_type == R_MIPS16_GPREL)
howto = &elf_mips16_gprel_howto;
/* start-sanitize-r5900 */
else if (r_type == R_MIPS15_S3)
howto = &elf_mips15_s3_howto;
/* end-sanitize-r5900 */
/* start-sanitize-sky */
else if (r_type == R_MIPS_DVP_11_PCREL)
howto = &elf_mips_dvp_11_pcrel_howto;