diff options
author | Alan Modra <amodra@gmail.com> | 2018-03-17 17:22:39 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-03-21 21:42:48 +1030 |
commit | 6a3858a69e6bdff1d10136c59bfcf7a0cbe47059 (patch) | |
tree | 7f5d374172fc5bf22200ae8f344b4d98bf9caf89 /bfd | |
parent | 675e28092f9d92c56c38d40d13ad5b766bdede05 (diff) | |
download | gdb-6a3858a69e6bdff1d10136c59bfcf7a0cbe47059.zip gdb-6a3858a69e6bdff1d10136c59bfcf7a0cbe47059.tar.gz gdb-6a3858a69e6bdff1d10136c59bfcf7a0cbe47059.tar.bz2 |
Correct multi-toc tprel relocs
Commit f15d0b545b trimmed some unnecessary TPREL relocs, but missed
changing another place where they are allocated.
* elf64-ppc.c (ppc_size_one_stub): Fix comment typo.
(ppc64_elf_layout_multitoc): Allocate relocs for tprel as we
do in size_dynamic_sections.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 6846481..2493668 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2018-03-21 Alan Modra <amodra@gmail.com> + * elf64-ppc.c (ppc_size_one_stub): Fix comment typo. + (ppc64_elf_layout_multitoc): Allocate relocs for tprel as we + do in size_dynamic_sections. + +2018-03-21 Alan Modra <amodra@gmail.com> + * elf64-ppc.c (ppc64_elf_relocate_section): Don't access rel[1] without first checking array bounds. * elf32-ppc.c (ppc_elf_relocate_section): Likewise. diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 7155aeb..48eeb55 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -11356,7 +11356,7 @@ ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) local_off = PPC64_LOCAL_ENTRY_OFFSET (stub_entry->other); - /* If the branch offset if too big, use a ppc_stub_plt_branch. + /* If the branch offset is too big, use a ppc_stub_plt_branch. Do the same for -R objects without function descriptors. */ if (off + (1 << 25) >= (bfd_vma) (1 << 26) - local_off || (stub_entry->stub_type == ppc_stub_long_branch_r2off @@ -11700,7 +11700,9 @@ ppc64_elf_layout_multitoc (struct bfd_link_info *info) htab->elf.irelplt->size += rel_size; htab->got_reli_size += rel_size; } - else if (bfd_link_pic (info)) + else if (bfd_link_pic (info) + && !((ent->tls_type & TLS_TPREL) != 0 + && bfd_link_executable (info))) { asection *srel = ppc64_elf_tdata (ibfd)->relgot; srel->size += rel_size; |