Incompatibility of PIC and non-PIC

David Huggins-Daines dhd@linuxcare.com
21 Aug 2000 13:46:19 -0400


Alan Modra <alan@linuxcare.com.au> writes:

> In some ways not having any hardware to run hppa-linux binaries on is
> good, as it gives me some excuse.  :-)

Well I'm enjoying tracking these problems down, even if the solutions
I propose are usually wrong :-)

> Let me know how this one goes.

Quite well, once I did this:

Index: bfd/elf32-hppa.c
===================================================================
RCS file: /home/cvs/parisc/binutils-2.10/bfd/elf32-hppa.c,v
retrieving revision 1.24
diff -u -p -r1.24 elf32-hppa.c
--- elf32-hppa.c	2000/08/19 12:21:12	1.24
+++ elf32-hppa.c	2000/08/21 17:39:36
@@ -957,7 +957,8 @@ hppa_build_one_stub (gen_entry, in_arg)
 
       if (!info->shared
 	  && stub_entry->h != NULL
-	  && stub_entry->h->pic_call)
+	  && stub_entry->h->pic_call
+	  && stub_entry->h->elf.plt.offset != (bfd_vma) -1)
 	{
 	  /* Build the .plt entry needed to call a PIC function from
 	     statically linked code.  We don't need any relocs.  */

I'm not sure why it's generating multiple stubs for the same symbol,
though.

-- 
dhd@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.