OSDN Git Service

include/
authorAlan Modra <amodra@bigpond.net.au>
Fri, 15 Feb 2008 03:35:52 +0000 (03:35 +0000)
committerAlan Modra <amodra@bigpond.net.au>
Fri, 15 Feb 2008 03:35:52 +0000 (03:35 +0000)
* bfdlink.h (struct bfd_link_hash_table): Delete creator field.
(struct bfd_link_info): Add output_bfd.
bfd/
* elflink.c: Replace all accesses to hash->creator field with
output_bfd->xvec.
* cofflink.c: Likewise.
* coff-h8300.c: Likewise.
* ecoff.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-ppc.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-sparc.c: Likewise.
* elfxx-mips.c: Likewise.
* i386linux.c: Likewise.
* m68klinux.c: Likewise.
* sparclinux.c: Likewise.
* sunos.c: Likewise.
* xcofflink.c: Likewise.
* linker.c: Likewise.
(_bfd_link_hash_table_init): Don't store creator.
ld/
* ldmain.h (output_bfd): Delete.
* ldmain.c (output_bfd): Delete.
Replace all occurrences of output_bfd with link_info.output_bfd.
* ldcref.c: Likewise.
* ldctor.c: Likewise.
* ldemul.c: Likewise.
* ldexp.c: Likewise.
* ldfile.c: Likewise.
* ldlang.c: Likewise.
* ldmisc.c: Likewise.
* ldwrite.c: Likewise.
* pe-dll.c: Likewise.
* emultempl/aix.em: Likewise.
* emultempl/alphaelf.em: Likewise.
* emultempl/armcoff.em: Likewise.
* emultempl/armelf.em: Likewise.
* emultempl/avrelf.em: Likewise.
* emultempl/beos.em: Likewise.
* emultempl/elf-generic.em: Likewise.
* emultempl/elf32.em: Likewise.
* emultempl/gld960.em: Likewise.
* emultempl/hppaelf.em: Likewise.
* emultempl/irix.em: Likewise.
* emultempl/linux.em: Likewise.
* emultempl/lnk960.em: Likewise.
* emultempl/m68hc1xelf.em: Likewise.
* emultempl/mmix-elfnmmo.em: Likewise.
* emultempl/mmo.em: Likewise.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* emultempl/ppc32elf.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
* emultempl/scoreelf.em: Likewise.
* emultempl/sh64elf.em: Likewise.
* emultempl/spuelf.em: Likewise.
* emultempl/sunos.em: Likewise.
* emultempl/vanilla.em: Likewise.
* emultempl/vxworks.em: Likewise.
* emultempl/xtensaelf.em: Likewise.
* emultempl/z80.em: Likewise.
* ldlang.c (open_output): Don't return output, instead write
link_info_output_bfd directly.
* emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator
with link_info.output_bfd->xvec.
* emultempl/hppaelf.em: Likewise.
* emultempl/ppc32elf.em: Likewise.
* emultempl/ppc64elf.em: Likewise.
* emultempl/spuelf.em: Likewise.

19 files changed:
bfd/ChangeLog
bfd/coff-h8300.c
bfd/cofflink.c
bfd/ecoff.c
bfd/elf32-m68hc1x.c
bfd/elf32-ppc.c
bfd/elf64-alpha.c
bfd/elf64-ppc.c
bfd/elf64-sparc.c
bfd/elflink.c
bfd/elfxx-mips.c
bfd/i386linux.c
bfd/linker.c
bfd/m68klinux.c
bfd/sparclinux.c
bfd/sunos.c
bfd/xcofflink.c
include/ChangeLog
include/bfdlink.h

index 2b415ef..d629360 100644 (file)
@@ -1,3 +1,24 @@
+2008-02-15  Alan Modra  <amodra@bigpond.net.au>
+
+       * elflink.c: Replace all accesses to hash->creator field with
+       output_bfd->xvec.
+       * cofflink.c: Likewise.
+       * coff-h8300.c: Likewise.
+       * ecoff.c: Likewise.
+       * elf32-m68hc1x.c: Likewise.
+       * elf32-ppc.c: Likewise.
+       * elf64-alpha.c: Likewise.
+       * elf64-ppc.c: Likewise.
+       * elf64-sparc.c: Likewise.
+       * elfxx-mips.c: Likewise.
+       * i386linux.c: Likewise.
+       * m68klinux.c: Likewise.
+       * sparclinux.c: Likewise.
+       * sunos.c: Likewise.
+       * xcofflink.c: Likewise.
+       * linker.c: Likewise.
+       (_bfd_link_hash_table_init): Don't store creator.
+
 2008-02-14  Peter Jones  <pjones@redhat.com>
 
        * efi-rtdrv-ia32.c: New file.
index 0f8dbda..5ff87ae 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for Renesas H8/300 COFF binaries.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Written by Steve Chamberlain, <sac@cygnus.com>.
 
@@ -1116,11 +1116,11 @@ h8300_reloc16_extra_cases (bfd *abfd, struct bfd_link_info *link_info,
        struct h8300_coff_link_hash_table *htab;
        asection *vectors_sec;
 
-       if (link_info->hash->creator != abfd->xvec)
+       if (link_info->output_bfd->xvec != abfd->xvec)
          {
            (*_bfd_error_handler)
              (_("cannot handle R_MEM_INDIRECT reloc when using %s output"),
-              link_info->hash->creator->name);
+              link_info->output_bfd->xvec->name);
 
            /* What else can we do?  This function doesn't allow return
               of an error, and we don't want to call abort as that
@@ -1264,7 +1264,7 @@ h8300_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
   /* Add the symbols using the generic code.  */
   _bfd_generic_link_add_symbols (abfd, info);
 
-  if (info->hash->creator != abfd->xvec)
+  if (info->output_bfd->xvec != abfd->xvec)
     return TRUE;
 
   htab = h8300_coff_hash_table (info);
index c6ca559..19a7dd2 100644 (file)
@@ -1,6 +1,6 @@
 /* COFF specific linker code.
    Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-   2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -482,7 +482,7 @@ coff_link_add_symbols (bfd *abfd,
            (*sym_hash)->root.u.c.p->alignment_power
              = bfd_coff_default_section_alignment_power (abfd);
 
-         if (info->hash->creator->flavour == bfd_get_flavour (abfd))
+         if (bfd_get_flavour (info->output_bfd) == bfd_get_flavour (abfd))
            {
              /* If we don't have any symbol information currently in
                  the hash table, or if we are looking at a symbol
@@ -574,7 +574,7 @@ coff_link_add_symbols (bfd *abfd,
      optimize the handling of any .stab/.stabstr sections.  */
   if (! info->relocatable
       && ! info->traditional_format
-      && info->hash->creator->flavour == bfd_get_flavour (abfd)
+      && bfd_get_flavour (info->output_bfd) == bfd_get_flavour (abfd)
       && (info->strip != strip_all && info->strip != strip_debugger))
     {
       asection *stabstr;
index ead1f9b..9b2a1c9 100644 (file)
@@ -3402,7 +3402,7 @@ ecoff_link_add_externals (bfd *abfd,
 
       /* If we are building an ECOFF hash table, save the external
         symbol information.  */
-      if (info->hash->creator->flavour == bfd_get_flavour (abfd))
+      if (bfd_get_flavour (info->output_bfd) == bfd_get_flavour (abfd))
        {
          if (h->abfd == NULL
              || (! bfd_is_und_section (section)
index 6fb5129..9ad82b6 100644 (file)
@@ -1,5 +1,5 @@
 /* Motorola 68HC11/HC12-specific support for 32-bit ELF
-   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Contributed by Stephane Carrez (stcarrez@nerim.fr)
 
@@ -232,7 +232,7 @@ elf32_m68hc11_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info)
 
   htab = m68hc11_elf_hash_table (info);
 
-  if (htab->root.root.creator->flavour != bfd_target_elf_flavour)
+  if (bfd_get_flavour (info->output_bfd) != bfd_target_elf_flavour)
     return 0;
 
   /* Count the number of input BFDs and find the top input section id.
index 520f991..2dedefd 100644 (file)
@@ -2772,7 +2772,7 @@ ppc_elf_add_symbol_hook (bfd *abfd,
   if (sym->st_shndx == SHN_COMMON
       && !info->relocatable
       && sym->st_size <= elf_gp_size (abfd)
-      && is_ppc_elf_target (info->hash->creator))
+      && is_ppc_elf_target (info->output_bfd->xvec))
     {
       /* Common symbols less than or equal to -G nn bytes are automatically
         put into .sbss.  */
index 94a7ed0..308b4e9 100644 (file)
@@ -3104,7 +3104,7 @@ elf64_alpha_relax_opt_call (struct alpha_relax_info *info, bfd_vma symval)
 
   /* We've now determined that we can skip an initial gp load.  Verify
      that the call and the target use the same gp.   */
-  if (info->link_info->hash->creator != info->tsec->owner->xvec
+  if (info->link_info->output_bfd->xvec != info->tsec->owner->xvec
       || info->gotobj != alpha_elf_tdata (info->tsec->owner)->gotobj)
     return 0;
 
index 0dae3d7..35d6b64 100644 (file)
@@ -4275,7 +4275,7 @@ ppc64_elf_check_directives (bfd *ibfd, struct bfd_link_info *info)
   struct ppc_link_hash_entry **p, *eh;
 
   htab = ppc_hash_table (info);
-  if (!is_ppc64_elf_target (htab->elf.root.creator))
+  if (!is_ppc64_elf_target (info->output_bfd->xvec))
     return TRUE;
 
   if (is_ppc64_elf_target (ibfd->xvec))
index a93097f..df3fb8b 100644 (file)
@@ -1,6 +1,6 @@
 /* SPARC-specific support for 64-bit ELF
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -441,7 +441,7 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
          return FALSE;
        }
 
-      if (info->hash->creator != abfd->xvec
+      if (info->output_bfd->xvec != abfd->xvec
          || (abfd->flags & DYNAMIC) != 0)
         {
          /* STT_REGISTER only works when linking an elf64_sparc object.
@@ -510,7 +510,7 @@ elf64_sparc_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
       return TRUE;
     }
   else if (*namep && **namep
-          && info->hash->creator == abfd->xvec)
+          && info->output_bfd->xvec == abfd->xvec)
     {
       int i;
       struct _bfd_sparc_elf_app_reg *p;
index a0bd0df..a00634b 100644 (file)
@@ -884,7 +884,7 @@ _bfd_elf_merge_symbol (bfd *abfd,
 
   /* This code is for coping with dynamic objects, and is only useful
      if we are doing an ELF link.  */
-  if (info->hash->creator != abfd->xvec)
+  if (info->output_bfd->xvec != abfd->xvec)
     return TRUE;
 
   /* For merging, we only care about real symbols.  */
@@ -3336,7 +3336,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
         the format of the output file.  */
       if (info->relocatable
          || !is_elf_hash_table (htab)
-         || htab->root.creator != abfd->xvec)
+         || info->output_bfd->xvec != abfd->xvec)
        {
          if (info->relocatable)
            bfd_set_error (bfd_error_invalid_operation);
@@ -3433,7 +3433,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
         format as the output, we can't make a shared library.  */
       if (info->shared
          && is_elf_hash_table (htab)
-         && htab->root.creator == abfd->xvec
+         && info->output_bfd->xvec == abfd->xvec
          && !htab->dynamic_sections_created)
        {
          if (! _bfd_elf_link_create_dynamic_sections (abfd, info))
@@ -4674,7 +4674,7 @@ elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info)
   if (! dynamic
       && is_elf_hash_table (htab)
       && bed->check_relocs != NULL
-      && (*bed->relocs_compatible) (abfd->xvec, htab->root.creator))
+      && (*bed->relocs_compatible) (abfd->xvec, info->output_bfd->xvec))
     {
       asection *o;
 
index 1b24ee5..514b14c 100644 (file)
@@ -6083,7 +6083,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
 
   if (SGI_COMPAT (abfd)
       && ! info->shared
-      && info->hash->creator == abfd->xvec
+      && info->output_bfd->xvec == abfd->xvec
       && strcmp (*namep, "__rld_obj_head") == 0)
     {
       struct elf_link_hash_entry *h;
index 52cc36e..0f18789 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for linux flavored i386 a.out binaries.
    Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003,
-   2004, 2006, 2007 Free Software Foundation, Inc.
+   2004, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -346,9 +346,9 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
      If we do, and the defining entry is from a shared library, we
      need to create the dynamic sections.
 
-     FIXME: What if abfd->xvec != info->hash->creator?  We may want to
-     be able to link Linux a.out and ELF objects together, but serious
-     confusion is possible.  */
+     FIXME: What if abfd->xvec != info->output_bfd->xvec?  We may
+     want to be able to link Linux a.out and ELF objects together,
+     but serious confusion is possible.  */
 
   insert = FALSE;
 
@@ -356,7 +356,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
       && linux_hash_table (info)->dynobj == NULL
       && strcmp (name, SHARABLE_CONFLICTS) == 0
       && (flags & BSF_CONSTRUCTOR) != 0
-      && abfd->xvec == info->hash->creator)
+      && abfd->xvec == info->output_bfd->xvec)
     {
       if (! linux_link_create_dynamic_sections (abfd, info))
        return FALSE;
@@ -365,7 +365,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
     }
 
   if (bfd_is_abs_section (section)
-      && abfd->xvec == info->hash->creator)
+      && abfd->xvec == info->output_bfd->xvec)
     {
       h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE,
                                  FALSE, FALSE);
index fb293cc..327426e 100644 (file)
@@ -1,6 +1,6 @@
 /* linker.c -- BFD linker routines
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007
+   2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support
 
@@ -151,9 +151,9 @@ SUBSUBSECTION
 
        Sometimes the <<_bfd_link_add_symbols>> function must store
        some information in the hash table entry to be used by the
-       <<_bfd_final_link>> function.  In such a case the <<creator>>
-       field of the hash table must be checked to make sure that the
-       hash table was created by an object file of the same format.
+       <<_bfd_final_link>> function.  In such a case the output bfd
+       xvec must be checked to make sure that the hash table was
+       created by an object file of the same format.
 
        The <<_bfd_final_link>> routine must be prepared to handle a
        hash entry without any extra information added by the
@@ -165,7 +165,7 @@ SUBSUBSECTION
        initialization function.
 
        See <<ecoff_link_add_externals>> for an example of how to
-       check the <<creator>> field before saving information (in this
+       check the output bfd before saving information (in this
        case, the ECOFF external symbol debugging information) in a
        hash table entry.
 
@@ -471,13 +471,12 @@ _bfd_link_hash_newfunc (struct bfd_hash_entry *entry,
 bfd_boolean
 _bfd_link_hash_table_init
   (struct bfd_link_hash_table *table,
-   bfd *abfd,
+   bfd *abfd ATTRIBUTE_UNUSED,
    struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *,
                                      struct bfd_hash_table *,
                                      const char *),
    unsigned int entsize)
 {
-  table->creator = abfd->xvec;
   table->undefs = NULL;
   table->undefs_tail = NULL;
   table->type = bfd_link_generic_hash_table;
@@ -1359,7 +1358,7 @@ generic_link_add_symbol_list (bfd *abfd,
             hash table other than the generic hash table, so we only
             do this if we are certain that the hash table is a
             generic one.  */
-         if (info->hash->creator == abfd->xvec)
+         if (info->output_bfd->xvec == abfd->xvec)
            {
              if (h->sym == NULL
                  || (! bfd_is_und_section (bfd_get_section (p))
@@ -2243,7 +2242,7 @@ _bfd_generic_link_output_symbols (bfd *output_bfd,
                 this routine will be called with a hash table
                 other than a generic hash table, so we double
                 check that.  */
-             if (info->hash->creator == input_bfd->xvec)
+             if (info->output_bfd->xvec == input_bfd->xvec)
                {
                  if (h->sym != NULL)
                    *sym_ptr = sym = h->sym;
index 61445d0..d56c431 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for linux flavored m68k a.out binaries.
    Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -350,9 +350,9 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
      If we do, and the defining entry is from a shared library, we
      need to create the dynamic sections.
 
-     FIXME: What if abfd->xvec != info->hash->creator?  We may want to
-     be able to link Linux a.out and ELF objects together, but serious
-     confusion is possible.  */
+     FIXME: What if abfd->xvec != info->output_bfd->xvec?  We may
+     want to be able to link Linux a.out and ELF objects together,
+     but serious confusion is possible.  */
 
   insert = FALSE;
 
@@ -360,7 +360,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
       && linux_hash_table (info)->dynobj == NULL
       && strcmp (name, SHARABLE_CONFLICTS) == 0
       && (flags & BSF_CONSTRUCTOR) != 0
-      && abfd->xvec == info->hash->creator)
+      && abfd->xvec == info->output_bfd->xvec)
     {
       if (! linux_link_create_dynamic_sections (abfd, info))
        return FALSE;
@@ -369,7 +369,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
     }
 
   if (bfd_is_abs_section (section)
-      && abfd->xvec == info->hash->creator)
+      && abfd->xvec == info->output_bfd->xvec)
     {
       h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE,
                                  FALSE, FALSE);
index 4144ce7..c7e0299 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for linux flavored sparc a.out binaries.
    Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002,
-   2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+   2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -346,9 +346,9 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
      If we do, and the defining entry is from a shared library, we
      need to create the dynamic sections.
 
-     FIXME: What if abfd->xvec != info->hash->creator?  We may want to
-     be able to link Linux a.out and ELF objects together, but serious
-     confusion is possible.  */
+     FIXME: What if abfd->xvec != info->output_bfd->xvec?  We may
+     want to be able to link Linux a.out and ELF objects together,
+     but serious confusion is possible.  */
 
   insert = FALSE;
 
@@ -356,7 +356,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
       && linux_hash_table (info)->dynobj == NULL
       && strcmp (name, SHARABLE_CONFLICTS) == 0
       && (flags & BSF_CONSTRUCTOR) != 0
-      && abfd->xvec == info->hash->creator)
+      && abfd->xvec == info->output_bfd->xvec)
     {
       if (! linux_link_create_dynamic_sections (abfd, info))
        return FALSE;
@@ -365,7 +365,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string,
     }
 
   if (bfd_is_abs_section (section)
-      && abfd->xvec == info->hash->creator)
+      && abfd->xvec == info->output_bfd->xvec)
     {
       h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE,
                                  FALSE, FALSE);
index 1c17dce..67880b2 100644 (file)
@@ -1,6 +1,7 @@
 /* BFD backend for SunOS binaries.
    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -829,7 +830,7 @@ sunos_add_dynamic_symbols (bfd *abfd,
   unsigned long need;
 
   /* Make sure we have all the required sections.  */
-  if (info->hash->creator == abfd->xvec)
+  if (info->output_bfd->xvec == abfd->xvec)
     {
       if (! sunos_create_dynamic_sections (abfd, info,
                                           ((abfd->flags & DYNAMIC) != 0
@@ -870,7 +871,7 @@ sunos_add_dynamic_symbols (bfd *abfd,
 
   /* There's no hope of using a dynamic object which does not exactly
      match the format of the output file.  */
-  if (info->hash->creator != abfd->xvec)
+  if (info->output_bfd->xvec != abfd->xvec)
     {
       bfd_set_error (bfd_error_invalid_operation);
       return FALSE;
@@ -1121,7 +1122,7 @@ sunos_add_one_symbol (struct bfd_link_info *info,
     }
 
   if ((abfd->flags & DYNAMIC) != 0
-      && abfd->xvec == info->hash->creator
+      && abfd->xvec == info->output_bfd->xvec
       && (h->flags & SUNOS_CONSTRUCTOR) != 0)
     /* The existing symbol is a constructor symbol, and this symbol
        is from a dynamic object.  A constructor symbol is actually a
@@ -1145,7 +1146,7 @@ sunos_add_one_symbol (struct bfd_link_info *info,
                                          hashp))
     return FALSE;
 
-  if (abfd->xvec == info->hash->creator)
+  if (abfd->xvec == info->output_bfd->xvec)
     {
       /* Set a flag in the hash table entry indicating the type of
         reference or definition we just found.  Keep a count of the
@@ -1191,7 +1192,7 @@ struct bfd_link_needed_list *
 bfd_sunos_get_needed_list (bfd *abfd ATTRIBUTE_UNUSED,
                           struct bfd_link_info *info)
 {
-  if (info->hash->creator != &MY (vec))
+  if (info->output_bfd->xvec != &MY (vec))
     return NULL;
   return sunos_hash_table (info)->needed;
 }
index f14c62b..21d9a2d 100644 (file)
@@ -1,6 +1,6 @@
 /* POWER/PowerPC XCOFF linker support.
    Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-   2005, 2006, 2007 Free Software Foundation, Inc.
+   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -560,7 +560,7 @@ xcoff_link_add_dynamic_symbols (bfd *abfd, struct bfd_link_info *info)
 
   /* We can only handle a dynamic object if we are generating an XCOFF
      output file.  */
-   if (info->hash->creator != abfd->xvec)
+   if (info->output_bfd->xvec != abfd->xvec)
     {
       (*_bfd_error_handler)
        (_("%s: XCOFF shared object when not producing XCOFF output"),
@@ -786,7 +786,7 @@ xcoff_link_create_extra_sections (bfd * abfd, struct bfd_link_info *info)
 {
   bfd_boolean return_value = FALSE;
 
-  if (info->hash->creator == abfd->xvec)
+  if (info->output_bfd->xvec == abfd->xvec)
     {
       /* We need to build a .loader section, so we do it here.  This
         won't work if we're producing an XCOFF output file with no
@@ -1294,7 +1294,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
             place.  */
          if (aux.x_csect.x_smclas == XMC_TC
              && sym.n_sclass == C_HIDEXT
-             && info->hash->creator == abfd->xvec
+             && info->output_bfd->xvec == abfd->xvec
              && ((bfd_xcoff_is_xcoff32 (abfd)
                   && aux.x_csect.x_scnlen.l == 4)
                  || (bfd_xcoff_is_xcoff64 (abfd)
@@ -1664,7 +1664,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
             shared object, which will cause symbol redefinitions,
             although this is an easier case to detect.  */
 
-         if (info->hash->creator == abfd->xvec)
+         if (info->output_bfd->xvec == abfd->xvec)
            {
              if (! bfd_is_und_section (section))
                *sym_hash = xcoff_link_hash_lookup (xcoff_hash_table (info),
@@ -1789,7 +1789,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
                  = csect->alignment_power;
            }
 
-         if (info->hash->creator == abfd->xvec)
+         if (info->output_bfd->xvec == abfd->xvec)
            {
              int flag;
 
@@ -1848,7 +1848,7 @@ xcoff_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
              /* We identify all symbols which are called, so that we
                 can create glue code for calls to functions imported
                 from dynamic objects.  */
-             if (info->hash->creator == abfd->xvec
+             if (info->output_bfd->xvec == abfd->xvec
                  && *rel_csect != bfd_und_section_ptr
                  && (rel->r_type == R_BR
                      || rel->r_type == R_RBR)
@@ -2066,7 +2066,7 @@ xcoff_link_check_ar_symbols (bfd *abfd,
 
   if ((abfd->flags & DYNAMIC) != 0
       && ! info->static_link
-      && info->hash->creator == abfd->xvec)
+      && info->output_bfd->xvec == abfd->xvec)
     return xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded);
 
   symesz = bfd_coff_symesz (abfd);
@@ -2099,7 +2099,7 @@ xcoff_link_check_ar_symbols (bfd *abfd,
             undefined references in shared objects.  */
          if (h != NULL
              && h->type == bfd_link_hash_undefined
-             && (info->hash->creator != abfd->xvec
+             && (info->output_bfd->xvec != abfd->xvec
                  || (((struct xcoff_link_hash_entry *) h)->flags
                      & XCOFF_DEF_DYNAMIC) == 0))
            {
@@ -2180,7 +2180,7 @@ _bfd_xcoff_bfd_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
        while (member != NULL)
          {
            if (bfd_check_format (member, bfd_object)
-               && (info->hash->creator == member->xvec)
+               && (info->output_bfd->xvec == member->xvec)
                && (! bfd_has_map (abfd) || (member->flags & DYNAMIC) != 0))
              {
                bfd_boolean needed;
@@ -2252,7 +2252,7 @@ xcoff_mark (struct bfd_link_info *info, asection *sec)
 
   sec->flags |= SEC_MARK;
 
-  if (sec->owner->xvec == info->hash->creator
+  if (sec->owner->xvec == info->output_bfd->xvec
       && coff_section_data (sec->owner, sec) != NULL
       && xcoff_section_data (sec->owner, sec) != NULL)
     {
@@ -2386,7 +2386,7 @@ xcoff_sweep (struct bfd_link_info *info)
              /* Keep all sections from non-XCOFF input files.  Keep
                 special sections.  Keep .debug sections for the
                 moment.  */
-             if (sub->xvec != info->hash->creator
+             if (sub->xvec != info->output_bfd->xvec
                  || o == xcoff_hash_table (info)->debug_section
                  || o == xcoff_hash_table (info)->loader_section
                  || o == xcoff_hash_table (info)->linkage_section
@@ -2759,7 +2759,7 @@ xcoff_build_ldsyms (struct xcoff_link_hash_entry *h, void * p)
          || h->root.type == bfd_link_hash_defweak)
       && (h->root.u.def.section->owner == NULL
          || (h->root.u.def.section->owner->xvec
-             != ldinfo->info->hash->creator)))
+             != ldinfo->info->output_bfd->xvec)))
     h->flags |= XCOFF_MARK;
 
   /* If this symbol is called and defined in a dynamic object, or it
@@ -3257,7 +3257,7 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd,
       bfd_byte *esym, *esymend;
       bfd_size_type symesz;
 
-      if (sub->xvec != info->hash->creator)
+      if (sub->xvec != info->output_bfd->xvec)
        continue;
       subdeb = bfd_get_section_by_name (sub, ".debug");
       if (subdeb == NULL || subdeb->size == 0)
index 6a8cac1..fd6c3d2 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-15  Alan Modra  <amodra@bigpond.net.au>
+
+       * bfdlink.h (struct bfd_link_hash_table): Delete creator field.
+       (struct bfd_link_info): Add output_bfd.
+
 2008-02-11  Bob Wilson  <bob.wilson@acm.org>
 
        * xtensa-config.h (XCHAL_HAVE_THREADPTR): Redefine to zero.
index 66cec01..bcd4b4f 100644 (file)
@@ -1,6 +1,6 @@
 /* bfdlink.h -- header file for BFD link routines
    Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
    Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -160,11 +160,6 @@ struct bfd_link_hash_table
 {
   /* The hash table itself.  */
   struct bfd_hash_table table;
-  /* The back end which created this hash table.  This indicates the
-     type of the entries in the hash table, which is sometimes
-     important information when linking object files of different
-     types together.  */
-  const bfd_target *creator;
   /* A linked list of undefined and common symbols, linked through the
      next field in the bfd_link_hash_entry structure.  */
   struct bfd_link_hash_entry *undefs;
@@ -396,6 +391,9 @@ struct bfd_link_info
      option).  If this is NULL, no symbols are being wrapped.  */
   struct bfd_hash_table *wrap_hash;
 
+  /* The output BFD.  */
+  bfd *output_bfd;
+
   /* The list of input BFD's involved in the link.  These are chained
      together via the link_next field.  */
   bfd *input_bfds;