bfd: avoid infinite loop when static linking XCOFF
authorClément Chigot <clement.chigot@atos.net>
Tue, 13 Apr 2021 06:32:55 +0000 (08:32 +0200)
committerAlan Modra <amodra@gmail.com>
Tue, 13 Apr 2021 08:53:39 +0000 (18:23 +0930)
git commit b95a0a3177bc changed a "return FALSE" to "continue", and
missed updating the while loop iterator.

* xcofflink.c (xcoff_link_check_ar_symbols): Update esym earlier.

bfd/ChangeLog
bfd/xcofflink.c

index 28c5791282c5cf5821555bca4f8f5748bef608c6..1603be8e954014d74299ee178d524eccf8da2933 100644 (file)
@@ -1,3 +1,7 @@
+2021-04-13  Clément Chigot  <clement.chigot@atos.net>
+
+       * xcofflink.c (xcoff_link_check_ar_symbols): Update esym earlier.
+
 2021-04-13  Nelson Chu  <nelson.chu@sifive.com>
 
        * elfnn-riscv.c (riscv_version_mismatch): Do not report the warning
index 84048620b8e77c01b697ff3c730b1b457f80c81b..f0e0fe7aafc9e3991869b618289f838d91a1be4d 100644 (file)
@@ -2349,6 +2349,7 @@ xcoff_link_check_ar_symbols (bfd *abfd,
       struct internal_syment sym;
 
       bfd_coff_swap_sym_in (abfd, (void *) esym, (void *) &sym);
+      esym += (sym.n_numaux + 1) * symesz;
 
       if (EXTERN_SYM_P (sym.n_sclass) && sym.n_scnum != N_UNDEF)
        {
@@ -2382,8 +2383,6 @@ xcoff_link_check_ar_symbols (bfd *abfd,
              return true;
            }
        }
-
-      esym += (sym.n_numaux + 1) * symesz;
     }
 
   /* We do not need this object file.  */
This page took 0.02672 seconds and 4 git commands to generate.