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>
Wed, 26 Aug 2015 14:04:10 +0000 (23:34 +0930)
commit0e28778672160ee57d12fcc4f0e631122088fe69
treeacc29a02c3b5e3a00d0aa0ad62d3bd74ed05ce67
parentc97c330ba8e80776c546e5f562916bf077e358b3
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