* objdump.c (show_raw_insn): New global.
(usage): Update.
(long_options): Update.
(disassemble_data): Set disasm_info.flags if --show-raw-insn.
* objdump.c (disassemble_data): Set new arch,mach,endian fields in
disasm_info.
(objdump_print_address): Use it. If we need the right section for
the symbol, and we can't find it, print an offset from the section
rather than using a symbol from some other section.
PR 8251.
symbols after other symbols with the same value. Likewise for
symbols which look like file names.
(objdump_print_address): Always chose the first reasonable symbol
with a given value.
PR 8148.
(stop_address): New variable.
(usage): Mention --start-address and --stop-address.
(OPTION_START_ADDRESS, OPTION_STOP_ADDRESS): Define.
(long_options): Add "start-address" and "stop-address".
(disassemble_data): Handle start_address and stop_address.
(dump_data, dump_reloc_set): Likewise.
(main): Don't set seenflag for -l. Handle OPTION_START_ADDRESS
and OPTION_STOP_ADDRESS.
* objcopy.c (parse_vma): Move to bucomm.c.
* bucomm.c (parse_vma): New function, moved in from objcopy.c.
* bucomm.h (parse_vma): Declare.
* binutils.texi, objdump.1: Document new objdump options.
PR 7983.
* dlltool.c (add_indirect): New.
(asm_prefix): New
(gen_exp_file): Timestamp should be 0. Insert prefix when
needed. New code for indirection.
(gen_lib_file): Timestamp should be 0. Insert prefix
when needed.
(usage): Document --add-indirect.
(main): Cope with new option.
* objdump.c (dump_private_headers): New.
(usage): Document new option.
(long_option): Add private-headers.
(dump_bfd_private_header): New.
(main): Cope with new option.
(objdump_print_address): If aux->require_sec, require that the
symbol be in aux->sec even if HAS_RELOC is not set.
(disassemble_data): Set aux.require_sec around the
objdump_print_address call for the instruction address.
PR 3441.
(usage): Document --disassemble-all.
(long_options): Add disassemble-all as a synonym for -D.
(compare_symbols): Make pointers const.
(compare_relocs): New static function.
(disassemble_data): Rename disassemble to disassemble_fn to avoid
shadowing. If dump_reloc_info, print relocs along with
disassembly. Skip sections which are not SEC_CODE unless
disassemble_all or only is set.
(display_bfd): Don't call dump_relocs if disassemble is set.
(main): Accept and handle -D.
* binutils.texi: Document -D/--disassemble-all.
* objdump.1: Likewise.
PR 5059.
(--dynamic-reloc) arguments to objdump.
* nm.c (dynamic): New static variable.
(long_options): Added "dynamic".
(usage): Mention -D and --dynamic.
(main): Add D to getopt string. Handle -D by setting dynamic.
(display_rel_file): If dynamic is non-zero, read dynamic symbols
rather than normal symbols.
* nm.1: Updated for -D (--dynamic) option.
* objdump.c (dump_dynamic_symtab): New global variable.
(dump_dynamic_reloc_info): New global variable.
(dynsyms, dynsymcount): New global variables.
(usage): Mention -R, -T, --dynamic-syms and --dynamic-reloc.
(long_options): Added "dynamic-reloc" and "dynamic-syms".
(slurp_symtab): If no symbols, return rather than exit.
(slurp_dynamic_symtab): New function.
(display_bfd): Handle dump_dynamic_symtab and
dump_dynamic_reloc_info.
(dump_symbols): Take new dynamic argument, indicating whether to
display dynamic symbols.
(dump_relocs): Move most printing into dump_reloc_set.
(dump_dynamic_relocs): New function.
(dump_reloc_set): New function, extracted from dump_relocs.
(main): Add R and T to getopt string. Handle -T by setting
dump_dynamic_symtab and -R by setting dump_dynamic_reloc_info.
* objdump.1: Updated for -R (--dynamic-reloc) and -T
(--dynamic-syms) options.
* binutils.texi: Updated for new nm and objdump options.
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.
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.
(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.
It would never be called.
(list_matching_formats): Take an arg giving the list of matching
formats.
(display_bfd): Pass the arg, and get it filled in by calling
bfd_check_format_matches instead of bfd_check_format.
(display_info, display_info_table): target_vector was renamed to
bfd_target_vector.
It would never be called.
(list_matching_formats): Take an arg giving the list of matching
formats.
(display_bfd): Pass the arg, and get it filled in by calling
bfd_check_format_matches instead of bfd_check_format.
* binutils.texi (objdump): Note some limitations of -h section
address printing.
* objdump.c (stab_name): Allocate dynamically.
(stab_print): Use pointers to strings instead of char arrays.
(dump_stabs): Change alloc and init of arrays appropriately.
(dump_stabs_1): Always decide whether to print stab_name or
the stab's type number, if unnamed.
(dump_headers): Don't test for SEC_BALIGN if it's not defined by bfd.h.
(The latter is done with #ifdef in case it turns out SEC_BALIGN has to be
put back. I didn't *see* any uses of it besides this one, though.)
* objdump.c (remove_useless_symbols): New function.
* objdump.c (comp): Simplify.
* objdump.c (dis-assemble_data): Make simpler and more
efficient how we filter out useless symbols: Just filter
BEFORE the sort (using remove_useless_symbols).
* objdump.c (objdump_print_address): Simplify.
Change output syntax to match gdb.