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]

ppc64 ld segfault on ABI incompatible shared lib.


Fixes a segfault in ppc_size_one_stub caused by someone exporting a
function code symbol without exporting a corresponding opd entry from a
shared lib.

	* elf64-ppc.c (ppc_type_of_stub): Disallow stubs other than
	ppc_stub_plt_call to symbols defined in shared libs.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.139
diff -u -p -r1.139 elf64-ppc.c
--- bfd/elf64-ppc.c	18 Nov 2003 04:14:15 -0000	1.139
+++ bfd/elf64-ppc.c	25 Nov 2003 01:58:42 -0000
@@ -6070,8 +6070,9 @@ ppc_type_of_stub (asection *input_sec,
 	      }
 	}
 
-      if (h->elf.root.type != bfd_link_hash_defined
-	  && h->elf.root.type != bfd_link_hash_defweak)
+      if (!(h->elf.root.type == bfd_link_hash_defined
+	    || h->elf.root.type == bfd_link_hash_defweak)
+	  || h->elf.root.u.def.section->output_section == NULL)
 	return ppc_stub_none;
     }
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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