diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 1998-06-26 22:25:39 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@redhat.com> | 1998-06-26 22:25:39 +0000 |
commit | 6cddf7d9676cb0264628654e5a242ef7acf700ab (patch) | |
tree | 67f58170223ad2e0cbf3ad3a3dd8749655ad1e0a /binutils | |
parent | 3f1739b32a0a74c9a138d4b26cdcaebc7eee6829 (diff) | |
download | gdb-6cddf7d9676cb0264628654e5a242ef7acf700ab.zip gdb-6cddf7d9676cb0264628654e5a242ef7acf700ab.tar.gz gdb-6cddf7d9676cb0264628654e5a242ef7acf700ab.tar.bz2 |
* objcopy.c (strip_main): keep_specific_list == NULL as additional
condition to set up strip all symbols by default.
(copy_archive): don't change archive when error in object files of
the archive.
PR16197
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 7 | ||||
-rw-r--r-- | binutils/objcopy.c | 27 |
2 files changed, 22 insertions, 12 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 1d5b9fc..918ca6b 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +1998-06-26 Vladimir N. Makarov <vmakarov@cygnus.com> + + * objcopy.c (strip_main): keep_specific_list == NULL as additional + condition to set up strip all symbols by default. + (copy_archive): don't change archive when error in object files of + the archive. + Wed Jun 24 17:53:47 1998 Ian Lance Taylor <ian@cygnus.com> * stabs.c (parse_number): Sign extend negative values correctly if diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 15cd1b4..f2b1156 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -961,7 +961,7 @@ copy_archive (ibfd, obfd, output_target) list = NULL; this_element = bfd_openr_next_archived_file (ibfd, NULL); - while (this_element != (bfd *) NULL) + while (!status && this_element != (bfd *) NULL) { /* Create an output file for this member. */ char *output_name = concat (dir, "/", bfd_get_filename(this_element), @@ -983,7 +983,12 @@ copy_archive (ibfd, obfd, output_target) if (bfd_check_format (this_element, bfd_object) == true) copy_object (this_element, output_bfd); - bfd_close (output_bfd); + if (!bfd_close (output_bfd)) + { + bfd_nonfatal (bfd_get_filename (output_bfd)); + /* Error in new object file. Don't change archive. */ + status = 1; + } /* Open the newly output file and attach to our list. */ output_bfd = bfd_openr (output_name, output_target); @@ -1097,6 +1102,7 @@ setup_section (ibfd, isection, obfdarg) bfd *obfd = (bfd *) obfdarg; struct section_list *p; sec_ptr osection; + bfd_size_type size; bfd_vma vma; bfd_vma lma; flagword flags; @@ -1124,9 +1130,10 @@ setup_section (ibfd, isection, obfdarg) goto loser; } - if (!bfd_set_section_size (obfd, - osection, - bfd_section_size (ibfd, isection))) + size = bfd_section_size (ibfd, isection); + if (copy_byte >= 0) + size = (size + interleave - 1) / interleave; + if (! bfd_set_section_size (obfd, osection, size)) { err = "size"; goto loser; @@ -1284,12 +1291,7 @@ copy_section (ibfd, isection, obfdarg) RETURN_NONFATAL (bfd_get_filename (ibfd)); if (copy_byte >= 0) - { - filter_bytes (memhunk, &size); - /* The section has gotten smaller. */ - if (!bfd_set_section_size (obfd, osection, size)) - RETURN_NONFATAL (bfd_get_filename (obfd)); - } + filter_bytes (memhunk, &size); if (!bfd_set_section_contents (obfd, osection, memhunk, (file_ptr) 0, size)) @@ -1742,7 +1744,8 @@ strip_main (argc, argv) /* Default is to strip all symbols. */ if (strip_symbols == STRIP_UNDEF && discard_locals == LOCALS_UNDEF - && strip_specific_list == NULL) + && strip_specific_list == NULL + && keep_specific_list == NULL) strip_symbols = STRIP_ALL; if (output_target == (char *) NULL) |