Update year range in copyright notice of all files.
[external/binutils.git] / bfd / elf-eh-frame.c
index 0500cd3..1b03b9b 100644 (file)
@@ -1,5 +1,5 @@
 /* .eh_frame section optimization.
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2017 Free Software Foundation, Inc.
    Written by Jakub Jelinek <jakub@redhat.com>.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -924,6 +924,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
              && read_value (abfd, buf - length, length, FALSE) == 0)
            {
              (*info->callbacks->minfo)
+               /* xgettext:c-format */
                (_("discarding zero address range FDE in %B(%A).\n"),
                 abfd, sec);
              this_inf->u.fde.cie_inf = NULL;
@@ -1028,6 +1029,7 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
 
  free_no_table:
   (*info->callbacks->einfo)
+    /* xgettext:c-format */
     (_("%P: error in %B(%A); no .eh_frame_hdr table will be created.\n"),
      abfd, sec);
   hdr_info->u.dwarf.table = FALSE;
@@ -1369,14 +1371,27 @@ _bfd_elf_discard_section_eh_frame
                     && ent->make_relative == 0)
                    || (ent->fde_encoding & 0x70) == DW_EH_PE_aligned))
              {
+               static int num_warnings_issued = 0;
+
                /* If a shared library uses absolute pointers
                   which we cannot turn into PC relative,
                   don't create the binary search table,
                   since it is affected by runtime relocations.  */
                hdr_info->u.dwarf.table = FALSE;
-               (*info->callbacks->einfo)
-                 (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
-                    " table being created.\n"), abfd, sec);
+               if (num_warnings_issued < 10)
+                 {
+                   (*info->callbacks->einfo)
+                     /* xgettext:c-format */
+                     (_("%P: FDE encoding in %B(%A) prevents .eh_frame_hdr"
+                        " table being created.\n"), abfd, sec);
+                   num_warnings_issued ++;
+                 }
+               else if (num_warnings_issued == 10)
+                 {
+                   (*info->callbacks->einfo)
+                     (_("%P: Further warnings about FDE encoding preventing .eh_frame_hdr generation dropped.\n"));
+                   num_warnings_issued ++;
+                 }
              }
            ent->removed = 0;
            hdr_info->u.dwarf.fde_count++;
@@ -1661,7 +1676,8 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info,
       addr = bfd_get_signed_32 (abfd, contents + offset) + offset;
       if (addr <= last_addr)
        {
-         (*_bfd_error_handler) (_("%B: %s not in order"), sec->owner, sec->name);
+         /* xgettext:c-format */
+         _bfd_error_handler (_("%B: %s not in order"), sec->owner, sec->name);
          return FALSE;
        }
 
@@ -1674,15 +1690,17 @@ _bfd_elf_write_section_eh_frame_entry (bfd *abfd, struct bfd_link_info *info,
   addr -= (sec->output_section->vma + sec->output_offset + sec->rawsize);
   if (addr & 1)
     {
-      (*_bfd_error_handler) (_("%B: %s invalid input section size"),
-                            sec->owner, sec->name);
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%B: %s invalid input section size"),
+                         sec->owner, sec->name);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
   if (last_addr >= addr + sec->rawsize)
     {
-      (*_bfd_error_handler) (_("%B: %s points past end of text section"),
-                            sec->owner, sec->name);
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%B: %s points past end of text section"),
+                         sec->owner, sec->name);
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
@@ -2111,7 +2129,7 @@ _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *info)
       sec = hdr_info->u.compact.entries[i];
       if (sec->output_section != osec)
        {
-         (*_bfd_error_handler)
+         _bfd_error_handler
            (_("Invalid output section for .eh_frame_entry: %s"),
             sec->output_section->name);
          return FALSE;
@@ -2134,7 +2152,7 @@ _bfd_elf_fixup_eh_frame_hdr (struct bfd_link_info *info)
 
   if (i != 0)
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        (_("Invalid contents in %s section"), osec->name);
       return FALSE;
     }