summaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-02-16 12:23:12 +1030
committerAlan Modra <amodra@gmail.com>2017-02-16 22:54:36 +1030
commit247d6c4c14769b7576d810a381a68e35388ee874 (patch)
tree6657dd55cfe4ea323b1262af43b06058c43ce6fe /bfd/elf32-hppa.c
parenta48cda7f860584f98825ee6715b0da2adf65bb1a (diff)
PR21132, hppa-linux pie support doesn't work
This fixes a long-standing hppa bug seen when generating PIEs, and I think possible to trigger with forced local symbols in shared libraries. Not allocating enough space for PLT relocs results in ld writing outside of the buffer. PR 21132 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs if pic.
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index de14468a27..e64ea9aff9 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -1976,6 +1976,8 @@ allocate_plt_static (struct elf_link_hash_entry *eh, void *inf)
sec = htab->etab.splt;
eh->plt.offset = sec->size;
sec->size += PLT_ENTRY_SIZE;
+ if (bfd_link_pic (info))
+ htab->etab.srelplt->size += sizeof (Elf32_External_Rela);
}
else
{