This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Oops, the problem remains even with binutils 2.11.90.0.5 ! [Re: ld sig11 while compiling asmutils-0.14 on RedHat-7.1]
- To: dmitry dot antipov at auriga dot ru
- Subject: Re: Oops, the problem remains even with binutils 2.11.90.0.5 ! [Re: ld sig11 while compiling asmutils-0.14 on RedHat-7.1]
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Thu, 26 Apr 2001 11:31:23 -0700
- Cc: jules at earthcorp dot com, binutils at sources dot redhat dot com
- References: <3AE7C160.4729F69@auriga.ru> <20010425235249.A7754@lucon.org> <3AE7D0F1.F68AF43C@auriga.ru>
On Thu, Apr 26, 2001 at 11:40:33AM +0400, dmitry.antipov@auriga.ru wrote:
>
> As I see, this patch is already included into nasm-0.98-6 RPM comes with
> RedHat 7.1.
> But this problem with ld still remains even with binutils 2.11.90.0.5 !
>
Another nasm bug. But ld shouldn't dump core. I will check in this
patch shortly. I will see if I can fix nasm.
H.J.
---
2001-04-26 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_check_relocs): Verify if r_symndx is
valid.
Index: elf32-i386.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-i386.c,v
retrieving revision 1.23
diff -u -p -r1.23 elf32-i386.c
--- elf32-i386.c 2001/04/06 22:50:17 1.23
+++ elf32-i386.c 2001/04/26 18:27:46
@@ -501,6 +501,20 @@ elf_i386_check_relocs (abfd, info, sec,
r_symndx = ELF32_R_SYM (rel->r_info);
+ if (r_symndx >= symtab_hdr->sh_size / symtab_hdr->sh_entsize)
+ {
+ if (abfd->my_archive)
+ (*_bfd_error_handler) (_("%s(%s): bad symbol index: %d"),
+ bfd_get_filename (abfd->my_archive),
+ bfd_get_filename (abfd),
+ r_symndx);
+ else
+ (*_bfd_error_handler) (_("%s: bad symbol index: %d"),
+ bfd_get_filename (abfd),
+ r_symndx);
+ return false;
+ }
+
if (r_symndx < symtab_hdr->sh_info)
h = NULL;
else
@@ -686,7 +700,7 @@ elf_i386_check_relocs (abfd, info, sec,
(*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"),
bfd_get_filename (abfd),
name);
- }
+ }
sreloc = bfd_get_section_by_name (dynobj, name);
if (sreloc == NULL)