gas/arc: Make member of arc_flags const
[deliverable/binutils-gdb.git] / bfd / coff-alpha.c
index 028e70398429fed0345c7d939ec63263c47ccfb5..55fd35070be4d9fa5a8e83c92e6492cd2791326a 100644 (file)
@@ -1,7 +1,5 @@
 /* BFD back-end for ALPHA Extended-Coff files.
-   Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-   2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 1993-2016 Free Software Foundation, Inc.
    Modified from coff-mips.c by Steve Chamberlain <sac@cygnus.com> and
    Ian Lance Taylor <ian@cygnus.com>.
 
@@ -1228,7 +1226,7 @@ alpha_convert_external_reloc (bfd *output_bfd ATTRIBUTE_UNUSED,
   unsigned long r_symndx;
   bfd_vma relocation;
 
-  BFD_ASSERT (info->relocatable);
+  BFD_ASSERT (bfd_link_relocatable (info));
 
   if (h->root.type == bfd_link_hash_defined
       || h->root.type == bfd_link_hash_defweak)
@@ -1407,7 +1405,7 @@ alpha_relocate_section (bfd *output_bfd,
 
   lita_sec = symndx_to_section[RELOC_SECTION_LITA];
   gp = _bfd_get_gp_value (output_bfd);
-  if (! info->relocatable && lita_sec != NULL)
+  if (! bfd_link_relocatable (info) && lita_sec != NULL)
     {
       struct ecoff_section_tdata *lita_sec_data;
 
@@ -1532,7 +1530,7 @@ alpha_relocate_section (bfd *output_bfd,
             not otherwise used for anything.  For some reason, the
             address of the relocation does not appear to include the
             section VMA, unlike the other relocation types.  */
-         if (info->relocatable)
+         if (bfd_link_relocatable (info))
            H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr,
                      ext_rel->r_vaddr);
          adjust_addrp = FALSE;
@@ -1685,7 +1683,7 @@ alpha_relocate_section (bfd *output_bfd,
              if (h == (struct ecoff_link_hash_entry *) NULL)
                abort ();
 
-             if (! info->relocatable)
+             if (! bfd_link_relocatable (info))
                {
                  if (h->root.type == bfd_link_hash_defined
                      || h->root.type == bfd_link_hash_defweak)
@@ -1728,7 +1726,7 @@ alpha_relocate_section (bfd *output_bfd,
 
          addend += r_vaddr;
 
-         if (info->relocatable)
+         if (bfd_link_relocatable (info))
            {
              /* Adjust r_vaddr by the addend.  */
              H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr);
@@ -1764,7 +1762,7 @@ alpha_relocate_section (bfd *output_bfd,
          /* Store a value from the reloc stack into a bitfield.  If
             we are generating relocatable output, all we do is
             adjust the address of the reloc.  */
-         if (! info->relocatable)
+         if (! bfd_link_relocatable (info))
            {
              bfd_vma mask;
              bfd_vma val;
@@ -1830,7 +1828,7 @@ alpha_relocate_section (bfd *output_bfd,
                abort ();
            }
 
-         if (info->relocatable)
+         if (bfd_link_relocatable (info))
            {
              /* We are generating relocatable output, and must
                 convert the existing reloc.  */
@@ -1956,7 +1954,7 @@ alpha_relocate_section (bfd *output_bfd,
            }
        }
 
-      if (info->relocatable && adjust_addrp)
+      if (bfd_link_relocatable (info) && adjust_addrp)
        {
          /* Change the address of the relocation.  */
          H_PUT_64 (input_bfd,
@@ -2189,7 +2187,7 @@ alpha_ecoff_get_elt_at_filepos (bfd *archive, file_ptr filepos)
 static bfd *
 alpha_ecoff_openr_next_archived_file (bfd *archive, bfd *last_file)
 {
-  file_ptr filestart;
+  ufile_ptr filestart;
 
   if (last_file == NULL)
     filestart = bfd_ardata (archive)->first_file_filepos;
@@ -2210,6 +2208,12 @@ alpha_ecoff_openr_next_archived_file (bfd *archive, bfd *last_file)
         BSD-4.4-style element with a long odd size.  */
       filestart = last_file->proxy_origin + size;
       filestart += filestart % 2;
+      if (filestart < last_file->proxy_origin)
+       {
+         /* Prevent looping.  See PR19256.  */
+         bfd_set_error (bfd_error_malformed_archive);
+         return NULL;
+       }
     }
 
   return alpha_ecoff_get_elt_at_filepos (archive, filestart);
@@ -2243,7 +2247,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
     alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
     alpha_ecoff_swap_scnhdr_out,
     FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
-    ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2,
+    ECOFF_NO_LONG_SECTION_NAMES, 4, FALSE, 2, 32768,
     alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in,
     alpha_ecoff_swap_scnhdr_in, NULL,
     alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook,
@@ -2347,8 +2351,9 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data =
 #define _bfd_ecoff_section_already_linked \
   _bfd_coff_section_already_linked
 #define _bfd_ecoff_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define _bfd_ecoff_bfd_link_check_relocs    _bfd_generic_link_check_relocs
 
-const bfd_target ecoffalpha_little_vec =
+const bfd_target alpha_ecoff_le_vec =
 {
   "ecoff-littlealpha",         /* name */
   bfd_target_ecoff_flavour,
This page took 0.026805 seconds and 4 git commands to generate.