aboutsummaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-04-13 08:32:55 +0200
committerAlan Modra <amodra@gmail.com>2021-04-13 18:23:39 +0930
commitd2f1139ef0c006f35210fac76cb034cfe8d57c2e (patch)
treea3df665f58341934b54f4d8b21005e3b54154a3b /bfd/xcofflink.c
parent1cfc6f00e45104551da9146bb413b60acd0e387f (diff)
downloadbinutils-d2f1139ef0c006f35210fac76cb034cfe8d57c2e.zip
binutils-d2f1139ef0c006f35210fac76cb034cfe8d57c2e.tar.gz
binutils-d2f1139ef0c006f35210fac76cb034cfe8d57c2e.tar.bz2
bfd: avoid infinite loop when static linking XCOFF
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.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 8404862..f0e0fe7 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -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. */