aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-05-15 02:22:20 +0000
committerAlan Modra <amodra@gmail.com>2006-05-15 02:22:20 +0000
commit7de713b9e51c1b283e68168c8bcbaa69384698b1 (patch)
tree41af0f9c851775588c5e7ac55774afecabf4c4ff /bfd/elf32-ppc.c
parent30b2f8e7936cdbad4ebaaab2093d50db0419cb8b (diff)
downloadgdb-7de713b9e51c1b283e68168c8bcbaa69384698b1.zip
gdb-7de713b9e51c1b283e68168c8bcbaa69384698b1.tar.gz
gdb-7de713b9e51c1b283e68168c8bcbaa69384698b1.tar.bz2
PR 2658
* elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic -shared link.
Diffstat (limited to 'bfd/elf32-ppc.c')
-rw-r--r--bfd/elf32-ppc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
index 9ee2bcd..9be70f8 100644
--- a/bfd/elf32-ppc.c
+++ b/bfd/elf32-ppc.c
@@ -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;