This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Remove _bfd_elf_reloc_type_class
- From: "H . J . Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Tue, 23 Apr 2002 20:42:42 -0700
- Subject: PATCH: Remove _bfd_elf_reloc_type_class
The reason why MIPS works is elf_link_sort_relocs doesn't do anything
since _bfd_elf_reloc_type_class just returns reloc_class_normal. Is
there any reason to call elf_link_sort_relocs if the default
elf_backend_reloc_type_class is used?
H.J.
----
2002-04-23 H.J. Lu (hjl@gnu.org)
* elf-bfd.h (_bfd_elf_reloc_type_class): Removed.
* elf.c (_bfd_elf_reloc_type_class): Likewise.
* elflink.h (elf_bfd_final_link): Call elf_link_sort_relocs
only if bed->elf_backend_reloc_type_class != NULL.
* elfxx-target.h (elf_backend_reloc_type_class): Default to
NULL.
--- bfd/elf-bfd.h.combreloc Fri Apr 19 13:58:51 2002
+++ bfd/elf-bfd.h Tue Apr 23 20:08:13 2002
@@ -1190,8 +1190,6 @@ extern void _bfd_elf_sprintf_vma
extern void _bfd_elf_fprintf_vma
PARAMS ((bfd *, PTR, bfd_vma));
-extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
- PARAMS ((const Elf_Internal_Rela *));
extern bfd_vma _bfd_elf_rela_local_sym
PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *));
extern bfd_vma _bfd_elf_rel_local_sym
--- bfd/elf.c.combreloc Sat Apr 20 23:52:46 2002
+++ bfd/elf.c Tue Apr 23 20:07:44 2002
@@ -6876,13 +6876,6 @@ _bfd_elf_fprintf_vma (abfd, stream, valu
#endif
}
-enum elf_reloc_type_class
-_bfd_elf_reloc_type_class (rela)
- const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED;
-{
- return reloc_class_normal;
-}
-
/* For RELA architectures, return what the relocation value for
relocation against a local symbol. */
--- bfd/elflink.h.combreloc Wed Apr 3 09:39:26 2002
+++ bfd/elflink.h Tue Apr 23 20:09:23 2002
@@ -5723,7 +5723,8 @@ elf_bfd_final_link (abfd, info)
o->reloc_count = 0;
}
- if (dynamic && info->combreloc && dynobj != NULL)
+ if (dynamic && info->combreloc && dynobj != NULL
+ && bed->elf_backend_reloc_type_class != NULL)
relativecount = elf_link_sort_relocs (abfd, info, &reldyn);
/* If we are linking against a dynamic object, or generating a
--- bfd/elfxx-target.h.combreloc Thu Apr 4 23:07:05 2002
+++ bfd/elfxx-target.h Tue Apr 23 20:05:23 2002
@@ -360,7 +360,7 @@ Foundation, Inc., 59 Temple Place - Suit
#define elf_backend_fprintf_vma _bfd_elf_fprintf_vma
#endif
#ifndef elf_backend_reloc_type_class
-#define elf_backend_reloc_type_class _bfd_elf_reloc_type_class
+#define elf_backend_reloc_type_class NULL
#endif
#ifndef elf_backend_discard_info
#define elf_backend_discard_info NULL