2008-12-16  Roland McGrath  <roland@redhat.com>

	* dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
	symver magic to bind to ELFUTILS_0.138.
	(_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
	wrapper for ELFUTILS_0.130 version set.

2008-12-18  Roland McGrath  <roland@redhat.com>

	* derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
	addresses are taken as relative to MOD->low_addr.

2008-12-15  Roland McGrath  <roland@redhat.com>

	* derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
	debug.bias.

2008-12-11  Roland McGrath  <roland@redhat.com>

	* offline.c (process_archive): Don't call elf_end and close if
	returning NULL.  Check first elf_begin call and set error code
	specially for empty archive.
	Fixes RHBZ#465878.

2008-12-02  Roland McGrath  <roland@redhat.com>

	* dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.

2008-11-26  Roland McGrath  <roland@redhat.com>

	* dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
	return value, and interpret encoded OFFSET argument.

2008-10-07  Roland McGrath  <roland@redhat.com>

	* dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.

2008-09-29  Roland McGrath  <roland@redhat.com>

	* segment.c (insert): Must realloc DWFL->lookup_module here too.
	(dwfl_report_segment): Clear DWFL->lookup_module before insert calls.

2008-08-28  Roland McGrath  <roland@redhat.com>

	* segment.c (reify_segments): Fix last change.

2008-08-27  Roland McGrath  <roland@redhat.com>

	* linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
	failure from pread64.

2008-08-26  Roland McGrath  <roland@redhat.com>

	* segment.c (reify_segments): Insert a trailing segment for a module
	end that is above the highest current segment.

2008-08-25  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
	coded return value, not plain DWFL_E_LIBELF.  Return DWFL_E_BADELF
	if FILE->elf is not ELF_K_ELF.

	* dwfl_segment_report_module.c: Add a cast.

2008-08-21  Denys Vlasenko  <dvlasenk@redhat.com>

	* dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
	which decides which symbol is "closest" to a given address.

2008-08-15  Roland McGrath  <roland@redhat.com>

	* argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
	(options, parse_opt): Handle --core.

	* core-file.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwflP.h (dwfl_core_file_report): Declare it.

	* link_map.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwflP.h (dwfl_link_map_report): Declare it.

	* libdwflP.h (MIN, MAX): New macros.
	(Dwfl_Memory_Callback): New typedef.
	(Dwfl_Module_Callback): New typedef.
	(dwfl_segment_report_module): Declare it.
	* dwfl_segment_report_module.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.

	* derelocate.c (dwfl_module_address_section): Add INTDEF.
	* libdwflP.h: Add INTDECL.

	* segment.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
	* libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
	lookup_addr, lookup_module, lookup_segndx, replace removed members
	modules, nmodules.
	(struct Dwfl_Module): New member segment.
	* dwfl_end.c (dwfl_end): Free the new ones.  Iterate via modulelist
	to each free module.
	* dwfl_module.c (dwfl_report_begin_add): Do nothing.
	(dwfl_report_begin): Don't call it.  Truncate the segment table instead.
	(dwfl_report_module): Don't touch DWFL->nmodules.
	(dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
	(compare_modules): Function removed.
	* dwfl_getmodules.c: Rewritten.
	Add INTDEF.
	* libdwflP.h: Add INTDECLs.
	* dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
	* dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.

2008-08-03  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c: Include <fts.h> before <config.h>.

2008-07-17  Roland McGrath  <roland@redhat.com>

	* dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
	zero if the failure was only ENOENT.

2008-06-03  Roland McGrath  <roland@redhat.com>

	* dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
	symbols.

2008-05-22  Petr Machata  <pmachata@redhat.com>

	* dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.

2008-05-06  Roland McGrath  <roland@frob.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
	FTS_LOGICAL here too.
	(dwfl_linux_kernel_find_elf): Likewise.

2008-04-29  Roland McGrath  <roland@redhat.com>

	* find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
	based on canonicalize_file_name if it differs from the supplied name.

	* linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
	we accept symlinks.

2008-04-27  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (report_kernel): Fix crash when
	dwfl_report_elf fails.

2008-04-05  Roland McGrath  <roland@redhat.com>

	* linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.

	* dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
	Clear it after freeing.
	* dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.

2008-03-26  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getdwarf.c (load_symtab): Don't return success for
	SHT_DYNSYM, just set *SYMSCN like the comment says.

	* dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.

	* argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.

2008-03-19  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getsrc.c: Adjust address for module bias before search.

2008-03-01  Roland McGrath  <roland@redhat.com>

	* libdwflP.h (__libdwfl_seterrno): Remove parameter name from
	prototype to avoid older compiler's complaint about reuse of the name.
	(__libdwfl_canon_error): Likewise.

2008-02-19  Roland McGrath  <roland@redhat.com>

	* relocate.c (relocate_section): Check for an unhandled relocation
	type before resolving a reloc's symbol.  Lift DWFL_E_BADRELTYPE ->
	DWFL_E_UNKNOWN_MACHINE check out of loops.

	* dwfl_module_getdwarf.c (load_dw): Skip relocation if
	DEBUGFILE->relocated is already set.

2008-01-26  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.

	* dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
	incoming *FILE_NAME at the start.

2008-01-08  Roland McGrath  <roland@redhat.com>

	* Makefile.am (euinclude): Variable removed.
	(pkginclude_HEADERS): Set this instead of euinclude_HEADERS.

2007-10-23  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
	module to appear first.

2007-10-20  Roland McGrath  <roland@redhat.com>

	* offline.c (process_archive_member): Take FD argument, pass it down
	to process_file.  Return Elf_Cmd, not bool.
	Call elf_next here, always before elf_end.
	(process_archive): Update caller.  Don't close FD here unless there
	are no member refs.

	* dwfl_module.c (free_file): Close fd only when elf_end returns zero.

	* libdwflP.h (struct dwfl_file): New bool member `relocated'.
	* dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
	partial relocation to one or both files.
	(dwfl_module_getdwarf): For ET_REL, make sure extra sections'
	relocations have been applied to the debug file if dwfl_module_getelf
	has been used before.

	* relocate.c (resolve_symbol): New function.
	(relocate_section): Call it.

	* relocate.c (relocate_getsym): Handle null MOD->symfile.
	(relocate_section): Take new bool arg, PARTIAL.  If true,
	no error for BADRELTYPE/RELUNDEF, instead just skip them
	and leave only those skipped relocs behind the reloc section.
	(__libdwfl_relocate_section): Take new arg, pass it down.
	(__libdwfl_relocate): Take new bool arg, DEBUG.  If false,
	do partial relocation on all sections.
	* dwfl_module_getdwarf.c (load_dw): Update caller.
	* libdwflP.h: Update decls.
	* derelocate.c (dwfl_module_address_section): Pass new argument
	to __libdwfl_relocate_section, true.

	* derelocate.c (cache_sections): Don't cache reloc sections when
	section_address callback is null.

2007-10-19  Roland McGrath  <roland@redhat.com>

	* relocate.c (relocate_section): Fix fencepost error in r_offset check.

	* derelocate.c (struct dwfl_relocation): Add member `relocs'.
	(struct secref): Likewise.
	(cache_sections): Cache the relocation section referring to each
	section we cache, if any.
	(dwfl_module_address_section): Use __libdwfl_relocate_section as
	necessary.

	* relocate.c (struct reloc_symtab_cache): New type.
	(relocate_getsym): Use it instead of four arguments.
	(__libdwfl_relocate): Update caller.
	(relocate_section): New function, broken out of ...
	(__libdwfl_relocate): ... here.
	(__libdwfl_relocate_section): New function.
	* libdwflP.h: Declare it.

2007-10-17  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
	to relocated st_value.

	* dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
	ET_REL to 0x100.

2007-10-16  Roland McGrath  <roland@redhat.com>

	* dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
	section has larger alignment requirements not met by the original BASE,
	rather than padding more between sections.

	* dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.

	* dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
	to sh_addr value.

	* dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
	at zero in ET_REL case.  Adjust BASE to necessary alignment.

	* dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
	for DATA_VADDR.
	(__libdwfl_find_build_id): Update caller.

	* relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
	* dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
	* offline.c (dwfl_offline_section_address): Bail early if there is
	separate debug file.

	* relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.

2007-10-09  Roland McGrath  <roland@redhat.com>

	* dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
	caching SHDR->sh_addr = 0.
	* offline.c (dwfl_offline_section_address): Never called for sh_addr
	really at 0, don't check for it.  Use MOD->debug directly, not symfile.

	* dwfl_module_getdwarf.c (load_symtab): Return success properly when
	we've found SHT_SYMTAB.

	* relocate.c (relocate_getsym): New function.
	(__libdwfl_relocate): Use it.
	(__libdwfl_relocate_value): Take new Elf * argument.  Make SYMSHSTRNDX
	be a pointer instead of value; cache getshstrndx result there.
	* libdwflP.h: Update decl.
	* derelocate.c (cache_sections): Update caller.
	Always work on the main file, not the symfile.
	(dwfl_module_address_section): Likewise.
	* dwfl_module_getsym.c (dwfl_module_getsym): Update caller.

2007-10-07  Roland McGrath  <roland@redhat.com>

	* offline.c (process_archive): Initialize MOD.

	* linux-kernel-modules.c (get_release): New function, broken out of ...
	(report_kernel): ... here.  Call it.
	(try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
	(find_kernel_elf): Update caller.
	(report_kernel_archive): New function.
	(dwfl_linux_kernel_report_offline): Call it.

	* offline.c (process_file): Take new arg PREDICATE, pass it down.
	(process_archive): Likewise.
	(process_archive_member): Likewise.  When nonnull, let the predicate
	decide whether to use this member.
	(__libdwfl_report_offline): New function, broken out of ...
	(dwfl_report_offline): ... here.  Call it.
	* libdwflP.h: Declare it.

	* offline.c (process_archive, process_archive_member): New functions.
	(process_elf, process_file): New functions, broken out of ...
	(dwfl_report_offline): ... here.  Call process_file, which recurses on
	ELF_K_AR files.

	* dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
	(dwfl_report_elf): ... here.  Call it.
	* libdwflP.h: Declare it.

2007-10-06  Roland McGrath  <roland@redhat.com>

	* derelocate.c (dwfl_module_relocations): Don't call
	dwfl_module_getdwarf.

	* derelocate.c (find_section): Use __libdwfl_seterrno, not
	__libdw_seterrno.

	* relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
	SHF_ALLOC, to cache sh_addr resolved to 0.

	* dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
	values nonzero already, just use its existing layout.

	* relocate.c (__libdwfl_relocate): Clear size of reloc section in its
	in-core shdr after applying it.

2007-10-04  Ulrich Drepper  <drepper@redhat.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
	initialization of notes variable.

2007-10-04  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
	fill in with vaddr of "__start_notes" symbol if found.
	(check_notes): New function.
	(check_kernel_notes): New function.
	(dwfl_linux_kernel_report_kernel): Call it.
	(check_module_notes): New function.
	(dwfl_linux_kernel_report_modules): Call it.

	* linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
	Try dwfl_build_id_find_elf first.

	* linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
	Set kernel module e_type to ET_DYN.

2007-10-03  Roland McGrath  <roland@redhat.com>

	* find-debuginfo.c (validate): New function, broken out of ...
	(find_debuginfo_in_path): ... here.  New function, broken out of ...
	(dwfl_standard_find_debuginfo): ... here.  Call it, after trying
	dwfl_build_id_find_debuginfo first.

	* dwfl_build_id_find_elf.c: New file.
	* dwfl_build_id_find_debuginfo.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add them.
	* libdwfl.h: Declare them.
	* libdwflP.h: Add INTDECLs.

	* dwfl_module_build_id.c: New file.
	* dwfl_module_report_build_id.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add them.
	* libdwfl.h: Declare them.
	* libdwflP.h (struct Dwfl_Module): New members build_id_bits,
	build_id_len, build_id_vaddr.  Declare __libdwfl_find_build_id.
	* dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.

	* dwfl_module_getdwarf.c (find_offsets): New function.
	(find_dynsym): New function, calls that.
	(find_symtab): Call it.

2007-09-11  Roland McGrath  <roland@redhat.com>

	* dwfl_module_addrsym.c: Prefer a later global symbol at the same
	address if its st_size is smaller.

2007-08-13  Roland McGrath  <roland@redhat.com>

	* dwfl_module_addrsym.c: Add dead initializer for stupid compiler.

2007-08-12  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
	FTS_LOGICAL.

	* elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
	a second phdr if it happens to match EHDR_VMA exactly.

2007-08-08  Roland McGrath  <roland@redhat.com>

	* dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
	those with no names.  Rewrite best symbol algorithm not to assume a
	sorted table and to be smarter handling sizeless symbols.

2007-07-16  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
	reviving an existing module.

2007-06-08  Roland McGrath  <roland@redhat.com>

	* libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.

2007-05-17  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
	whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
	(dwfl_linux_kernel_find_elf): Likewise.

	* linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
	getline and sscanf instead of fscanf.

2007-05-08  Roland McGrath  <roland@redhat.com>

	* offline.c (dwfl_offline_section_address): Don't assume section
	numbers match between stripped and debuginfo files.  Instead, assume
	only that the ordering among SHF_ALLOC sections matches.

	* linux-kernel-modules.c (report_kernel): Change RELEASE argument to
	pointer to string.
	(dwfl_linux_kernel_report_offline): Update caller.
	(dwfl_linux_kernel_report_kernel): Likewise.

2007-04-23  Roland McGrath  <roland@redhat.com>

	* argp-std.c (options): Fix group title string.

	* argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
	Update via STATE->input every time we set STATE->hook, not only at
	ARGP_KEY_SUCCESS.

	* dwfl_module.c (free_file): Free FILE->name.

2007-04-16  Roland McGrath  <roland@redhat.com>

	* derelocate.c (cache_sections): Apply bias to sh_addr.
	(compare_secrefs): Fix address comparison to avoid signed overflow.
	(find_section): New function, broken out of ...
	(dwfl_module_relocate_address): ... here, call it.
	(check_module): New function, broken out of ...
	(dwfl_module_relocate_address): ... here, call it.
	(dwfl_module_address_section): New function.
	* libdwfl.h: Declare it.

2007-03-26  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (__libdwfl_module_free): Free MOD itself.

2007-03-18  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
	(find_debuginfo): ... here.  Call it.
	Don't return error for libelf errors finding .gnu_debuglink section.

2007-03-12  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
	(dwfl_report_begin): ... here.  Call it.
	* libdwfl.h: Declare it.
	* libdwflP.h: Add INTDECL.

	* elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.

	* offline.c: Comment typo fix.

2007-03-04  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
	(find_kernel_elf): New function, broken out of ...
	(report_kernel): ... here.  Call it.
	(dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
	(intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
	virtual address bounds of kernel from symbols rounded to page size.
	(dwfl_linux_kernel_report_kernel): Use that if it works, before
	resorting to report_kernel.

	* dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
	ET_EXEC file with nonzero bias.

	* dwfl_module_addrname.c (dwfl_module_addrname): Just call
	dwfl_module_addrsym.  Guts moved to ...
	* dwfl_module_addrsym.c: ... here; new file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_module_addrsym.
	* libdwflP.h: Add INTDECL.

2007-03-03  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (free_file): New function, broken out of ...
	(__libdwfl_module_free): ... here.  In it, close fd after elf_end.

	* dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
	on libelf failure.

2007-03-02  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c: Fix bogus error test for asprintf call.

2007-02-02  Roland McGrath  <roland@redhat.com>

	* dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
	address exactly if it's no other module's low boundary.

	* dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
	and size cover the address, select the closest symbol with st_size==0
	that lies in the same section.

2007-01-29  Roland McGrath  <roland@redhat.com>

	* dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
	not PACKAGE_STRING.

2007-01-20  Roland McGrath  <roland@redhat.com>

	* relocate.c (__libdwfl_relocate_value): Treat section_address of -1
	as omitted, not 0.
	* libdwfl.h (Dwfl_Callbacks): Update comment.
	* derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
	* linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
	For ignored missing section, use -1 instead of 0.
	* offline.c (dwfl_offline_section_address): Expect a call for 0.

2007-01-19  Roland McGrath  <roland@redhat.com>

	* argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
	zero so a lone -e foo.so is shown without address bias.

2007-01-10  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (report_kernel): Check asprintf return value
	directly instead of via side effect, to silence warn_unused_result.
	(dwfl_linux_kernel_report_offline): Likewise.
	(dwfl_linux_kernel_find_elf): Likewise.
	(dwfl_linux_kernel_module_section_address): Likewise.
	* find-debuginfo.c (try_open): Likewise.
	* linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
	(dwfl_linux_proc_report): Likewise.

	* libdwfl.h (dwfl_begin): Require nonnull argument.

2006-12-27  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (compare_modules): Fix address comparison to avoid
	signed overflow.  Patch by Frank Ch. Eigler <fche@redhat.com>.

2006-10-30  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (dwfl_report_module): Comment typo fix.

2006-09-05  Roland McGrath  <roland@redhat.com>

	* derelocate.c (cache_sections): Use alloca instead of variable-sized
	auto array, in function already alloca.

2006-08-14  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (try_kernel_name): If the call to
	dwfl_standard_find_debuginfo produces no results, try it again
	with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.

	* find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
	* libdwflP.h: ... to here.
	* linux-kernel-modules.c (try_kernel_name): Skip manual open if it
	repeats the first thing dwfl_standard_find_debuginfo will try.

	* linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
	(dwfl_linux_kernel_module_section_address): If a /sys file is missing
	and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
	section name.

2006-07-12  Ulrich Drepper  <drepper@redhat.com>

	* cu.c: Adjust for internal_function_def removal.
	* dwfl_error.c: Likewise.
	* dwfl_module.c: Likewise.
	* dwfl_module_getdwarf.c: Likewise.
	* lines.c: Likewise.
	* relocate.c: Likewise.

2006-07-11  Ulrich Drepper  <drepper@redhat.com>

	* dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
	it can overflow the return value type.
	Patch by Tim Moore <timoore@redhat.com>.

2006-06-28  Roland McGrath  <roland@redhat.com>

	* libdwfl.h: Cosmetic changes.

	* dwfl_line_comp_dir.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_line_comp_dir.

	* dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.

	* dwfl_linecu.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_linecu.

	* libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
	(dwfl_linecu): Define as macro.

	* relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.

	* dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
	(dwfl_module_addrname): Function moved ...
	* dwfl_module_addrname.c: ... here, new file.
	* dwfl_module_getsym.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add them.
	* libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
	* libdwflP.h: Add INTDECLs.

2006-06-27  Roland McGrath  <roland@redhat.com>

	* dwfl_module.c (dwfl_report_end): Whitespace fix.

2006-06-13  Roland McGrath  <roland@redhat.com>

	* elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
	Use __libdwfl_seterrno for elf_memory failure.

2006-05-22  Roland McGrath  <roland@redhat.com>

	* dwfl_module_return_value_location.c
	(dwfl_module_return_value_location): Use __libdwfl_module_getebl.

2006-05-27  Ulrich Drepper  <drepper@redhat.com>

	* libdwfl.h: Add extern "C".

2006-05-22  Ulrich Drepper  <drepper@redhat.com>

	* cu.c (addrarange): Handle files without aranges information.

2006-05-16  Ulrich Drepper  <drepper@redhat.com>

	* dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
	->modules is NULL.

2006-02-26  Roland McGrath  <roland@redhat.com>

	* dwfl_version.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_version.

	* offline.c (dwfl_report_offline): Account for dwfl_report_elf having
	aligned up from DWFL->offline_next_address when checking for overlap.

2005-12-22  Roland McGrath  <roland@redhat.com>

	* argp-std.c (parse_opt): Call dwfl_end in failure cases.

	* linux-proc-maps.c (proc_maps_report): New function, broken out of ...
	(dwfl_linux_proc_report): ... here.  Call it.
	(dwfl_linux_proc_maps_report): New function.
	* libdwfl.h: Declare it.
	* libdwflP.h: Add INTDECL.
	* argp-std.c (options, parse_opt): Grok -M/--linux-process-map.

	* dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
	failed with DWFL_E_NO_DWARF.

2005-11-26  Roland McGrath  <roland@redhat.com>

	* dwfl_end.c (dwfl_end): Free the DWFL itself.

2005-11-25  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
	(load_dw): Use it.
	* dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
	* libdwflP.h: Declare it.

	* dwfl_module_register_names.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_module_register_names.

2005-11-21  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
	Don't leak malloc'd file name.
	If a /sys/.../sections file is missing and starts with ".init",
	try the variant with "_init" too; catches PPC64 kernel braindamage.

2005-11-15  Roland McGrath  <roland@redhat.com>

	* libdwfl.h: Comment fixes.

	* dwfl_module_return_value_location.c: Add unlikely for error case.

2005-11-13  Roland McGrath  <roland@redhat.com>

	* dwfl_return_value_location.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_module_return_value_location.
	* libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.

2005-10-20  Roland McGrath  <roland@redhat.com>

	* libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
	* relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
	instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.

2005-10-01  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
	with errno 0.

2005-09-19  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
	PRIx64 instead of PRIi64, lest addresses with high bits set overflow
	the signed integer reading; they will just have to be in hexadecimal.
	(dwfl_linux_kernel_module_section_address): Likewise.

2005-08-28  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am (%.os): Use COMPILE.os.
	(COMPILE.os): Filter out gconv options.

2005-08-25  Roland McGrath  <roland@redhat.com>

	* cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
	* dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.

2005-08-24  Roland McGrath  <roland@redhat.com>

	* dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.

	* argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
	magic initializer to set -heur-stack-bound option.

2005-08-22  Roland McGrath  <roland@redhat.com>

	* dwfl_validate_address.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_validate_address.

	* derelocate.c (dwfl_module_relocate_address): Add INTDEF.
	* libdwflP.h: Add INTDECL.

	* dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
	elf_rawdata for symbol-related sections.

	* offline.c (dwfl_report_offline): Move offline_next_address outside
	module's range, in case it's an ET_EXEC using fixed segment locations.
	* libdwfl.h: Update comment.

	* dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
	required alignment.

2005-08-20  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
	function to choose whether to report.
	(dwfl_linux_kernel_report_offline): Likewise.
	* libdwfl.h: Update decl.
	* argp-std.c (parse_opt): Update caller.

	* dwfl_getsrclines.c: New file.
	* dwfl_onesrcline.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add them.
	* libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.

	* linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
	MODULESDIR[0].  Call fts_close on failure.

	* dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
	Close ET_REL file descriptors after relocation.
	(find_dw): Update caller.
	* offline.c (dwfl_report_offline): Get the file into memory and close
	the file descriptor.

	* dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
	MOD->debug.elf is already set.

	* find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
	(dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.

	* argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
	dwfl_linux_kernel_report_offline with offline_callbacks.

	* linux-kernel-modules.c (report_kernel): New function, broken out of
	...
	(dwfl_linux_kernel_report_kernel): ... here.  Use it.
	(dwfl_linux_kernel_report_offline): New function.
	* libdwfl.h: Declare it.
	* libdwflP.h: Add INTDECL.

2005-08-19  Roland McGrath  <roland@redhat.com>

	Use standard debuginfo search path to look for vmlinux.
	* find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
	passed zero.
	* linux-kernel-modules.c (try_kernel_name): New function, broken out
	of ...
	(dwfl_linux_kernel_report_kernel): ... here.  Use it.

	* argp-std.c (offline_callbacks): New variable.
	(parse_opt): Use it for -e.  Allow multiple -e options.

	* offline.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.
	* libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
	* libdwflP.h: Add INTDECLs.
	(OFFLINE_REDZONE): New macro.
	(struct Dwfl): New member `offline_next_address'.
	* dwfl_begin.c (dwfl_begin): Initialize it.
	* dwfl_module.c (dwfl_report_begin): Likewise.

	* dwfl_report_elf.c (dwfl_report_elf): Accept all types.  When ET_REL,
	do a nominal absolute section layout starting at BASE.
	* libdwfl.h: Update comment.

2005-08-18  Roland McGrath  <roland@redhat.com>

	* dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
	dwfl_module_getdwarf if necessary.

	* dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
	* libdwfl.h: Update comment.

	* derelocate.c: New file.
	* Makefile.am (libdwfl_a_SOURCES): Add it.

	* libdwflP.h (struct Dwfl_Module): isrel -> e_type.
	* dwfl_report_elf.c (dwfl_report_elf): Initialize it.
	* dwfl_module_getdwarf.c (open_elf): Update initialization.
	(load_dw, dwfl_module_addrname): Update uses.
	* relocate.c (__libdwfl_relocate): Likewise.

2005-08-04  Roland McGrath  <roland@redhat.com>

	* libdwfl.h (Dwfl_Callbacks.section_address): Take additional
	arguments SHNDX, SHDR.
	(dwfl_linux_kernel_module_section_address): Update prototype.
	* relocate.c (__libdwfl_relocate_value): Update caller.
	* linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
	Take the new arguments.

2005-08-10  Roland McGrath  <roland@redhat.com>

	* relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
	use it instead of MOD->debug.file.
	* libdwflP.h: Update decl.
	* dwfl_module_getdwarf.c (load_dw): Update caller.
	Fixes bug #165598.

2005-08-09  Roland McGrath  <roland@redhat.com>

	* libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
	* cu.c: Use INTUSE on dwarf_* calls.
	* dwfl_error.c: Likewise.
	* dwfl_module.c: Likewise.
	* dwfl_module_getdwarf.c: Likewise.
	* dwfl_module_getsrc_file.c: Likewise.
	* lines.c: Likewise.

2005-08-07  Roland McGrath  <roland@redhat.com>

	* linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
	names contain '_' or '-', look for files named either "foo-bar.ko"
	or "foo_bar.ko".

2005-07-29  Roland McGrath  <roland@redhat.com>

	* loc2c.c: File removed.
	* loc2c.h: File removed.
	* loc2c-runtime.h: File removed.
	* test2.c: File removed.
	* Makefile.am (EXTRA_DIST): Variable removed.
	(noinst_HEADERS): Remove loc2c.h from here.

2005-07-28  Ulrich Drepper  <drepper@redhat.com>

	* libdwfl.h: Add a few missing extern for function prototypes.

	* libdwfl_crc32.c: New file.
	* libdwfl_crc32_file.c: New file.
	* libdwflP.h: Declare the new functions.
	* Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
	libdwfl_crc32_file.c.
	* libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
	instead of crc32_file.

2005-07-28  Roland McGrath  <roland@redhat.com>

	* ptest.c: Moved to ../tests/dwflmodtest.c.

	* Makefile.am (noinst_PROGRAMS): Variable removed.
	(libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
	(EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
	(libdwfl): Don't use libdwfl.so any more.
	(libdwfl.so, install, uninstall): Targets removed.
	(test2_SOURCES): Define EXTRA_DIST instead of this.
	* libdwfl.map: File removed.

	* libdwfl.h: Use "" for libdw.h #include.

2005-07-27  Roland McGrath  <roland@redhat.com>

	* libdwfl.map: Add dwfl_getmodules.

2005-07-23  Ulrich Drepper  <drepper@redhat.com>

	* Makefile.am: Fix rules to allow building with mudflap.

2005-07-21  Roland McGrath  <roland@redhat.com>

	* Makefile.am (noinst_HEADERS): Add loc2c.c.

	* test2.c (main): Check sscanf result to quiet warning.

2005-07-20  Roland McGrath  <roland@redhat.com>

	* libdwfl-branch merged, creating this direcotry.