binutils-gdb/ld/testsuite/ld-elf/pr29259.s
Tomoaki Kawada fba1ac87dc 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.
2022-06-18 20:11:23 +09:30

14 lines
252 B
ArmAsm

.data
.L1:
.section ".data.1", "aw", %progbits
.p2align 5
.dc.a .L1
.section ".data.2", "aw", %progbits
.p2align 5
.dc.a .L1
.section ".data.3", "aw", %progbits
.p2align 5
.dc.a .L1
.section ".data.4", "aw", %progbits
.p2align 5
.dc.a .L1