]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use stable sort for ld -r relocs
authorAlan Modra <amodra@gmail.com>
Wed, 26 Aug 2015 08:02:08 +0000 (17:32 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 6 Mar 2018 07:53:11 +0000 (18:23 +1030)
commiteb47bb4236a4e1c68572c60771f374a396b2fb13
tree47580ac4a485894d0f300378f58600f380680557
parent582d4301840c637252ba50ed86cc3d75b8103037
Use stable sort for ld -r relocs

A number of targets emit multiple relocs at a given r_offset, and
depend on those relocs staying in their original order.

PR 18867
* elflink.c (cmp_ext32l_r_offset, cmp_ext32b_r_offset): Delete.
(cmp_ext64l_r_offset, cmp_ext64b_r_offset): Delete.
(ext32l_r_offset, ext32b_r_offset, ext64l_r_offset, ext64b_r_offset):
New functions.
(elf_link_adjust_relocs): Use an insertion sort to sort relocs.
bfd/ChangeLog
bfd/elflink.c