Add support to GDB for the Renesas rl78 architecture.
[external/binutils.git] / bfd / sunos.c
index a9117f4..8ef25ed 100644 (file)
@@ -1,13 +1,14 @@
 /* BFD backend for SunOS binaries.
    Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2011
+   Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -17,7 +18,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
 
 #define TARGETNAME "a.out-sunos-big"
 
@@ -828,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
@@ -869,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;
@@ -1120,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
@@ -1144,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
@@ -1190,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;
 }
@@ -1747,9 +1749,6 @@ sunos_scan_dynamic_symbol (struct sunos_link_hash_entry *h, void * data)
 {
   struct bfd_link_info *info = (struct bfd_link_info *) data;
 
-  if (h->root.root.type == bfd_link_hash_warning)
-    h = (struct sunos_link_hash_entry *) h->root.root.u.i.link;
-
   /* Set the written flag for symbols we do not want to write out as
      part of the regular symbol table.  This is all symbols which are
      not defined in a regular object file.  For some reason symbols