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]

elf64-ppc undefined sym fix


The comment says it all.

	* elf64-ppc.c (ppc_build_one_stub): Point undefined function syms
	at the plt call stub.

Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.40
diff -u -p -r1.40 elf64-ppc.c
--- bfd/elf64-ppc.c	17 May 2002 13:25:04 -0000	1.40
+++ bfd/elf64-ppc.c	20 May 2002 12:56:21 -0000
@@ -4153,6 +4153,20 @@ ppc_build_one_stub (gen_entry, in_arg)
       htab->sglink->_cooked_size = p - htab->sglink->contents;
       htab->sglink->reloc_count += 1;
 
+      /* Do the best we can for shared libraries built without
+	 exporting ".foo" for each "foo".  This can happen when symbol
+	 versioning scripts strip all bar a subset of symbols.  */
+      if (stub_entry->h->oh->root.type != bfd_link_hash_defined
+	  && stub_entry->h->oh->root.type != bfd_link_hash_defweak)
+	{
+	  /* Point the symbol at the stub.  There may be multiple stubs,
+	     we don't really care;  The main thing is to make this sym
+	     defined somewhere.  */
+	  stub_entry->h->oh->root.type = bfd_link_hash_defined;
+	  stub_entry->h->oh->root.u.def.section = stub_entry->stub_sec;
+	  stub_entry->h->oh->root.u.def.value = stub_entry->stub_offset;
+	}
+
       /* Now build the stub.  */
       off = stub_entry->h->elf.plt.offset;
       if (off >= (bfd_vma) -2)

-- 
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]