]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ppc64_elf_edit_opd revamp, take 2
authorAlan Modra <amodra@gmail.com>
Tue, 9 Dec 2014 04:01:01 +0000 (14:31 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 11 Feb 2015 12:36:36 +0000 (23:06 +1030)
Now that ld -r relocs are sorted by the pr17666 fix, there isn't so
much need to sort incoming relocs.

* elf64-ppc.c (sort_r_offset): Delete.
(ppc64_elf_edit_opd): Don't sort input relocs.

bfd/ChangeLog
bfd/elf64-ppc.c

index 76e082b9fe3daa33d51e29a8ac57f4f64fc3c9af..9c07abedb6c65e88fb0a13073622f17582744c5b 100644 (file)
@@ -1,6 +1,10 @@
 2015-02-11  Alan Modra  <amodra@gmail.com>
 
        Apply from master.
+       2014-12-09  Alan Modra  <amodra@gmail.com>
+       * elf64-ppc.c (sort_r_offset): Delete.
+       (ppc64_elf_edit_opd): Don't sort input relocs.
+
        2014-12-04  Alan Modra  <amodra@gmail.com>
        PR 17666
        * elflink.c: Include bfd_stdint.h.
index 2e9d35a88681862f98ac6a7c083bbd365b163671..cb58df18d111908e09bde09cedd963e3b59a828a 100644 (file)
@@ -7589,21 +7589,6 @@ dec_dynrel_count (bfd_vma r_info,
   return FALSE;
 }
 
-/* qsort comparison function sorting relocs by r_offset.  */
-
-static int
-sort_r_offset (const void *p, const void *q)
-{
-  const Elf_Internal_Rela *a = (const Elf_Internal_Rela *) p;
-  const Elf_Internal_Rela *b = (const Elf_Internal_Rela *) q;
-
-  if (a->r_offset < b->r_offset)
-    return -1;
-  else if (a->r_offset > b->r_offset)
-    return 1;
-  return 0;
-}
-
 /* Remove unused Official Procedure Descriptor entries.  Currently we
    only remove those associated with functions in discarded link-once
    sections, or weakly defined functions that have been overridden.  It
@@ -7657,7 +7642,6 @@ ppc64_elf_edit_opd (struct bfd_link_info *info)
                                            info->keep_memory);
       if (relstart == NULL)
        return FALSE;
-      qsort (relstart, sec->reloc_count, sizeof (*relstart), sort_r_offset);
 
       /* First run through the relocs to check they are sane, and to
         determine whether we need to edit this opd section.  */