* emultempl/alphaelf.em (alpha_after_open): Use elf_object_id.
authorAlan Modra <amodra@gmail.com>
Fri, 15 Feb 2008 09:03:02 +0000 (09:03 +0000)
committerAlan Modra <amodra@gmail.com>
Fri, 15 Feb 2008 09:03:02 +0000 (09:03 +0000)
* emultempl/hppaelf.em (hppaelf_create_output_section_statements):
Likewise.
* emultempl/ppc64elf.em (ppc_create_output_section_statements):
Likewise.
* emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete.  Replace all
uses with..
(is_ppc_elf): ..this new macro.

ld/ChangeLog
ld/emultempl/alphaelf.em
ld/emultempl/hppaelf.em
ld/emultempl/ppc32elf.em
ld/emultempl/ppc64elf.em

index ec63420c02381871d8cd297c3661da4ae423a632..f8d3bf858443dfece6add620222158ddde9171fd 100644 (file)
@@ -1,3 +1,14 @@
+2008-02-15  Alan Modra  <amodra@bigpond.net.au>
+
+       * emultempl/alphaelf.em (alpha_after_open): Use elf_object_id.
+       * emultempl/hppaelf.em (hppaelf_create_output_section_statements):
+       Likewise.
+       * emultempl/ppc64elf.em (ppc_create_output_section_statements):
+       Likewise.
+       * emultempl/ppc32elf.em (is_ppc_elf32_vec): Delete.  Replace all
+       uses with..
+       (is_ppc_elf): ..this new macro.
+
 2008-02-15  Alan Modra  <amodra@bigpond.net.au>
 
        * ldmain.h (output_bfd): Delete.
index 81bb377d730392fda2dc8a79f8c02aec4030245f..d6766ba51ff920068273eef8f1aac67396d92116 100644 (file)
@@ -32,8 +32,6 @@ static bfd_boolean limit_32bit;
 static bfd_boolean disable_relaxation;
 
 extern bfd_boolean elf64_alpha_use_secureplt;
-extern const bfd_target bfd_elf64_alpha_vec;
-extern const bfd_target bfd_elf64_alpha_freebsd_vec;
 
 
 /* Set the start address as in the Tru64 ld.  */
@@ -42,8 +40,8 @@ extern const bfd_target bfd_elf64_alpha_freebsd_vec;
 static void
 alpha_after_open (void)
 {
-  if (link_info.output_bfd->xvec == &bfd_elf64_alpha_vec
-      || link_info.output_bfd->xvec == &bfd_elf64_alpha_freebsd_vec)
+  if (bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
+      && elf_object_id (link_info.output_bfd) == ALPHA_ELF_TDATA)
     {
       unsigned int num_plt;
       lang_output_section_statement_type *os;
index f5808b3385c4a2e8aab6cdae856067302ba237ee..182ab5307bb6b01800b1629c40f984d4fa29c668 100644 (file)
@@ -67,13 +67,8 @@ hppaelf_after_parse (void)
 static void
 hppaelf_create_output_section_statements (void)
 {
-  extern const bfd_target bfd_elf32_hppa_linux_vec;
-  extern const bfd_target bfd_elf32_hppa_nbsd_vec;
-  extern const bfd_target bfd_elf32_hppa_vec;
-
-  if (link_info.output_bfd->xvec != &bfd_elf32_hppa_linux_vec
-      && link_info.output_bfd->xvec != &bfd_elf32_hppa_nbsd_vec
-      && link_info.output_bfd->xvec != &bfd_elf32_hppa_vec)
+  if (!(bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
+       && elf_object_id (link_info.output_bfd) == HPPA_ELF_TDATA))
     return;
 
   stub_file = lang_add_input_file ("linker stubs",
index 79266a1b5cc440091fe2dc1d86f51133b2dad7c5..1a93ed44927a68b055faf54b191cc5b851d1465b 100644 (file)
@@ -27,17 +27,9 @@ fragment <<EOF
 #include "libbfd.h"
 #include "elf32-ppc.h"
 
-extern const bfd_target bfd_elf32_powerpc_vec;
-extern const bfd_target bfd_elf32_powerpcle_vec;
-extern const bfd_target bfd_elf32_powerpc_vxworks_vec;
-
-static inline int
-is_ppc_elf32_vec(const bfd_target * vec)
-{
-  return (vec == &bfd_elf32_powerpc_vec
-         || vec == &bfd_elf32_powerpc_vxworks_vec
-         || vec == &bfd_elf32_powerpcle_vec);
-}
+#define is_ppc_elf(bfd) \
+  (bfd_get_flavour (bfd) == bfd_target_elf_flavour \
+   && elf_object_id (bfd) == PPC32_ELF_TDATA)
 
 /* Whether to run tls optimization.  */
 static int notlsopt = 0;
@@ -52,7 +44,7 @@ static int old_got = 0;
 static void
 ppc_after_open (void)
 {
-  if (is_ppc_elf32_vec (link_info.output_bfd->xvec))
+  if (is_ppc_elf (link_info.output_bfd))
     {
       int new_plt;
       int keep_new;
@@ -109,7 +101,7 @@ ppc_after_open (void)
 static void
 ppc_before_allocation (void)
 {
-  if (is_ppc_elf32_vec (link_info.output_bfd->xvec))
+  if (is_ppc_elf (link_info.output_bfd))
     {
       if (ppc_elf_tls_setup (link_info.output_bfd, &link_info) && !notlsopt)
        {
index f6af69595db480cbd4f24851154fe00e632aa1e5..51623b18a4353c498eff3f114ddb638af76e2ef4 100644 (file)
@@ -72,11 +72,8 @@ static int non_overlapping_opd = 0;
 static void
 ppc_create_output_section_statements (void)
 {
-  extern const bfd_target bfd_elf64_powerpc_vec;
-  extern const bfd_target bfd_elf64_powerpcle_vec;
-
-  if (link_info.output_bfd->xvec != &bfd_elf64_powerpc_vec
-      && link_info.output_bfd->xvec != &bfd_elf64_powerpcle_vec)
+  if (!(bfd_get_flavour (link_info.output_bfd) == bfd_target_elf_flavour
+       && elf_object_id (link_info.output_bfd) == PPC64_ELF_TDATA))
     return;
 
   link_info.wrap_char = '.';