This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: gas misbehavior in binutils-2.16.1 for sh4 target and--enable-shared
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: vapier at gentoo dot org
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 25 Aug 2005 14:13:29 +0900 (JST)
- Subject: Re: gas misbehavior in binutils-2.16.1 for sh4 target and--enable-shared
- References: <200508241953.14014.vapier@gentoo.org>
Mike Frysinger <vapier@gentoo.org> wrote:
> binutils-2.16.1 with --enabled-shared:
> test.o: ELF 32-bit LSB relocatable, Hitachi SH, version 1 (SYSV), not stripped
> Flags: 0x19, unknown ISA
It's caused by an off-by-one error. Thanks for catching it.
sh_elf_get_flags_from_mach looks up a value in a table starting with
the wrong index. I've committed the attached patch.
Regards,
kaz
--
2005-08-25 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* elf32-sh.c (sh_elf_get_flags_from_mach): Fix off-by-one error.
--- ORIG/src/bfd/elf32-sh.c 2005-08-25 11:59:27.000000000 +0900
+++ LOCAL/src/bfd/elf32-sh.c 2005-08-25 12:05:33.000000000 +0900
@@ -6655,7 +6655,7 @@ sh_elf_set_mach_from_flags (bfd *abfd)
int
sh_elf_get_flags_from_mach (unsigned long mach)
{
- int i = ARRAY_SIZE (sh_ef_bfd_table);
+ int i = ARRAY_SIZE (sh_ef_bfd_table) - 1;
for (; i>0; i--)
if (sh_ef_bfd_table[i] == mach)