This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: binutils test failure on PPC: Segementation fault in ppc_elf_create_linker_section


On Fri, Apr 12, 2002 at 11:14:26AM +0200, Andreas Jaeger wrote:
> 
> Running /usr/src/packages/BUILD/binutils-2.12.90.0.4/ld/testsuite/ld-srec/srec.exp ...
> FAIL: S-records
> 
> The problem is a segmentation fault in ld:

Caused by the hash table for the srec linker being a
struct generic_link_hash_table rather than a
struct elf_link_hash_table.  

bfd/ChangeLog
	* elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.40
diff -u -p -r1.40 elf32-ppc.c
--- bfd/elf32-ppc.c	19 Feb 2002 12:40:25 -0000	1.40
+++ bfd/elf32-ppc.c	15 Apr 2002 08:43:25 -0000
@@ -2542,7 +2542,8 @@ ppc_elf_add_symbol_hook (abfd, info, sym
 {
   if (sym->st_shndx == SHN_COMMON
       && !info->relocateable
-      && sym->st_size <= elf_gp_size (abfd))
+      && sym->st_size <= elf_gp_size (abfd)
+      && info->hash->creator->flavour == bfd_target_elf_flavour)
     {
       /* Common symbols less than or equal to -G nn bytes are automatically
 	 put into .sdata.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]