diff options
author | Tomoaki Kawada <kawada@kmckk.co.jp> | 2022-06-16 09:54:30 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-06-18 20:11:23 +0930 |
commit | fba1ac87dcb76e61f270d236f1e7c8aaec80f9c4 (patch) | |
tree | 4122da4e90d8f5897cec0d8719132794548883de /zlib/examples/gzappend.c | |
parent | 3f52a09075e3c62f2150375bb7fca338e7db45e7 (diff) | |
download | binutils-fba1ac87dcb76e61f270d236f1e7c8aaec80f9c4.zip binutils-fba1ac87dcb76e61f270d236f1e7c8aaec80f9c4.tar.gz binutils-fba1ac87dcb76e61f270d236f1e7c8aaec80f9c4.tar.bz2 |
Fix the sorting algorithm for reloc entries
The optimized insertion sort algorithm in `elf_link_adjust_relocs`
incorrectly assembled "runs" from unsorted entries and inserted them to an
already-sorted prefix, breaking the loop invariants of insertion sort.
This commit updates the run assembly loop to break upon encountering a
non-monotonic change in the sort key.
PR 29259
bfd/
* elflink.c (elf_link_adjust_relocs): Ensure run being inserted
is sorted.
ld/
* testsuite/ld-elf/pr29259.d,
* testsuite/ld-elf/pr29259.s,
* testsuite/ld-elf/pr29259.t: New test.
Diffstat (limited to 'zlib/examples/gzappend.c')
0 files changed, 0 insertions, 0 deletions