summaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2000-10-20 10:38:47 +0000
committerJakub Jelinek <jakub@redhat.com>2000-10-20 10:38:47 +0000
commit3ae92f491c4b89b056108da2dbfcbbd2868faaee (patch)
tree62d0507108ec5e85f0a6b750b4f02120a7bcfe74 /bfd
parent2b9786ec7321f57d36d308ace5e98f86e43da0c6 (diff)
downloadgdb-3ae92f491c4b89b056108da2dbfcbbd2868faaee.tar.gz
gas/
* config/tc-sparc.c (sparc_ip): Fix a bug which caused v9_arg_p instructions to loose any special insn->architecture mask. * config/tc-sparc.c (v9a_asr_table): Add v9b ASRs. (sparc_md_end, sparc_arch_types, sparc_arch, sparc_elf_final_processing): Handle v8plusb and v9b architectures. (sparc_ip): Handle siam mode operands. Support v9b ASRs (and request v9b architecture if they are used). bfd/ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data, elf32_sparc_object_p, elf32_sparc_final_write_processing): Support v8plusb. * elf64-sparc.c (sparc64_elf_merge_private_bfd_data, sparc64_elf_object_p): Support v9b. * archures.c: Declare v8plusb and v9b machines. * bfd-in2.h: Ditto. * cpu-sparc.c: Ditto. include/opcode/ * sparc.h (enum sparc_opcode_arch_val): Add SPARC_OPCODE_ARCH_V9B. Note that '3' is used for siam operand. opcodes/ * sparc-dis.c (v9a_asr_reg_names): Add v9b ASRs. (compute_arch_mask): Add v8plusb and v9b machines. (print_insn_sparc): siam mode decoding, accept ASRs up to 25. * opcodes/sparc-opc.c: Support for Cheetah instruction set. (prefetch_table): Add #invalidate.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog11
-rw-r--r--bfd/archures.c5
-rw-r--r--bfd/bfd-in2.h5
-rw-r--r--bfd/cpu-sparc.c30
-rw-r--r--bfd/elf32-sparc.c39
-rw-r--r--bfd/elf64-sparc.c25
6 files changed, 72 insertions, 43 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c11b80932ff..51a601f659d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,14 @@
+2000-10-20 Jakub Jelinek <jakub@redhat.com>
+
+ * elf32-sparc.c (elf32_sparc_merge_private_bfd_data,
+ elf32_sparc_object_p, elf32_sparc_final_write_processing):
+ Support v8plusb.
+ * elf64-sparc.c (sparc64_elf_merge_private_bfd_data,
+ sparc64_elf_object_p): Support v9b.
+ * archures.c: Declare v8plusb and v9b machines.
+ * bfd-in2.h: Ditto.
+ * cpu-sparc.c: Ditto.
+
2000-10-16 Geoffrey Keating <geoffk@shoggoth.cygnus.com>
* elf64-sparc.c (sparc64_elf_relocate_section): Clear the location
diff --git a/bfd/archures.c b/bfd/archures.c
index 70fa0868b2c..5729217d7bf 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -109,9 +109,12 @@ DESCRIPTION
.#define bfd_mach_sparc_sparclite_le 6
.#define bfd_mach_sparc_v9 7
.#define bfd_mach_sparc_v9a 8 {* with ultrasparc add'ns *}
+.#define bfd_mach_sparc_v8plusb 9 {* with cheetah add'ns *}
+.#define bfd_mach_sparc_v9b 10 {* with cheetah 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)
+. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
+. && (mach) != bfd_mach_sparc_sparclite_le)
. bfd_arch_mips, {* MIPS Rxxxx *}
.#define bfd_mach_mips3000 3000
.#define bfd_mach_mips3900 3900
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 64238aca9f8..55c2dbab071 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1379,9 +1379,12 @@ enum bfd_architecture
#define bfd_mach_sparc_sparclite_le 6
#define bfd_mach_sparc_v9 7
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */
+#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */
+#define bfd_mach_sparc_v9b 10 /* with cheetah 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)
+ ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a \
+ && (mach) != bfd_mach_sparc_sparclite_le)
bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
diff --git a/bfd/cpu-sparc.c b/bfd/cpu-sparc.c
index 234bd92bd29..57ccc2ed8c9 100644
--- a/bfd/cpu-sparc.c
+++ b/bfd/cpu-sparc.c
@@ -1,5 +1,5 @@
/* BFD support for the SPARC architecture.
- Copyright (C) 1992, 94, 95, 96, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1992, 94, 95, 96, 97, 2000 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -135,6 +135,34 @@ static const bfd_arch_info_type arch_info_struct[] =
false,
sparc_compatible,
bfd_default_scan,
+ &arch_info_struct[7],
+ },
+ {
+ 32, /* bits in a word */
+ 32, /* bits in an address */
+ 8, /* bits in a byte */
+ bfd_arch_sparc,
+ bfd_mach_sparc_v8plusb,
+ "sparc",
+ "sparc:v8plusb",
+ 3,
+ false,
+ sparc_compatible,
+ bfd_default_scan,
+ &arch_info_struct[8],
+ },
+ {
+ 64, /* bits in a word */
+ 64, /* bits in an address */
+ 8, /* bits in a byte */
+ bfd_arch_sparc,
+ bfd_mach_sparc_v9b,
+ "sparc",
+ "sparc:v9b",
+ 3,
+ false,
+ sparc_compatible,
+ bfd_default_scan,
0,
}
};
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 1dd03514513..11ac53936ca 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -1959,33 +1959,6 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
error = false;
-#if 0
- /* ??? The native linker doesn't do this so we can't (otherwise gcc would
- have to know which linker is being used). Instead, the native linker
- bumps up the architecture level when it has to. However, I still think
- warnings like these are good, so it would be nice to have them turned on
- by some option. */
-
- /* If the output machine is normal sparc, we can't allow v9 input files. */
- if (bfd_get_mach (obfd) == bfd_mach_sparc
- && (bfd_get_mach (ibfd) == bfd_mach_sparc_v8plus
- || bfd_get_mach (ibfd) == bfd_mach_sparc_v8plusa))
- {
- error = true;
- (*_bfd_error_handler)
- (_("%s: compiled for a v8plus system and target is v8"),
- bfd_get_filename (ibfd));
- }
- /* If the output machine is v9, we can't allow v9+vis input files. */
- if (bfd_get_mach (obfd) == bfd_mach_sparc_v8plus
- && bfd_get_mach (ibfd) == bfd_mach_sparc_v8plusa)
- {
- error = true;
- (*_bfd_error_handler)
- (_("%s: compiled for a v8plusa system and target is v8plus"),
- bfd_get_filename (ibfd));
- }
-#else
if (bfd_get_mach (ibfd) >= bfd_mach_sparc_v9)
{
error = true;
@@ -1998,7 +1971,6 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd)
if (bfd_get_mach (obfd) < bfd_get_mach (ibfd))
bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd));
}
-#endif
if (((elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA)
!= previous_ibfd_e_flags)
@@ -2028,7 +2000,10 @@ elf32_sparc_object_p (abfd)
{
if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS)
{
- if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1)
+ if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3)
+ return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
+ bfd_mach_sparc_v8plusb);
+ else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1)
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc,
bfd_mach_sparc_v8plusa);
else if (elf_elfheader (abfd)->e_flags & EF_SPARC_32PLUS)
@@ -2066,6 +2041,12 @@ elf32_sparc_final_write_processing (abfd, linker)
elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1;
break;
+ case bfd_mach_sparc_v8plusb :
+ elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS;
+ elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK;
+ elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1
+ | EF_SPARC_SUN_US3;
+ break;
case bfd_mach_sparc_sparclite_le :
elf_elfheader (abfd)->e_machine = EM_SPARC;
elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA;
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index 2efe03464d8..e63bc3bd3ed 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -2929,25 +2929,26 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd)
else /* Incompatible flags */
{
error = false;
-
+
+#define EF_SPARC_ISA_EXTENSIONS \
+ (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3 | EF_SPARC_HAL_R1)
+
if ((ibfd->flags & DYNAMIC) != 0)
{
/* We don't want dynamic objects memory ordering and
architecture to have any role. That's what dynamic linker
should do. */
- new_flags &= ~(EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1);
+ new_flags &= ~(EF_SPARCV9_MM | EF_SPARC_ISA_EXTENSIONS);
new_flags |= (old_flags
- & (EF_SPARCV9_MM
- | EF_SPARC_SUN_US1
- | EF_SPARC_HAL_R1));
+ & (EF_SPARCV9_MM | EF_SPARC_ISA_EXTENSIONS));
}
else
{
/* Choose the highest architecture requirements. */
- old_flags |= (new_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1));
- new_flags |= (old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1));
- if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1))
- == (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1))
+ old_flags |= (new_flags & EF_SPARC_ISA_EXTENSIONS);
+ new_flags |= (old_flags & EF_SPARC_ISA_EXTENSIONS);
+ if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3))
+ && (old_flags & EF_SPARC_HAL_R1))
{
error = true;
(*_bfd_error_handler)
@@ -3020,8 +3021,10 @@ sparc64_elf_object_p (abfd)
bfd *abfd;
{
unsigned long mach = bfd_mach_sparc_v9;
-
- if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1)
+
+ if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3)
+ mach = bfd_mach_sparc_v9b;
+ else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1)
mach = bfd_mach_sparc_v9a;
return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, mach);
}