diff options
author | Alan Modra <amodra@gmail.com> | 2020-03-11 14:43:16 +1030 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2020-05-08 20:42:42 +0300 |
commit | 6bd720998abdcd0fddb1fab59c6c82256cd09886 (patch) | |
tree | d578013319b670e97c313c9151b92f5a337a7215 | |
parent | Automatic date update in version.in (diff) | |
download | binutils-gdb-6bd720998abdcd0fddb1fab59c6c82256cd09886.tar.gz binutils-gdb-6bd720998abdcd0fddb1fab59c6c82256cd09886.tar.bz2 binutils-gdb-6bd720998abdcd0fddb1fab59c6c82256cd09886.zip |
powerpc64-ld infinite loop
If this code dealing with possible conversion of inline plt sequences
is ever executed, ld will hang. A binary with such sequences and of
code size larger than approximately 90% the reach of an unconditional
branch is the trigger. Oops.
* elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop.
(cherry picked from commit 435edf0bf231240ccecb474b74ebb49dc8db2633)
(cherry picked from commit de9c1b7cfe6e57ea8b677dc2de06e83de50f47c2)
-rw-r--r-- | bfd/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 702416cd43b..fd102a9cfe0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2020-03-11 Alan Modra <amodra@gmail.com> + + * elf64-ppc.c (ppc64_elf_inline_plt): Do increment rel in for loop. + 2020-02-27 Alan Modra <amodra@gmail.com> PR 24511 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 73ea2865fd5..bea722c6b98 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -7507,7 +7507,7 @@ ppc64_elf_inline_plt (struct bfd_link_info *info) return FALSE; relend = relstart + sec->reloc_count; - for (rel = relstart; rel < relend; ) + for (rel = relstart; rel < relend; rel++) { enum elf_ppc64_reloc_type r_type; unsigned long r_symndx; |