This is the mail archive of the binutils@sourceware.org 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]

fix pr2658, segfault in ppc_elf_relax_section


Applying mainline and 2.17.

	PR 2658
	* elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
	-shared link.

Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.197
diff -u -p -r1.197 elf32-ppc.c
--- bfd/elf32-ppc.c	2 May 2006 01:41:20 -0000	1.197
+++ bfd/elf32-ppc.c	15 May 2006 02:01:17 -0000
@@ -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;

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