This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix SPARC v8plusb handling
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Cc: davem at redhat dot com
- Date: Fri, 30 Jul 2004 09:54:58 +0200
- Subject: [PATCH] Fix SPARC v8plusb handling
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
elf32_sparc_merge_private_bfd_data expected all machines >=
bfd_mach_sparc_v9 to be 64-bit, which has been originally true, but after
v8plusb was added is false.
I have created a new macro and put it just below the defines, so that
it is more likely it will be adjusted when v8plusc or v8plusd arches
will be added...
2004-07-30 Jakub Jelinek <jakub@redhat.com>
* archures.c (bfd_mach_sparc_64bit_p): Define.
* elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Use it.
* bfd-in2.h: Rebuilt.
--- bfd/bfd-in2.h.jj 2004-07-30 11:41:56.000000000 +0200
+++ bfd/bfd-in2.h 2004-07-30 12:02:44.376310497 +0200
@@ -1576,6 +1576,9 @@ enum bfd_architecture
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
&& (mach) != bfd_mach_sparc_sparclite_le)
+/* Nonzero if MACH is a 64 bit sparc architecture. */
+#define bfd_mach_sparc_64bit_p(mach) \
+ ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
--- bfd/elf32-sparc.c.jj 2004-07-01 16:28:46.000000000 +0200
+++ bfd/elf32-sparc.c 2004-07-30 12:02:07.816774162 +0200
@@ -3303,6 +3303,7 @@ elf32_sparc_merge_private_bfd_data (ibfd
bfd *obfd;
{
bfd_boolean error;
+ unsigned long ibfd_mach;
/* FIXME: This should not be static. */
static unsigned long previous_ibfd_e_flags = (unsigned long) -1;
@@ -3312,7 +3313,8 @@ elf32_sparc_merge_private_bfd_data (ibfd
error = FALSE;
- if (bfd_get_mach (ibfd) >= bfd_mach_sparc_v9)
+ ibfd_mach = bfd_get_mach (ibfd);
+ if (bfd_mach_sparc_64bit_p (ibfd_mach))
{
error = TRUE;
(*_bfd_error_handler)
@@ -3321,8 +3323,8 @@ elf32_sparc_merge_private_bfd_data (ibfd
}
else if ((ibfd->flags & DYNAMIC) == 0)
{
- if (bfd_get_mach (obfd) < bfd_get_mach (ibfd))
- bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd));
+ if (bfd_get_mach (obfd) < ibfd_mach)
+ bfd_set_arch_mach (obfd, bfd_arch_sparc, ibfd_mach);
}
if (((elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA)
--- bfd/archures.c.jj 2004-07-30 11:41:56.000000000 +0200
+++ bfd/archures.c 2004-07-30 11:57:15.836394268 +0200
@@ -128,6 +128,9 @@ DESCRIPTION
.#define bfd_mach_sparc_v9_p(mach) \
. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
. && (mach) != bfd_mach_sparc_sparclite_le)
+.{* Nonzero if MACH is a 64 bit sparc architecture. *}
+.#define bfd_mach_sparc_64bit_p(mach) \
+. ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
. bfd_arch_mips, {* MIPS Rxxxx *}
.#define bfd_mach_mips3000 3000
.#define bfd_mach_mips3900 3900
Jakub