mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
fba1ac87dc
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.
14 lines
135 B
Makefile
14 lines
135 B
Makefile
#ld: -r -T pr29259.t
|
|
#readelf: -Wr
|
|
|
|
Relocation section .*
|
|
+Offset +Info +Type .*
|
|
0+00 .*
|
|
#...
|
|
0+20 .*
|
|
#...
|
|
0+40 .*
|
|
#...
|
|
0+60 .*
|
|
#pass
|