daily update
[deliverable/binutils-gdb.git] / bfd / elfxx-mips.c
index 28a4e8b333beb373bdb30e01baff628f08fc5bae..fb8e1f73d7cfa49268d5fdfc09ea507ac4e69422 100644 (file)
@@ -13,7 +13,7 @@
 
    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,
@@ -23,7 +23,9 @@
 
    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.  */
+
 
 /* This file handles functionality common to the different MIPS ABI's.  */
 
@@ -323,6 +325,8 @@ struct mips_elf_link_hash_table
   bfd_boolean mips16_stubs_seen;
   /* True if we're generating code for VxWorks.  */
   bfd_boolean is_vxworks;
+  /* True if we already reported the small-data section overflow.  */
+  bfd_boolean small_data_overflow_reported;
   /* Shortcuts to some dynamic sections, or NULL if they are not
      being used.  */
   asection *srelbss;
@@ -8030,7 +8034,21 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            ;
          else
            {
+             struct mips_elf_link_hash_table *htab;
+
+             htab = mips_elf_hash_table (info);
              BFD_ASSERT (name != NULL);
+             if (!htab->small_data_overflow_reported
+                 && (howto->type == R_MIPS_GPREL16
+                     || howto->type == R_MIPS_LITERAL))
+               {
+                 const char *msg =
+                   _("small-data section exceeds 64KB;"
+                     " lower small-data size limit (see option -G)");
+
+                 htab->small_data_overflow_reported = TRUE;
+                 (*info->callbacks->einfo) ("%P: %s\n", msg);
+               }
              if (! ((*info->callbacks->reloc_overflow)
                     (info, NULL, name, howto->name, (bfd_vma) 0,
                      input_bfd, input_section, rel->r_offset)))
@@ -10172,6 +10190,7 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
   ret->rld_value = 0;
   ret->mips16_stubs_seen = FALSE;
   ret->is_vxworks = FALSE;
+  ret->small_data_overflow_reported = FALSE;
   ret->srelbss = NULL;
   ret->sdynbss = NULL;
   ret->srelplt = NULL;
This page took 0.02658 seconds and 4 git commands to generate.