aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index a754ac5..076fa6d 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -8172,7 +8172,7 @@ elf_link_adjust_relocs (bfd *abfd,
memcpy (base, onebuf, elt_size);
}
- for (p = base + elt_size; p < end; )
+ for (p = base + elt_size; (p += elt_size) < end; )
{
/* base to p is sorted, *p is next to insert. */
r_off = (*ext_r_off) (p);
@@ -8214,10 +8214,8 @@ elf_link_adjust_relocs (bfd *abfd,
memmove (loc, p, runlen);
memcpy (loc + runlen, buf, sortlen);
}
- p += runlen;
+ p += runlen - elt_size;
}
- else
- p += elt_size;
}
/* Hashes are no longer valid. */
free (reldata->hashes);