PR 2658
authorAlan Modra <amodra@gmail.com>
Mon, 15 May 2006 02:22:20 +0000 (02:22 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 15 May 2006 02:22:20 +0000 (02:22 +0000)
* elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
-shared link.

bfd/ChangeLog
bfd/elf32-ppc.c

index c64ae218c1203e03fc9512babaf7e1dd5c6aa737..d5e2c7904cc454b4ffec6ae39cd012d71fcb6bc0 100644 (file)
@@ -1,3 +1,9 @@
+2006-05-15  Alan Modra  <amodra@bigpond.net.au>
+
+       PR 2658
+       * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
+       -shared link.
+
 2006-05-11  Michael Matz  <matz@suse.de>
 
        * elflink.c (match_group_member): Correctly iterate group
index 9ee2bcd85732df67164460f44f87a046d4b17496..9be70f82ce760ed2a7239c1cef80307c15c8d61e 100644 (file)
@@ -5181,6 +5181,10 @@ ppc_elf_relax_section (bfd *abfd,
       else if (r_type != R_PPC_PLTREL24)
        toff += irel->r_addend;
 
+      /* Attempted -shared link of non-pic code loses.  */
+      if (tsec->output_section == NULL)
+       continue;
+
       symaddr = tsec->output_section->vma + tsec->output_offset + toff;
 
       roff = irel->r_offset;