* fix pr2658, segfault in ppc_elf_relax_section
@ 2006-05-15 10:14 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2006-05-15 10:14 UTC (permalink / raw)
To: binutils; +Cc: Lior Balkohen
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-05-15 2:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-15 10:14 fix pr2658, segfault in ppc_elf_relax_section Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).