This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNU ld ifunc dynamic relocation order


This part addresses -zcombreloc sorting.  GNU ld currently sorts
dynamic relocs for -zcombreloc (usually the default), and destroys any
order the backend imposes.

So here I add some parameters to elf_backend_reloc_type_class in order
to give the backend some chance of distinguishing ifunc relocations
from other types.  It's not quite as simple as looking at the reloc to
find a symbol index, then testing the type of symbol, because we
currently don't have a mapping of output dynamic symbol index to
hash table symbol entry.  (A backend could generate such a map if
necessary.)  Instead, I make the assumption that backends will keep
ifunc relocations in a separate section, so their reloc_type_class
function can simply check for that section or sections.

I also change the second dynamic reloc sort function to sort first on
reloc class.  Previously the sorting was first on low address of
groups of relocs all against the same symbol.  This should not make a
great deal of difference to ld.so efficiency since by this stage we
have excluded reloc_class_relative by the first sort function, and
reloc_class_plt normally belong in .rel(a).plt, not .rel(a).dyn.  So
we should have only reloc_class_normal, reloc_class_copy and
reloc_class_ifunc relocs, and unless I'm quite mistaken a given symbol
won't appear in more than one of these classes.

The third part of this series hasn't been completed yet, but will
take care to order powerpc64 ifunc relocs as was done in part one for
powerpc.  I intend to leave other target modifications to their
respective maintainers.

	* 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.

Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.368
diff -u -p -r1.368 elf-bfd.h
--- bfd/elf-bfd.h	25 Mar 2013 06:00:06 -0000	1.368
+++ bfd/elf-bfd.h	27 Mar 2013 10:50:53 -0000
@@ -641,7 +641,8 @@ enum elf_reloc_type_class {
   reloc_class_normal,
   reloc_class_relative,
   reloc_class_plt,
-  reloc_class_copy
+  reloc_class_copy,
+  reloc_class_ifunc
 };
 
 struct elf_reloc_cookie
@@ -1128,7 +1129,7 @@ struct elf_backend_data
 
   /* This function returns class of a reloc type.  */
   enum elf_reloc_type_class (*elf_backend_reloc_type_class)
-    (const Elf_Internal_Rela *);
+  (const struct bfd_link_info *, const asection *, const Elf_Internal_Rela *);
 
   /* This function, if defined, removes information about discarded functions
      from other sections which mention them.  */
@@ -1777,7 +1778,8 @@ extern bfd_boolean _bfd_elf_can_make_rel
   (bfd *input_bfd, struct bfd_link_info *info, asection *eh_frame_section);
 
 extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
-  (const Elf_Internal_Rela *);
+  (const struct bfd_link_info *, const asection *,
+   const Elf_Internal_Rela *);
 extern bfd_vma _bfd_elf_rela_local_sym
   (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *);
 extern bfd_vma _bfd_elf_rel_local_sym
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.590
diff -u -p -r1.590 elf.c
--- bfd/elf.c	25 Mar 2013 06:00:06 -0000	1.590
+++ bfd/elf.c	27 Mar 2013 10:50:54 -0000
@@ -9756,7 +9756,9 @@ bfd_get_elf_phdrs (bfd *abfd, void *phdr
 }
 
 enum elf_reloc_type_class
-_bfd_elf_reloc_type_class (const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED)
+_bfd_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED)
 {
   return reloc_class_normal;
 }
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.484
diff -u -p -r1.484 elflink.c
--- bfd/elflink.c	26 Mar 2013 07:02:52 -0000	1.484
+++ bfd/elflink.c	27 Mar 2013 10:50:58 -0000
@@ -8097,17 +8097,14 @@ elf_link_sort_cmp2 (const void *A, const
 {
   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 
 	    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;
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.328
diff -u -p -r1.328 elf32-ppc.c
--- bfd/elf32-ppc.c	27 Mar 2013 13:25:48 -0000	1.328
+++ bfd/elf32-ppc.c	27 Mar 2013 13:26:54 -0000
@@ -9362,14 +9362,19 @@ ppc_elf_finish_dynamic_symbol (bfd *outp
 }
 
 static enum elf_reloc_type_class
-ppc_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+ppc_elf_reloc_type_class (const struct bfd_link_info *info,
+			  const asection *rel_sec,
+			  const Elf_Internal_Rela *rela)
 {
+  struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info);
+
+  if (rel_sec == htab->reliplt)
+    return reloc_class_ifunc;
+
   switch (ELF32_R_TYPE (rela->r_info))
     {
     case R_PPC_RELATIVE:
       return reloc_class_relative;
-    case R_PPC_REL24:
-    case R_PPC_ADDR24:
     case R_PPC_JMP_SLOT:
       return reloc_class_plt;
     case R_PPC_COPY:
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.405
diff -u -p -r1.405 elf64-ppc.c
--- bfd/elf64-ppc.c	21 Feb 2013 03:02:30 -0000	1.405
+++ bfd/elf64-ppc.c	27 Mar 2013 10:50:58 -0000
@@ -8816,8 +8816,8 @@ allocate_got (struct elf_link_hash_entry
   dyn = htab->elf.dynamic_sections_created;
   if ((info->shared
        || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))
-	    && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
-		|| h->root.type != bfd_link_hash_undefweak))
+      && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+	  || h->root.type != bfd_link_hash_undefweak))
     {
       asection *relgot = ppc64_elf_tdata (gent->owner)->relgot;
       relgot->size += rentsize;
@@ -14062,9 +14062,15 @@ ppc64_elf_finish_dynamic_symbol (bfd *ou
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-ppc64_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+ppc64_elf_reloc_type_class (const struct bfd_link_info *info,
+			    const asection *rel_sec,
+			    const Elf_Internal_Rela *rela)
 {
   enum elf_ppc64_reloc_type r_type;
+  struct ppc_link_hash_table *htab = ppc_hash_table (info);
+
+  if (rel_sec == htab->reliplt)
+    return reloc_class_ifunc;
 
   r_type = ELF64_R_TYPE (rela->r_info);
   switch (r_type)
Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10300.c,v
retrieving revision 1.120
diff -u -p -r1.120 elf-m10300.c
--- bfd/elf-m10300.c	11 Feb 2013 05:30:54 -0000	1.120
+++ bfd/elf-m10300.c	27 Mar 2013 10:50:54 -0000
@@ -5532,7 +5532,9 @@ _bfd_mn10300_elf_finish_dynamic_sections
    properly.  */
 
 static enum elf_reloc_type_class
-_bfd_mn10300_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+_bfd_mn10300_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+				   const asection *rel_sec ATTRIBUTE_UNUSED,
+				   const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.311
diff -u -p -r1.311 elf32-arm.c
--- bfd/elf32-arm.c	21 Mar 2013 10:34:11 -0000	1.311
+++ bfd/elf32-arm.c	27 Mar 2013 10:50:55 -0000
@@ -14429,7 +14429,9 @@ elf32_arm_post_process_headers (bfd * ab
 }
 
 static enum elf_reloc_type_class
-elf32_arm_reloc_type_class (const Elf_Internal_Rela *rela)
+elf32_arm_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			    const asection *rel_sec ATTRIBUTE_UNUSED,
+			    const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-bfin.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-bfin.c,v
retrieving revision 1.61
diff -u -p -r1.61 elf32-bfin.c
--- bfd/elf32-bfin.c	10 Feb 2013 04:01:15 -0000	1.61
+++ bfd/elf32-bfin.c	27 Mar 2013 10:50:55 -0000
@@ -1301,7 +1301,9 @@ bfin_check_relocs (bfd * abfd,
 }
 
 static enum elf_reloc_type_class
-elf32_bfin_reloc_type_class (const Elf_Internal_Rela * rela)
+elf32_bfin_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela * rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-cr16.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16.c,v
retrieving revision 1.25
diff -u -p -r1.25 elf32-cr16.c
--- bfd/elf32-cr16.c	11 Feb 2013 05:30:54 -0000	1.25
+++ bfd/elf32-cr16.c	27 Mar 2013 10:50:55 -0000
@@ -2916,7 +2916,9 @@ error_return:
    properly.  */
 
 static enum elf_reloc_type_class
-_bfd_cr16_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+_bfd_cr16_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+				const asection *rel_sec ATTRIBUTE_UNUSED,
+				const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-cris.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cris.c,v
retrieving revision 1.129
diff -u -p -r1.129 elf32-cris.c
--- bfd/elf32-cris.c	21 Feb 2013 03:02:28 -0000	1.129
+++ bfd/elf32-cris.c	27 Mar 2013 10:50:55 -0000
@@ -4241,7 +4241,9 @@ cris_elf_copy_private_bfd_data (bfd *ibf
 }
 
 static enum elf_reloc_type_class
-elf_cris_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_cris_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela)
 {
   enum elf_cris_reloc_type r_type = ELF32_R_TYPE (rela->r_info);
   switch (r_type)
Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.192
diff -u -p -r1.192 elf32-hppa.c
--- bfd/elf32-hppa.c	21 Feb 2013 03:02:29 -0000	1.192
+++ bfd/elf32-hppa.c	27 Mar 2013 10:50:55 -0000
@@ -4436,7 +4436,9 @@ elf32_hppa_finish_dynamic_symbol (bfd *o
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
+elf32_hppa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   /* Handle TLS relocs first; we don't want them to be marked
      relative by the "if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)"
Index: bfd/elf32-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-i386.c,v
retrieving revision 1.302
diff -u -p -r1.302 elf32-i386.c
--- bfd/elf32-i386.c	21 Feb 2013 03:02:29 -0000	1.302
+++ bfd/elf32-i386.c	27 Mar 2013 10:50:55 -0000
@@ -4718,7 +4718,9 @@ elf_i386_finish_local_dynamic_symbol (vo
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf_i386_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_i386_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela)
 {
   switch (ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-lm32.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-lm32.c,v
retrieving revision 1.19
diff -u -p -r1.19 elf32-lm32.c
--- bfd/elf32-lm32.c	21 Feb 2013 02:29:09 -0000	1.19
+++ bfd/elf32-lm32.c	27 Mar 2013 10:50:55 -0000
@@ -1741,7 +1741,9 @@ lm32_elf_finish_dynamic_symbol (bfd *out
 }
 
 static enum elf_reloc_type_class
-lm32_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+lm32_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-m32r.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m32r.c,v
retrieving revision 1.111
diff -u -p -r1.111 elf32-m32r.c
--- bfd/elf32-m32r.c	10 Feb 2013 04:36:31 -0000	1.111
+++ bfd/elf32-m32r.c	27 Mar 2013 10:50:56 -0000
@@ -3981,7 +3981,9 @@ static const struct bfd_elf_special_sect
 };
 
 static enum elf_reloc_type_class
-m32r_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+m32r_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-m68k.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.140
diff -u -p -r1.140 elf32-m68k.c
--- bfd/elf32-m68k.c	21 Feb 2013 03:02:29 -0000	1.140
+++ bfd/elf32-m68k.c	27 Mar 2013 10:50:56 -0000
@@ -4737,7 +4737,9 @@ bfd_elf_m68k_set_target_options (struct 
 }
 
 static enum elf_reloc_type_class
-elf32_m68k_reloc_type_class (const Elf_Internal_Rela *rela)
+elf32_m68k_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-metag.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-metag.c,v
retrieving revision 1.6
diff -u -p -r1.6 elf32-metag.c
--- bfd/elf32-metag.c	11 Feb 2013 05:30:54 -0000	1.6
+++ bfd/elf32-metag.c	27 Mar 2013 10:50:56 -0000
@@ -3257,7 +3257,9 @@ elf_metag_post_process_headers (bfd * ab
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf_metag_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_metag_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			    const asection *rel_sec ATTRIBUTE_UNUSED,
+			    const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-nios2.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-nios2.c,v
retrieving revision 1.3
diff -u -p -r1.3 elf32-nios2.c
--- bfd/elf32-nios2.c	21 Feb 2013 03:02:29 -0000	1.3
+++ bfd/elf32-nios2.c	27 Mar 2013 10:50:56 -0000
@@ -3977,7 +3977,9 @@ nios2_elf32_link_hash_table_create (bfd 
 
 /* Implement elf_backend_reloc_type_class.  */
 static enum elf_reloc_type_class
-nios2_elf32_reloc_type_class (const Elf_Internal_Rela *rela)
+nios2_elf32_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			      const asection *rel_sec ATTRIBUTE_UNUSED,
+			      const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-s390.c,v
retrieving revision 1.128
diff -u -p -r1.128 elf32-s390.c
--- bfd/elf32-s390.c	21 Feb 2013 03:02:29 -0000	1.128
+++ bfd/elf32-s390.c	27 Mar 2013 10:50:56 -0000
@@ -3712,7 +3712,9 @@ elf_s390_finish_dynamic_symbol (bfd *out
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf_s390_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_s390_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
@@ -3940,7 +3942,6 @@ elf32_s390_merge_private_bfd_data (bfd *
 #define elf_backend_relocate_section	      elf_s390_relocate_section
 #define elf_backend_size_dynamic_sections     elf_s390_size_dynamic_sections
 #define elf_backend_init_index_section	      _bfd_elf_init_1_index_section
-#define elf_backend_reloc_type_class	      elf_s390_reloc_type_class
 #define elf_backend_grok_prstatus	      elf_s390_grok_prstatus
 #define elf_backend_plt_sym_val		      elf_s390_plt_sym_val
 #define elf_backend_add_symbol_hook           elf_s390_add_symbol_hook
Index: bfd/elf32-sh.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh.c,v
retrieving revision 1.186
diff -u -p -r1.186 elf32-sh.c
--- bfd/elf32-sh.c	21 Feb 2013 03:02:29 -0000	1.186
+++ bfd/elf32-sh.c	27 Mar 2013 10:50:56 -0000
@@ -7261,7 +7261,9 @@ sh_elf_finish_dynamic_sections (bfd *out
 }
 
 static enum elf_reloc_type_class
-sh_elf_reloc_type_class (const Elf_Internal_Rela *rela)
+sh_elf_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			 const asection *rel_sec ATTRIBUTE_UNUSED,
+			 const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sparc.c,v
retrieving revision 1.97
diff -u -p -r1.97 elf32-sparc.c
--- bfd/elf32-sparc.c	21 Feb 2013 03:02:29 -0000	1.97
+++ bfd/elf32-sparc.c	27 Mar 2013 10:50:56 -0000
@@ -153,7 +153,9 @@ elf32_sparc_final_write_processing (bfd 
 }
 
 static enum elf_reloc_type_class
-elf32_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
+elf32_sparc_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			      const asection *rel_sec ATTRIBUTE_UNUSED,
+			      const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-tilepro.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-tilepro.c,v
retrieving revision 1.18
diff -u -p -r1.18 elf32-tilepro.c
--- bfd/elf32-tilepro.c	21 Feb 2013 03:02:29 -0000	1.18
+++ bfd/elf32-tilepro.c	27 Mar 2013 10:50:56 -0000
@@ -3964,7 +3964,9 @@ tilepro_elf_plt_sym_val (bfd_vma i, cons
 }
 
 static enum elf_reloc_type_class
-tilepro_reloc_type_class (const Elf_Internal_Rela *rela)
+tilepro_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			  const asection *rel_sec ATTRIBUTE_UNUSED,
+			  const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-vax.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-vax.c,v
retrieving revision 1.74
diff -u -p -r1.74 elf32-vax.c
--- bfd/elf32-vax.c	10 Feb 2013 04:36:32 -0000	1.74
+++ bfd/elf32-vax.c	27 Mar 2013 10:50:57 -0000
@@ -2026,7 +2026,9 @@ elf_vax_finish_dynamic_sections (bfd *ou
 }
 
 static enum elf_reloc_type_class
-elf_vax_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_vax_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			  const asection *rel_sec ATTRIBUTE_UNUSED,
+			  const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.139
diff -u -p -r1.139 elf32-xtensa.c
--- bfd/elf32-xtensa.c	21 Feb 2013 03:02:29 -0000	1.139
+++ bfd/elf32-xtensa.c	27 Mar 2013 10:50:57 -0000
@@ -3585,7 +3585,9 @@ elf_xtensa_final_write_processing (bfd *
 
 
 static enum elf_reloc_type_class
-elf_xtensa_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_xtensa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elf64-aarch64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-aarch64.c,v
retrieving revision 1.10
diff -u -p -r1.10 elf64-aarch64.c
--- bfd/elf64-aarch64.c	8 Mar 2013 17:37:28 -0000	1.10
+++ bfd/elf64-aarch64.c	27 Mar 2013 10:50:57 -0000
@@ -5560,7 +5560,9 @@ elf64_aarch64_post_process_headers (bfd 
 }
 
 static enum elf_reloc_type_class
-elf64_aarch64_reloc_type_class (const Elf_Internal_Rela *rela)
+elf64_aarch64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+				const asection *rel_sec ATTRIBUTE_UNUSED,
+				const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF64_R_TYPE (rela->r_info))
     {
Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.190
diff -u -p -r1.190 elf64-alpha.c
--- bfd/elf64-alpha.c	18 Feb 2013 02:56:58 -0000	1.190
+++ bfd/elf64-alpha.c	27 Mar 2013 10:50:57 -0000
@@ -5315,7 +5315,9 @@ elf64_alpha_final_link (bfd *abfd, struc
 }
 
 static enum elf_reloc_type_class
-elf64_alpha_reloc_type_class (const Elf_Internal_Rela *rela)
+elf64_alpha_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			      const asection *rel_sec ATTRIBUTE_UNUSED,
+			      const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF64_R_TYPE (rela->r_info))
     {
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.114
diff -u -p -r1.114 elf64-hppa.c
--- bfd/elf64-hppa.c	21 Feb 2013 03:02:30 -0000	1.114
+++ bfd/elf64-hppa.c	27 Mar 2013 10:50:57 -0000
@@ -194,9 +194,6 @@ static bfd_boolean elf64_hppa_finish_dyn
   (bfd *, struct bfd_link_info *,
    struct elf_link_hash_entry *, Elf_Internal_Sym *);
 
-static enum elf_reloc_type_class elf64_hppa_reloc_type_class
-  (const Elf_Internal_Rela *);
-
 static bfd_boolean elf64_hppa_finish_dynamic_sections
   (bfd *, struct bfd_link_info *);
 
@@ -2446,7 +2443,9 @@ elf64_hppa_finalize_dynreloc (struct elf
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf64_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
+elf64_hppa_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   if (ELF64_R_SYM (rela->r_info) == STN_UNDEF)
     return reloc_class_relative;
Index: bfd/elf64-ia64-vms.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ia64-vms.c,v
retrieving revision 1.8
diff -u -p -r1.8 elf64-ia64-vms.c
--- bfd/elf64-ia64-vms.c	22 Feb 2013 01:20:48 -0000	1.8
+++ bfd/elf64-ia64-vms.c	27 Mar 2013 10:50:57 -0000
@@ -4310,7 +4310,9 @@ elf64_ia64_print_private_bfd_data (bfd *
 }
 
 static enum elf_reloc_type_class
-elf64_ia64_reloc_type_class (const Elf_Internal_Rela *rela)
+elf64_ia64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF64_R_TYPE (rela->r_info))
     {
Index: bfd/elf64-s390.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-s390.c,v
retrieving revision 1.126
diff -u -p -r1.126 elf64-s390.c
--- bfd/elf64-s390.c	10 Feb 2013 04:36:32 -0000	1.126
+++ bfd/elf64-s390.c	27 Mar 2013 10:50:58 -0000
@@ -3516,7 +3516,9 @@ do_glob_dat:
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf_s390_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_s390_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			   const asection *rel_sec ATTRIBUTE_UNUSED,
+			   const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF64_R_TYPE (rela->r_info))
     {
@@ -3752,7 +3754,6 @@ const struct elf_size_info s390_elf64_si
 #define elf_backend_relocate_section	      elf_s390_relocate_section
 #define elf_backend_size_dynamic_sections     elf_s390_size_dynamic_sections
 #define elf_backend_init_index_section	      _bfd_elf_init_1_index_section
-#define elf_backend_reloc_type_class	      elf_s390_reloc_type_class
 #define elf_backend_plt_sym_val		      elf_s390_plt_sym_val
 #define elf_backend_add_symbol_hook           elf_s390_add_symbol_hook
 
Index: bfd/elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.130
diff -u -p -r1.130 elf64-sparc.c
--- bfd/elf64-sparc.c	13 Jul 2012 14:22:48 -0000	1.130
+++ bfd/elf64-sparc.c	27 Mar 2013 10:50:58 -0000
@@ -765,7 +765,9 @@ elf64_sparc_print_symbol_all (bfd *abfd 
 }
 
 static enum elf_reloc_type_class
-elf64_sparc_reloc_type_class (const Elf_Internal_Rela *rela)
+elf64_sparc_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			      const asection *rel_sec ATTRIBUTE_UNUSED,
+			      const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF64_R_TYPE (rela->r_info))
     {
Index: bfd/elf64-x86-64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-x86-64.c,v
retrieving revision 1.294
diff -u -p -r1.294 elf64-x86-64.c
--- bfd/elf64-x86-64.c	25 Mar 2013 06:00:06 -0000	1.294
+++ bfd/elf64-x86-64.c	27 Mar 2013 10:50:58 -0000
@@ -4666,7 +4666,9 @@ elf_x86_64_finish_local_dynamic_symbol (
    dynamic linker, before writing them out.  */
 
 static enum elf_reloc_type_class
-elf_x86_64_reloc_type_class (const Elf_Internal_Rela *rela)
+elf_x86_64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
Index: bfd/elfnn-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfnn-ia64.c,v
retrieving revision 1.14
diff -u -p -r1.14 elfnn-ia64.c
--- bfd/elfnn-ia64.c	21 Feb 2013 02:29:10 -0000	1.14
+++ bfd/elfnn-ia64.c	27 Mar 2013 10:50:58 -0000
@@ -4808,7 +4808,9 @@ elfNN_ia64_print_private_bfd_data (bfd *
 }
 
 static enum elf_reloc_type_class
-elfNN_ia64_reloc_type_class (const Elf_Internal_Rela *rela)
+elfNN_ia64_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			     const asection *rel_sec ATTRIBUTE_UNUSED,
+			     const Elf_Internal_Rela *rela)
 {
   switch ((int) ELFNN_R_TYPE (rela->r_info))
     {
Index: bfd/elfxx-tilegx.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-tilegx.c,v
retrieving revision 1.19
diff -u -p -r1.19 elfxx-tilegx.c
--- bfd/elfxx-tilegx.c	31 Jan 2013 07:32:45 -0000	1.19
+++ bfd/elfxx-tilegx.c	27 Mar 2013 10:50:59 -0000
@@ -4370,7 +4370,9 @@ tilegx_elf_plt_sym_val (bfd_vma i, const
 }
 
 enum elf_reloc_type_class
-tilegx_reloc_type_class (const Elf_Internal_Rela *rela)
+tilegx_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			 const asection *rel_sec ATTRIBUTE_UNUSED,
+			 const Elf_Internal_Rela *rela)
 {
   switch ((int) TILEGX_ELF_R_TYPE (rela->r_info))
     {
Index: bfd/elfxx-tilegx.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-tilegx.h,v
retrieving revision 1.1
diff -u -p -r1.1 elfxx-tilegx.h
--- bfd/elfxx-tilegx.h	13 Jun 2011 15:18:46 -0000	1.1
+++ bfd/elfxx-tilegx.h	27 Mar 2013 10:50:59 -0000
@@ -22,7 +22,9 @@
 #include "elf/internal.h"
 
 extern enum elf_reloc_type_class
-tilegx_reloc_type_class (const Elf_Internal_Rela *);
+tilegx_reloc_type_class (const struct bfd_link_info *,
+			 const asection *,
+			 const Elf_Internal_Rela *);
 
 extern reloc_howto_type *
 tilegx_reloc_name_lookup (bfd *, const char *);

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]