* elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire
authorAlan Modra <amodra@gmail.com>
Mon, 24 Sep 2001 01:38:31 +0000 (01:38 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 24 Sep 2001 01:38:31 +0000 (01:38 +0000)
reloc rather than just the type.
(_bfd_elf_reloc_type_class): Likewise.
* elf.c (_bfd_elf_reloc_type_class): Likewise.
* elf32-arm.h (elf32_arm_reloc_type_class): Likewise.
* elf32-cris.c (elf_cris_reloc_type_class): Likewise.
* elf32-i386.c (elf_i386_reloc_type_class): Likewise.
* elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise.
* elf32-ppc.c (ppc_elf_reloc_type_class): Likewise.
* elf32-s390.c (elf_s390_reloc_type_class): Likewise.
* elf32-sh.c (sh_elf_reloc_type_class): Likewise.
* elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise.
* elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise.
* elf64-s390.c (elf_s390_reloc_type_class): Likewise.
* elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise.
* elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise.
* elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise.
* elflink.h: Formatting fixes.
(elf_link_sort_relocs): Make "count" and "size" bfd_size_type.
Call bfd_zmalloc rather than calloc.  Remove unnecessary cast of
o->contents to PTR.  Update call to elf_backend_reloc_type_class.

17 files changed:
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf.c
bfd/elf32-arm.h
bfd/elf32-cris.c
bfd/elf32-i386.c
bfd/elf32-m68k.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-sparc.c
bfd/elf64-alpha.c
bfd/elf64-s390.c
bfd/elf64-sparc.c
bfd/elf64-x86-64.c
bfd/elflink.h
bfd/elfxx-ia64.c

index 2f424e96702adb1f33244ad2cfbee38df3f1e2ac..b9bcb5c65d4a5e59429ab39678786bfd8423b34a 100644 (file)
@@ -1,3 +1,27 @@
+2001-09-24  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf-bfd.h (elf_backend_reloc_type_class): Pass in the entire
+       reloc rather than just the type.
+       (_bfd_elf_reloc_type_class): Likewise.
+       * elf.c (_bfd_elf_reloc_type_class): Likewise.
+       * elf32-arm.h (elf32_arm_reloc_type_class): Likewise.
+       * elf32-cris.c (elf_cris_reloc_type_class): Likewise.
+       * elf32-i386.c (elf_i386_reloc_type_class): Likewise.
+       * elf32-m68k.c (elf32_m68k_reloc_type_class): Likewise.
+       * elf32-ppc.c (ppc_elf_reloc_type_class): Likewise.
+       * elf32-s390.c (elf_s390_reloc_type_class): Likewise.
+       * elf32-sh.c (sh_elf_reloc_type_class): Likewise.
+       * elf32-sparc.c (elf32_sparc_reloc_type_class): Likewise.
+       * elf64-alpha.c (elf64_alpha_reloc_type_class): Likewise.
+       * elf64-s390.c (elf_s390_reloc_type_class): Likewise.
+       * elf64-sparc.c (sparc64_elf_reloc_type_class): Likewise.
+       * elf64-x86-64.c (elf64_x86_64_reloc_type_class): Likewise.
+       * elfxx-ia64.c (elfNN_ia64_reloc_type_class): Likewise.
+       * elflink.h: Formatting fixes.
+       (elf_link_sort_relocs): Make "count" and "size" bfd_size_type.
+       Call bfd_zmalloc rather than calloc.  Remove unnecessary cast of
+       o->contents to PTR.  Update call to elf_backend_reloc_type_class.
+
 2001-09-22  John Reiser  <jreiser@BitWagon.com>
 
        * elfcode.h (elf_object_p): Allow for no section header at all in
 
 2001-09-20  John Reiser  <jreiser@BitWagon.com>
        
-       * elf32-i386.c (elf_i386_relocate_section): coordinate info->symbolic
-         and info->allow_shlib_undefined.
-       * elf32-cris.c: likewise
-       * elf32-hppa.c: likewise
-       * elf32-m68k.c: likewise
-       * elf32-mips.c: likewise
-       * elf32-ppc.c: likewise
-       * elf32-s390.c: likewise
-       * elf32-sh.c: likewise
-       * elf32-sparc.c: likewise
-       * elf64-alpha.c: likewise
-       * elf64-hppa.c: likewise
-       * elf64-ppc.c: likewise
-       * elf64-s390.c: likewise
-       * elf64-sparc.c: likewise
-       * elf64-x86-64.c: likewise
-       * elfxx-ia64.c: likewise
+       * elf32-i386.c (elf_i386_relocate_section): Coordinate info->symbolic
+       and info->allow_shlib_undefined.
+       * elf32-cris.c: Likewise.
+       * elf32-hppa.c: Likewise.
+       * elf32-m68k.c: Likewise.
+       * elf32-mips.c: Likewise.
+       * elf32-ppc.c: Likewise.
+       * elf32-s390.c: Likewise.
+       * elf32-sh.c: Likewise.
+       * elf32-sparc.c: Likewise.
+       * elf64-alpha.c: Likewise.
+       * elf64-hppa.c: Likewise.
+       * elf64-ppc.c: Likewise.
+       * elf64-s390.c: Likewise.
+       * elf64-sparc.c: Likewise.
+       * elf64-x86-64.c: Likewise.
+       * elfxx-ia64.c: Likewise.
 
 2001-09-18  Bruno Haible  <haible@clisp.cons.org>
 
index eaf37fe4eefce99b2a40e395f3d5f6c18f21d4ea..ec3b21d7706ce97c79ac7874408620c2e6f54759 100644 (file)
@@ -665,8 +665,8 @@ struct elf_backend_data
     PARAMS ((bfd *, PTR, bfd_vma));
 
   /* This function returns class of a reloc type.  */
-  enum elf_reloc_type_class (* elf_backend_reloc_type_class)
-    PARAMS ((int));
+  enum elf_reloc_type_class (*elf_backend_reloc_type_class)
+    PARAMS ((const Elf_Internal_Rela *));
 
   /* The swapping table to use when dealing with ECOFF information.
      Used for the MIPS ELF .mdebug section.  */
@@ -1044,7 +1044,7 @@ extern void _bfd_elf_fprintf_vma
   PARAMS ((bfd *, PTR, bfd_vma));
 
 extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 
 extern unsigned long bfd_elf_hash
   PARAMS ((const char *));
index f5eb576c9a9f6ae43ff710924ca1ac64864d01cb..a6ceafbf19b4ab4299f0be9c1a71e6fd264eca78 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5982,8 +5982,8 @@ _bfd_elf_fprintf_vma (abfd, stream, value)
 }
 
 enum elf_reloc_type_class
-_bfd_elf_reloc_type_class (type)
-     int type ATTRIBUTE_UNUSED;
+_bfd_elf_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED;
 {
   return reloc_class_normal;
 }
index a4e0e906d2506b27dccd28047b4f04dffe0e63b3..071af98927ce377496d4279ea126f523bbf7f450 100644 (file)
@@ -92,7 +92,7 @@ boolean bfd_elf32_arm_get_bfd_for_interworking
 boolean bfd_elf32_arm_process_before_allocation
   PARAMS ((bfd *, struct bfd_link_info *, int));
 static enum elf_reloc_type_class elf32_arm_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 
 #define INTERWORK_FLAG(abfd)   (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK)
 
@@ -3459,10 +3459,10 @@ elf32_arm_post_process_headers (abfd, link_info)
 }
 
 static enum elf_reloc_type_class
-elf32_arm_reloc_type_class (type)
-     int type;
+elf32_arm_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_ARM_RELATIVE:
       return reloc_class_relative;
index e50d05cca755bc7227ac869e2467ce1b352ebffc..aca0852967e9b1fd766d9f23fb1057dbb69160d2 100644 (file)
@@ -86,7 +86,7 @@ static boolean elf_cris_finish_dynamic_sections
 static void elf_cris_hide_symbol
   PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
 static enum elf_reloc_type_class elf_cris_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 
 static reloc_howto_type cris_elf_howto_table [] =
 {
@@ -2981,10 +2981,10 @@ cris_elf_merge_private_bfd_data (ibfd, obfd)
 
 
 static enum elf_reloc_type_class
-elf_cris_reloc_type_class (type)
-     int type;
+elf_cris_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_CRIS_RELATIVE:
       return reloc_class_relative;
index 4b01066e0b3dc356976f437e4d3e86c66ea35f71..211f93acb28c1a71277d160f1410fbd48e354e3a 100644 (file)
@@ -63,7 +63,8 @@ static boolean elf_i386_finish_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static boolean elf_i386_fake_sections
   PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *));
-static enum elf_reloc_type_class elf_i386_reloc_type_class PARAMS ((int));
+static enum elf_reloc_type_class elf_i386_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
 static boolean elf_i386_grok_prstatus
   PARAMS ((bfd *abfd, Elf_Internal_Note *note));
 static boolean elf_i386_grok_psinfo
@@ -2186,10 +2187,10 @@ elf_i386_fake_sections (abfd, hdr, sec)
 }
 
 static enum elf_reloc_type_class
-elf_i386_reloc_type_class (type)
-     int type;
+elf_i386_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_386_RELATIVE:
       return reloc_class_relative;
index d381be9ce39be651a6bd945c1aaf6477237a962b..80613f11e4395a77d107442e1e9c268a88311272 100644 (file)
@@ -64,7 +64,7 @@ static boolean elf32_m68k_merge_private_bfd_data
 static boolean elf32_m68k_print_private_bfd_data
   PARAMS ((bfd *, PTR));
 static enum elf_reloc_type_class elf32_m68k_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 
 static reloc_howto_type howto_table[] = {
   HOWTO(R_68K_NONE,       0, 0, 0, false,0, complain_overflow_dont,     bfd_elf_generic_reloc, "R_68K_NONE",      false, 0, 0x00000000,false),
@@ -2308,10 +2308,10 @@ error_return:
 }
 
 static enum elf_reloc_type_class
-elf32_m68k_reloc_type_class (type)
-     int type;
+elf32_m68k_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_68K_RELATIVE:
       return reloc_class_relative;
index a85995654e21f640a6513af2bdfbd746500aaf7f..d770b2bf0f2ccc798efebe7ee382b573203e5555 100644 (file)
@@ -108,7 +108,8 @@ static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *,
                                                      Elf_Internal_Sym *));
 
 static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *));
-static enum elf_reloc_type_class ppc_elf_reloc_type_class PARAMS ((int));
+static enum elf_reloc_type_class ppc_elf_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
 static boolean ppc_elf_grok_prstatus
   PARAMS ((bfd *abfd, Elf_Internal_Note *note));
 static boolean ppc_elf_grok_psinfo
@@ -3717,10 +3718,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 }
 
 static enum elf_reloc_type_class
-ppc_elf_reloc_type_class (type)
-     int type;
+ppc_elf_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_PPC_RELATIVE:
       return reloc_class_relative;
index 088d5d162e46c0868a46a9c1c140166df88e6716..73db3f7854ea4fbffc31092224be2712b2ea9f6e 100644 (file)
@@ -56,7 +56,8 @@ static boolean elf_s390_finish_dynamic_symbol
 static boolean elf_s390_finish_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static boolean elf_s390_object_p PARAMS ((bfd *));
-static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((int));
+static enum elf_reloc_type_class elf_s390_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
 
 #define USE_RELA 1             /* We want RELA relocations, not REL.  */
 
@@ -2139,10 +2140,10 @@ elf_s390_object_p (abfd)
 }
 
 static enum elf_reloc_type_class
-elf_s390_reloc_type_class (type)
-     int type;
+elf_s390_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_390_RELATIVE:
       return reloc_class_relative;
index 6f94095c941e36a04fea673b734f067fc2dbc248..b91e8380c20fe86a5fef03d069597c08b122578f 100644 (file)
@@ -84,7 +84,7 @@ static boolean sh_elf_gc_sweep_hook
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
           const Elf_Internal_Rela *));
 static enum elf_reloc_type_class sh_elf_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 
 /* The name of the dynamic interpreter.  This is put in the .interp
    section.  */
@@ -4434,10 +4434,10 @@ sh_elf_finish_dynamic_sections (output_bfd, info)
 }
 
 static enum elf_reloc_type_class
-sh_elf_reloc_type_class (type)
-     int type;
+sh_elf_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_SH_RELATIVE:
       return reloc_class_relative;
index c50e4458deb5b8c4358227f578c129af90fbd24d..889d83fccc0c568ac3da3c902ca59725a98b66ed 100644 (file)
@@ -53,7 +53,7 @@ static boolean elf32_sparc_object_p
 static void elf32_sparc_final_write_processing
   PARAMS ((bfd *, boolean));
 static enum elf_reloc_type_class elf32_sparc_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 static asection * elf32_sparc_gc_mark_hook
   PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *,
           struct elf_link_hash_entry *, Elf_Internal_Sym *));
@@ -2082,10 +2082,10 @@ elf32_sparc_final_write_processing (abfd, linker)
 }
 
 static enum elf_reloc_type_class
-elf32_sparc_reloc_type_class (type)
-     int type;
+elf32_sparc_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF32_R_TYPE (rela->r_info))
     {
     case R_SPARC_RELATIVE:
       return reloc_class_relative;
index 7d9206efaad8d79e279e0fc577d27efe082a2e87..0dd6c091c3b6ee905022bf752890185a2c846b31 100644 (file)
@@ -136,7 +136,7 @@ static boolean elf64_alpha_merge_ind_symbols
 static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs
   PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int));
 static enum elf_reloc_type_class elf64_alpha_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 \f
 struct alpha_elf_link_hash_entry
 {
@@ -4131,10 +4131,10 @@ elf64_alpha_final_link (abfd, info)
 }
 
 static enum elf_reloc_type_class
-elf64_alpha_reloc_type_class (type)
-     int type;
+elf64_alpha_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF64_R_TYPE (rela->r_info))
     {
     case R_ALPHA_RELATIVE:
       return reloc_class_relative;
index a8b71ddf914da8cf9e8d55bba325bcbac563dfad..02a436fbaa47b9c26e450a69d8819cdad8806366 100644 (file)
@@ -56,7 +56,8 @@ static boolean elf_s390_finish_dynamic_symbol
 static boolean elf_s390_finish_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
 static boolean elf_s390_object_p PARAMS ((bfd *));
-static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((int));
+static enum elf_reloc_type_class elf_s390_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
 
 #define USE_RELA 1             /* We want RELA relocations, not REL.  */
 
@@ -2100,10 +2101,10 @@ elf_s390_object_p (abfd)
 
 
 static enum elf_reloc_type_class
-elf_s390_reloc_type_class (type)
-     int type;
+elf_s390_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF64_R_TYPE (rela->r_info))
     {
     case R_390_RELATIVE:
       return reloc_class_relative;
index 7a18d9b1e47a7959d705bf47f00ee12bb9e49eb6..6fd24f9f9572ee2b44f2b8088ee6b223fb89eece 100644 (file)
@@ -96,7 +96,8 @@ static boolean sparc64_elf_slurp_reloc_table
 static long sparc64_elf_canonicalize_dynamic_reloc
   PARAMS ((bfd *, arelent **, asymbol **));
 static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR));
-static enum elf_reloc_type_class sparc64_elf_reloc_type_class PARAMS ((int));
+static enum elf_reloc_type_class sparc64_elf_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
 \f
 /* The relocation "howto" table.  */
 
@@ -2917,10 +2918,10 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info)
 }
 
 static enum elf_reloc_type_class
-sparc64_elf_reloc_type_class (type)
-     int type;
+sparc64_elf_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF64_R_TYPE (rela->r_info))
     {
     case R_SPARC_RELATIVE:
       return reloc_class_relative;
index c86a50f1aa56dd18184a01cdc6a96d811e776811..0359b164ac4c7ab0d2f6c7867e3d63a9b9fc848d 100644 (file)
@@ -153,7 +153,8 @@ static boolean elf64_x86_64_finish_dynamic_symbol
           Elf_Internal_Sym *sym));
 static boolean elf64_x86_64_finish_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
-static enum elf_reloc_type_class elf64_x86_64_reloc_type_class PARAMS ((int));
+static enum elf_reloc_type_class elf64_x86_64_reloc_type_class
+  PARAMS ((const Elf_Internal_Rela *));
 
 /* Given a BFD reloc type, return a HOWTO structure.  */
 static reloc_howto_type *
@@ -1936,10 +1937,10 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info)
 }
 
 static enum elf_reloc_type_class
-elf64_x86_64_reloc_type_class (type)
-     int type;
+elf64_x86_64_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELF64_R_TYPE (rela->r_info))
     {
     case R_X86_64_RELATIVE:
       return reloc_class_relative;
index 393f932b17c2333cb01339f5f595601eb8a507c4..e38f0d50bd5b1985a1fee7cf56a39f608266a9a8 100644 (file)
@@ -4338,8 +4338,8 @@ elf_link_sort_cmp1 (A, B)
      const PTR A;
      const PTR B;
 {
-  struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A;
-  struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B;
+  struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A;
+  struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B;
   int relativea, relativeb;
 
   relativea = a->type == reloc_class_relative;
@@ -4365,8 +4365,8 @@ elf_link_sort_cmp2 (A, B)
      const PTR A;
      const PTR B;
 {
-  struct elf_link_sort_rela *a = (struct elf_link_sort_rela *)A;
-  struct elf_link_sort_rela *b = (struct elf_link_sort_rela *)B;
+  struct elf_link_sort_rela *a = (struct elf_link_sort_rela *) A;
+  struct elf_link_sort_rela *b = (struct elf_link_sort_rela *) B;
   int copya, copyb;
 
   if (a->offset < b->offset)
@@ -4395,7 +4395,8 @@ elf_link_sort_relocs (abfd, info, psec)
   bfd *dynobj = elf_hash_table (info)->dynobj;
   asection *reldyn, *o;
   boolean rel = false;
-  size_t count, size, i, j, ret;
+  bfd_size_type count, size;
+  size_t i, j, ret;
   struct elf_link_sort_rela *rela;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
 
@@ -4421,7 +4422,7 @@ elf_link_sort_relocs (abfd, info, psec)
   if (size != reldyn->_raw_size)
     return 0;
 
-  rela = (struct elf_link_sort_rela *) calloc (sizeof (*rela), count);
+  rela = (struct elf_link_sort_rela *) bfd_zmalloc (sizeof (*rela) * count);
   if (rela == NULL)
     {
       (*info->callbacks->warning)
@@ -4441,7 +4442,7 @@ elf_link_sort_relocs (abfd, info, psec)
            struct elf_link_sort_rela *s;
 
            erel = (Elf_External_Rel *) o->contents;
-           erelend = (Elf_External_Rel *) ((PTR) o->contents + o->_raw_size);
+           erelend = (Elf_External_Rel *) (o->contents + o->_raw_size);
            s = rela + o->output_offset / sizeof (Elf_External_Rel);
            for (; erel < erelend; erel++, s++)
              {
@@ -4450,8 +4451,7 @@ elf_link_sort_relocs (abfd, info, psec)
                else
                  elf_swap_reloc_in (abfd, erel, &s->u.rel);
 
-               s->type = ((*bed->elf_backend_reloc_type_class)
-                          ((int) ELF_R_TYPE (s->u.rel.r_info)));
+               s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
              }
          }
        else
@@ -4460,7 +4460,7 @@ elf_link_sort_relocs (abfd, info, psec)
            struct elf_link_sort_rela *s;
 
            erela = (Elf_External_Rela *) o->contents;
-           erelaend = (Elf_External_Rela *) ((PTR) o->contents + o->_raw_size);
+           erelaend = (Elf_External_Rela *) (o->contents + o->_raw_size);
            s = rela + o->output_offset / sizeof (Elf_External_Rela);
            for (; erela < erelaend; erela++, s++)
              {
@@ -4470,8 +4470,7 @@ elf_link_sort_relocs (abfd, info, psec)
                else
                  elf_swap_reloca_in (dynobj, erela, &s->u.rela);
 
-               s->type = ((*bed->elf_backend_reloc_type_class)
-                          ((int) ELF_R_TYPE (s->u.rel.r_info)));
+               s->type = (*bed->elf_backend_reloc_type_class) (&s->u.rela);
              }
          }
       }
index ef18ec32ed15613d29865bc389c6e7c03863cd9c..739fe7a5aa67f780fc3bf78c76f9a6862c1d2e19 100644 (file)
@@ -301,7 +301,7 @@ static boolean elfNN_ia64_merge_private_bfd_data
 static boolean elfNN_ia64_print_private_bfd_data
   PARAMS ((bfd *abfd, PTR ptr));
 static enum elf_reloc_type_class elfNN_ia64_reloc_type_class
-  PARAMS ((int));
+  PARAMS ((const Elf_Internal_Rela *));
 \f
 /* ia64-specific relocation */
 
@@ -4330,10 +4330,10 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr)
 }
 
 static enum elf_reloc_type_class
-elfNN_ia64_reloc_type_class (type)
-     int type;
+elfNN_ia64_reloc_type_class (rela)
+     const Elf_Internal_Rela *rela;
 {
-  switch (type)
+  switch ((int) ELFNN_R_TYPE (rela->r_info))
     {
     case R_IA64_REL32MSB:
     case R_IA64_REL32LSB:
This page took 0.052149 seconds and 4 git commands to generate.