aboutsummaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
AgeCommit message (Collapse)AuthorFilesLines
1996-01-08 * objcopy.c: Include budbg.h.Ian Lance Taylor1-10/+68
(convert_debugging): New static variable. (OPTION_DEBUGGING): Define. (copy_options): Add "debugging". (copy_usage): Mention --debugging. (is_strip_section): Skip debugging sections if convert_debugging. (setup_section, copy_section): Likewise. (filter_symbols): Skip debugging symbols if convert_debugging. (copy_object): If convert_debugging, read and write debugging information. (write_debugging_info): New static function. (copy_main): Handle --debugging. * Makefile.in (DEBUG_OBJS): New variable. ($(OBJCOPY_PROG)): Depend upon and link against $(DEBUG_OBJS). ($(STRIP_PROG)): Likewise. (OBJDUMP_OBJS): Remove variable. ($(OBJDUMP_PROG)): Use objdump.o $(DEBUG_OBJS) rather than $(OBJDUMP_OBJS). * binutils.texi, objcopy.1: Document --debugging.
1995-11-06 * bucomm.h: Include <sys/types.h>.Ian Lance Taylor1-24/+3
* ar.c: Don't include <sys/types.h> or <stdio.h>. * bucomm.c, dlltool.c, nlmconv.c, objcopy.c, objdump.c: Likewise.
1995-08-05 * objcopy.c (mark_symbols_used_in_relocations): Handle sectionsJeff Law1-1/+4
with no relocations. * coffgrok.c (do_sections_p1): Likewise. Fix for net bug.
1995-07-12Wed Jul 12 10:40:23 1995 H.J. Lu <hjl@nynexst.com>Ian Lance Taylor1-5/+20
* objcopy.c (simple_copy): Preserve errno on failure. (smart_rename): Print error mesage if simple_copy fails.
1995-07-04 * objcopy.c (copy_archive): Record all output BFD's, and closeIan Lance Taylor1-5/+11
them before unlinking them and removing the temporary directory, to avoid NFS problems. PR 6795.
1995-07-04 * objcopy.c (enum strip_action): Define strip_unneeded.Ian Lance Taylor1-73/+121
(OPTION_STRIP_UNNEEDED): Define. (strip_options): Add "strip-unneeded". (copy_options): Likewise. (copy_usage): Mention --strip-unneeded. (strip_usage): Likewise. (is_strip_section): Strip debugging sections if strip_unneeded. (filter_symbols): If strip_unneeded, only keep BSF_KEEP symbols. (copy_object): If strip_all, discard symbols without checking discard_locals. (copy_object): Call filter_symbols if strip_unneeded. (setup_section): Strip debugging sections if strip_unneeded. (copy_section): Likewise. (strip_main): Handle OPTION_STRIP_UNNEEDED. (copy_main): Likewise. * binutils.texi, objcopy.1, strip.1: Document --strip-unneeded. PR 6684.
1995-03-06 * bucomm.c (list_supported_targets): New function.Ian Lance Taylor1-0/+8
* bucomm.h (list_supported_targets): Declare. * ar.c (usage): Call list_supported_targets. * nm.c (usage): Likewise. * objcopy.c (copy_usage, strip_usage): Likewise. * objdump.c (usage): Likewise. * size.c (usage): Likewise. * strings.c (usage): Likewise. PR 6345.
1995-02-17--set-section-flags patch from dje.Ian Lance Taylor1-3/+2
1995-02-17 * objcopy.c (struct section_list): Add fields remove, set_flags,Ian Lance Taylor1-85/+337
and flags. Change adjust from boolean to enum. (remove_sections): Remove static variable. (sections_removed): New static variable. (copy_options): Add --set-section-flags. (copy_usage): Mention --set-section-flags. (parse_flags): New static function. (find_section_list): New static function. (is_strip_symbol): Change return type from int to boolean. (is_strip_section): New static function. (filter_symbols): Call is_strip_section. (copy_object): When adding sections, check for specified flags or VMA. Call filter_symbols if any sections are being removed. (setup_section): Use find_section_list function rather than looking through remove_sections and adjust_sections. Handle --set-section-flags. (copy_section): Use find_section_list rather than looking through remove_sections. (strip_main): Use find_section_list instead of adding items to sections_removed. (copy_main): Use find_section_list instead of adding items to sections_removed and adjust_sections. Handle --set-section-flags. * binutils.texi, objcopy.1: Document --set-section-flags.
1994-12-14removed some unreachable code from objcopyKen Raeburn1-1/+0
1994-12-08objcopy.c (add_strip_symbol): Cast return value of xmalloc.Ken Raeburn1-4/+64
1994-11-17 * objcopy.c (main): Fix is_strip test. FromIan Lance Taylor1-53/+133
pirker@eiunix.tuwien.ac.at (Martin Pirker).
1994-10-20 * objcopy.c (gap_fill_set, gap_fill): New static variables.Ian Lance Taylor1-5/+161
(copy_options): Accept --gap-fill. (copy_usage): Mention --gap-fill. (copy_object): Support --gap-fill. (get_sections, compare_section_vma): New static functions. (copy_main): Handle --gap-fill. * binutils.texi, objcopy.1: Document --gap-fill.
1994-10-19 * objcopy.c (copy_object): Revert yesterday's change.Ian Lance Taylor1-9/+1
* binutils.texi, objcopy.1: Remove special mention of --set-start and `binary' output format.
1994-10-18 * objcopy.c (copy_object): If the output file format is `binary',Ian Lance Taylor1-1/+9
and the start address was not set using --set-start, default the start address to zero. This hack is because the `binary' output file format uses the start address to set the virtual address of the first byte in the file. * binutils.texi, objcopy.1: Add some notes on generating S-records and binary files.
1994-10-18 * objcopy.c (struct section_list): Add fields used, adjust, val.Ian Lance Taylor1-28/+252
(adjust_start, set_start_set, set_start): New static variables. (adjust_section_vma, adjust_sections): New static variables. (copy_options): Add --adjust-start, --adjust-vma, --adjust-section-vma, --adjust-warnings, --no-adjust-warnings, --set-start. (parse_vma): New static function. (copy_usage): Mention new options. (copy_object): Handle --set-start and --adjust-start. (setup_section): Correct type of last argument to PTR. Set used field if section is removed. Handle --adjust-vma and --adjust-section-vma. (copy_section): Correct type of last argument to PTR. (mark_symbols_used_in_relocations): Likewise. (strip_main): Clear used field when handling -R. (copy_main): Handle new options. * binutils.texi (objcopy): Document new options. * objcopy.1: Document new options.
1994-06-10 * objcopy.c (copy_archive): Make the temporary directory in theIan Lance Taylor1-2/+2
same directory as the output BFD, since we may not have write permission on the current directory. Set the permissions of the new directory to 0700, not 0777.
1994-05-11Tue May 10 18:22:06 1994 Jason Molenda (crash@sendai.cygnus.com)Jason Molenda1-13/+20
* objcopy.c (copy_section): Set section size correctly if using interleave.
1994-03-30 Update for recent BFD changes to symbol and reloc reading. RenameIan Lance Taylor1-16/+49
all uses of get_symtab_upper_bound to bfd_get_symtab_upper_bound. Also: * coffgrok.c (symcount): Change to long. (do_sections_p1): Check for error return from bfd_get_reloc_upper_bound. Change relcount to long, and check for error from bfd_canonicalize_reloc. (coff_grok): Change storage to long. Check for error from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * nlmconv.c (main): Change symcount, newsymalloc, newsymcount, and i to long. Check for error from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. (copy_sections): Change reloc_size and reloc_count to long. Check for error from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (mangle_relocs, i386_mangle_relocs, alpha_mangle_relocs): Change reloc_count_ptr argument to long *. Make corresponding changes to variables loaded from *reloc_count_ptr. * nm.c (display_rel_file): Change storage and symcount to long. Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. * objcopy.c (filter_symbols): Change symcount, src_count and dst_count to long. (copy_object): Change symcount to long. Pass another argument to fprintf. Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. (copy_section): Change relcount to long. Check for errors from bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. (mark_symbols_used_in_relocations): Change relcount and i to long. Check for errors form bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. * objdump.c (storage): Remove global variable. (symcount): Changed to long. (slurp_symtab): New local variable storage. Check for errors from bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. (remove_useless_symbols): Change return value and count to long. (objdump_print_address): Change min, max, thisplace and i to long. (disassemble_data): Change i to long. (dump_symbols): Change count to long. (dump_relocs): Change relcount to long. Check for errors from bfd_ret_reloc_upper_bound and bfd_canonicalize_reloc. (display_info_table): Add casts when passing LONGEST_ARCH for printf %* argument.
1994-03-28 * More fixes for object formats which allow multiple sectionsJeff Law1-16/+79
with the same name: * objcopy.c (setup_section): Make a new output section even if one already exists with the given name. (copy_section): Use isection->output_section rather than trying to look the output section up by its (possibly non-unique) name.
1994-03-14 * objcopy.c (mangle_section): Delete unused function.Jeff Law1-19/+8
(setup_section): Set osection here instead of calling mangle section to do it.
1994-02-11 * objcopy.c (strip_main, copy_main): Add missing 'break' in switch.David MacKenzie1-0/+3
1994-02-04 * objcopy.c (filter_bytes): Make MEMHUNK a char *, not PTR, so weDavid MacKenzie1-1/+1
can do arithmetic on it.
1994-02-03 * nlmconv.c (main), objcopy.c (copy_file): Print matching formatsDavid MacKenzie1-12/+17
if ambiguous match. * nm.c (display_file), size.c (display_bfd): Eliminate gotos. Print matching formats if there is an ambiguous match. Use bfd_nonfatal instead of hardcoded error message if nothing matches. * arsup.c, ar.c, objdump.c: Use bfd_get_filename instead of abfd->filename. * nm.c (display_archive): New function, from code in display_file. (display_rel_file): Renamed from do_one_rel_file. * size.c: Indent. (display_archive): New function from code in display_file. (display_file): Check bfd_close error return. * strings.c (strings_object_file): Check bfd_check_format error return. * strings.c, objdump.c, size.c: Use bfd_nonfatal instead of bfd_perror. * bucomm.c: Delete references to exit_handler. It wasn't set anywhere, and now that we're using the libiberty xmalloc, it wouldn't always get called before exiting. (list_matching_formats): Function moved from objdump.c. * bucomm.h: Declare it. * objdump.c (disassemble_data): Move some variable decls closer to their use. Add some comments. Replace a nested block with a return.
1994-01-26 * objcopy.c (filter_bytes): New function.David MacKenzie1-29/+78
(copy_section): Call it. (copy_options, copy_usage, copy_main): Add --byte option to activate it. Appropriate the -b option (which was an undocumented synonym for -F) for it, also. Add --interleave, -i option for additional control. (setup_section, copy_section, mangle_section): Renamed with no `s' on the end. * objcopy.1, binutils.texi: Document the new options. * objdump.c (display_target_tables, display_target_list): New functions broken out of display_info. Eliminate some magic constants. Use more meaningful variable names. (dump_bfd_header): New function broken out of display_bfd. (dump_section_header): New function broken out of dump_headers. (remove_useless_symbols): Don't shadow global variable name with parameter. (objdump_print_address): Fix backward test.
1994-01-14 * objcopy.c (strip_main, copy_main): Don't clobber the input fileIan Lance Taylor1-523/+673
if copy_file fails.
1993-09-23 * objcopy.c (copy_object): Copy all applicable file flags.Ian Lance Taylor1-0/+706
(copy_file): Don't copy EXEC_P specially here. This permits strip to generate an executable file on UnixWare; it still does not actually strip the debugging information.