Commit Graph

107 Commits

Author SHA1 Message Date
Nick Clifton 34b5e0b205 PR 868
*dwarf2.c: Revert previous patch.  All of the allocate memory is
        on an obstack which will be freed at some other time.
2008-02-22 15:27:38 +00:00
Nick Clifton 515ef31dec PR 868
* libbfd.c (bfd_realloc_or_free): New function.  Performs like
   bfd_realloc, but if the (re)allocation fails, the pointer is
   freed.
   * libbfd-in.h: Prototype.
   * libbfd.h: Regenerate.
   * bfdio.c (bfd_bwrite): Use the new function.
   (bfd_seek): Likewise.
   * bfdwin.c:(bfd_get_file_window): Likewise.
   * elf-strtab.c (_bfd_elf_strtab_add): Likewise.
   * elf32-ppc.c (ppc_elf_relax_section): Likewise.
   * elf32-xtensa.c (vsprintf_msg): Likewise.
   * mach-o.c (bfd_mach_o_core_fetch_environment): Likewise.
   * stabs.c (_bfd_link_seciton_stabs): Likewise.
   * vms-misc.c (_bfd_vms_get_record): Likewise.
   * vms-tir.c (check_section): Likewise.
   * vms.c (vms_new_section_hook): Likewise.
   * elf32-arm.c (elf32_arm_section_map_add): Check that the
   allocation of sec_data->map succeeded before using it.
   * elflink.c (elf_link_output_sym): Do not overwrite finfo->
   symshndxbuf until it is known that the reallocation succeeded.
2008-02-20 17:42:36 +00:00
Nick Clifton b42bf1e0f9 PR 868
* dwarf2.c (read_abbrevs): Free the abbreviation table if we run
   out of memory.
   (decode_line_info): Free the line_info_table before returning a
   failure result.
   (_bfd_dwarf2_cleanup_debug_info): Free the abbreviation table.
   Free the line table.  Free the function table.  Free the variable
   table.
2008-02-20 15:56:33 +00:00
Nathan Sidwell d74e4b29eb * dwarf2.c (find_line): Don't trust debug information after an
unparseable compilation unit.
2008-02-16 10:51:38 +00:00
Alan Modra 709d67f15a PR 5755
* arange-set.c: Delete.
	* arange-set.h: Delete.
	* dwarf2.c: Revert 2007-09-21 changes.
	* Makefile.am: Likewise.
	* Makefile.in: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.
2008-02-12 00:26:00 +00:00
Nick Clifton 4ab2002928 * Makefile.am (BFD32_LIBS): Add arange-set.lo.
(BFD32_LIBS_CFILES): Add arange-set.c.
  (SOURCE_HFILES): Add arange-set.h
  (dwarf2.lo): Add dependency upon arange-set.h.
  (arange-set.lo): New target.
* Makefile.in: Regenerate.
* arange-set.c: New file.
* arange-set.h: New file.
* dwarf2.c: Include arange-set.h.
  (struct dwarf2_debug) Add new fields comp_unit_count and comp_unit_arange_set.
  (struct comp_unit) Replace field arange with a new field arange_set.
  (dwarf2_arange_set_allocate, dwarf2_arange_set_deallocate,
  (dwarf2_combine_arange_value, dwarf2_arange_set_new,
  (dwarf2_arange_set_with_value_new, dwarf2_comp_unit_arange_add): New
  functions to utilize arange set in dwarf2.c.
  (arange_add): Formatting change for a line longer than 80 characters.
  (decode_line_info): Replace call target arange_add with
  (dwarf2_comp_unit_arange_add.
  (read_rangelist_insert_arange_list,
  (read_rangelist_comp_unit_arange_add): New functions used as callbacks
  for read_rangelist.
  (read_rangelist): Change interface to accept a callback and data to
  allow caller to select the action peformed on a new range list read.
  (scan_unit_for_symbols): Use new interface of read_rangelist.
  (parse_comp_unit): Create an arange set for each new comp unit.  Use new
  interface of read_rangelist.  Replace call to arange_add with that to
  dwarf2_comp_unit_arange_add.
  (comp_unit_contains_address): Replace sequential search with a call to
  arange_set_lookup_address, which can handles large set efficiently.
  (stash_copy_local_aranges, stash_maybe_enable_arange_set,
  (stash_find_nearest_line_fast): New functions maintaining and using a
  valued global arange set for all compilation units to speed up
  bfd_dwarf2_find_nearest_line.
  (find_line): Use global arange set.  Replace sequential search over all
  compilation units with a call to stash_find_nearest_line_fast.  Add
  book keeping to count number of compilation units.  Replace empty
  arange list test with a call to arange_set_empty_p.
2007-09-21 16:16:18 +00:00
H.J. Lu aff90a5f25 bfd/
2007-09-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4986
	* dwarf2.c (new_line_sorts_after): Undo the last change.
	(add_line_info): Only keep the last entry with the same address
	and end sequence.

ld/testsuite/

2007-09-02  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4986
	* ld-ia64/line.exp: New.
	* ld-ia64/undefined.s: Likewise.

	* ld-x86-64/line.exp: Don't check CC.
2007-09-02 13:29:20 +00:00
H.J. Lu 399347457c bfd/
2007-08-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4986
	* dwarf2.c (new_line_sorts_after): Also compare line number.

ld/testsuite/

2007-08-31  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4986
	* ld-x86-64/line.exp: New
	* ld-x86-64/undefined.s: Likewise.
2007-09-01 06:09:20 +00:00
Nick Clifton bd210d54db Speed up bfd_dwarf2_find_line.
* dwarf2.c (struct dwarf2_debug): Add new fields to support function and variable info hash tables. Add last_comp_unit, info_hash_count, funcinfo_hash_table, varinfo_hash_table, hash_units_head.
  (struct comp_unit): Add prev_unit, cached.
  (struct info_list_node, struct info_hash_entry, struct info_hash_table): New.
  (info_hash_table_newfunc, create_info_hash_table, insert_info_hash_table, lookup_info_hash_table): New functions implementing function and variable info hash tables.
  (scan_unit_for_symbols): Add checks to make sure hash tables are consistent with compilation units.
  (comp_unit_maybe_decode_line_info): New function.
  (comp_unit_find_line): Use comp_unit_maybe_decode_line_info.
  (reverse_funcinfo_list, reverse_varinfo_list, comp_unit_hash_info, info_hash_lookup_funcinfo, info_hash_lookup_varinfo, stash_maybe_update_info_hash_table, stash_verify_info_hash_table, stash_maybe_enable_info_hash_tables, stash_find_line_fast): New functions. Make use of info hash tables to speed up bfd_dwarf2_find_line.
  (find_line): Use hash table for faster lookup if it is turned on.
  Also add code to maintain bi-directional link in comp units.
2007-07-26 08:31:03 +00:00
Nick Clifton 6b33789f61 PR binutils/4797
* dwarf2.c: (find_line) Do not dereference functionname_ptr if do_line is true.
2007-07-19 16:51:10 +00:00
Nick Clifton cd123cb70c Switch sources over to use the GPL version 3 2007-07-03 14:26:43 +00:00
Nick Clifton bec42b1574 * dwarf2.c (find_line): New. Contains the duplicated code from:
(_bfd_dwarf2_find_nearest_line): Use it.
  (_bfd_dwarf2_find_line): Use it.
2007-06-26 14:28:13 +00:00
Andreas Schwab 0d4a14760d * configure.in (--with-separate-debug-dir): New option.
* configure: Regenerate.
	* Makefile.am (dwarf2.lo): Add rule to pass DEBUGDIR.
	* Makefile.in: Regenerate.
	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Pass DEBUGDIR to
	bfd_follow_gnu_debuglink.
	(_bfd_dwarf2_find_line): Likewise.
2007-06-23 08:40:54 +00:00
Nick Clifton 0d161102d0 * dwarf2.c: Add support for reading in debug information via a .gnu_debuglink section:
(struct dwarf2_debug): Add bfd field to record the bfd containing the debug info.
  (parse_comp_unit): Remove ABFD parameter.  Instead use the bfd field in the dwarf2_debug structure.
  (_bfd_dwarf2_find_nearest_line): If a debug info section could not be found in the current bfd call bfd_follow_gnu_debuglink to see if another file contains the debug information.  If it does, open it and continue.
  (bfd_dwarf2_find_line): Likewise.
2007-06-22 08:13:12 +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
Carlos O'Donell 024b2372f5 bfd/
2007-02-23  Carlos O'Donell  <carlos@codesourcery.com>

	* dwarf2.c (_bfd_dwarf2_find_nearest_line): Assume 32-bit
	DWARF even with 64-bit addresses.
	(_bfd_dwarf2_find_nearest_line): Likewise.
2007-02-23 17:38:07 +00:00
Alan Modra 7421a730ce * dwarf2.c (concat_filename): Apply DW_AT_comp_dir if dir table
entry isn't absolute.
2006-09-17 02:44:38 +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
Ben Elliston b48c61bccb * archive.c (bfd_generic_archive_p): Remove unused local variable
`fail'.
	* dwarf2.c (decode_line_info): Remove unused local variable
	`basic_block'.
	* elfcode.h (elf_slurp_reloc_table_from_section): Remove unsed
	local varibale `s'.
	* tekhex.c (tekhex_write_object_contents): Remove unused local
	variable `bytes_written'.
	* aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
	variable `r_addend'.
	* elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
	* elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
	(_bfd_ns32k_relocate_contents): Remove break after return.
	* elf.c (bfd_section_from_shdr): Remove breaks after returns.
2006-05-02 10:01:56 +00:00
Alan Modra e460dd0d29 * dwarf2.c: Formatting.
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
	output section check.
	* elf32-i370.c: Warning fixes inside #ifdef DEBUG.
	* elf32-m32c.c: Similarly.
	* elf32-ppc.c: Similarly.
	* elf32-v850.c: Similarly.
	* nlm32-sparc.c: Similarly.
	* elfcode.h: Similarly.
	(elf_symbol_flags): Delete.
	* elflink.c (elf_link_input_bfd): Comment typo.
2006-05-02 01:41:20 +00:00
H.J. Lu 75a657ba49 2006-03-11 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2443
	* dwarf2.c (concat_filename): Don't issue an error if file is
	0.
2006-03-11 15:01:18 +00:00
Alan Modra d8d1c398ee * dwarf2.c: Formatting.
(add_line_info): Remove outer loop.
2006-03-06 04:52:03 +00:00
H.J. Lu d4c32a815a 2006-03-05 H.J. Lu <hongjiu.lu@intel.com>
Alan Modra  <amodra@bigpond.net.au>

	PR binutils/2338
	* dwarf2.c (loadable_section): New struct.
	(dwarf2_debug): Add loadable_section_count and
	loadable_sections.
	(new_line_sorts_after): New.
	(add_line_info): Use new_line_sorts_after to compare line
	addresses.
	(check_function_name): Removed.
	(unset_sections): New.
	(place_sections): New.
	(_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
	and unset_sections on relocatable files.
	(_bfd_dwarf2_find_line): Likewise.
2006-03-06 01:36:52 +00:00
H.J. Lu 35ccda9e73 2006-02-15 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/2338
	* dwarf2.c (check_function_name): New function.
	(_bfd_dwarf2_find_nearest_line): Use check_function_name to
	check if function is correct.
2006-02-15 22:29:42 +00:00
H.J. Lu 6dd55cb711 2006-01-17 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/2096
	* dwarf2.c (comp_unit_contains_address): Update comment.
	(_bfd_dwarf2_find_nearest_line): Use section's vma, instead of
	lma.  Return TRUE only if both comp_unit_contains_address and
	comp_unit_find_nearest_line return TRUE.
	(_bfd_dwarf2_find_line): Use section's vma, instead of lma.
2006-01-17 17:12:58 +00:00
Nick Clifton 650f284e0d (lookup_symbol_in_function_table): Check for a function name before passing
it to strcmp.
2005-12-27 16:07:36 +00:00
Jim Wilson c955f9cdcb Fix addr2line -i problem; reports incorrect function nesting for inline funcs.
* dwarf2.c (struct funcinfo): Delete nesting_level field.
(lookup_address_in_function_table): Delete code to set funcinfo
caller_func field.  Delete local curr_func.
(scan_unit_for_symbols): New locals nested_funcs, nested_funcs_size.
Delete code setting funcinfo nesting_level field.  Add code to set
funcinfo caller_func field.
2005-09-22 19:50:27 +00:00
Jim Wilson d5cbaa1554 Add mangled names to addr2line -i output.
* dwarf2.c (find_abstract_instance_name): Don't early exit when name
set.  For DW_AT_name case, only set name if not already set.  Handle
DW_AT_MIPS_linkage_name.
2005-09-20 18:13:32 +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 98b880f44f Fix linker error found when compiling glibc with a mismatched gcc.
* dwarf2.c (scan_unit_for_symbols, case DT_AT_location): Verify that
DW_OP_addr is only opcode in location before using it.
2005-08-10 23:33:39 +00:00
Fred Fish a29b7e88f2 Reviewed and approved by Nick Clifton <nickc@redhat.com>
2005-08-05  Fred Fish  <fnf@specifix.com>
	* dwarf2.c (read_rangelist): Use addr_size instead of offset_size
	to determine how many bytes to read from each rangelist entry.
2005-08-07 14:47:02 +00:00
Paul Koning 0af4cd7c60 2005-07-08 Paul Koning <pkoning@equallogic.com>
* dwarf2.c (read_address): Check sign_extend_vma to handle targets
	where addresses are sign extended.
2005-07-08 21:42:33 +00:00
H.J. Lu 5cf2e3f01e 2005-07-06 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2.c (varinfo): Add addr.
	(lookup_symbol_in_variable_table): Also check addr.
	(scan_unit_for_symbols): Set addr for variable.
	(comp_unit_find_line): Updated.
2005-07-06 13:43:21 +00:00
Alan Modra 75758e9ddb * dwarf2.c (decode_line_info): Revert last change. Instead set
initial low_pc to -1 to avoid need to test whether loc_pc has
	been set.
2005-06-10 10:14:23 +00:00
H.J. Lu 6bd00c5db5 2005-06-09 H.J. Lu <hongjiu.lu@intel.com>
PR 1000
	* dwarf2.c (lookup_address_in_line_info_table): Restore code
	handling NULL function info, removed with 2005-04-03 change.
2005-06-09 13:32:30 +00:00
H.J. Lu 5420f73dbb bfd/
2005-06-06  H.J. Lu  <hongjiu.lu@intel.com>

	PR 990
	* bfd.c (bfd_find_line): New.

	* dwarf2.c (comp_unit): Add variable_table.
	(funcinfo): Add file, line, and sec.
	(varinfo): New.
	(lookup_symbol_in_function_table): New.
	(lookup_symbol_in_variable_table): New.
	(scan_unit_for_functions): Renamed to ...
	(scan_unit_for_symbols): This. Handle DW_TAG_entry_point and
	DW_TAG_variable.
	(comp_unit_find_nearest_line): Updated.
	(comp_unit_find_line): New.
	(_bfd_dwarf2_find_line): New.

	* elf-bfd.h (_bfd_elf_find_line): New.
	(_bfd_generic_find_line): New. Defined.

	* elf.c (_bfd_elf_find_line): New.

	* libbfd-in.h (_bfd_dwarf2_find_line): New.
	(_bfd_generic_find_line): New.

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

	* libbfd.c (_bfd_generic_find_line): New.

	* targets.c (BFD_JUMP_TABLE_SYMBOLS): Initialize _bfd_find_line
	with _bfd_generic_find_line.
	(bfd_target): Add _bfd_find_line.

binutils/

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

	PR 990
	* nm.c (print_symbol): Call bfd_find_line before
	bfd_find_nearest_line.
2005-06-06 14:28:31 +00:00
H.J. Lu b42f9a05b6 2005-06-06 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2.c (decode_line_info): Properly set low_pc.
2005-06-06 14:16:45 +00:00
H.J. Lu 2ae727ad93 2005-06-04 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2.c (comp_unit): Fix a typo in comment.
2005-06-04 16:33:09 +00:00
Fred Fish 4ab527b053 Approved by nickc@redhat.com
2005-05-23  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (struct dwarf2_debug): Add inliner_chain member.
	(struct funcinfo): Add caller_func, caller_file, caller_line.
	tag, and nesting_level members.
	(lookup_address_in_function_table): Change first passed parameter
	from "struct funcinfo *" to "struct comp_unit *".
	(lookup_address_in_function_table): Dereference unit to find function
	table.
	(lookup_address_in_function_table): Traverse the function list to
	create a chain of inlined functions back to the first non inlined
	function.
	(scan_unit_for_functions): Remember tag and nesting level.  Handle
	DW_AT_call_file and DW_AT_call_line.
	(comp_unit_find_nearest_line): Adjust lookup_address_in_function_table
	call to pass unit pointer instead of function table pointer.  For
	inlined functions, save pointer to the inliner chain.
	(_bfd_dwarf2_find_nearest_line): Initialize inliner_chain to NULL.
	(_bfd_dwarf2_find_inliner_info): New function that returns information
	from the inliner chain after a call to bfd_find_nearest_line.

	* bfd.c (bfd_find_inliner_info): Define using BFD_SEND.
	* targets.c (BFD_JUMP_TABLE_SYMBOLS): Add entry for
	NAME##_find_inliner_info.
	(bfd_target): Add _bfd_find_inliner_info.
	* bfd-in2.h: Regenerate.

	* libbfd-in.h (_bfd_nosymbols_find_inliner_info): Define as
	macro that always returns bfd_false.
	(_bfd_dwarf2_find_inliner_info): Declare.
	* libbfd.h: Regenerate.

	* elf32-arm.c (elf32_arm_find_inliner_info): New function
	that calls _bfd_dwarf2_find_inliner_info.
	(bfd_elf32_find_inliner_info): Define to elf32_arm_find_inliner_info.

	* elfxx-mips.c (_bfd_mips_elf_find_inliner_info): New function
	that calls _bfd_dwarf2_find_inliner_info.
	* elfxx-mips.h (_bfd_mips_elf_find_inliner_info): Declare.
	* elfn32-mips.c (bfd_elf32_find_inliner_info): Define to
	_bfd_mips_elf_find_inliner_info.
	* elf64-mips.c (bfd_elf64_find_inliner_info): Ditto.
	* elf32-mips.c (bfd_elf32_find_inliner_info): Ditto.

	* elf.c (_bfd_elf_find_inliner_info): New function that calls
	_bfd_dwarf2_find_inliner_info.
	* elf-bfd.h (_bfd_elf_find_inliner_info): Declare.
	* elfxx-target.h (bfd_elfNN_find_inliner_info): Define to
	_bfd_elf_find_inliner_info.

	* coffgen.c (coff_find_inliner_info): New function that
	calls _bfd_dwarf2_find_inliner_info.
	* libcoff-in.h (coff_find_inliner_info): Declare.
	* libcoff.h: Regenerate.
	* coff-rs6000.c (rs6000coff_vec): Add coff_find_inliner_info.
	(pmac_xcoff_vec) Ditto.
	* coff64-rs6000.c (rs6000coff64_vec): Ditto.
	(aix5coff64_vec): Ditto.

	* aout-target.h (MY_find_inliner_info): Define as
	_bfd_nosymbols_find_inliner_info.
	* aout-tic30.c (MY_find_inliner_info): Ditto.
	* binary.c (binary_find_inliner_info): Ditto.
	* i386msdos.c (msdos_find_inliner_info): Ditto.
	* ihex.c (ihex_find_inliner_info): Ditto.
	* libaout.h (aout_32_find_inliner_info): Ditto.
	* libecoff.h (_bfd_ecoff_find_inliner_info): Ditto.
	* mach-o.c (bfd_mach_o_find_inliner_info): Ditto.
	* mmo.c (mmo_find_inliner_info): Ditto.
	* nlm-target.h (nlm_find_inliner_info): Ditto.
	* pef.c (bfd_pef_find_inliner_info): Ditto.
	* ppcboot.c (ppcboot_find_inliner_info): Ditto.
	* srec.c (srec_find_inliner_info): Ditto.
	* tekhex.c (tekhex_find_inliner_info): Ditto.
	* versados.c (versados_find_inliner_info): Ditto.
	* xsym.c (bfd_sym_find_inliner_info): Ditto.

	* ieee.c (ieee_find_inliner_info): New function that always
	returns FALSE.
	* oasys.c (oasys_find_inliner_info): Ditto.
	* vms.c (vms_find_inliner_info): Ditto.
2005-05-23 17:44:55 +00:00
Nick Clifton 35330cce1a * dwarf2.c (read_abbrevs): If bfd_realloc fails, free currently allocated memory
before returning.
  (decode_line_info): Likewise.
  (_bfd_dwarf2_cleanup_debug_info): New function:  Frees memory	allocated by
  functions in this file.
* elf-bfd.h (_bfd_dwarf2_cleanup_debug_info): Prototype.
* elf.c (bfd_elf_close_and_cleanup): Call _bfd_dwarf2_cleanup_debug_info.
2005-05-05 14:25:23 +00:00
Nick Clifton 3e11053365 Update the address and phone number of the FSF organization in the GPL notices 2005-05-04 15:53:43 +00:00
Nick Clifton 53e09e0aaf Update the FSF address in the copyright/GPL notice 2005-05-04 07:19:45 +00:00
Fred Fish a13afe8eb5 Apply patch for binutils bug 806, approved by nickc@redhat.com.
2005-04-03  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (struct dwarf2_debug): Add dwarf_ranges_buffer and
	dwarf_ranges_size members.
	(struct comp_unit): Add base_address member.
	(struct funcinfo): Replace low/high members with an arange.
	(arange_add): Replace incoming "unit" parameter with "abfd" and
	"first_arange" pointers.  Reorganize/rewrite function body.
	(decode_line_info): Change arange_add call to pass bfd and arange
	pointers.
	(lookup_address_in_line_info_table): Use arange list instead of
	individual low/high members.  Walk function's arange list to find
	lowest PC in list, to test for overlapping functions.
	(read_debug_ranges): New function, reads the debug_ranges section.
	(lookup_address_in_function_table): Use arange list instead of
	individual low/high members.  Rewrite to find smallest range that
	matches.
	(read_rangelist): Read a given rangelist from debug_ranges.
	(scan_unit_for_functions): Use arange list instead of individual
	low/high members.  Handle a DW_AT_ranges attribute.
	(parse_comp_unit): Use arange list instead of individual low/high
	members.  Save comp unit base address.  Handle a DW_AT_ranges
	attribute.
2005-04-03 20:36:37 +00:00
Fred Fish 09a9d560e1 Approved by nickc@redhat.com
2005-03-29  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (struct comp_unit): Fix typo.
	(scan_unit_for_functions): Remove unused local variable "name"
	and dead code that set it.
2005-03-29 20:10:42 +00:00
Nick Clifton 36868d45f8 (read_indirect_string): Fix apparent typo, check dwarf_str_buffer allocation,
not dwarf_abbrev_buffer.
2005-03-17 08:24:28 +00:00
Fred Fish 26bf4e3302 Approved by nickc@redhat.com:
2005-02-21  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (find_abstract_instance_name): Call recursively
	to handle a DW_AT_specification.
2005-02-21 18:00:17 +00:00
Alan Modra f075ee0c61 include/
* xtensa-isa-internal.h (xtensa_length_decode_fn): Warning fix.
	* xtensa-isa.h (xtensa_insnbuf_to_chars): Likewise.
	(xtensa_insnbuf_from_chars, xtensa_isa_length_from_chars): Likewise.
include/coff/
	* xcoff.h (struct xcoff_loader_info): Warning fix.
bfd/
	* bfd-in.h (bfd_elf_bfd_from_remote_memory): Warning fix.
	* coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Likewise.
	* coff-rs6000.c (xcoff_write_armap_big): Warning fixes.  Remove
	useless assignments.
	(xcoff_write_archive_contents_big): Likewise.
	(_bfd_xcoff_put_ldsymbol_name): Likewise.
	* coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise.
	* coffgen.c (coff_write_symbols): Make "written" a bfd_vma.
	* cofflink.c (process_embedded_commands): Warning fixes.
	* cpu-arm.c: Delete unnecessary prototypes.  Convert to C90.
	Warning fixes.
	* dwarf2.c: Warning fixes.
	* elf-bfd.h: Likewise.
	* elf-eh-frame.c: Likewise.
	* elf-strtab.c: Likewise.
	* elf.c: Likewise.
	* elf32-m68k.c: Likewise.
	* elf32-ppc.c: Likewise.
	* elf32-sh-symbian.c: Likewise.
	* elf32-sh.c: Delete unnecessary prototypes.  Warning fixes.
	* elf64-sh64.c: Likewise.
	* peicode.h: Likewise.
	* elf64-mmix.c: Warning fixes.
	* elfcode.h: Likewise.
	* elfxx-mips.c: Likewise.
	* libbfd-in.h: Likewise.
	* libbfd.c: Likewise.
	* mach-o.c: Likewise.
	* merge.c: Likewise.
	* mmo.c: Likewise.
	* opncls.c: Likewise.
	* pef.c: Likewise.
	* srec.c: Likewise.
	* vms-hdr.c: Likewise.
	* vms-tir.c: Likewise.
	* xtensa-isa.c: Likewise.
	* xtensa-modules.c: Likewise.
	* xsym.c: Likewise.
	(pstrcmp): Use correct choice of string lengths.  Fix return value.
	(bfd_sym_module_name): Correct string length.
	* bfd-in2.h: Regenerate.
	* libbfd.h: Regenerate.
2005-02-20 14:59:07 +00:00
H.J. Lu c0c28ab8b2 2005-01-17 H.J. Lu <hongjiu.lu@intel.com>
* dwarf2.c (dwarf2_debug): Move info_ptr_unit to ...
	(comp_unit): Here.
	(read_unsigned_leb128): Removed.
	(read_signed_leb128): Removed.
	(find_abstract_instance_name): Updated.
	(parse_comp_unit): Accept info_ptr_unit.
	(_bfd_dwarf2_find_nearest_line): Set info_ptr_unit for each
	comp unit and pass it to parse_comp_unit.

	* elf-eh-frame.c (read_unsigned_leb128): Moved to ...
	(read_signed_leb128): Moved to ...
	* libbfd.c: Here.

	* libbfd-in.h (read_unsigned_leb128): New prototype.
	(read_signed_leb128): Likewise.
	* libbfd.h: Regenerated.
2005-01-17 17:12:00 +00:00
Fred Fish 06f22d7e75 Approved by nickc@redhat.com:
2005-01-05  Fred Fish  <fnf@specifixinc.com>
	* dwarf2.c (struct dwarf2_debug): Add info_ptr_unit member.
	(find_abstract_instance_name): New function.
	(scan_unit_for_functions): Handle DW_TAG_inlined_subroutine.
	(scan_unit_for_functions): Handle DW_AT_abstract_origin.
	(_bfd_dwarf2_find_nearest_line): Initialize info_ptr_unit.
2005-01-05 10:37:05 +00:00
Alan Modra 1ba54ee020 bfd/
* dwarf2.c (_bfd_dwarf2_find_nearest_line): Add output section
	vma and output offset to address.
	* simple.c (simple_save_output_info): Only set output section
	and offset for debug sections, or those not already set up by
	the linker.
	(bfd_simple_get_relocated_section_contents): Update comment.
ld/testsuite/
	* ld-elfvsb/elfvsb.exp: Remove file name from "undefined ref" string.
2004-09-24 07:07:22 +00:00