Commit Graph

238 Commits

Author SHA1 Message Date
Nick Clifton 3276085244 * objdump.c (objdump_print_addr): If displaying file offsets, show
the offset even if there are no symbols available.
  (dump_section): Display nothing if none of the section is going to
  be dumped.  Display the file offset, if requested, of the location
  from where the dump starts.
  * doc/binutils.texi (objdump): Mention that dumping via the -s
  switch is also affected by the -F option.
2008-02-26 08:44:10 +00:00
Nick Clifton 98ec6e7266 * objdump.c (display_file_offsets): New variable.
(long_options): Add -F/--file-offsets.
  (objdump_print_addr_with_sym): If displaying file offsets, print
  the offset of the given address.
  (disassemble_bytes): If displaying file offsets, tell the user how
  many zeroes are skipped and the file offset of the point where
  dumping resumes.
  (disassemble_section): Only display the name of the section if
  data is going to be dumped from it.
  (main): Handle new option.  Produce error messages if the start or
  stop addresses do not make sense.
  * doc/binutils.texi: Document the new feature.
  * NEWS: Mention the new feature.
2008-02-22 09:42:58 +00:00
Alan Modra ee832e1842 * objdump.c (main): Don't pass unadorned NULL to concat. 2008-02-07 08:39:54 +00:00
H.J. Lu 2dc4cec1f3 binutils/
2008-01-28  H.J. Lu  <hongjiu.lu@intel.com>

	* dwarf.c: Include "elf/common.h".
	(eh_addr_size): Changed to int.
	(dwarf_regnames_i386): New.
	(dwarf_regnames_x86_64): Likewise.
	(dwarf_regnames): Likewise.
	(dwarf_regnames_count): Likewise.
	(init_dwarf_regnames): Likewise.
	(regname): Likewise.
	(frame_display_row): Properly support different address size.
	Call regname to get register name.
	(display_debug_frames): Call regname to get register name.
	Display DW_CFA_def_cfa_register as DW_CFA_def_cfa_register
	instead of DW_CFA_def_cfa_reg.

	* dwarf.h (init_dwarf_regnames): New.

	* objdump.c: Include "elf-bfd.h".
	(dump_dwarf): Call init_dwarf_regnames on ELF input.

	* readelf.c (guess_is_rela): Change argument to int.
	(parse_args): Remove the undocumented upper case options for
	-wX.
	(process_file_header): Call init_dwarf_regnames if
	do_dwarf_register is true.

gas/testsuite/

2008-01-28  H.J. Lu  <hongjiu.lu@intel.com>

	* gas/cfi/cfi-alpha-1.d: Replace DW_CFA_def_cfa_reg with
	DW_CFA_def_cfa_register.
	* gas/cfi/cfi-alpha-3.d: Likewise.
	* gas/cfi/cfi-hppa-1.d: Likewise.
	* gas/cfi/cfi-i386.d: Likewise.
	* gas/cfi/cfi-m68k.d: Likewise.
	* gas/cfi/cfi-mips-1.d: Likewise.
	* gas/cfi/cfi-sh-1.d: Likewise.
	* gas/cfi/cfi-sparc-1.d: Likewise.
	* gas/cfi/cfi-sparc64-1.d: Likewise.
	* gas/cfi/cfi-x86_64.d: Likewise.

	* gas/cfi/cfi-common-1.d: Updated for i386/x86-64 register
	names.
	* gas/cfi/cfi-common-2.d: Likewise.
	* gas/cfi/cfi-common-5.d: Likewise.
	* gas/cfi/cfi-i386.d: Likewise.
	* gas/cfi/cfi-x86_64.d: Likewise.

ld/testsuite/

2008-01-28  H.J. Lu  <hongjiu.lu@intel.com>

	* ld-elf/eh1.d: Replace DW_CFA_def_cfa_reg with
	DW_CFA_def_cfa_register. Updated for i386/x86-64 register
	names.
	* ld-elf/eh2.d: Likewise.
	* ld-elf/eh3.d: Likewise.
	* ld-elf/eh4.d: Likewise.
	* ld-elf/eh5.d: Likewise.
2008-01-28 15:15:32 +00:00
Nick Clifton 41e9264106 * dwarf.c (is_relocatable): Remove definition.
(display_debug_frames): Remove check in is_relocatable.
* dwarf.h (is_relocatable): Remove declaration.
* objdump.c (is_relocatable): New static definition.
* readelf.c (dump_relocations): Make the function void.
  (is_32bit_abs_reloc): Add support for x86, Arc, Arm, D10V, Dlx, OR32 and Score.
  (is_32bit_pcrel_reloc): Add support for x86 and Arm.
  (is_16bit_abs_reloc): Add support for D10V.
  (debug_apply_rela_addends): Rename to debug_apply_relocations.
  Add code to support rel relocations.
  (load_debug_section): Fix call to debug_apply_relocations.
  (get_file_header): Remove setting of is_relocatable.
* gas/cfi/cfi-common-6.d: Allow for possible relocation of the .debug.eh_frame section.
2007-10-31 16:09:53 +00:00
Alan Modra 615f314969 * objdump.c (print_line): Check fwrite return value.
* srconv.c (checksum, wr_tr, wr_cs): Likewise.
	* sysdump.c (fillup): Return zero on getc or fread EOF.  Return count
	read.
2007-10-15 02:00:56 +00:00
Alan Modra 5184c2ae47 * objdump.c (dump_dwarf): Correct setting of is_relocatable. 2007-07-10 13:52:39 +00:00
Nick Clifton 32866df75e Change sources over to using GPLv3 2007-07-05 16:54:46 +00:00
Danny Smith b1364e8f1b * objdump.c: Include sys/stat.h. 2007-06-19 21:08:17 +00:00
Nick Clifton e8f5eee43d * objdump.c: Include sys/mman.h
(print_file_list): Remove f, add map, mapsize, linemap, maxline, last_line, first fields.
  (slurp_file): Add.
  (index_file): Add.
  (print_file_open): Call slurp_file and index_file. Initialize new fields.
  (skip_to_line): Rename to print_line and write only single line.
  (dump_line): Add.
  (show_line): Change to new algorithm.
2007-06-18 16:38:49 +00:00
Paul Brook e39ff52a3b 2007-05-22 Paul Brook <paul@codesourcery.com>
bunutils/
	* objdump.c (find_symbol_for_address): Merge section and target
	specific filtering code.

	ld/testsuite/
	* ld-arm-mixed-lib.d: Update expected output.
	* ld-arm/arm-app.d: Ditto.
	* ld-arm/mixed-app.d: Ditto.
	* ld-arm/arm-lib-plt32.d: Ditto.
	* ld-arm/arm-app-abs32.d: Ditto.
	* ld-arm/mixed-app-v5.d: Ditto.
	* ld-arm/armthumb-lib.d: Ditto.
	* ld-arm/arm-lib.d: Ditto.

	gas/testsuite/
	* gas/arm/backslash-at.d: Update expected output.
2007-05-22 15:05:12 +00:00
Richard Sandiford 7df428b116 binutils/
* objdump.c (disassemble_bytes): Ignore disassembler_needs_relocs
	for executables and shared libraries.

ld/testsuite/
	* ld-arm/emit-relocs1.d, ld-arm/emit-relocs1.s,
	* ld-arm/emit-relocs1-vxworks.d: New tests.
	* ld-arm/arm-elf.exp: Run them.
	* ld-arm/vxworks1.dd: Expect proper branch targets.
2007-05-21 06:36:01 +00:00
Nick Clifton d57376011b * objdump.c (load_debug_section): Select bias for DWARF debug addresses based on the flavour of the bfd. 2007-05-17 08:39:22 +00:00
Alan Modra 3db64b0092 bfd/
Many files: Include sysdep.h before bfd.h.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
binutils/
	* bucumm.h: Split off host dependencies to..
	* sysdep.h: ..here.
	Many files: Include sysdep.h.  Remove duplicate headers and reorder.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
ld/
	Many files: Include sysdep.h first.  Remove duplicate headers.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
opcodes/
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
	* ns32k-dis.c: Include sysdep.h first.
2007-04-26 14:47:00 +00:00
Alan Modra ed180cc5db * budemang.c: Delete.
* budemang.h: Delete.
	* addr2line.c (translate_addresses): Call bfd_demangle rather than
	demangle.
	* nm.c (print_symname): Likewise.
	* objdump.c (objdump_print_symname, dump_symbols): Likewise.
	(dump_bfd): Likewise.
	* prdbg.c (struct pr_handle <demangler>): Add int param.
	(tg_variable, tg_start_function): Adjust demangler calls.
	* Makefile.am: Remove mention of budemang.[ch].  Run "make dep-am".
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
2007-04-19 10:43:47 +00:00
H.J. Lu c428fa83c2 bfd/
2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (bfdver.h): Substitute report_bugs_to.  Also
	create doc/bfdver.texi.
	* Makefile.in: Regenerated.

	* configure.in (--with-bugurl): New option.
	* configure: Regenerated.

	* version.h (REPORT_BUGS_TO): New.

binutils/

2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (REPORT_BUGS_TO): Removed.
	(INCLUDES): Remove -DREPORT_BUGS_TO.
	* Makefile.in: Regenerated.

	* bucomm.c: Don't include bfdver.h.
	* objdump.c: Likewise.
	* version.c: Likewise.

	* bucomm.h: Include bfdver.h.

	* configure.in (--with-bugurl): Removed.
	* configure: Regenerated.

	* doc/Makefile.am (binutils_TEXINFOS): Removed.
	(AM_MAKEINFOFLAGS): Add -I ../../bfd/doc.
	(TEXI2DVI): Likewise.
	(config.texi): Removed.
	(MOSTLYCLEANFILES): Remove config.texi.
	* doc/Makefile.in: Regenerated.

	* doc/binutils.texi: Include bfdver.texi instead of
	config.texi.

gas/

2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (REPORT_BUGS_TO): Removed.
	(INCLUDES): Remove -DREPORT_BUGS_TO.
	* Makefile.in: Regenerated.

	* configure.in (--with-bugurl): Removed.
	* configure: Regenerated.

	* doc/Makefile.am (as_TEXINFOS): Remove gasver.texi.
	(AM_MAKEINFOFLAGS): Add -I ../../bfd/doc.
	(TEXI2DVI): Likewise.
	(gasver.texi): Removed.
	(MOSTLYCLEANFILES): Remove gasver.texi.
	(as.1): Don't depend on gasver.texi.
	* doc/Makefile.in: Regenerated.

	* doc/as.texi: Include bfdver.texi instead of gasver.texi.

gprof/

2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (REPORT_BUGS_TO): Removed.
	(INCLUDES): Remove -DREPORT_BUGS_TO.
	* Makefile.in: Regenerated.

	* configure.in (--with-bugurl): Removed.
	* configure: Regenerated.

ld/

2007-03-15  H.J. Lu  <hongjiu.lu@intel.com>

	* Makefile.am (ld_TEXINFOS): Remove ldver.texi.
	(AM_MAKEINFOFLAGS): Add -I ../../bfd/doc.
	(TEXI2DVI): Likewise.
	(REPORT_BUGS_TO): Removed.
	(INCLUDES): Remove -DREPORT_BUGS_TO.
	(ldver.texi): Likewise.
	(ld.1): Don't depend on ldver.texi.
	(MOSTLYCLEANFILES): Remove ldver.texi.
	* Makefile.in: Regenerated.

	* configure.in (--with-bugurl): Removed.
	* configure: Regenerated.

	* lexsup.c: Include bfdver.h.

	* ld.texinfo: Include bfdver.texi instead of ldver.texi.
2007-03-15 14:17:20 +00:00
Joseph Myers 92f01d6100 top level:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Fix quoting.
	* configure: Regenerate.

bfd:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-pkgversion): New option.
	* configure: Regenerate.
	* Makefile.am (bfdver.h): Substitute for @bfd_version_package@.
	* Makefile.in: Regenerate.
	* version.h (BFD_VERSION_STRING): Define using
	@bfd_version_package@.

bfd/doc:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* Makefile.in: Regenerate.

binutils:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-bugurl): New option.
	* configure: Regenerate.
	* Makefile.am (REPORT_BUGS_TO): Define.
	(INCLUDES): Define REPORT_BUGS_TO.
	Regenerate dependencies.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* bucomm.h: Remove include of bin-bugs.h.
	* addr2line.c (usage): Don't print empty REPORT_BUGS_TO.
	* ar.c (usage): Pass s to list_supported_targets.  Don't print
	empty REPORT_BUGS_TO.
	* coffdump.c (show_usage): Don't print empty REPORT_BUGS_TO.
	* cxxfilt.c (usage): Print bug url when giving help.
	* dlltool.c (usage): Likewise.
	* dllwrap.c (usage): Likewise.
	* nlmconv.c (show_usage): Don't print empty REPORT_BUGS_TO.
	* nm.c (usage): Likewise.
	* objcopy.c (copy_usage, strip_usage): Likewise.
	* objdump.c (usage): Likewise.
	* readelf.c ((usage): Likewise. Add STREAM argument.  Adjust
	callers.
	* size.c (usage): Don't print empty REPORT_BUGS_TO.
	* srconv.c (show_usage): Likewise.
	* strings.c (usage): Likewise.
	* sysdymp.c (show_usage): Likewise.
	* windres.c (usage): Likewise.

gas:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-bugurl): New option.
	* configure: Regenerate.
	* dep-in.sed: Remove bin-bugs.h.
	* Makefile.am (REPORT_BUGS_TO): Define.
	(INCLUDES): Define REPORT_BUGS_TO.
	(DEP_INCLUDES): Likewise.
	($(OBJS)): No longer depend on bin-bugs.h.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* as.c (show_usage): Don't print empty REPORT_BUGS_TO.
	* as.h: Remove include of bin-bugs.h.

gprof:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-pkgversion, --with-bugurl): New options.
	* configure: Regenerate.
	* Makefile.am (PKGVERSION, REPORT_BUGS_TO): Define.
	(INCLUDES): Define PKGVERSION and REPORT_BUGS_TO.
	Regenerate dependencies.
	* Makefile.in: Regenerate.
	* gprof.c (usage): Don't print empty REPORT_BUGS_TO.
	(main): Include PKGVERSION in version output.
	* gprof.h: Remove include of bin-bugs.h.

include:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* bin-bugs.h: Remove.

ld:
2007-02-17  Mark Mitchell  <mark@codesourcery.com>
            Nathan Sidwell  <nathan@codesourcery.com>
            Vladimir Prus  <vladimir@codesourcery.com
            Joseph Myers  <joseph@codesourcery.com>

	* configure.in (--with-bugurl): New option.
	* configure: Regenerate.
	* Makefile.am (REPORT_BUGS_TO): Define.
	(INCLUDES): Define REPORT_BUGS_TO.
	Regenerate dependencies.
	* Makefile.in: Regenerate.
	* ld.h: Remove include of bin-bugs.h.
	* lexsup.c (help): Don't print empty REPORT_BUGS_TO.
2007-02-17 13:33:57 +00:00
Paul Brook 2087ad8497 2006-10-30 Paul Brook <paul@codesourcery.com>
binutils/
	* objdump.c (disassemble_section): Set info->symtab_pos.
	(disassemble_data): Set info->symtab and info->symtab_size.

	include/
	* dis-asm.h (disassemble_info): Add symtab, symtab_pos and
	symtab_size.

	opcodes/
	* arm-dis.c (last_is_thumb, last_mapping_sym, last_mapping_addr): New.
	(get_sym_code_type): New function.
	(print_insn): Search for mapping symbols.
2006-10-31 20:21:57 +00:00
Nick Clifton 0112cd268b * bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as its
argument and emits the string followed by a comma and then the length of
  the string.
  (CONST_STRNEQ): New macro.  Checks to see if a variable string has a constant
  string as its initial characters.
  (CONST_STRNCPY): New macro.  Copies a constant string to the start of a
  variable string.
* bfd-in2.h: Regenerate.
* <remainign files>: Make use of the new macros.
2006-09-16 18:12:17 +00:00
Nick Clifton d68c385bfc PR binutils/3001
* addr2line.c (process_file): Change function from void to returning an int.  Return 0 upon success, 1 otherwise.
 (main): Use return value from process_file as the exit value.
* ar.c (ranlib_only):  Change function from void to returning an int.  Return 0 upon success, 1 otherwise.
  (ranlib_touch): Likewise.
  (main): Use return value from ranlib functions as exit value.
* objcopy.c (add_specific_symbol): Set status to 1 if get_file_size fails.
  (copy_file): Likewise.
  (strip_main): Likewise.
  (copy_main): Likewise.
* objdump.c (display_file): Set exit_status to 1 if get_file_size fails.
* size.c (display_file): Set return_code to 1 if get_file_size fails.
2006-08-06 15:49:46 +00:00
Nick Clifton 2ae86dfcdb Fix typo 2006-04-12 13:05:36 +00:00
Eric Botcazou db50c8404c * configure.in (CHECK_DECLS): Add snprintf and vsnprintf.
* configure: Regenerate.
	* objdump.c (fprintf): Remove declaration.
	* bucomm.h (fprintf): Declare if not already declared.
	(snprintf): Likewise.
	(vsnprintf): Likewise.
2006-02-09 11:49:53 +00:00
Andreas Schwab d99b646536 PR binutils/1486
binutils/:
	* configure.in: Don't define DISASSEMBLER_NEEDS_RELOCS.
	* configure: Regenerate.
	* objdump.c (struct objdump_disasm_info): Don't check for
	DISASSEMBLER_NEEDS_RELOCS.
	(objdump_print_addr): Likewise.
	(disassemble_bytes): Check disassembler_needs_relocs from
	disassemble_info at run-time instead of DISASSEMBLER_NEEDS_RELOCS
	at compile-time.
	(disassemble_section): Likewise.
	(disassemble_data): Initialize it.

include/:
	* dis-asm.h (struct disassemble_info): Add
	disassembler_needs_relocs.

objdump/:
	* disassemble.c (disassemble_init_for_target): Set
	disassembler_needs_relocs for bfd_arch_arm.
2006-01-17 17:39:20 +00:00
Mark Mitchell 07012eeef2 * addr2line.c (usage): Document @file.
* ar.c (usage): Likewise.
	* coffdump (usage): Likewise.
	* cxxfilt.c (usage): Likewise.
	* dlltool.c (usage): Likewise.
	* dllwrap.c (usage): Likewise.
	* nlmconv.c (usage): Likewise.
	* nm.c (usage): Likewise.
	* objcopy.c (usage): Likewise.
	* objdump.c (usage): Likewise.
	* readelf.c (usage): Likewise.
	* size.c (usage): Likeise.
	* srconv.c (usage): Likewise.
	* strings.c (usage): Likewise.
	* windres.c (usage): Likewise.
	* doc/binutils.texi: Add section on common options.
2005-10-03 19:37:44 +00:00
Mark Mitchell 869b9d07bb * addr2line.c (main): Likewise.
* ar.c (main): Likewise.
	* coffdump.c (main): Likewise.
	* cxxfilt.c (main): Likewise.
	* dlltool.c (main): Likewise.
	* dllwrap.c (main): Likewise.
	* nlmconv.c (main): Likewise.
	* nm.c (main): Likewise.
	* objcopy.c (main): Likewise.
	* objdump.c (main): Likewise.
	* readelf.c (main): Likewise.
	* size.c (main): Likeiwse.
	* srcconv.c (main): Likewise.
	* strings.c (main): Likewise.
	* sysdump.c (main): Likewise.
	* sysinfo.c (main): Likewise.
	* windres.c (main): Likewise.

	* ldmain.c (main): Use expandargv.

	* gprof.c (main): Use expandargv.

	* as.c (main): Use expandargv.
2005-09-30 16:37:32 +00:00
H.J. Lu bfe2612a14 2005-09-30 H.J. Lu <hongjiu.lu@intel.com>
* dwarf.c (fetch_indirect_string): Adjust for section address.
	(process_debug_info): Likewise.
	(display_debug_loc): Likewise.
	(display_debug_ranges): Likewise.

	* objdump.c (mach_o_dwarf_sections): New.
	(generic_dwarf_sections): Likewise.
	(check_mach_o_dwarf): Likewise.
	(dump_dwarf): Call check_mach_o_dwarf.
2005-09-30 14:57:52 +00:00
H.J. Lu 365544c3f0 2005-09-30 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.am (objdump_SOURCES): Add dwarf.c.
	* Makefile.in: Regenerated.

	* objdump.c: Include "dwarf.h".
	(usage): Add -W/--dwarf.
	(long_options): Likewise.
	(dump_dwarf_section_info): New.
	(load_debug_section): Likewise.
	(free_debug_section): Likewise.
	(dump_dwarf_section): Likewise.
	(dump_dwarf): Likewise.
	(dump_bfd): Load symbol table and call dump_dwarf if
	dump_dwarf_section_info isn't zero.
	(main): Handle -W/--dwarf.
2005-09-30 14:56:34 +00:00
H.J. Lu bc79cded48 bfd/
2005-08-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/1179
	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Use section lma
	instead of vma.
	(_bfd_dwarf2_find_line): Likewise.

binutils/

2005-08-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR binutils/1179
	* objdump.c (disassemble_bytes): Don't adjust
	adjust_section_vma.
	(adjust_addresses): Don't adjust vma for debugging section.
	Adjust lma only for relocatable files.
	(dump_bfd): Tell adjust_addresses if it is a relocatable file.
2005-08-17 14:28:01 +00:00
Jim Wilson 0fd3a4776c Kaveh Ghazi's printf format attribute checking patch.
bfd:
	* elf32-xtensa.c (vsprint_msg): Add format attribute.  Fix
	format bugs.
	* vms.h (_bfd_vms_debug): Add format attribute.
	(_bfd_vms_debug, _bfd_hexdump): Fix typos.

binutils:
	* bucomm.h (report): Add format attribute.
	* dlltool.c (inform): Likewise.
	* dllwrap.c (display, inform, warn): Likewise.
	* objdump.c (objdump_sprintf): Likewise.
	* readelf.c (error, warn): Likewise.  Fix format bugs.

gas:
	* config/tc-tic30.c (debug): Add format attribute.  Fix format
	bugs.

include:
	* dis-asm.h (fprintf_ftype): Add format attribute.

opcodes:
	* arc-dis.c, arm-dis.c, cris-dis.c, crx-dis.c, d10v-dis.c,
	d30v-dis.c, fr30-dis.c, h8300-dis.c, h8500-dis.c, i860-dis.c,
	ia64-dis.c, ip2k-dis.c, m10200-dis.c, m10300-dis.c,
	m88k-dis.c, mcore-dis.c, mips-dis.c, ms1-dis.c, or32-dis.c,
	ppc-dis.c, sh64-dis.c, sparc-dis.c, tic4x-dis.c, tic80-dis.c,
	v850-dis.c: Fix format bugs.
	* ia64-gen.c (fail, warn): Add format attribute.
	* or32-opc.c (debug): Likewise.
2005-07-07 19:27:52 +00:00
Steve Ellcey 398ee8f162 * configure.in (AM_BINUTILS_WARNINGS): Add.
(BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
	* configure: Regenerate.
	* config.in: Regenerate.
	* objdump.c (NEED_DECLARATION_*): Replace with !HAVE_DECL_*.
	* bucomm.h: (NEED_DECLARATION_*): Ditto.
2005-07-01 15:19:47 +00:00
Jakub Jelinek f9ecb0a440 * objdump.c (disassemble_bytes): Don't crash if q->howto == NULL.
If q->howto->name == NULL, print q->howto->type as number instead.
	(dump_reloc_set): Likewise.
2005-06-09 14:51:41 +00:00
Nick Clifton b43b5d5f76 Update FSF address 2005-05-08 14:17:41 +00:00
H.J. Lu 3bee8bcdbf 2005-04-19 H.J. Lu <hongjiu.lu@intel.com>
* objdump.c (dump_section_header): Skip linker created section.
2005-04-19 21:29:46 +00:00
H.J. Lu 64c1196b58 2005-04-17 H.J. Lu <hongjiu.lu@intel.com>
* objdump.c (dump_section_header): Support SEC_GROUP.
2005-04-17 14:33:06 +00:00
Nick Clifton 661f7c357e Add a check to see if the section for the symbol is chosen using
process_section_p.
2005-04-04 10:32:28 +00:00
Aaron W. LaFramboise 5810296be6 * objdump.c (disassemble_bytes): Remove cast. 2005-03-28 12:28:17 +00:00
Paul Brook 58450b3bbc 2005-03-18 Paul Brook <paul@codesourcery.com>
* objdump.c (objdump_print_addr): Avoid uninitialized warning.
2005-03-18 16:28:13 +00:00
Nick Clifton ce04548af9 objdump.c: Fix coding for DISASSEMBLER_NEEDS_RELOC:
(struct objdump_disasm_info): Add 'reloc' field.
(disassemble_bytes): Fix check for when an insn has a reloc associated with it.
Improve comment explaining why the use of octets is wrong.  Set the 'reloc'
field in objdump_disasm_info structure.
(objdump_print_addr): Use new 'reloc' field to lookup the correct address for
the symbol associated with the current instruction's relocation.
(disassemble_info): Initialise 'reloc' field.

gas/arm/inst.d: Allow for ARM ports which decode the reloc associated with
branches and so show the exact symbolic destination address rather than an
offset from the start of the section.

gas/arm/pic.d: Likewise.
2005-03-01 15:18:44 +00:00
Alan Modra 9210d87943 * dlltool.c: Warning fixes.
* objdump.c: Likewise.
2005-02-23 12:25:57 +00:00
H.J. Lu ebe372c1dd bfd/
2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

	* coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with
	SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK.
	Replace SEC_SHARED with SEC_COFF_SHARED.
	(styp_to_sec_flags): Likewise.

	* elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0.
	(TARGET_LITTLE_SYM): Likewise.

	* section.c (SEC_ARCH_BIT_0): Removed.
	(SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with
	SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE.
	(SEC_SHARED): Renamed to ...
	(SEC_COFF_SHARED): This.
	(SEC_BLOCK): Renamed to ...
	(SEC_TIC54X_BLOCK): This.
	(SEC_CLINK): Renamed to ...
	(SEC_TIC54X_CLINK): This.
	(SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY,
	SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the
	end.
	* bfd-in2.h: Regenerated.

binutils/

2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

	* objcopy.c (parse_flags): Replace SEC_SHARED with
	SEC_COFF_SHARED.

	* objdump.c (dump_section_header): Dump SEC_TIC54X_BLOCK and
	SEC_TIC54X_CLINK for TI c54x only. Remove SEC_ARCH_BIT_0. Dump
	SEC_COFF_SHARED for COFF only.

gas/

2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

	* config/obj-coff.c (obj_coff_section): Replace SEC_SHARED with
	SEC_COFF_SHARED.

	* config/tc-tic54x.c (tic54x_bss): Replace SEC_BLOCK with
	SEC_TIC54X_BLOCK.
	(demand_empty_rest_of_line): Likewise.
	(tic54x_sblock): Likewise.
	(tic54x_clink): Replace with SEC_CLINK with SEC_TIC54X_CLINK.

ld/

2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

	* ldlang.c (lang_add_section): Check SEC_TIC54X_BLOCK for TI
	tic54x input only.
	(lang_size_sections_1): Check SEC_COFF_SHARED_LIBRARY for COFF
	and ECOFF output only.
2005-02-22 00:50:07 +00:00
Andreas Schwab 0bcb06d2f2 binutils/:
* configure.in: Don't define SKIP_ZEROES.
	* configure: Regenerate.
	* objdump.c (disassemble_data): Set skip_zeroes and
	skip_zeroes_at_end in disasm_info to defaults.
	(DEFAULT_SKIP_ZEROES): Rename from SKIP_ZEROES and always define.
	(DEFAULT_SKIP_ZEROES_AT_END): Rename from SKIP_ZEROES_AT_END and
	always define.
	(disassemble_bytes): Use skip_zeroes and skip_zeroes_at_end from
	objdump_disasm_info.

include/:
	* dis-asm.h (struct disassemble_info): Add skip_zeroes and
	skip_zeroes_at_end.

opcodes/:
	* disassemble.c (disassemble_init_for_target) <case
	bfd_arch_ia64>: Set skip_zeroes to 16.
	<case bfd_arch_tic4x>: Set skip_zeroes to 32.
2005-01-10 09:54:50 +00:00
Alan Modra 180e47e2d7 * objdump.c (remove_useless_symbols): Discard section symbols. 2004-12-30 22:33:20 +00:00
Alan Modra 83ef079838 * objdump.c (dump_symbols): Fix thinko last change. Improve error
messages.
2004-10-11 08:18:43 +00:00
Nick Clifton 3c9458e953 Implement a new BFD API function: bfd_is_target_special_symbol. Use this in nm
and objdump to skip the displaying of ARM Mapping symbols unless specifically
requested.
2004-10-08 14:54:04 +00:00
Alan Modra c9727e01b5 bfd/
* bfd.c (bfd_get_synthetic_symtab): Pass counts and both symbol tables.
	* elf-bfd.h (_bfd_elf_get_synthetic_symtab): Adjust.
	* elf.c (_bfd_elf_get_synthetic_symtab): Adjust.
	* libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Adjust.
	* targets.c (struct bfd_target <_bfd_get_synthetic_symtab>): Adjust.
	* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't read symbols.
	Use both symbol tables on non-relocatable objects.  Use a common
	error exit.  Fix "mid" warning.
	* libbfd.h: Regenerate.
	* bfd-in2.h: Regenerate.
binutils/
	* objdump.c (dump_bfd): Pass both symbol tables to
	bfd_get_synthetic_symtab.
2004-08-28 03:05:18 +00:00
Jakub Jelinek 90e3cdf2a9 bfd/
* elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define
	if not yet defined.
	* elf64-ppc.c (bfd_elf64_get_synthetic_symtab): Define.
	(synthetic_opd, synthetic_relocatable): New variables.
	(compare_symbols, compare_relocs): New helper routines.
	(ppc64_elf_get_synthetic_symtab): New function.
	* bfd.c (bfd_get_synthetic_symtab): Rename dynsyms argument
	to relsyms.
	* bfd-in2.h: Regenerated.
	* elf.c (_bfd_elf_get_synthetic_symtab): Rename dynsyms argument
	to relsyms.  Return 0 if abfd is relocatable.
binutils/
	* objdump.c (dump_bfd): For relocatable objects, pass syms instead
	of dynsyms to bfd_get_synthetic_symtab.
2004-08-17 09:07:35 +00:00
Nick Clifton ed049af3bc Fix for PR 280 - remove duplicated raw insn output fron h8300/h8500 disassemblers 2004-07-22 16:52:43 +00:00
H.J. Lu 082b729701 bfd/
2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* aout-adobe.c (aout_32_section_already_linked): Defined.
	* aout-target.h (MY_section_already_linked): Likewise.
	* aout-tic30.c (MY_section_already_linked): Likewise.
	* binary.c (binary_section_already_linked): Likewise.
	* bout.c (b_out_section_already_linked): Likewise.
	* coff-alpha.c (_bfd_ecoff_section_already_linked): Likewise.
	* coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
	* coffcode.h (coff_section_already_linked): Likewise.
	* i386msdos.c (msdos_section_already_linked): Likewise.
	* i386os9k.c (os9k_section_already_linked): Likewise.
	* ieee.c (ieee_section_already_linked): Likewise.
	* ihex.c (ihex_section_already_linked): Likewise.
	* mach-o.c (bfd_mach_o_section_already_linked): Likewise.
	* mmo.c (mmo_section_already_linked): Likewise.
	* nlm-target.h (nlm_section_already_linked): Likewise.
	* oasys.c (oasys_section_already_linked): Likewise.
	* pef.c (bfd_pef_section_already_linked): Likewise.
	* ppcboot.c (ppcboot_section_already_linked): Likewise.
	* som.c (som_bfd_discard_group): Likewise.
	* srec.c (srec_section_already_linked): Likewise.
	* tekhex.c (tekhex_section_already_linked): Likewise.
	* versados.c (versados_section_already_linked): Likewise.
	* vms.c (vms_section_already_linked): Likewise.
	* coff-target.h (_bfd_xcoff_section_already_linked): Likewise.
	* xsym.c (bfd_sym_section_already_linked): Likewise.

	* bfd-in.h (bfd_section_already_linked_table_init): New.
	(bfd_section_already_linked_table_free): Likewise.

	* coff-rs6000.c (rs6000coff_vec): Add
	_bfd_generic_section_already_linked.
	(pmac_xcoff_vec): Likewise.
	* coff64-rs6000.c (rs6000coff64_vec): Likewise.
	(aix5coff64_vec): Likewise.

	* elf-bfd.h (_bfd_elf_section_already_linked): New prototype.
	* elflink.c (_bfd_elf_section_already_linked): New function.

	* elfxx-target.h (bfd_elfNN_section_already_linked): Defined.

	* libbfd-in.h (_bfd_nolink_section_already_linked): Defined.
	(_bfd_generic_section_already_linked): New.
	(bfd_section_already_linked_hash_entry): Likewise.
	(bfd_section_already_linked): Likewise.
	(bfd_section_already_linked_table_lookup): Likewise.
	(bfd_section_already_linked_table_insert): Likewise.

	* linker.c (bfd_section_already_linked): New.
	(_bfd_section_already_linked_table): Likewise.
	(bfd_section_already_linked_table_lookup): Likewise.
	(bfd_section_already_linked_table_insert): Likewise.
	(already_linked_newfunc): Likewise.
	(bfd_section_already_linked_table_init): Likewise.
	(bfd_section_already_linked_table_free): Likewise.
	(_bfd_generic_section_already_linked): Likewise.

	* section.c (bfd_section): Remove comdat.
	(bfd_comdat_info): Moved to ...
	* bfd-in.h (coff_comdat_info): Here.
	(bfd_coff_get_comdat_section): New.
	* coffgen.c (bfd_coff_get_comdat_section): Likewise.
	* libcoff-in.h (coff_section_tdata): Add comdat.
	* coffcode.h (handle_COMDAT): Updated.
	* cofflink.c (coff_link_add_symbols): Likewise.
	* ecoff.c (bfd_debug_section): Likewise.

	* targets.c (bfd_target): Add _section_already_linked.
	(BFD_JUMP_TABLE_LINK): Updated.

	* bfd-in2.h: Regenerated.
	* libbfd.h: Likewise.
	* libcoff.h: Likewise.

binutils/

2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* objcopy.c (filter_symbols): Use bfd_coff_get_comdat_section
	to access comdat.
	* objdump.c (dump_section_header): Likewise.

ld/

2004-07-21  H.J. Lu  <hongjiu.lu@intel.com>

	* ldlang.c (already_linked_hash_entry): Removed.
	(already_linked): Likewise.
	(already_linked_table): Likewise.
	(section_already_linked): Call bfd_section_already_linked.
	(lang_process): Replace already_linked_table_init with
	bfd_section_already_linked_table_init and check return. Replace
	already_linked_table_free with bfd_section_already_linked_table_free.
2004-07-21 15:42:58 +00:00
Alan Modra 135dfb4a65 * objcopy.c (copy_section): Use bfd_get_section_size instead of
_raw_size or bfd_get_section_size_before_reloc.  Don't set reloc_done.
	(compare_section_lma): Likewise.
	* addr2line.c (find_address_in_section): Likewise.
	* coffgrok.c (do_sections_p1): Likewise.
	* dlltool.c (scan_drectve_symbols): Likewise.
	* nlmconv.c (main): Likewise.
	(copy_sections): Likewise.
	(powerpc_mangle_relocs): Likewise.
	* objdump.c (disassemble_section): Likewise.
	* prdbg.c (find_address_in_section): Likewise.
	* size.c (berkeley_sum): Likewise.
	* srconv.c (wr_ob): Likewise.
	* strings.c (strings_a_section): Likewise.
2004-06-15 01:19:13 +00:00
Alan Modra 46212538d6 * objdump.c (disassemble_section): Don't disassemble sections
without SEC_HAS_CONTENTS.
2004-04-24 12:39:47 +00:00
Jakub Jelinek 4c45e5c9ce bfd/
* bfd.c (bfd_get_synthetic_symtab): Define.
	* targets.c (BFD_JUMP_TABLE_DYNAMIC): Add
	NAME##_get_synthetic_symtab.
	(struct bfd_target): Add _bfd_get_synthetic_symtab.
	* libbfd-in.h (_bfd_nodynamic_get_synthetic_symtab): Define.
	* elf-bfd.h (struct elf_backend_data): Add plt_sym_val and
	relplt_name fields.
	(_bfd_elf_get_synthetic_symtab): New prototype.
	* elfcode.h (elf_get_synthetic_symtab): Define.
	* elf.c (_bfd_elf_get_synthetic_symtab): New function.
	* elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Define.
	(elf_backend_plt_sym_val, elf_backend_relplt_name): Define.
	(elfNN_bed): Add elf_backend_plt_sym_val and elf_backend_relplt_name.
	* bfd-in2.h: Rebuilt.
	* libbfd.h: Rebuilt.
	* elf32-i386.c (elf_i386_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* elf64-x86-64.c (elf64_x86_64_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* elf32-s390.c (elf_s390_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* elf64-s390.c (elf_s390_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* elf32-sparc (elf32_sparc_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* elf64-sparc.c (sparc64_elf_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* elf32-ppc.c (ppc_elf_plt_sym_val): New function.
	(elf_backend_plt_sym_val): Define.
	* aout-target.h (MY_get_synthetic_symtab): Define.
	* aout-tic30.c (MY_get_synthetic_symtab): Define.
	* coff-rs6000.c (rs6000coff_vec): Add
	_bfd_nodynamic_get_synthetic_symtab.
	(pmac_xcoff_vec): Likewise.
	* coff64-rs6000.c (rs6000coff64_vec): Add
	_bfd_nodynamic_get_synthetic_symtab.
	(aix5coff64_vec): Likewise.
	* sunos.c (MY_get_synthetic_symtab): Define.
	* vms.c (vms_get_synthetic_symtab): Define.
binutils/
	* objdump.c (synthsyms, synthcount): New variables.
	(disassemble_data): Use dynsyms for stripped binaries or libraries.
	Add synthetized symbols.
	(dump_bfd): For disassemble, initialize dynsyms always and
	also synthsyms.  Free synthsyms and clear {sym,dynsym,synth}count
	before returning.
2004-04-22 14:45:32 +00:00
Nathan Sidwell 6f10430691 * objdump.c (struct SFILE): Replace current pointer with pos
offset, rename size to alloc.
	(objdump_sprintf): Avoid unnecessary copies in the common case
	(disassemble_bytes): Keep sfile live throughout the
	function. Adjust usage appropriately.
2004-03-15 12:31:41 +00:00
Jakub Jelinek 68b3b8dc9e * objdump.c (disassemble_bytes): Subtract rel_offset from printed
reloc address.
	(disassemble_section): Set rel_offset to section->vma instead of
	pinfo->buffer_vma.
2003-12-22 10:49:59 +00:00
Kazu Hirata aaad4cf36a * ChangeLog-9197: Fix comment typos.
* coffgrok.c: Likewise.
	* filemode.c: Likewise.
	* objcopy.c: Likewise.
	* objdump.c: Likewise.
	* prdbg.c: Likewise.
	* stabs.c: Likewise.
	* unwind-ia64.c: Likewise.
2003-12-06 00:06:12 +00:00
Alan Modra 3b9ad1cc1f * objdump.c: Wrap long lines, init vars separately from decl.
(disassemble_section): Reset require_sec after call to
	find_symbol_for_address.
2003-11-19 08:21:14 +00:00
Nick Clifton 22a398e190 Add new field to disassemble_info structure: symbol_is_valid() and use it to
skip displaying arm elf mapping symbols in disassembly output.
2003-11-14 15:12:44 +00:00
Alan Modra 0f6cb37fa4 * objdump.c: Revert rev 1.81 commit. 2003-11-11 01:57:04 +00:00
Nick Clifton b2699c8b72 Remove "member" from verbose output of "-dv" in order to conform to POSIX
specification.
2003-11-10 17:28:33 +00:00
Nick Clifton f24ddbddc5 Use consistent error messages for missing files.
Detect directories where an ordinary file is expected.
2003-11-07 12:19:34 +00:00
Kazu Hirata 50c2245bd8 * ChangeLog: Fix typos.
* ChangeLog-9197: Likewise.
	* ChangeLog-9899: Likewise.
	* NEWS: Likewise.
	* ar.c: Fix comment typos.
	* arsup.c: Likewise.
	* coffgrok.c: Likewise.
	* debug.c: Likewise.
	* debug.h: Likewise.
	* dlltool.c: Likewise.
	* ieee.c: Likewise.
	* nm.c: Likewise.
	* objdump.c: Likewise.
	* prdbg.c: Likewise.
	* readelf.c: Likewise.
	* resrc.c: Likewise.
	* sysinfo.y: Likewise.
	* windres.c: Likewise.
2003-10-27 13:20:32 +00:00
Nathan Sidwell 29ca8dc5bb bfd/Changelog:
* libbfd-in.h (_bfd_link_section_stabs): Add string offset
	parameter.
	* cofflink.c (coff_link_add_symbols): Deal with split stab
	sections.
	* elflink.h (elf_link_add_object_symbols): Deal with split stab
	sections.
	* stabs.c (_bfd_link_section_stabs): Add string offset parameter.
	* libbfd.h: Regenerated.
ld/ChangeLog:
	* ldwrite.c (unsplittable_name): New.
	(clone_section): Strip existing numeric suffix. Only truncate names
	for coff targets.
	(split_sections): Use unsplittable_name.
binutils/ChangeLog:
	* objdump.c (read_section_stabs): Just read one section, return
	pointer to it. Add size parameter.
	(print_section_stabs): Add string offset parameter. Adjust.
	(struct stab_section_names): Add string offset member.
	(find_stabs_sections): Correct check for split section suffix,
	adjust read_section_stabs and print_section_stabs calls.
	(dump_stabs_section): Clear string_offset, free string table.
2003-10-07 08:53:42 +00:00
Andrew Cagney 92c2346c02 Index: opcodes/ChangeLog
2003-09-03  Andrew Cagney  <cagney@redhat.com>

	* dis-init.c (init_disassemble_info): New file and function.
	* Makefile.am (CFILES): Add "dis-init.c".
	(libopcodes_la_SOURCES): Add "dis-init.c".
	(dis-init.lo): Specify dependencies.
	* Makefile.in: Regenerate.

Index: include/ChangeLog
2003-08-27  Andrew Cagney  <cagney@redhat.com>

	* dis-asm.h (init_disassemble_info): Declare.
	(INIT_DISASSEMBLE_INFO): Redefine as a call to
	init_disassemble_info.
	(INIT_DISASSEMBLE_INFO_NO_ARCH): Ditto.

Index: binutils/ChangeLog
2003-09-03  Andrew Cagney  <cagney@redhat.com>

	* objdump.c: Refer to init_disassemble_info in comments.
	(disassemble_data): Replace INIT_DISASSEMBLE_INFO with
	init_disassemble_info.
2003-09-03 23:43:18 +00:00
Nick Clifton 155e0d2321 Use bfd_map_over_sections to walk section chain.
Do not dump the contents of an empty section.
2003-09-03 08:26:52 +00:00
Alan Modra d3ba05513b * objcopy.c: Remove unnecessary prototypes and casts.
* objdump.c: Remove unnecessary casts.
	* readelf.c: Convert to C90.  Remove unnecessary prototypes and casts.
	(get_osabi_name): Move so we don't need a forward declaration.
2003-08-05 14:40:54 +00:00
Alan Modra 43ac988152 * objdump.c (include_paths, include_path_count): New vars.
(usage): Describe --include.
	(long_options): Add "include".
	(add_include_path): New function.
	(struct print_file_list): Make filename const.  Add modname.
	(try_print_file_open, update_source_path): New functions.
	(show_line): Use them.
	(main): Handle 'I' option.  Don't check for NULL xrealloc arg.
2003-08-04 14:29:34 +00:00
Alan Modra fd7bb956ee * objdump.c: Remove unnecessary prototypes.
(disassemble_bytes): Add rel_offset parameter.  Simplify reloc skipping
	code, and print relocs when dump_dynamic_reloc_info.
	(disassemble_data): Read and handle dynamic relocs.  Correct reloc
	skip code.  Formatting.
	(dump_bfd): Don't dump dynamic relocs when disassembling.
2003-07-30 03:54:15 +00:00
Nick Clifton 46dca2e0ea Update to Iso C. 2003-07-29 15:40:37 +00:00
Nick Clifton f1e2bc6264 Do not ignore sections without the LOAD flag when disassemble_all is true.
Only print a message about disassembling a section if it contains some data.
2003-07-24 14:06:07 +00:00
Nick Clifton 51cdc6e056 * objdump.c: New command line option --debugging-tags.
* doc/binutils.texi: Document new command line option.
* prdbg.c: Code to print the debug info as tags compatible with ctags.
* budbg.h: Adjust prototype.
* NEWS: Mention new switch
2003-07-22 13:33:32 +00:00
Nick Clifton 31e0f3cd45 * objdump.c (main) :Accept multiple -M switch.
* doc/binutils.texi: Document that multiple -M switches are accepted and that
  a single -M switch can contain comma separated options.
* arm-dis.c (parse_arm_disassembler_option): Do not expect option string to be
  NUL terminated.
  (parse_disassembler_options): Allow options to be space or comma separated.
2003-07-18 11:34:41 +00:00
Nick Clifton 073fbac62c * objdump.c (main): Issue a warning message if multiple -M
switches are used.

	* doc/binutils.texi (objdump): Update documentation about -M
	option.
2003-07-17 17:02:46 +00:00
Alan Modra 1049f94e8e Correct spelling of "relocatable". 2003-06-25 06:40:27 +00:00
H.J. Lu 6e50c90cfe 2003-04-30 H.J. Lu <hjl@gnu.org>
* objdump.c (only): Change it to char **.
	(only_size): New.
	(only_used): New.
	(disassemble_data): Check only as an array.
	(dump_data): Likewise.
	(dump_relocs): Likewise.
	(main): Treat only as an array.
2003-05-01 00:40:41 +00:00
Alexandre Oliva 335a186916 * objdump.c (dump_data): Don't truncate the address to long; make
the width large enough, and uniform for all entries in a section.
2003-04-01 00:32:47 +00:00
Nick Clifton 06d86cf78e Move display_info() function into bucomm.c 2003-03-24 11:28:35 +00:00
Nick Clifton 98a91d6ae2 (disassemble_data): Use disasm_info.fprintf_func not printf for emitting new
lines.
2003-03-17 11:16:51 +00:00
Nick Clifton f0c8c24a69 Fix help messages about demangling styles 2003-02-13 09:53:07 +00:00
Alan Modra b34976b65a s/boolean/bfd_boolean/ s/true/TRUE/ s/false/FALSE/. Simplify
comparisons of bfd_boolean vars with TRUE/FALSE.  Formatting.
2002-11-30 08:39:46 +00:00
Alan Modra 8ab56b6f54 * objdump.c (dump_data): Correct addr_offset for opb != 1. 2002-10-21 02:18:58 +00:00
Alan Modra 6e1a7e9a11 * Makefile.am: Run "make dep-am".
* objdump.c: #include "bfdver.h".
	* version.c: Likewise.
	* Makefile.in: Regenerate.
	* config.in: Regenerate.
	* configure: Regenerate.
	* po/POTFILES.in: Regenerate.
2002-10-14 12:07:58 +00:00
Alan Modra fe0507eba5 * objdump.c (dump_bfd): Restore lines accidentally deleted in
last commit.
2002-08-28 12:32:06 +00:00
Nick Clifton 026df7c5e6 Add TMS320C4x support 2002-08-28 10:38:51 +00:00
Alan Modra a1df01d1e4 * nm.c (display_rel_file): Don't report "no symbols" as an error.
* objdump.c (slurp_symtab): Likewise.
	(slurp_dynamic_symtab): Likewise.
	(dump_symbols): Likewise.  Do print "no symbols" to stdout.
2002-08-26 10:14:15 +00:00
Nick Clifton b5e2a4f34a Replace 'gnu-new-abi' with 'gnu-v3' 2002-08-14 15:12:07 +00:00
Alan Modra a6637ec0ed * budemang.c: New file, "demangle" function.
* budemang.h: New file.
	* addr2line.c (translate_addresses): Use "demangle".
	* nm.c (print_symname): Likewise.
	* objdump.c (objdump_print_symname): Likewise.
	(dump_symbols): Likewise.  Also, don't use bfd_asymbol_name macro
	here since that obfuscates.
	* rdcoff.c: Don't #include demangle.h.
	* Makefile.am (CFILES): Add budemang.c, emul_aix.c,
	emul_vanilla.c.  Remove emul_$(EMULATION).c.  Sort.
	(HFILES): Add budemang.h.  Sort.
	(nm_new_SOURCES, objdump_SOURCES, addr2line_SOURCES): Add budemang.c.
	Run "make dep-am".
	* Makefile.in: Regenerate.
	* po/POTFILES.in: Regenerate.
2002-07-02 04:21:25 +00:00
Alan Modra b1f88ebebf * bucomm.c: Replace CONST with const.
* nm.c: Likewise.
	* objdump.c: Likewise.
2002-06-08 07:38:30 +00:00
Alan Modra 28b18af1b9 * objdump.c: Fix formatting. 2002-06-03 13:02:04 +00:00
Jakub Jelinek 13ae64f3c7 * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL
for symbols from SHF_TLS section.
	(_bfd_elf_print_private_bfd_data): Add PT_TLS.
	(elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections.
	(map_sections_to_segments): Build PT_TLS segment if necessary.
	(assign_file_positions_for_segments): Likewise.
	(get_program_header_size): Account for PT_TLS segment.
	(swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from
	SEC_THREAD_LOCAL sections to STT_TLS.
	* reloc.c: Add 386 and IA-64 TLS relocs.
	* section.c (SEC_THREAD_LOCAL): Define.
	(SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS):
	Remove.
	* elflink.h (elf_link_add_object_symbols): Support .tcommon.
	(size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS
	unconditionally.
	(struct elf_final_link_info): Add first_tls_sec.
	(elf_bfd_final_link): Set first_tls_sec.
	Compute elf_hash_table (info)->tls_segment.
	(elf_link_output_extsym): Handle STT_TLS symbols.
	(elf_link_input_bfd): Likewise.
	* syms.c (BSF_THREAD_LOCAL): Define.
	* bfd-in2.h: Rebuilt.
	* libbfd.h: Rebuilt.
	* elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff,
	elf_i386_mkobject, elf_i386_object_p): New functions.
	(elf_howto_table): Add TLS relocs.
	(elf_i386_reloc_type_lookup): Support TLS relocs.
	(elf_i386_info_to_howto_rel): Likewise.
	(struct elf_i386_link_hash_entry): Add tls_type.
	(struct elf_i386_obj_tdata): New.
	(elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type):
	New macros.
	(struct elf_i386_link_hash_table): Add tls_ldm_got.
	(link_hash_newfunc): Clear tls_type.
	(elf_i386_check_relocs): Support TLS relocs.
	(elf_i386_gc_sweep_hook): Likewise.
	(allocate_dynrelocs): Likewise.
	(elf_i386_size_dynamic_sections): Likewise.
	(elf_i386_relocate_section): Likewise.
	(elf_i386_finish_dynamic_symbol): Likewise.
	(bfd_elf32_mkobject, elf_backend_object_p): Define.
	* elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset,
	dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done,
	want_tprel, want_dtpmod, want_dtprel.
	(elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions.
	(ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to
	R_IA64_LTOFF_TPREL22.
	(elf_code_to_howto_index): Add TLS relocs.
	(elfNN_ia64_check_relocs): Support TLS relocs.
	(allocate_global_data_got): Account for TLS .got data.
	(allocate_dynrel_entries): Account for TLS dynamic relocations.
	(elfNN_ia64_install_value): Supprt TLS relocs.
	(set_got_entry): Support TLS relocs.
	(elfNN_ia64_relocate_section): Likewise.

	* config/obj-elf.c (elf_common): Renamed from obj_elf_common.
	(obj_elf_common): Call elf_common.
	(obj_elf_tls_common): New function.
	(elf_pseudo_tab): Support .tls_common.
	(special_sections): Add .tdata and .tbss.
	(obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS
	sections.
	(obj_elf_parse_section_letters): Support T in section flags (SHF_TLS).
	(obj_elf_parse_section_letters): Include T in error message.
	* config/tc-ppc.c (ppc_section_letter): Likewise.
	* config/tc-alpha.c (alpha_elf_section_letter): Likewise.
	(tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as
	SEC_MERGE.
	* config/tc-sparc.c (md_apply_fix3): Likewise.
	* config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs.
	Define them if not BFD_ASSEMBLER.
	(lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF
	and @NTPOFF.
	(md_apply_fix3): Add TLS relocs.
	* config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE,
	FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE,
	FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE.
	(pseudo_func): Support @dtpmod(), @dtprel() and @tprel().
	(ia64_elf_section_letter): Include T in error message.
	(md_begin): Support TLS operators.
	(md_operand): Likewise.
	(ia64_gen_real_reloc_type): Support TLS relocs.
	* testsuite/gas/i386/tlspic.s: New file.
	* testsuite/gas/i386/tlsd.s: New file.
	* testsuite/gas/i386/tlsnopic.s: New file.
	* testsuite/gas/i386/tlsd.d: New file.
	* testsuite/gas/i386/tlsnopic.d: New file.
	* testsuite/gas/i386/tlspic.d: New file.
	* testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests.
	* testsuite/gas/ia64/tls.s: New file.
	* testsuite/gas/ia64/tls.d: New file.
	* testsuite/gas/ia64/ia64.exp: Add tls test.
	* write.c (adjust_reloc_syms): Don't change symbols in
	SEC_THREAD_LOCAL sections to STT_SECTION + addend.

	* elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define.
	* elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22.
	* elf/i386.h: Add TLS relocs.

	* scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss.
	* ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for
	output section if necessary.  Handle .tbss.
	(lang_size_sections): Clear _raw_size for .tbss section
	(it allocates space in PT_TLS segment only).
	* ldwrite.c (build_link_order): Build link order for .tbss too.

	* readelf.c (get_segment_type): Add PT_TLS.
	(get_elf_section_flags): Add SHF_TLS.
	(get_dynamic_flags): Optimize.  Add DF_STATIC_TLS.
	(process_dynamic_segment): Use puts instead of printf.
	(get_symbol_type): Support STT_TLS.
	* objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT,
	SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS.
	Add SEC_THREAD_LOCAL.
2002-05-23 13:12:53 +00:00
Kazu Hirata 0af11b59ba * filemode.c: Fix formatting.
* ieee.c: Likewise.
	* is-ranlib.c: Likewise.
	* is-strip.c: Likewise.
	* maybe-ranlib.c: Likewise.
	* maybe-strip.c: Likewise.
	* nlmconv.c: Likewise.
	* nm.c: Likewise.
	* not-ranlib.c: Likewise.
	* not-strip.c: Likewise.
	* objcopy.c: Likewise.
	* objdump.c: Likewise.
2002-05-21 19:34:58 +00:00
Thiemo Seufer 21611032e1 * objdump.c (dump_headers): Fix output formatting for ELF32
architectures in a BFD64 enabled toolchain.
	* bfd/bfd.c (bfd_get_arch_size): Remove bfd_set_error call for
	non-ELF targets.
2002-05-21 16:21:18 +00:00
Daniel Jacobowitz d7a283d444 2002-01-29 Daniel Jacobowitz <drow@mvista.com>
* objdump.c: Include "getopt.h" after "bucomm.h" so that
        __GNU_LIBRARY__ will be defined.
        * size.c: Likewise.
2002-01-29 16:46:37 +00:00
Nick Clifton 8b53311e10 Tidy up formatting of --help output. 2002-01-23 16:12:56 +00:00
Thiemo Seufer 65de42c0f9 * addr2line.c (main): Protoype.
* ar.c (main): Protoype.
	* nm.c (main): Protoype.
	* objcopy.c (main): Protoype.
	* objdump.c (main): Protoype.
	* size.c (main): Protoype.
	* strings.c (main): Protoype.
	* gasp.c (main): Protoype.
2001-12-18 08:22:30 +00:00
Alan Modra 6a8c2b0d5e * coffdump.c (PROGRAM_VERSION): Delete.
(main <'V'>): Call print_version.
	* srconv.c: Likewise.
	* sysdump.c: Likewise.
	* version.c (program_version): Remove.
	(print_version): Use BFD_VERSION_STRING.  Just print the current
	year in copyright message.
	* addr2line.c (program_version): Remove unused declaration.
	* objdump.c (display_target_tables): Use BFD_VERSION_STRING in
	place of BFD_VERSION.
	* Makefile.am (Makefile): Depend on bfd/configure.in
	(cplus-dem.o): Depend on Makefile.
	Run "make dep-am"
	* Makefile.in: Regenerate.
2001-10-02 06:02:12 +00:00
Richard Henderson 9e85c2a02f * objdump.c (dump_section_header): Dump SEC_ARCH_BIT_0. 2001-09-28 21:10:41 +00:00
Alan Modra 451dad9c58 * bucomm.c (fatal): Define using VPARAMS, VA_OPEN, VA_FIXEDARG,
VA_CLOSE.
	(non_fatal): Likewise.
	* objdump.c (objdump_sprintf): Likewise.
	* readelf.c (error): Likewise.
	(warn): Likewise.
2001-09-26 01:55:19 +00:00
H.J. Lu 3882b01078 Locale changes from Bruno Haible <haible@clisp.cons.org>. 2001-09-19 05:33:36 +00:00
Alan Modra e59b4dfbd2 * ar.c (print_contents): Cast args of bfd_seek to the right types.
Replace bfd_read call with call to bfd_bread.
	(extract_file): Likewise.

	* objdump.c (dump_section_header): Cast section->filepos to
	unsigned long to suit printf format string.
	* readelf.c (process_section_headers): Similarly for sh_offset.
	(process_unwind): Likewise.
2001-09-18 10:05:55 +00:00
H.J. Lu d8180c76ad 2001-08-10 H.J. Lu <hjl@gnu.org>
* nm.c (print_value): Add one arg, bfd *.
	(print_value): Replace fprintf_vma with bfd_fprintf_vma.
	(print_symbol_info_bsd): Also pass `abfd' to print_value ().
	(print_symbol_info_sysv): Likewise.
	(print_symbol_info_posix): Likewise.

	* objdump.c (dump_section_header): Replace printf_vma with
	bfd_printf_vma.
	(print_section_stabs): Likewise.
	(dump_bfd_header): Likewise.
	(objdump_print_value): Replace sprintf_vma with
	bfd_sprintf_vma.
	(disassemble_bytes): Likewise.
	(dump_reloc_set): Likewise.
2001-08-10 16:43:18 +00:00
Alan Modra 2863d58a18 * readelf.c: Add missing prototypes.
* objdump.c: Likewise.  Format existing prototypes.
2001-08-09 14:46:50 +00:00
John Healy 8f9d9bd9e9 2001-08-03 John Healy <jhealy@redhat.com>
Patch suggested by Frank Eigler <fche@redhat.com>.
        * objdump.c (disassemble_data): Fill in section member of the
        disasm_info structure.
2001-08-03 22:08:44 +00:00
Alan Modra 2f83960e2c * bucomm.c (list_supported_architectures): New function.
* bucomm.h (list_supported_architectures): Declare.
	* objdump.c (usage): Call the above.
2001-07-29 05:31:43 +00:00
Dave Brolley 20fe064957 2001-07-25 Dave Brolley <brolley@redhat.com>
* objdump.c (SKIP_ZEROES): Only define it if it is not already defined.
	(SKIP_ZEROES_AT_END): Only define it if it is not already defined.
2001-07-25 15:25:11 +00:00
Nick Clifton 76a406e5b0 Remove section VMA adjustment when computing the address of the line to show. 2001-05-28 10:03:19 +00:00
Nick Clifton 8c2bc6877d Fix typos in ChangeLogs and update copyright notices 2001-03-13 06:43:59 +00:00
Nick Clifton 7340082dc8 Change bfd_target_vector from an array to a pointer 2001-02-07 23:16:22 +00:00
Nick Clifton 8b1e6df337 Add OBJDUMP_DEFS to configure and makefile
Check for DISASSEMBLER_NEEDS_RELOCS in objdump and read in relocs if set.
2001-01-09 20:25:31 +00:00
H.J. Lu 2ac374c471 2000-08-17 Christopher C. Chimelis <chris@debian.org>
* objdump.c (LONGEST_ARCH): Set to sizeof("powerpc:common").
2000-08-18 01:58:12 +00:00
Nick Clifton 28c309a287 Add optional style argument to --demangle switch. 2000-07-20 18:02:56 +00:00
Mark Kettenis 86d65c94b2 * objdump.c (usage): Make output of `objdump --help' more
consistent with the rest of the GNU world.  Add a line describing
the purpose of the program.
2000-07-12 19:52:17 +00:00
Nick Clifton d1cdf50144 Fix description of --stabs switch 2000-06-24 19:53:12 +00:00
Alan Modra fb101eadc0 Fix my inept 2000-05-24 change. 2000-05-30 07:47:56 +00:00
Alan Modra f190c5c4e9 Ensure bfd_close after bfd_openw so we don't get multiple bfd_openw
calls for same file.
2000-05-25 02:05:08 +00:00
H.J. Lu 5ee1baa27d 2000-05-12 H.J. Lu <hjl@gnu.org>
* nlmconv.c (temp_filename): Removed.

	* nlmconv.c (link_inputs): Use make_temp_file () instead of
	choose_temp_base ().
	* objdump.c (display_target_list): Likewise.
	(display_info_table): Likewise.
2000-05-13 06:38:34 +00:00
Timothy Wall ea58412531 Fix bug disassmbling binary files for non-octet byte targets. 2000-04-18 17:16:59 +00:00
Alan Modra 12ff5d5690 Portability fixes. 2000-04-14 04:14:25 +00:00
Alan Modra 37cc8ec1be A mostly cosmetic tidy up of warnings and error message reporting. 2000-04-07 04:34:50 +00:00
Timothy Wall 34cbe64ecf SEC_BLOCK, SEC_CLINK, and C_STATLAB added (TI COFF support). 2000-04-07 00:58:07 +00:00
Alan Modra 8ad3436c79 Move translated part of bug report string back into .c files so
xgettext can find it.  Regnerate .pot files.
2000-04-04 14:32:35 +00:00
Alan Modra c20f4f8c21 Move bug report string to one place. 2000-04-03 14:10:05 +00:00
Alan Modra f6af82bd44 This lot mainly cleans up `comparison between signed and unsigned' gcc
warnings.  One usused var, and a macro parenthesis fix too.  Also check
input sections are elf when doing gc in elflink.h.
2000-02-21 12:01:27 +00:00
Timothy Wall f15632584b Fix bug in interlisting option, added --file-start-context option. 2000-02-08 18:38:13 +00:00
Timothy Wall 940b2b788c octets vs bytes changes for binutils 2000-02-03 18:12:55 +00:00
Nick Clifton 94470b237b Add support for documenting target specific disassembler options 2000-01-27 21:44:26 +00:00
Nick Clifton 1dada9c5d3 Overhaul --help output 1999-11-21 11:37:21 +00:00
Ian Lance Taylor d24de309df 1999-10-27 Fred Fish <fnf@cygnus.com>
* objdump.c (display_bfd): Break into two functions.  The
	actual dumping code moves to dump_bfd.  If bfd is not
	unambiguously recognized as a bfd_object, attempt to dump
	it as a bfd_core.
	(dump_bfd): New function.
1999-10-28 03:30:13 +00:00
Ian Lance Taylor f1f8ce075e comment fix 1999-09-19 22:39:49 +00:00
Ian Lance Taylor 8bea4d5c6c 1999-09-12 Donn Terry <donn@interix.com>
* objdump.c (dump_headers): If wide_output, print Flags header.
1999-09-12 18:49:47 +00:00
Ian Lance Taylor deecf979f6 1999-09-12 Donn Terry <donn@interix.com>
* objdump.c (dump_section_header): Print any comdat information.
1999-09-12 18:39:32 +00:00
Ian Lance Taylor 75cd796a72 * objdump.c (exit_status): New static variable.
(nonfatal): New static function.
	(disassemble_data): Set exit_status on error.
	(read_section_stabs): Likewise.
	(display_bfd): Likewise.  Call nonfatal rather than bfd_nonfatal.
	(display_file): Call nonfatal rather than bfd_nonfatal.
	(display_target_list, display_info_table): Likewise.
	(main): Return exit_status rather than 0.
1999-08-09 05:23:29 +00:00
Ian Lance Taylor 24c411edf7 * objdump.c (dump_section_header): Update for renaming of
SEC_SHORT to SEC_SMALL_DATA.  Print SEC_SHARED flag.
1999-08-09 03:23:37 +00:00
Richard Henderson c235b8f824 * objdump.c (dump_section_header): Print SEC_SHORT. 1999-07-14 17:24:46 +00:00
Ian Lance Taylor b4c96d0d37 * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED
as appropriate.  Add variable initializations.  Add casts.
	* objdump.c (disassemble_bytes): Change j to bfd_vma.
	* readelf.c (process_syminfo): Change i to unsigned int.
	(display_debug_info): Change abbrev_number to unsigned long.
	(process_mips_specific): Change fcnt to size_t.
1999-07-11 20:02:30 +00:00
Nick Clifton dd92f63977 Add -M command line switch to objdump - text of switch is passed on to disassembler
Add support for register name set selection ot ARM disassembler.
1999-06-16 02:24:36 +00:00
Ian Lance Taylor e07bf1ac47 * objdump.c (disassemble_bytes): If the disassembler returns an
error, print out anything it may have printed to the buffer.  From
	H.J. Lu <hjl@gnu.org>.
1999-06-13 19:02:25 +00:00
DJ Delorie 09cda596de 1999-05-10 DJ Delorie <dj@cygnus.com>
* windres.c (quot): Quote shell metacharacters in a string
	(main): quote parameters to cpp that might have metacharacters in
	them.  Allow -D as an alias for --define to allow for sharing make
	macros with gcc.
	* objdump.c (dump_reloc_set): don't core if howto->name is NULL
	* Makefile.am: Give rescoff.c a cpu-specific -D so it can set
	the correct BFD.
	* Makefile.in: ditto
	* rescoff.c (write_coff_file): Set the correct BFD
1999-05-11 21:06:16 +00:00
Nick Clifton a8a9050d4a Set display_endian based on target endianism. 1999-05-06 07:41:56 +00:00
Richard Henderson 252b5132c7 19990502 sourceware import 1999-05-03 07:29:11 +00:00