Move RTEMS target configuration to ELF sections
[deliverable/binutils-gdb.git] / bfd / cofflink.c
index bcdf778ac0a6afdf57f73dc125fe63d0b3a2e6c4..41cf77df507a1d0f511530f3b273103a8b7b6e5c 100644 (file)
@@ -1,5 +1,5 @@
 /* COFF specific linker code.
-   Copyright (C) 1994-2016 Free Software Foundation, Inc.
+   Copyright (C) 1994-2017 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -344,8 +344,8 @@ coff_link_add_symbols (bfd *abfd,
                       & COFF_LINK_HASH_PE_SECTION_SYMBOL) == 0
                      && (*sym_hash)->root.type != bfd_link_hash_undefined
                      && (*sym_hash)->root.type != bfd_link_hash_undefweak)
-                   (*_bfd_error_handler)
-                     ("Warning: symbol `%s' is both section and non-section",
+                   _bfd_error_handler
+                     (_("Warning: symbol `%s' is both section and non-section"),
                       name);
 
                  addit = FALSE;
@@ -445,7 +445,8 @@ coff_link_add_symbols (bfd *abfd,
                          && !(DTYPE ((*sym_hash)->type) == DTYPE (sym.n_type)
                               && (BTYPE ((*sym_hash)->type) == T_NULL
                                   || BTYPE (sym.n_type) == T_NULL)))
-                       (*_bfd_error_handler)
+                       _bfd_error_handler
+                         /* xgettext: c-format */
                          (_("Warning: type of symbol `%s' changed from %d to %d in %B"),
                           abfd, name, (*sym_hash)->type, sym.n_type);
 
@@ -1398,7 +1399,8 @@ mark_relocs (struct coff_final_link_info *flaginfo, bfd *input_bfd)
         in the relocation table.  This will then be picked up in the
         skip/don't-skip pass.  */
       for (; irel < irelend; irel++)
-       flaginfo->sym_indices[ irel->r_symndx ] = -1;
+       if ((unsigned long) irel->r_symndx < obj_raw_syment_count (input_bfd))
+         flaginfo->sym_indices[irel->r_symndx] = -1;
     }
 }
 
@@ -2361,7 +2363,8 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
          if ((o->flags & SEC_RELOC) != 0
              && o->reloc_count != 0)
            {
-             (*_bfd_error_handler)
+             _bfd_error_handler
+               /* xgettext: c-format */
                (_("%B: relocs in section `%A', but it has no contents"),
                 input_bfd, o);
              bfd_set_error (bfd_error_no_contents);
@@ -2424,6 +2427,7 @@ _bfd_coff_link_input_bfd (struct coff_final_link_info *flaginfo, bfd *input_bfd)
              /* Complain if definition comes from an excluded section.  */
              if (ps->flags & SEC_EXCLUDE)
                (*flaginfo->info->callbacks->einfo)
+                 /* xgettext: c-format */
                  (_("%X`%s' referenced in section `%A' of %B: "
                     "defined in discarded section `%A' of %B\n"),
                   h->root.root.string, o, input_bfd, ps, ps->owner);
@@ -2720,7 +2724,8 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data)
              if (sec->reloc_count > 0xffff
                  && (! obj_pe (output_bfd)
                      || bfd_link_relocatable (flaginfo->info)))
-               (*_bfd_error_handler)
+               _bfd_error_handler
+                 /* xgettext: c-format */
                  (_("%s: %s: reloc overflow: 0x%lx > 0xffff"),
                   bfd_get_filename (output_bfd),
                   bfd_get_section_name (output_bfd, sec),
@@ -2729,7 +2734,8 @@ _bfd_coff_write_global_sym (struct bfd_hash_entry *bh, void *data)
              if (sec->lineno_count > 0xffff
                  && (! obj_pe (output_bfd)
                      || bfd_link_relocatable (flaginfo->info)))
-               (*_bfd_error_handler)
+               _bfd_error_handler
+                 /* xgettext: c-format */
                  (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"),
                   bfd_get_filename (output_bfd),
                   bfd_get_section_name (output_bfd, sec),
@@ -2953,8 +2959,9 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
       else if (symndx < 0
               || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
        {
-         (*_bfd_error_handler)
-           ("%B: illegal symbol index %ld in relocs", input_bfd, symndx);
+         _bfd_error_handler
+           /* xgettext: c-format */
+           (_("%B: illegal symbol index %ld in relocs"), input_bfd, symndx);
          return FALSE;
        }
       else
@@ -3114,7 +3121,8 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
        case bfd_reloc_ok:
          break;
        case bfd_reloc_outofrange:
-         (*_bfd_error_handler)
+         _bfd_error_handler
+           /* xgettext: c-format */
            (_("%B: bad reloc address 0x%lx in section `%A'"),
             input_bfd, input_section, (unsigned long) rel->r_vaddr);
          return FALSE;
This page took 0.025473 seconds and 4 git commands to generate.