[AArch64] Drop unused argument to elf_aarch64_create_or_find_stub_sec
[deliverable/binutils-gdb.git] / bfd / pe-mips.c
index 940c069dfcdd1e421e8082f6e3be3b6869a715db..7bd6e6de9b15993b5e303044ce0ef19696561b01 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for MIPS PE COFF files.
-   Copyright (C) 1990-2014 Free Software Foundation, Inc.
+   Copyright (C) 1990-2015 Free Software Foundation, Inc.
    Modified from coff-i386.c by DJ Delorie, dj@cygnus.com
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -339,7 +339,7 @@ static reloc_howto_type howto_table[] =
         FALSE),                /* Pcrel_offset. */
 };
 
-#define NUM_HOWTOS ((sizeof (howto_table) / sizeof (howto_table[0]))
+#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
 
 /* Turn a howto into a reloc nunmber.  */
 
@@ -349,8 +349,11 @@ static reloc_howto_type howto_table[] =
 /* Customize coffcode.h.  */
 #define MIPS 1
 
-#define RTYPE2HOWTO(cache_ptr, dst) \
-           (cache_ptr)->howto = howto_table + (dst)->r_type;
+#define RTYPE2HOWTO(cache_ptr, dst)                            \
+  ((cache_ptr)->howto =                                                \
+   ((dst)->r_type < NUM_HOWTOS                                 \
+    ? howto_table + (dst)->r_type                              \
+    : NULL))
 
 /* Compute the addend of a reloc.  If the reloc is to a common symbol,
    the object file contains the value of the common symbol.  By the
@@ -372,7 +375,7 @@ static reloc_howto_type howto_table[] =
       coffsym = (obj_symbols (abfd)                            \
                 + (cache_ptr->sym_ptr_ptr - symbols));         \
     else if (ptr)                                              \
-      coffsym = coff_symbol_from (abfd, ptr);                  \
+      coffsym = coff_symbol_from (ptr);                                \
     if (coffsym != NULL                                                \
        && coffsym->native->u.syment.n_scnum == 0)              \
       cache_ptr->addend = - coffsym->native->u.syment.n_value; \
This page took 0.023979 seconds and 4 git commands to generate.