summaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2013-03-27 13:37:50 +0000
committerAlan Modra <amodra@bigpond.net.au>2013-03-27 13:37:50 +0000
commit2a10530a84c1eded770fef33145c3733995bf5ba (patch)
tree6e7b47a0aa51c6bf80e57d63c17fbd1598ae2c7b /bfd/elflink.c
parente5535d769578d8c8c482e1f796d2380cf22f54ae (diff)
downloadbinutils-redhat-2a10530a84c1eded770fef33145c3733995bf5ba.tar.gz
* elf-bfd.h (enum elf_reloc_type_class): Add reloc_class_ifunc.
(struct elf_backend_data <elf_backed_reloc_type_class>): Add bfd_link_info* and asection* params. (_bfd_elf_reloc_type_class): Likewise. * elf.c (_bfd_elf_reloc_type_class): Likewise. * elflink.c (elf_link_sort_cmp2): Sort first on reloc class. (elf_link_sort_relocs): Update elf_backed_reloc_type_class call. * elf32-ppc.c (ppc_elf_reloc_type_class): Return reloc_class_ifunc for any reliplt reloc. Don't return reloc_class_plt for R_PPC_REL24 and R_PPC_ADDR24. * elf64-ppc.c (allocate_got): Formatting. (ppc64_elf_reloc_type_class): Return reloc_class_ifunc for any reliplt reloc. * elf-m10300.c, * elf32-arm.c, * elf32-bfin.c, * elf32-cr16.c, * elf32-cris.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32r.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-s390.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilepro.c, * elf32-vax.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-s390.c, * elf64-sparc.c, * elf64-x86-64.c, * elfnn-ia64.c, * elfxx-tilegx.c, * elfxx-tilegx.h: Add extra params to the various reloc_type_class functions.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bb981388c6..38add1a98c 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -8097,17 +8097,14 @@ elf_link_sort_cmp2 (const void *A, const void *B)
{
const struct elf_link_sort_rela *a = (const struct elf_link_sort_rela *) A;
const struct elf_link_sort_rela *b = (const struct elf_link_sort_rela *) B;
- int copya, copyb;
- if (a->u.offset < b->u.offset)
+ if (a->type < b->type)
return -1;
- if (a->u.offset > b->u.offset)
+ if (a->type > b->type)
return 1;
- copya = (a->type == reloc_class_copy) * 2 + (a->type == reloc_class_plt);
- copyb = (b->type == reloc_class_copy) * 2 + (b->type == reloc_class_plt);
- if (copya < copyb)
+ if (a->u.offset < b->u.offset)
return -1;
- if (copya > copyb)
+ if (a->u.offset > b->u.offset)
return 1;
if (a->rela->r_offset < b->rela->r_offset)
return -1;
@@ -8334,7 +8331,7 @@ elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec)
struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p;
(*swap_in) (abfd, erel, s->rela);
- s->type = (*bed->elf_backend_reloc_type_class) (s->rela);
+ s->type = (*bed->elf_backend_reloc_type_class) (info, o, s->rela);
s->u.sym_mask = r_sym_mask;
p += sort_elt;
erel += ext_size;