From a31d9957aba48c79228bf0f510565f37f73f1d6f Mon Sep 17 00:00:00 2001 From: amodra Date: Thu, 4 Dec 2003 03:03:26 +0000 Subject: [PATCH] * elf32-i386.c (elf_i386_object_p): Delete. (elf_backend_object_p): Don't define. * elf32-s390.c (elf_s390_object_p): No need to alloc tdata here. * elf32-sh.c (sh_elf_object_p): Likewise. * elf32-sparc.c (elf32_sparc_object_p): Likewise. * elf64-alpha.c (elf64_alpha_object_p): Likewise. * elf64-s390.c (elf_s390_object_p): Likewise. * elf64-x86-64.c (elf64_x86_64_elf_object_p): Likewise. --- bfd/ChangeLog | 11 +++++++++++ bfd/elf32-i386.c | 15 --------------- bfd/elf32-s390.c | 8 -------- bfd/elf32-sh.c | 14 +------------- bfd/elf32-sparc.c | 9 --------- bfd/elf64-alpha.c | 9 --------- bfd/elf64-s390.c | 8 -------- bfd/elf64-x86-64.c | 8 -------- 8 files changed, 12 insertions(+), 70 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8f59bc8c70..95097af019 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2003-12-04 Alan Modra + + * elf32-i386.c (elf_i386_object_p): Delete. + (elf_backend_object_p): Don't define. + * elf32-s390.c (elf_s390_object_p): No need to alloc tdata here. + * elf32-sh.c (sh_elf_object_p): Likewise. + * elf32-sparc.c (elf32_sparc_object_p): Likewise. + * elf64-alpha.c (elf64_alpha_object_p): Likewise. + * elf64-s390.c (elf_s390_object_p): Likewise. + * elf64-x86-64.c (elf64_x86_64_elf_object_p): Likewise. + 2003-12-03 Kazuhiro Inaoka * archures.c (bfd_mach_m32r2): Add new machine type. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 8adaa0faac..876efc6ab0 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -546,20 +546,6 @@ elf_i386_mkobject (bfd *abfd) return TRUE; } -static bfd_boolean -elf_i386_object_p (bfd *abfd) -{ - /* Allocate our special target data. */ - struct elf_i386_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; - return TRUE; -} - /* i386 ELF linker hash table. */ struct elf_i386_link_hash_table @@ -3253,7 +3239,6 @@ elf_i386_finish_dynamic_sections (bfd *output_bfd, #define elf_info_to_howto_rel elf_i386_info_to_howto_rel #define bfd_elf32_mkobject elf_i386_mkobject -#define elf_backend_object_p elf_i386_object_p #define bfd_elf32_bfd_is_local_label_name elf_i386_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_i386_link_hash_table_create diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index b47ba22016..07ba23cc32 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -685,14 +685,6 @@ static bfd_boolean elf_s390_object_p (abfd) bfd *abfd; { - /* Allocate our special target data. */ - struct elf_s390_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; /* Set the right machine number for an s390 elf32 file. */ return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31); } diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index cf1e51fdad..c8a091d53c 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -6960,19 +6960,7 @@ sh_elf_merge_private_data (bfd *ibfd, bfd *obfd) static bfd_boolean sh_elf_object_p (bfd *abfd) { - struct sh_elf_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct sh_elf_obj_tdata); - - if (!sh_elf_set_mach_from_flags (abfd)) - return FALSE; - - /* Allocate our special target data. */ - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; - return TRUE; + return sh_elf_set_mach_from_flags (abfd); } /* Finish up dynamic symbol handling. We set the contents of various diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c index ea3a9b139b..f77f22c7c3 100644 --- a/bfd/elf32-sparc.c +++ b/bfd/elf32-sparc.c @@ -3340,15 +3340,6 @@ static bfd_boolean elf32_sparc_object_p (abfd) bfd *abfd; { - /* Allocate our special target data. */ - struct elf32_sparc_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct elf32_sparc_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; - if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS) { if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3) diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c index 1e2d246544..6025277a6b 100644 --- a/bfd/elf64-alpha.c +++ b/bfd/elf64-alpha.c @@ -393,15 +393,6 @@ static bfd_boolean elf64_alpha_object_p (abfd) bfd *abfd; { - /* Allocate our special target data. */ - struct alpha_elf_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; - /* Set the right machine number for an Alpha ELF file. */ return bfd_default_set_arch_mach (abfd, bfd_arch_alpha, 0); } diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index e14a0fc4c7..2260248fe3 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -638,14 +638,6 @@ static bfd_boolean elf_s390_object_p (abfd) bfd *abfd; { - /* Allocate our special target data. */ - struct elf_s390_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; /* Set the right machine number for an s390 elf32 file. */ return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64); } diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 5778f165fc..a6886201d3 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -579,14 +579,6 @@ elf64_x86_64_mkobject (bfd *abfd) static bfd_boolean elf64_x86_64_elf_object_p (bfd *abfd) { - /* Allocate our special target data. */ - struct elf64_x86_64_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct elf64_x86_64_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return FALSE; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; /* Set the right machine number for an x86-64 elf64 file. */ bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64); return TRUE; -- 2.11.0