aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2008-02-15 09:03:02 +0000
committerAlan Modra <amodra@gmail.com>2008-02-15 09:03:02 +0000
commit5503fea1b9e6164095b2afa6d52c734cad217b3c (patch)
tree2892a09e3ef387bd865d09f5fafbe3966f4ecde7
parent0c8d6e5c6d36827b284c46ae256ace8ed4e3daf8 (diff)
downloadgdb-5503fea1b9e6164095b2afa6d52c734cad217b3c.zip
gdb-5503fea1b9e6164095b2afa6d52c734cad217b3c.tar.gz
gdb-5503fea1b9e6164095b2afa6d52c734cad217b3c.tar.bz2
* 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.
-rw-r--r--ld/ChangeLog11
-rw-r--r--ld/emultempl/alphaelf.em6
-rw-r--r--ld/emultempl/hppaelf.em9
-rw-r--r--ld/emultempl/ppc32elf.em18
-rw-r--r--ld/emultempl/ppc64elf.em7
5 files changed, 22 insertions, 29 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ec63420..f8d3bf85 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,16 @@
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.
* ldmain.c (output_bfd): Delete.
Replace all occurrences of output_bfd with link_info.output_bfd.
diff --git a/ld/emultempl/alphaelf.em b/ld/emultempl/alphaelf.em
index 81bb377..d6766ba 100644
--- a/ld/emultempl/alphaelf.em
+++ b/ld/emultempl/alphaelf.em
@@ -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;
diff --git a/ld/emultempl/hppaelf.em b/ld/emultempl/hppaelf.em
index f5808b3..182ab53 100644
--- a/ld/emultempl/hppaelf.em
+++ b/ld/emultempl/hppaelf.em
@@ -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",
diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em
index 79266a1..1a93ed4 100644
--- a/ld/emultempl/ppc32elf.em
+++ b/ld/emultempl/ppc32elf.em
@@ -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)
{
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index f6af695..51623b1 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -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 = '.';