X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Fformat.c;h=4ccca2a3aa789492d7f418a5daf3c5eb5031c97b;hb=0bf60745767d2465c81ee57ae7705a62d6d8fafe;hp=5b82996453c6e6f4501aee849c52b9954e6cb4a4;hpb=10adf131a598d8a101af9e0f8eadcb3a935eb943;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/format.c b/bfd/format.c index 5b82996453..4ccca2a3aa 100644 --- a/bfd/format.c +++ b/bfd/format.c @@ -1,6 +1,6 @@ /* 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. @@ -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 - 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 @@ -173,6 +173,14 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) 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. */ } @@ -319,6 +327,14 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) 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. */ }