]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
powerpc64-ld infinite loop
authorAlan Modra <amodra@gmail.com>
Wed, 11 Mar 2020 04:13:16 +0000 (14:43 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 11 Mar 2020 04:31:15 +0000 (15:01 +1030)
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.

bfd/ChangeLog
bfd/elf64-ppc.c

index 67858c7538b11e5f6f073fb0686827ab6620eecb..c60fe8c7f9320284089e6033debb96161c79be90 100644 (file)
@@ -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-03-10  Alan Modra  <amodra@gmail.com>
 
        PR 25648
index 05ef34b030ac551cc3158080451bf31853720837..c804ab3d6af8c411c209acd0bc3b9b82d6a442fa 100644 (file)
@@ -7621,7 +7621,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;