* config/tc-xtensa.h (resource_table): Change units to unsigned chars.
[deliverable/binutils-gdb.git] / bfd / format.c
index 256ec0efd423f5992d928fe43e836846f7060177..4ccca2a3aa789492d7f418a5daf3c5eb5031c97b 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic BFD support for file formats.
 /* Generic BFD support for file formats.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003
-   Free Software Foundation, Inc.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002,
+   2003, 2005 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -17,7 +17,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 /*
 SECTION
 
 /*
 SECTION
@@ -173,6 +173,14 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
          if (matching)
            free (matching_vector);
 
          if (matching)
            free (matching_vector);
 
+         /* If the file was opened for update, then `output_has_begun'
+            some time ago when the file was created.  Do not recompute
+            sections sizes or alignments in _bfd_set_section_contents.
+            We can not set this flag until after checking the format,
+            because it will interfere with creation of BFD sections.  */
+         if (abfd->direction == both_direction)
+           abfd->output_has_begun = TRUE;
+
          return TRUE;                  /* File position has moved, BTW.  */
        }
 
          return TRUE;                  /* File position has moved, BTW.  */
        }
 
@@ -245,16 +253,6 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
            matching_vector[match_count] = temp;
 
          match_count++;
            matching_vector[match_count] = temp;
 
          match_count++;
-
-#ifdef GNU960
-         /* Big- and little-endian b.out archives look the same, but it
-            doesn't matter: there is no difference in their headers, and
-            member file byte orders will (I hope) be handled appropriately
-            by bfd.  Ditto for big and little coff archives.  And the 4
-            coff/b.out object formats are unambiguous.  So accept the
-            first match we find.  */
-         break;
-#endif
        }
       else if ((err = bfd_get_error ()) == bfd_error_wrong_object_format
               || err == bfd_error_file_ambiguously_recognized)
        }
       else if ((err = bfd_get_error ()) == bfd_error_wrong_object_format
               || err == bfd_error_file_ambiguously_recognized)
@@ -329,6 +327,14 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
       if (matching)
        free (matching_vector);
 
       if (matching)
        free (matching_vector);
 
+      /* If the file was opened for update, then `output_has_begun'
+        some time ago when the file was created.  Do not recompute
+        sections sizes or alignments in _bfd_set_section_contents.
+        We can not set this flag until after checking the format,
+        because it will interfere with creation of BFD sections.  */
+      if (abfd->direction == both_direction)
+       abfd->output_has_begun = TRUE;
+
       return TRUE;                     /* File position has moved, BTW.  */
     }
 
       return TRUE;                     /* File position has moved, BTW.  */
     }
 
@@ -425,7 +431,7 @@ bfd_format_string (bfd_format format)
   switch (format)
     {
     case bfd_object:
   switch (format)
     {
     case bfd_object:
-      return "object";         /* Linker/assember/compiler output.  */
+      return "object";         /* Linker/assembler/compiler output.  */
     case bfd_archive:
       return "archive";                /* Object archive file.  */
     case bfd_core:
     case bfd_archive:
       return "archive";                /* Object archive file.  */
     case bfd_core:
This page took 0.044202 seconds and 4 git commands to generate.