Adjust compare_link_order for unstable qsort
authorSandra Loosemore <sandra@codesourcery.com>
Wed, 15 Dec 2021 23:05:41 +0000 (16:05 -0700)
committerAlan Modra <amodra@gmail.com>
Thu, 16 Dec 2021 06:55:55 +0000 (17:25 +1030)
commit6628ac006d166a7e373846538a6097a3150946e9
tree8d0083348d233804bbe39811fe6099b88098ab0f
parent05f62e0c9a0b14e211c6b2b6234095b50794b20b
Adjust compare_link_order for unstable qsort

In a cross toolchain for nios2-elf target and x86_64-w64-mingw32 host
using binutils 2.37, we observed a failure that didn't show up on
x86_64-linux-gnu host:  testcase pr25490-5.s was failing with

C:\path\to\nios2-elf-ld.exe: looping in map_segments
FAIL: __patchable_function_entries section 5

     * ldelfgen.c (compare_link_order): Don't use section id in
sorting.  Keep original ordering instead.  Update comments.
ld/ldelfgen.c