This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
[patch] fatal signal in ppc_elf_check_relocs (was: Re: Patch for ppc _SDA_BASE_ value)
- To: GNU binutils <binutils at sourceware dot cygnus dot com>
- Subject: [patch] fatal signal in ppc_elf_check_relocs (was: Re: Patch for ppc _SDA_BASE_ value)
- From: Momchil Velikov <velco at fadata dot bg>
- Date: Sat, 01 Apr 2000 19:31:48 +0300
Hi,
The linker gets a fatal signal when reporing an error
in ppc_elf_check_relocs, because the howto table is not
initialized. It can be demonstrated this way:
$ cat > xx.c
int a;
int
foo ()
{
return a;
}
$ powerpc-svr4-gcc -c -msdata xx.c
$ powerpc-svr4-ld -shared -o xx xx.o
Segmentation fault
$
Regards,
-velco
2000-04-01 Momchil Velikov <velco@fadata.bg>
* elf32-ppc.c (ppc_elf_check_relocs): Initialize the howto
table.
--- elf32-ppc.c.orig.1 Sat Apr 1 14:56:16 2000
+++ elf32-ppc.c Sat Apr 1 14:56:32 2000
@@ -2114,6 +2114,9 @@
return false;
}
+ if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */
+ ppc_elf_howto_init ();
+
dynobj = elf_hash_table (info)->dynobj;
symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
local_got_refcounts = elf_local_got_refcounts (abfd);