OSDN Git Service

daily update
[pf3gnuchains/pf3gnuchains3x.git] / bfd / coff-i960.c
index 5227575..d0374d2 100644 (file)
@@ -1,33 +1,39 @@
 /* BFD back-end for Intel 960 COFF files.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1999, 2000, 2001,
-   2002, 2003, 2004 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2007, 2008  Free Software Foundation, Inc.
    Written by Cygnus Support.
 
-This file is part of BFD, the Binary File Descriptor library.
+   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
-(at your option) any later version.
+   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 3 of the License, or
+   (at your option) any later version.
 
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   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.  */
 
 #define I960 1
 #define BADMAG(x) I960BADMAG(x)
 
-#include "bfd.h"
 #include "sysdep.h"
+#include "bfd.h"
 #include "libbfd.h"
 #include "coff/i960.h"
 #include "coff/internal.h"
-#include "libcoff.h"           /* to allow easier abstraction-breaking */
+
+#ifndef bfd_pe_print_pdata
+#define bfd_pe_print_pdata     NULL
+#endif
+
+#include "libcoff.h"           /* To allow easier abstraction-breaking.  */
 
 static bfd_boolean coff_i960_is_local_label_name
   PARAMS ((bfd *, const char *));
@@ -296,6 +302,20 @@ coff_i960_reloc_type_lookup (abfd, code)
     }
 }
 
+static reloc_howto_type *
+coff_i960_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
+                            const char *r_name)
+{
+  if (strcasecmp (howto_optcall.name, r_name) == 0)
+    return &howto_optcall;
+  if (strcasecmp (howto_rellong.name, r_name) == 0)
+    return &howto_rellong;
+  if (strcasecmp (howto_iprmed.name, r_name) == 0)
+    return &howto_iprmed;
+
+  return NULL;
+}
+
 /* The real code is in coffcode.h */
 
 #define RTYPE2HOWTO(cache_ptr, dst) \
@@ -468,14 +488,14 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
 
       if (howto->type == R_OPTCALL && ! info->relocatable && symndx != -1)
        {
-         int class;
+         int class_val;
 
          if (h != NULL)
-           class = h->class;
+           class_val = h->symbol_class;
          else
-           class = sym->n_sclass;
+           class_val = sym->n_sclass;
 
-         switch (class)
+         switch (class_val)
            {
            case C_NULL:
              /* This symbol is apparently not from a COFF input file.
@@ -613,6 +633,7 @@ coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp)
 #define coff_adjust_symndx coff_i960_adjust_symndx
 
 #define coff_bfd_reloc_type_lookup coff_i960_reloc_type_lookup
+#define coff_bfd_reloc_name_lookup coff_i960_reloc_name_lookup
 
 #include "coffcode.h"