]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Merge branch 'master' into roland/notes
authorRoland McGrath <roland@redhat.com>
Fri, 21 May 2010 00:04:15 +0000 (17:04 -0700)
committerRoland McGrath <roland@redhat.com>
Fri, 21 May 2010 00:04:15 +0000 (17:04 -0700)
Conflicts:
libdw/libdw.map
libdwfl/Makefile.am
libdwfl/argp-std.c
libdwfl/core-file.c
libdwfl/libdwfl.h
libdwfl/libdwflP.h
libdwfl/linux-proc-maps.c
libelf/Makefile.am
libelf/common.h
libelf/elf_begin.c
libelf/elf_readall.c
libelf/libelf.map
libelf/libelfP.h
tests/Makefile.am

18 files changed:
1  2 
NEWS
libdw/ChangeLog
libdw/libdw.map
libdwfl/ChangeLog
libdwfl/Makefile.am
libdwfl/dwfl_module.c
libdwfl/libdwfl.h
libdwfl/libdwflP.h
libdwfl/linux-proc-maps.c
libelf/ChangeLog
libelf/Makefile.am
libelf/common.h
libelf/elf_begin.c
libelf/elf_readall.c
libelf/libelf.map
libelf/libelfP.h
tests/ChangeLog
tests/Makefile.am

diff --cc NEWS
Simple merge
diff --cc libdw/ChangeLog
index 1642ce85afdf1a79ad943a0a74296fbd465e7df6,66e774a1f507a9d317efcd95cb51f40cc0bbe8c5..c56790621ef37d618dea0fa4552c34ee00f12b7f
+ 2010-05-08  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c (__libdw_intern_expression): Take new argument
+       REF_SIZE.  Use that to handle DW_OP_call_ref correctly.
+       (getlocation): Update caller.
+       * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
+       * dwarf_frame_register.c (dwarf_frame_register): Likewise.
+       * libdwP.h: Update decl.
+ 2010-04-26  Roland McGrath  <roland@redhat.com>
+       * cfi.h (struct Dwarf_Frame_s): Add cfa_invalid alternative in cfa_rule.
+       * cfi.c (execute_cfi): Set that instead of doing cfi_assert for
+       DW_CFA_def_cfa_{offset*,register} when a non-offset rule is in force.
+       * dwarf_frame_cfa.c (dwarf_frame_cfa): Handle cfa_invalid.
+       * dwarf_getlocation.c (__libdw_intern_expression): Take new arg CFAP.
+       Prepend DW_OP_call_frame_cfa if true.
+       (getlocation): Update caller.
+       * dwarf_frame_cfa.c (dwarf_frame_cfa): Likewise.
+       * dwarf_frame_register.c (dwarf_frame_register): Likewise.
+       * libdwP.h: Update decl.
+ 2010-04-22  Roland McGrath  <roland@redhat.com>
+       * cfi.c (execute_cfi): Never return without cleanup.
+       Free FS on failure.
+       (cie_cache_initial_state): Adjust caller to expect that free.
+       (__libdw_frame_at_address): Likewise.
+ 2010-03-10  Roland McGrath  <roland@redhat.com>
+       * libdw.map (ELFUTILS_0.146): New set.  Add dwfl_core_file_report.
+ 2010-02-15  Roland McGrath  <roland@redhat.com>
+       * Makefile.am: Use config/eu.am for common stuff.
+ 2010-02-02  Mark Wielaard  <mjw@redhat.com>
+       * fde.c (intern_fde): Fix length check for sized_augmentation_data.
+ 2010-01-07  Roland McGrath  <roland@redhat.com>
+       * dwarf_getcfi_elf.c (getcfi_phdr): Use elf_getphdrnum.
+ 2010-01-05  Roland McGrath  <roland@redhat.com>
+       * dwarf_aggregate_size.c: New file.
+       * Makefile.am (libdw_a_SOURCES): Add it.
+       * libdw.h: Declare it.
+       * libdwP.h: Add INTDECL.
+       * libdw.map (ELFUTILS_0.144): New set.  Add dwarf_aggregate_size.
+       * dwarf_srclang.c: Add INTDEF.
+       * libdwP.h: Add INTDECL.
+       * dwarf.h: Add some more DW_AT_GNU_* types from gcc.
+       * dwarf.h: Add DW_AT_GNU_vector, DW_AT_GNU_template_name.
+ 2009-11-21  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c (check_constant_offset): Return 1 for all
+       non-constant forms.
+ 2009-10-15  Roland McGrath  <roland@redhat.com>
+       * libdw_form.c (__libdw_form_val_len): Grok DW_FORM_sec_offset,
+       DW_FORM_exprloc, DW_FORM_flag_present, and DW_FORM_ref_sig8.
+ 2009-09-17  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c (dwarf_getlocation_implicit_value): Make OP
+       argument a pointer to const.
+       * libdw.h: Update decl.
+ 2009-09-10  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c (store_implicit_value): New function.
+       (__libdw_intern_expression): Use it, handle DW_OP_implicit_value.
+       (dwarf_getlocation_implicit_value): New function.
+       * libdw.h: Declare it.
+       * libdw.map (ELFUTILS_0.143): Add it.
+ 2009-09-09  Mark Wielaard  <mjw@redhat.com>
+       * dwarf_getcfi.c (dwarf_getcfi): Clear cfi->ebl.
+ 2009-08-21  Josh Stone  <jistone@redhat.com>
+       * dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
+ 2009-08-10  Roland McGrath  <roland@redhat.com>
+       * dwarf_getscopevar.c: Use dwarf_diename.
+ 2009-08-09  Roland McGrath  <roland@redhat.com>
+       * libdw.map (ELFUTILS_0.143): New version set,
+       inherits from ELFUTILS_0.142.
+       * dwarf_arrayorder.c: Use OLD_VERSION and NEW_VERSION to define an
+       alias in the ELFUTILS_0.122 version set and the default in the new set.
+       * dwarf_srclang.c: Likewise.
+       * dwarf_decl_file.c: Likewise.
+       * dwarf_decl_line.c: Likewise.
+       * dwarf_decl_column.c: Likewise.
+       * dwarf_bytesize.c: Likewise.
+       * dwarf_bitsize.c: Likewise.
+       * dwarf_bitoffset.c: Likewise.
+ 2009-08-07  Roland McGrath  <roland@redhat.com>
+       * dwarf_arrayorder.c: Use dwarf_attr_integrate.
+       * dwarf_srclang.c: Likewise.
+       * dwarf_decl_file.c: Likewise.
+       * dwarf_decl_line.c (__libdw_attr_intval): Likewise.
+       * dwarf_bytesize.c: Likewise.
+       * dwarf_bitsize.c: Likewise.
+       * dwarf_bitoffset.c: Likewise.
+ 2009-07-22  Roland McGrath  <roland@redhat.com>
+       * dwarf_frame_cfa.c: Change calling convention.
+       * libdw.h: Update decl.
+       * dwarf_frame_register.c: Change calling/return-value convention for
+       value-only results and undefined/same_value.
+       * libdw.h: Update decl.
+       * dwarf_getlocation.c (__libdw_intern_expression): Take new bool
+       argument, append DW_OP_stack_value if set.  Don't take NOPS argument,
+       return that value instead.
+       (getlocation): Update caller.
+       * dwarf_frame_cfa.c: Likewise.
+       * libdwP.h: Update decl.
+ 2009-07-21  Roland McGrath  <roland@redhat.com>
+       * dwarf_getsrc_file.c: Ignore a CU that just has no DW_AT_stmt_list.
+       Fix loop iteration after skipping a bogus or useless CU.
+       * dwarf_entry_breakpoints.c: Handle 0 dwarf_errno () as harmless
+       absence, not DWARF_E_NO_DEBUG_LINE.
+ 2009-07-20  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c (__libdw_intern_expression):
+       Handle DW_OP_stack_value.
+ 2009-07-16  Roland McGrath  <roland@redhat.com>
+       * dwarf_formudata.c (__libdw_formptr): Handle DW_FORM_sec_offset,
+       reject others when CU's version > 3.
+       * dwarf_formflag.c: Handle DW_FORM_flag_present.
+       * dwarf.h: Add DW_OP_{implicit,stack}_value from DWARF 4 draft.
+       Also DW_TAG_type_unit and DW_TAG_rvalue_reference_type.
+       Also DW_AT_signature, DW_AT_main_subprogram, DW_AT_data_bit_offset,
+       and DW_AT_const_expr.
+       Also DW_FORM_sec_offset, DW_FORM_exprloc, DW_FORM_flag_present,
+       and DW_FORM_ref_sig8.
+ 2009-07-15  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c: Grok DW_OP_form_tls_address,
+       DW_OP_GNU_push_tls_address, and DW_OP_bit_piece.
+ 2009-07-13  Roland McGrath  <roland@redhat.com>
+       * dwarf_getlocation.c: Grok DW_OP_call_frame_cfa.
+ 2009-07-08  Roland McGrath  <roland@redhat.com>
+       * libdw.map (ELFUTILS_0.142): Add dwfl_module_dwarf_cfi,
+       dwfl_module_eh_cfi.
+       * libdwP.h (struct Dwarf): Add member `cfi'.
+       * dwarf_end.c (dwarf_end): Call __libdw_destroy_frame_cache on it.
+       * dwarf_getcfi.c: New file.
+       * dwarf_getcfi_elf.c: New file.
+       * dwarf_cfi_end.c: New file.
+       * dwarf_cfi_addrframe.c: New file.
+       * dwarf_frame_cfa.c: New file.
+       * dwarf_frame_register.c: New file.
+       * dwarf_frame_return_address_register.c: New file.
+       * Makefile.am (libdw_a_SOURCES): Add them.
+       * unwind.h: Declare those functions.
+       * libdw.map (ELFUTILS_0.142): Export them.
+       * dwarf_getlocation.c (__libdw_intern_expression): New function,
+       broken out of ...
+       (getlocation): ... here, call it.
+       * libdwP.h: Declare it.
+       * cie.c: New file.
+       * fde.c: New file.
+       * frame-cache.c: New file.
+       * cfi.c: New file.
+       * cfi.h: New file.
+       * encoded-value.h: New file.
+       * Makefile.am (libdw_a_SOURCES, noinst_HEADERS): Add them.
+       * libdwP.h: Add DWARF_E_INVALID_CFI to errors enum.
+       * dwarf_error.c (errmsgs): Add element for it.
+       * dwarf_next_cfi.c: New file.
+       * Makefile.am (libdw_a_SOURCES): Add it.
+       * libdw.h (Dwarf_CIE, Dwarf_FDE, Dwarf_CIE_Entry): New types.
+       Declare dwarf_next_cfi.
+       * libdw.map (ELFUTILS_0.142): New set, inherits from ELFUTILS_0.136.
+       Add dwarf_next_cfi.
+       * memory-access.h [! ALLOW_UNALIGNED]
+       (read_2ubyte_unaligned): Renamed to ...
+       (read_2ubyte_unaligned_1): ... this.  Take bool rather than Dwarf *.
+       (read_2ubyte_unaligned): Define as macro passing dbg->other_byte_order.
+       (read_2sbyte_unaligned): Likewise.
+       (read_4ubyte_unaligned): Likewise.
+       (read_4sbyte_unaligned): Likewise.
+       (read_8ubyte_unaligned): Likewise.
+       (read_8sbyte_unaligned): Likewise.
+       * libdwP.h (IDX_eh_frame): Remove it.
+       * dwarf_begin_elf.c (dwarf_scnnames): Remove its element.
+ 2009-07-08  Roland McGrath  <roland@redhat.com>
+       * libdwP.h (struct Dwarf_Line_s): Reorder members to pack better.
+       * dwarf_getlocation.c (check_constant_offset): New function.
+       (dwarf_getlocation, dwarf_getlocation_addr): Call it to
+       handle DW_AT_data_member_location of data[48] as constant offset.
+ 2009-06-18  Roland McGrath  <roland@redhat.com>
+       * libdwP.h (__libdw_read_address_inc): Constify.
+       (__libdw_read_offset_inc): Likewise.
+       * dwarf_getaranges.c: Likewise.
+       * dwarf_getlocation.c: Likewise.
+       * dwarf_getsrclines.c: Likewise.
+       * dwarf_nextcu.c: Likewise.
+ 2009-05-05  Petr Machata  <pmachata@redhat.com>
+       * libdwP.h (__libdw_formptr): Declare new function.
+       * dwarf_formudata.c: Implement it here.
+       * dwarf_getlocation.c (dwarf_getlocation_addr):
+       Call it instead of hand-rolled offset handling code.
+       * dwarf_getsrclines.c (dwarf_getsrclines): Likewise.
+       * dwarf_ranges.c (dwarf_ranges): Likewise.
+ 2009-05-04  Petr Machata  <pmachata@redhat.com>
+       * libdwP.h (__libdw_read_begin_end_pair_inc): Declare new function.
+       * dwarf_ranges.c: Implement it here.
+       (dwarf_ranges): Call it.
+       * dwarf_getlocation.c (dwarf_getlocation_addr): Call it also here.
+ 2009-04-23  Petr Machata  <pmachata@redhat.com>
+       * dwarf_formaddr.c (dwarf_formaddr): Call __libdw_read_* instead
+       of read_*ubyte_unaligned.
+       * dwarf_formref_die.c (dwarf_formref_die): Likewise.
+       * dwarf_formstring.c (dwarf_formstring): Likewise.
+       * dwarf_formudate.c (dwarf_formudata): Likewise.
+       * dwarf_getaranges.c (dwarf_getaranges): Likewise.
+       * dwarf_getlocation.c (dwarf_getlocation_addr): Likewise.
+       * dwarf_getpubnames.c (get_offsets): Likewise.
+       * dwarf_nextcu.c (dwarf_nextcu): Likewise.
+ 2009-04-23  Petr Machata  <pmachata@redhat.com>
+       * libdwP.h (__libdw_read_addr_inc, __libdw_read_off_inc,
+       __libdw_read_addr, __libdw_read_off): Add four new internal
+       functions.
+ 2009-05-07  Roland McGrath  <roland@redhat.com>
+       * dwarf_getmacros.c (dwarf_getmacros): Use absolute section offset in
+       return value and OFFSET argument, not CU-relative.  Only fetch the
+       attribute data when called with OFFSET of 0.
+ 2009-05-07  Petr Machata  <pmachata@redhat.com>
+       * dwarf_getmacros.c (dwarf_getmacros): Take into account offset in
+       DW_AT_macro_info attribute of CU DIE.
+ 2009-04-15  Roland McGrath  <roland@redhat.com>
+       * dwarf.h (DW_CIE_ID): Removed.
+       (DW_CIE_ID_32, DW_CIE_ID_64): New constants replace it.
+ 2009-04-01  Roland McGrath  <roland@redhat.com>
+       * dwarf.h: Add DW_CFA_GNU_negative_offset_extended.
+ 2009-01-28  Roland McGrath  <roland@redhat.com>
+       * libdwP.h (struct Dwarf_Line_s): Move out of struct Dwarf_Lines_s
+       defn so C++ doesn't scope the name to not match the Dwarf_Line typedef.
+       * libdwP.h (struct Dwarf_Files_s): Replace dbg field with cu field.
+ 2009-01-26  Roland McGrath  <roland@redhat.com>
+       * dwarf_ranges.c: Return 0 when no ranges or *_pc attrs at all.
+ 2009-01-25  Roland McGrath  <roland@redhat.com>
+       * dwarf_getattrs.c: Correctly skip attribute values when restarting.
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+       * Makefile.am ($(srcdir)/known-dwarf.h): Target renamed back.
+       Put these rules under if MAINTAINER_MODE.
+ 2009-01-22  Roland McGrath  <roland@redhat.com>
+       * dwarf.h: Add DW_OP_GNU_encoded_addr.
+ 2009-01-21  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (CLEANFILES): Renamed to ...
+       (MOSTLYCLEANFILES): ... here.
+       (CLEANFILES): New variable, add known-dwarf.h.
+ 2009-01-17  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (known-dwarf.h): Target renamed, not in $(srcdir).
+       Make it unconditional.
+       (BUILT_SOURCES): Updated.
+       * dwarf.h: Add description comments for DW_LANG_* values.
+       * Makefile.am [MAINTAINER_MODE]
+       ($(srcdir)/known-dwarf.h): New target.
+       (BUILT_SOURCES): Add it.
+       * dwarf.h: Add DW_OP_GNU_push_tls_address, DW_OP_GNU_uninit.
+ 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
+       * dwarf_error.c: Always use __thread.  Remove all !USE_TLS code.
+ 2009-01-08  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (libdw.so): Don't depend on $(zip_LIBS), just link it in.
+ 2008-01-06  Roland McGrath  <roland@redhat.com>
+       * libdwP.h (struct Dwarf_Abbrev): Change type of 'has_children' to bool.
+       Reorder members.
+       * dwarf_haschildren.c: Return -1 for error case, not 0.
+       * Makefile.am (libdw.so): Link in $(zip_LIBS).
+ 2009-01-06  Ulrich Drepper  <drepper@redhat.com>
+       * dwarf.h: Add definition for unwind and call frame information.
+       * memory-access.h: Define read_ubyte_unaligned, read_sbyte_unaligned,
+       read_ubyte_unaligned_inc, and read_sbyte_unaligned_inc.
+ 2008-08-15  Roland McGrath  <roland@redhat.com>
+       * libdw.map (ELFUTILS_0.136): New version set, inherits from
+       ELFUTILS_0.130.  Add dwfl_addrsegment, dwfl_report_segment.
+ 2008-01-21  Ulrich Drepper  <drepper@redhat.com>
+       * dwarf_child.c: Minor optimizations.
+       * dwarf_getattrs.c: Likewise.
+       * dwarf_getpubnames.c: Likewise.
+       * dwarf_siblingof.c: Likewise.
+       * dwarf_tag.c: Likewise.
+ 2008-01-18  Ulrich Drepper  <drepper@redhat.com>
+       * dwarf_getsrclines.c (dwarf_getsrclines): Don't require exact match
+       of DWARF_VERSION comparison, just fail if the file's version is newer.
+ 2008-01-17  Nick Clifton  <nickc@redhat.com>
+       * dwarf.h (DWARF3_LENGTH_MIN_ESCAPE_CODE): New define.
+       (DWARF3_LENGTH_MAX_ESCAPE_CODE): New define.
+       (DWARF3_LENGTH_64_BIT): New define.
+       * dwarf_getaranges (dwarf_getaranges): Use the new definitions.
+       * dwarf_getpubnames: Include dwarf.h.
+       (get_offsets): Use the new definitions.
+       * dwarf_getsrclines.c (dwarf_getsrclines): Use the new defintions.
+       * dwarf_nextcu.c: Include dwarf.h.  Correct comment.
+       (dwarf_nextcu): Use the new definitions.
+       * libdwP.h (DIE_OFFSET_FROM_CU_OFFSET): New macro.
+       * dwarf_diecu.c (dwarf_diecu): Use the new macro.
+       * dwarf_getaranges (dwarf_getaranges): Use the new macro.
+       * dwarf_nextcu.c (dwarf_nextcu): Use the new macro.
+       * dwarf_getpubnames (get_offsets): Replace assertion with test and
+       error return.
+       * dwarf_entry_breakpoints.c (dwarf_entry_breakpoints): Use CUDIE.
+       * dwarf_siblingof (dwarf_siblingof): Detect a NULL return pointer.
+       Set the address in the return structure to the address of the next
+       non-sibling die, if there is no sibling and the return pointer is
+       not the same as the die pointer.
+       * libdw.h: Expand the description of the dwarf_siblingof prototype.
+       * dwarf_child.c: Fix typo in comment.
+       * libdwP.h (DWARF_VERSION): Change to 3.
+       * dwarf_formref.c (__libdw_formref.c): Handle attributes which do
+       not have a initialised valp pointer.
+       * dwarf_getattrs.c (dwarf_getattrs): Return 1 rather than 0 when
+       the end of the attributes is reached.  When the callback fails,
+       return the address of the failing attribute, not the address of
+       its successor.
+       * libdw.h: Expand the description of the dwarf_getattrs prototype.
+       * dwarf_child.c (__libdw_find_attr): Use the new definition.
+       (dwarf_child): Likewise.
+       * dwarf_tag.c (__libdw_findabbrev): Likewise.
+       (dwarf_tag): Likewise.
+ 2008-01-08  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (euinclude): Variable removed.
+       (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
+       (libdw.so): Pass -Wl,--enable-new-dtags,-rpath,$(pkglibdir).
 +2007-08-04  Roland McGrath  <roland@redhat.com>
 +
 +      * libdw.map (ELFUTILS_0.131): Add dwfl_module_build_id,
 +      dwfl_module_report_build_id, dwfl_build_id_find_elf,
 +      dwfl_build_id_find_debuginfo.
 +
 +2007-04-19  Roland McGrath  <roland@redhat.com>
 +
 +      * libdw.map (ELFUTILS_0.131): New set, inherits from ELFUTILS_0.130.
 +      Add dwfl_register_map, dwfl_register_map_begin, dwfl_register_map_end,
 +      dwfl_register_map_populate, dwfl_core_file_report,
 +      dwfl_core_file_find_elf, dwfl_core_file_register_map,
 +      dwfl_core_file_read_note.
 +
  2007-10-17  Roland McGrath  <roland@redhat.com>
  
        * libdw.h (__deprecated_attribute__): New macro.
diff --cc libdw/libdw.map
index f0edbf35b2b12592139f856ebe765fff1476f2b4,1a9afb135cf81fb5e00978df7dfae23e57a1d88d..c0e3a79f646f5aad73565076e0c4a9131437f3f1
@@@ -177,18 -177,63 +177,76 @@@ ELFUTILS_0.130 
      *;
  } ELFUTILS_0.127;
  
- ELFUTILS_0.131 {
+ ELFUTILS_0.136 {
+   global:
+     dwfl_addrsegment;
+     dwfl_report_segment;
+   local:
+     *;
+ } ELFUTILS_0.130;
+ ELFUTILS_0.138 {
+   global:
+     # Replaced ELFUTILS_0.130 version, which has bug-compatibility wrapper.
+     dwfl_module_build_id;
+   local:
+     *;
+ } ELFUTILS_0.136;
+ ELFUTILS_0.142 {
+   global:
+     dwarf_next_cfi;
+     dwarf_getcfi;
+     dwarf_getcfi_elf;
+     dwarf_cfi_addrframe;
+     dwarf_cfi_end;
+     dwarf_frame_cfa;
+     dwarf_frame_register;
+     dwarf_frame_info;
+     dwfl_module_dwarf_cfi;
+     dwfl_module_eh_cfi;
+ } ELFUTILS_0.138;
+ ELFUTILS_0.143 {
+   global:
+     dwarf_getlocation_implicit_value;
+     # Replaced ELFUTILS_0.122 versions.  Both versions point to the
+     # same implementation, but users of the new symbol version can
+     # presume that they use dwarf_attr_integrate properly.
+     dwarf_arrayorder;
+     dwarf_bitoffset;
+     dwarf_bitsize;
+     dwarf_bytesize;
+     dwarf_decl_column;
+     dwarf_decl_file;
+     dwarf_decl_line;
+     dwarf_srclang;
+ } ELFUTILS_0.142;
+ ELFUTILS_0.144 {
+   global:
+     dwarf_aggregate_size;
+ } ELFUTILS_0.143;
+ ELFUTILS_0.146 {
+   global:
+     dwfl_core_file_report;
+ } ELFUTILS_0.144;
++
++ELFUTILS_XXX {
 +  global:
 +    dwfl_register_map;
 +    dwfl_register_map_begin;
 +    dwfl_register_map_end;
 +    dwfl_register_map_populate;
 +
 +    dwfl_core_file_report;
 +    dwfl_core_file_find_elf;
 +    dwfl_core_file_register_map;
 +    dwfl_core_file_read_note;
-   local:
-     *;
- } ELFUTILS_0.130;
++} ELFUTILS_0.144;
index 285c7db5a11e2748de2046511abf8f2e3fc94e89,347ebcf4fec9e2a8893cd3db3022e828ecdb2e56..0dd77f4b97adac930b09ab5927ef3840e92fdd5e
+ 2010-05-20  Roland McGrath  <roland@redhat.com>
+       * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
+       (grovel_auxv): ... this.  Take DWFL argument.
+       (dwfl_linux_proc_report): Update caller.
+       * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
+       based on dwfl->segment_align or manifest alignment of MOD->low_addr.
+ 2010-05-19  Roland McGrath  <roland@redhat.com>
+       * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
+ 2010-05-06  Roland McGrath  <roland@redhat.com>
+       * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
+       * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
+       * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
+       ID but we didn't find a file.
+       * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
+       and refuse any fallback file-by-name if it lacks the matching ID.
+       * dwfl_error.c (dwfl_errno): Add INTDEF.
+       * libdwflP.h: Add INTDECL.
+       * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
+       failure cases.
+ 2010-05-04  Roland McGrath  <roland@redhat.com>
+       * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
+       ET_DYN that has a DT_DEBUG.
+       * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
+       * segment.c (insert): Fix moving of values following insertion.
+       (reify_segments): Fix up MOD->segment backpointer indices after
+       later insertions in the main loop invalidate them.
+       * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
+       apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
+       * core-file.c (dwfl_core_file_report): Return any nonzero count of
+       modules reported, even if link_map grovelling failed and only sniffing
+       found anything.
+ 2010-04-26  Roland McGrath  <roland@redhat.com>
+       * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
+       Works around probably-wrong ld -r behavior for case of a DWARF address
+       constant that refers to a discarded SHF_ALLOC section.
+ 2010-04-14  Roland McGrath  <roland@redhat.com>
+       * link_map.c (report_r_debug): Limit iterations on the l_next chain to
+       an upper bound on sane possible number of elements.
+ 2010-03-11  Roland McGrath  <roland@redhat.com>
+       * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
+       the second half for 32-bit matches.
+ 2010-03-10  Roland McGrath  <roland@redhat.com>
+       * core-file.c (dwfl_core_file_report): Punt EHDR argument.
+       * argp-std.c (parse_opt): Update caller.
+       * libdwfl.h: Declare dwfl_core_file_report.
+       * libdwflP.h: Don't.
+ 2010-02-17  Roland McGrath  <roland@redhat.com>
+       * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
+       If set, find the first index not below ADDR.
+       (dwfl_segment_report_module): Update callers.
+       Pass true when calculating return value.
+ 2010-02-15  Roland McGrath  <roland@redhat.com>
+       * Makefile.am: Use config/eu.am for common stuff.
+       * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
+       variable in failure path.
+ 2010-02-02  Mark Wielaard  <mjw@redhat.com>
+       * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
+       * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
+ 2010-01-07  Roland McGrath  <roland@redhat.com>
+       * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
+       * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
+       * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
+       * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
+ 2010-01-06  Roland McGrath  <roland@redhat.com>
+       * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
+       (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
+ 2009-11-16  Roland McGrath  <roland@redhat.com>
+       * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
+ 2009-11-12  Petr Machata  <pmachata@redhat.com>
+       * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
+       the chunk is both offset-contiguous and vaddr-contiguous.
+ 2009-11-05  Roland McGrath  <roland@redhat.com>
+       * link_map.c (report_r_debug): Skip entries with l_ld==0.
+       Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
+ 2009-09-04  Roland McGrath  <roland@redhat.com>
+       * image-header.c (__libdw_image_header): Fix tranposed comparison.
+ 2009-08-27  Roland McGrath  <roland@redhat.com>
+       * image-header.c: New file.
+       * Makefile.am (libdwfl_a_SOURCES): Add it.
+       * libdwflP.h: Declare __libdw_image_header.
+       * open.c (decompress): Don't consume ELF on failure.
+       (what_kind): New function, broken out of ...
+       (__libdw_open_file): ... here.  Call it.
+       If it fails, try __libdw_image_header and then try what_kind again.
+       * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
+       leave it behind for next decompressor.
+       * open.c (decompress): Free BUFFER on failure.
+ 2009-08-26  Roland McGrath  <roland@redhat.com>
+       * gzip.c (find_zImage_payload): New function, broken out of ...
+       (mapped_zImage): ... here.  Call it.
+       (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
+       stupid method of just trying the decoder.
+       * open.c [USE_LZMA]: Try __libdw_unlzma.
+       * libdwflP.h: Declare it.
+       (DWFL_ERRORS): Add DWFL_E_LZMA.
+       * gzip.c [LZMA]: Implement liblzma version for XZ file format.
+       * lzma.c: New file.
+       * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
+       * gzip.c (mapped_zImage): Limit scan to 32kb.
+       Make this unconditional, support bzip2 kernel images too.
+       (unzip): Use direct inflate method for non-mmap case too.
+       Only zlib uses the stream method.
+ 2009-08-09  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_build_id.c: Use new macros for versioned definitions.
+ 2009-07-08  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_dwarf_cfi.c: New file.
+       * dwfl_module_eh_cfi.c: New file.
+       * Makefile.am (libdwfl_a_SOURCES): Add them.
+       * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
+       Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
+ 2009-07-08  Roland McGrath  <roland@redhat.com>
+       * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
+ 2009-06-18  Mark Wielaard  <mjw@redhat.com>
+       * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
+ 2009-06-13  Ulrich Drepper  <drepper@redhat.com>
+       * derelocate.c: Don't use deprecated libelf functions.
+       * dwfl_module_getdwarf.c: Likewise.
+       * relocate.c: Likewise.
+ 2009-04-23  Ulrich Drepper  <drepper@redhat.com>
+       * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
+       defined.  Otherwise just define the latest version.
+ 2009-04-22  Roland McGrath  <roland@redhat.com>
+       * relocate.c (resolve_symbol): Apply correct bias to st_value found in
+       a non-ET_REL module.
+       * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
+       adjust properly for non-ET_REL.
+ 2009-04-21  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
+       * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
+       * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
+       for ET_REL.
+       * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
+ 2009-04-20  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
+ 2009-04-19  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_getdwarf.c (find_file): Renamed to ...
+       (__libdwfl_getelf): ... this.  Make it global.
+       (find_symtab, find_dw): Update callers.
+       (dwfl_module_getelf): Functions moved ...
+       * dwfl_module_getelf.c: ... here, new file.
+       * Makefile.am (libdwfl_a_SOURCES): Add it.
+       * libdwflP.h: Declare __libdwfl_getelf.
+ 2009-04-14  Roland McGrath  <roland@redhat.com>
+       * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
+       absolute (already adjusted in place) or needing load bias adjustment.
+       * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
+       gelf_getphdr failure.  Fix file size limit checks.
+       * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
+ 2009-04-08  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_getsym.c: Don't adjust for bias again after
+       __libdwfl_relocate_value.
+       * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
+       a non-SHF_ALLOC section.
+       (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
+       * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
+ 2009-03-09  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
+       variable to outer scope, so we cache it for the loop.
+       * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
+ 2009-02-12  Roland McGrath  <roland@redhat.com>
+       * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
+       __libdwfl_relocate_value to find correct sh_addr value.
+ 2009-02-10  Roland McGrath  <roland@redhat.com>
+       * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
+       If false, don't fail for NO_PHDR.
+       (dwfl_report_elf): Update caller.
+       * libdwflP.h: Update decl.
+       * offline.c (process_elf): Call it with false, so we don't refuse
+       dubiously-formed objects here.
+       * link_map.c (consider_executable): Don't assert dwfl_addrsegment
+       finds our module.  We shouldn't crash when we confuse some guesses.
+ 2009-02-10  Ulrich Drepper  <drepper@redhat.com>
+       * open.c (decompress): Avoid crash with empty input file.
+ 2009-01-27  Roland McGrath  <roland@redhat.com>
+       * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
+       with zero vaddr and memsz.
+ 2009-01-22  Roland McGrath  <roland@redhat.com>
+       * open.c (decompress): Move BUFFER, SIZE decls outside #if.
+       * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
+       after address-matching loop.
+       * segment.c (lookup): Fix fencepost in checking for HINT match.
+ 2009-01-14  Roland McGrath  <roland@redhat.com>
+       * gzip.c [!BZLIB] (mapped_zImage): New function.
+       (unzip) [!BZLIB]: Grok Linux kernel zImage format.
+ 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
+       * dwfl_error.c: Always use __thread.  Remove all !USE_TLS code.
+ 2009-01-08  Roland McGrath  <roland@redhat.com>
+       * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
+       Skip subdirectory named "source".
+       (dwfl_linux_kernel_find_elf): Likewise.
+ 2009-01-06  Roland McGrath  <roland@redhat.com>
+       * linux-kernel-modules.c (check_suffix): New function.
+       Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
+       (dwfl_linux_kernel_report_offline): Use it.
+       (dwfl_linux_kernel_find_elf): Likewise.
+ 2009-01-05  Roland McGrath  <roland@redhat.com>
+       * argp-std.c (parse_opt): Use __libdw_open_file for core file.
+       * dwfl_build_id_find_debuginfo.c: Use it to open the file.
+       * dwfl_build_id_find_elf.c: Likewise.
+       * dwfl_module_getdwarf.c (open_elf): Likewise.
+       * dwfl_report_elf.c: Likewise.
+       * find-debuginfo.c (validate): Likewise.
+       * offline.c (__libdwfl_report_offline): Likewise.
+       * libdwflP.h: Declare __libdw_open_file.
+       * open.c: New file.
+       * Makefile.am (libdwfl_a_SOURCES): Add it.
+       * gzip.c: New file.
+       * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
+       * bzip2.c: New file.
+       * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
+       * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
+ 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-08-04  Roland McGrath  <roland@redhat.com>
 +
 +      * core-file.c (dwfl_core_file_report): Use dwfl_module_report_build_id.
 +      (dwfl_core_file_find_elf): Use dwfl_build_id_find_elf.
 +
 +2007-05-03  Roland McGrath  <roland@redhat.com>
 +
 +      * core-file.c (no_module_overlaps): Renamed to ...
 +      (module_overlapping): ... here.  Return pointer instead of bool.
 +      Take new bool argument REORDER; if true, move found module to end.
 +      (offset_from_addr): New function.
 +      (string_from_offset): New function.
 +      (string_from_memory): New function.
 +      (getdata_core): New function.
 +      (addr_from_memory): New function.
 +      (report_link_map, report_r_debug, find_dt_debug): New functions.
 +      (dwfl_core_file_report): Use string_from_offset for soname extraction.
 +      Notice DT_DEBUG in found PT_DYNAMIC sections.
 +      Failing that, look for it in modules previously reported explicitly.
 +      Use report_r_debug to follow link_map list from DT_DEBUG.
 +      (dwfl_find_elf_by_build_id): Free old *FILE_NAME before setting it.
 +
 +2007-04-29  Roland McGrath  <roland@redhat.com>
 +
 +      * core-file.c (no_module_overlaps): New function.
 +      (dwfl_core_file_report): Use it to exclude duplicate modules.
 +
 +      * dwfl_module.c (__libdwfl_module_free): Free MOD->cb_data.
 +
 +      * argp-std.c (corefile_callbacks): Variable removed.
 +      (offline_callbacks): Use its .find_elf here.
 +      (parse_opt): Permit -e and --core together.
 +
 +2007-04-08  Roland McGrath  <roland@redhat.com>
 +
 +      * register-map.c: New file.
 +      * core-file-register-map.c: New file.
 +      * Makefile.am (libdwfl_a_SOURCES): Add them.
 +      * libdwfl.h (Dwfl_Register_Map): New opaque typedef.
 +      Declare dwfl_register_map_* functions, dwfl_core_file_register_map,
 +      and dwfl_core_file_read_note.
 +      * libdwflP.h (struct Dwfl_Register_Map): New type.
 +      (struct map_register): New type.
 +
  2007-10-23  Roland McGrath  <roland@redhat.com>
  
        * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
index 6645315f670f1478fdc2ab9fbfb7bac329dccb7a,8ec1f4fa517eca9f0a23e3d7c329daa90171eb7b..fa5395f5aa9e66b1f142d0a73491e082290946cc
@@@ -75,8 -64,18 +66,19 @@@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_e
                    dwfl_module_addrname.c dwfl_module_addrsym.c \
                    dwfl_module_return_value_location.c \
                    dwfl_module_register_names.c \
 -                  link_map.c core-file.c open.c image-header.c
+                   dwfl_segment_report_module.c \
++                  link_map.c core-file.c open.c image-header.c \
 +                  register-map.c core-file-register-map.c
  
+ if ZLIB
+ libdwfl_a_SOURCES += gzip.c
+ endif
+ if BZLIB
+ libdwfl_a_SOURCES += bzip2.c
+ endif
+ if LZMA
+ libdwfl_a_SOURCES += lzma.c
+ endif
  
  if MUDFLAP
  libdwfl = libdwfl.a $(libdw) $(libebl) $(libelf) $(libeu)
Simple merge
index cd1d97129cfade9b7ec7563accdcedfd06ae0e7a,51e98187bcd6573e538e43cd84cdb9d9a76c4947..bd28f064749231ebc090fd15f4d27399d7e053a1
@@@ -530,82 -561,18 +579,94 @@@ extern int dwfl_module_register_names (
                                       void *arg);
  
  
 +/*** Register map handling functions ***/
 +
 +/* Create an empty register map object.  */
 +extern Dwfl_Register_Map *dwfl_register_map_begin (void);
 +
 +/* Clean up and free a register map object.  */
 +extern void dwfl_register_map_end (Dwfl_Register_Map *);
 +
 +/* Populate the given register map with one set of registers you
 +   have access to.  REF supplies the machine backend that recognizes
 +   the note formats.  N_TYPE is the field from GElf_Nhdr for a core
 +   file note that would contain this register data.  OFFSET is the
 +   byte offset into the note contents corresponding to the register
 +   data you have, and SIZE is the number of bytes of that data.
 +
 +   Returns -1 for unexpected errors.  Returns 0 if N_TYPE is
 +   recognized but has no DWARF registers or is wholly redundant.
 +   Otherwise, returns one more than the highest DWARF register number
 +   now described in MAP.  SETNO will be returned by dwfl_register_map
 +   to refer to this register set.  */
 +
 +extern int dwfl_register_map_populate (Dwfl_Register_Map *map, Dwfl *ref,
 +                                     int setno,
 +                                     GElf_Word n_type,
 +                                     GElf_Word offset,
 +                                     GElf_Word size);
 +
 +/* Look up a DWARF register number in the given register map.
 +
 +   Returns -1 if REGNO is not described in MAP.  Otherwise, returns
 +   the register set number containing REGNO and sets *OFFSET to its
 +   byte position within that register set's data.  */
 +
 +extern int dwfl_register_map (Dwfl_Register_Map *map, int regno,
 +                            GElf_Word *offset)
 +  __nonnull_attribute__ (3);
 +
 +
 +/* Create and populate a register map from note types found in a core file,
 +   previously opened using dwfl_core_file_report.  Returns the number of
 +   register sets used in the map, or -1 for errors.
 +
 +   On success, OFFSET is filled with the location in the core file
 +   of the first note providing thread register information, and
 +   LIMIT is filled with the location after the last such note.  */
 +
 +extern int dwfl_core_file_register_map (Dwfl *dwfl, Dwfl_Register_Map **result,
 +                                      GElf_Off *offset, GElf_Off *limit)
 +  __nonnull_attribute__ (2, 3, 4);
 +
 +/* Examine notes starting at OFFSET and not exceeding LIMIT that
 +   provide register data for one thread.  Returns -1 for errors.
 +
 +   On success, OFFSETS[] and SIZES[] are filled with the file
 +   locations of the note data for the NSETS register sets described
 +   by MAP.  IDENT_SETNO, IDENT_POS, and IDENT_TYPE are filled to
 +   describe where in register set data to find a moniker for this
 +   thread.  NEW_OFFSET is filled with the file position following
 +   those notes.  NEXT and DESC_OFFSET are filled to describe the
 +   next note at *NEW_OFFSET.  Returns 1 if there may be additional
 +   threads in following notes.  Returns 0 if following notes (if
 +   any) have only non-thread data.  */
 +
 +extern int dwfl_core_file_read_note (Dwfl *dwfl, Dwfl_Register_Map *map,
 +                                   GElf_Off offset, GElf_Off limit,
 +                                   int nsets,
 +                                   GElf_Off offsets[nsets],
 +                                   GElf_Word sizes[nsets],
 +                                   int *ident_setno,
 +                                   GElf_Word *ident_pos,
 +                                   Elf_Type *ident_type,
 +                                   // XXX non-reg info?
 +                                   GElf_Off *new_offset,
 +                                   GElf_Nhdr *next, GElf_Off *desc_offset)
 +  __nonnull_attribute__ (6, 7, 8, 9, 10, 11, 12, 13);
 +
+ /* Find the CFI for this module.  Returns NULL if there is no CFI.
+    On success, fills in *BIAS with the difference between addresses
+    within the loaded module and those in the CFI referring to it.
+    The pointer returned can be used until the module is cleaned up.
+    Calling these more than once returns the same pointers.
+    dwfl_module_dwarf_cfi gets the '.debug_frame' information found with the
+    rest of the DWARF information.  dwfl_module_eh_cfi gets the '.eh_frame'
+    information found linked into the text.  A module might have either or
+    both.  */
+ extern Dwarf_CFI *dwfl_module_dwarf_cfi (Dwfl_Module *mod, Dwarf_Addr *bias);
+ extern Dwarf_CFI *dwfl_module_eh_cfi (Dwfl_Module *mod, Dwarf_Addr *bias);
  
  
  #ifdef __cplusplus
index 54a3d727a71f2092dc42afa6732094ee9d5c6b6b,e4c7e7c828a809e17b2352cf5689202448bbf32b..6aa8e051ef26dd889045e927f97a73c3f51fc233
@@@ -106,15 -110,24 +110,27 @@@ struct Dwf
  {
    const Dwfl_Callbacks *callbacks;
  
 +  /* Data hook for library-supplied reporting calls and find_elf hooks.  */
 +  void *cb_data;
 +
    Dwfl_Module *modulelist;    /* List in order used by full traversals.  */
  
-   Dwfl_Module **modules;
-   size_t nmodules;
    GElf_Addr offline_next_address;
+   GElf_Addr segment_align;    /* Smallest granularity of segments.  */
+   /* Binary search table in three parallel malloc'd arrays.  */
+   size_t lookup_elts;         /* Elements in use.  */
+   size_t lookup_alloc;                /* Elements allococated.  */
+   GElf_Addr *lookup_addr;     /* Start address of segment.  */
+   Dwfl_Module **lookup_module;        /* Module associated with segment, or null.  */
+   int *lookup_segndx;         /* User segment index, or -1.  */
+   /* Cache from last dwfl_report_segment call.  */
+   const void *lookup_tail_ident;
+   GElf_Off lookup_tail_vaddr;
+   GElf_Off lookup_tail_offset;
+   int lookup_tail_ndx;
  };
  
  #define OFFLINE_REDZONE               0x10000
index 60e9b58dbbc636fa04046bf5504c062cefb06b3a,8504a5f3afc1a88668e300edecd0b3f59dd22f90..697e22a104135252ad205e228aba3b69bf503211
@@@ -107,62 -86,54 +107,68 @@@ grovel_auxv (pid_t pid, Dwfl *dwfl, GEl
      {
        union
        {
 -      char buffer[sizeof (long int) * 2 * 64];
 -      Elf64_auxv_t a64[sizeof (long int) * 2 * 64 / sizeof (Elf64_auxv_t)];
 -      Elf32_auxv_t a32[sizeof (long int) * 2 * 32 / sizeof (Elf32_auxv_t)];
 -      } d;
 -      nread = read (fd, &d, sizeof d);
 -      if (nread > 0)
 +      Elf64_Ehdr e64;
 +      Elf32_Ehdr e32;
 +      char ident[EI_NIDENT];
 +      } u;
 +      Elf *elf;
 +
 +      /* We need a representative ELF header to set the format of things.  */
 +      if (asprintf (&fname, PROCEXEFMT, pid) < 0)
 +      elf = NULL;
 +      else
 +      {
 +        fd = open64 (fname, O_RDONLY);
 +        free (fname);
 +        if (fd < 0)
 +          elf = NULL;
 +        memset (&u, 0, sizeof u);
 +        ssize_t hdr_read = read (fd, u.ident, sizeof u.ident);
 +        close (fd);
 +        if (hdr_read < (ssize_t) sizeof u.ident)
 +          elf = NULL;
 +        else
 +          elf = elf_memory (u.ident, sizeof u);
 +      }
 +
 +      if (elf == NULL)
 +      nread = -1;
 +      else
        {
 -        switch (sizeof (long int))
 +        Elf_Data *data = gelf_getdata_memory (elf, buf, nread,
 +                                              ELF_T_AUXV, NULL);
 +        if (data == NULL)
 +          nread = -1;
 +        else
            {
 -          case 4:
 -            for (size_t i = 0; (char *) &d.a32[i] < &d.buffer[nread]; ++i)
 -              if (d.a32[i].a_type == AT_SYSINFO_EHDR)
 -                {
 -                  *sysinfo_ehdr = d.a32[i].a_un.a_val;
 -                  if (dwfl->segment_align > 1)
 -                    {
 -                      nread = 0;
 -                      break;
 -                    }
 -                }
 -              else if (d.a32[i].a_type == AT_PAGESZ
 -                       && dwfl->segment_align <= 1)
 -                dwfl->segment_align = d.a32[i].a_un.a_val;
 -            break;
 -          case 8:
 -            for (size_t i = 0; (char *) &d.a64[i] < &d.buffer[nread]; ++i)
 -              if (d.a64[i].a_type == AT_SYSINFO_EHDR)
 -                {
 -                  *sysinfo_ehdr = d.a64[i].a_un.a_val;
 -                  if (dwfl->segment_align > 1)
 -                    {
 -                      nread = 0;
 +            size_t nauxv = data->d_size / gelf_fsize (elf, ELF_T_AUXV, 1,
 +                                                      EV_CURRENT);
 +            for (size_t i = 0; i < nauxv; ++i)
 +              {
 +                GElf_auxv_t auxv_mem;
 +                GElf_auxv_t *auxv = gelf_getauxv (data, i, &auxv_mem);
-                 if (auxv != NULL && auxv->a_type == AT_SYSINFO_EHDR)
++                if (unlikely (auxv == NULL))
++                  break;
++                if (auxv->a_type == AT_SYSINFO_EHDR)
 +                  {
 +                    *sysinfo_ehdr = auxv->a_un.a_val;
-                     break;
++                    if (dwfl->segment_align > 1)
+                       break;
 -                    }
 -                }
 -              else if (d.a64[i].a_type == AT_PAGESZ
 -                       && dwfl->segment_align <= 1)
 -                dwfl->segment_align = d.a64[i].a_un.a_val;
 -            break;
 -          default:
 -            abort ();
 -            break;
 +                  }
++                else if (auxv->a_type == AT_PAGESZ
++                         && dwfl->segment_align <= 1)
++                  dwfl->segment_align = auxv->a_un.a_val;
 +              }
 +
 +            //gelf_freedata (data);
            }
 +
 +        elf_end (elf);
        }
      }
 -  while (nread > 0);
  
 -  close (fd);
 +  if (buf != buffer)
 +    free (buf);
  
    return nread < 0 ? errno : 0;
  }
index 364eb82c40c38d8ed921a5205ab2b9a1c0bab18d,7e6b9929700dbc21bddcba179d6c463e99d1c92d..07dc807342db533295dd93ecd928ee0c9daabe94
+ 2010-04-14  Roland McGrath  <roland@redhat.com>
+       * elf32_getphdr.c: Check for e_phoff/size outside the file bounds.
+       * elf_begin.c (file_read_elf): Don't set .phdr here.
+ 2010-04-13  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2010-04-06  Roland McGrath  <roland@redhat.com>
+       * elf_error.c (ELF_E_FD_MISMATCH_IDX): Avoid nonobvious abbreviation
+       in error message.
+ 2010-04-01  Petr Machata  <pmachata@redhat.com>
+       * elf_getdata.c (__elf_getdata_rdlock): Initialize data.s for data
+       that do not need a conversion.
+ 2010-03-11  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2010-03-04  Ulrich Drepper  <drepper@redhat.com>
+       * elf.h: Update from glibc.
+ 2010-02-17  Roland McGrath  <roland@redhat.com>
+       * elf_begin.c (file_read_elf): Leave section rawdata_base and
+       data_base pointers null when [sh_offset,sh_size) points outside
+       the mapped file.
+ 2010-02-15  Roland McGrath  <roland@redhat.com>
+       * Makefile.am: Use config/eu.am for common stuff.
+ 2010-01-07  Roland McGrath  <roland@redhat.com>
+       * elf32_getphdr.c: Use __elf_getphdrnum_rdlock.
+       * gelf_getphdr.c: Likewise.
+       * gelf_update_phdr.c: Likewise.
+       * elf32_updatefile.c (__elf32_updatemmap, __elf32_updatefile): Likewise.
+       * elf32_updatenull.c (__elf32_updatenull_wrlock): Likewise.
+       * elf32_newphdr.c: Clear section 0's sh_info when resetting e_phnum.
+       If COUNT is too large, use store PN_XNUM instead and set sh_info.
+       * elf_begin.c (file_read_elf): Always allocate space we can use later
+       for section 0 if doing RDWR.
+       * elf_getphdrnum.c: New file.
+       * Makefile.am (libelf_a_SOURCES): Add it.
+       * libelf.h: Declare elf_getphdrnum.
+       * libelfP.h: Declare __elf_getphdrnum_rdlock.
+       * libelf.map (ELFUTILS_1.6): New set, add elf_getphdrnum.
+       * elf.h: Update from glibc.
+ 2009-10-23  Lubomir Rintel  <lkundrak@v3.sk>
+       * elf32_updatefile.c (fill_mmap): When starting past shdr_end, start
+       filling from section start, not shdr_end.
+ 2009-11-10  Roland McGrath  <roland@redhat.com>
+       * elf_readall.c (__libelf_readall): Fetch file size if not yet known.
+ 2009-11-06  Mark Wielaard  <mjw@redhat.com>
+       * elf_next.c (elf_next): Mark the archive header as unusable when
+       there is no next ar element.
+ 2009-08-12  Mark Wielaard  <mjw@redhat.com>
+       * Makefile.am (libelf.so): Use -Wl,-z,defs not -defs.
+ 2009-07-26  Ulrich Drepper  <drepper@redhat.com>
+       * elf.h: Update from glibc.
+ 2009-07-21  Ulrich Drepper  <drepper@redhat.com>
+       * elf32_updatefile.c (__elfXX_updatemmap): Fix handling of gaps between
+       sections.  Patch by Lubomir Rintel <lkundrak@v3.sk>.
+ 2009-07-08  Roland McGrath  <roland@redhat.com>
+       * libelfP.h (struct Elf): Remove unused ar.has_index field.
+       Reorder various members for optimal packing.
+ 2009-07-08  Ulrich Drepper  <drepper@redhat.com>
+       * elf.h: Update from glibc.
+ 2009-06-13  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile.am (libelf_a_SOURCES): Replace elf_getshnum.c and
+       elf_getshstrndx.c with elf_getshdrnum.c and elf_getshdrstrndx.c.
+       * elf_getshnum.c: Renamed to...
+       * elf_getshdrnum.c: ...this.  Rename function and add old name as
+       alias.  Likewise for internal functions with derived names.
+       * elf_getshstrndx.c: Renamed to...
+       * elf_getshdrstrndx.c: ...this.  Rename function and add old name as
+       alias.  Likewise for internal functions with derived names.
+       * libelf.h: Add prototypes for new names.  Make old names as
+       deprecated.
+       * libelfP.h: Rename internal function prototypes.
+       * libelf.map: Export for names.
+       * elf32_checksum.c: Don't use deprecated functions.
+       * elf32_getshdr.c: Likewise.
+ 2009-06-01  Ulrich Drepper  <drepper@redhat.com>
+       * elf.h: Update from glibc.
+ 2009-04-14  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2009-04-01  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2009-02-10  Ulrich Drepper  <drepper@redhat.com>
+       * elf32_updatefile.c (updatefile): For the zeroth section we still
+       have to copy the section header.
+ 2009-02-01  Ulrich Drepper  <drepper@redhat.com>
+       * elf_strptr.c: Add comment re possible problem.
+ 2009-01-26  Ulrich Drepper  <drepper@redhat.com>
+       * elf32_updatenull.c (updatenull_wrlock): Fix comment of
+       ELF_F_LAYOUT behaviour re section header table.
+ 2009-01-22  Ulrich Drepper  <drepper@redhat.com>
+       * elf32_updatefile.c (__elfXX_updatemmap): Fill the gap between
+       sections even if only the section at the start of the gap has been
+       changed.
+       (__elfXX_updatefile): Likewise.
+ 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
+       * elf32_updatefile.c (__elfXX_updatemmap): Skip most of the loop to
+       handle sections for NOBITS sections.
+       (elfXX_updatefile): Likewise.
+       * elf32_updatefile.c (__elfXX_updatemmap): When skipping non-NOBITS
+       sections we haven't loaded, update last_position based on scn_start,
+       not based on old value.  Don't run the loop for the dummy section 0.
+       (elfXX_updatefile): Don't run the loop for the dummy section 0.
+ 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
+       * libelfP.h (_): We only have one translation domain, elfutils.
+       * Makefile.am: Use USE_LOCKS instead of USE_TLS.
+       * elf_error.c: Always use __thread.  Remove all !USE_TLS code.
+ 2009-01-04  Roland McGrath  <roland@redhat.com>
+       * note_xlate.h (elf_cvt_note): Don't examine a size too small to
+       container a note header.
+ 2008-12-11  Roland McGrath  <roland@redhat.com>
+       * elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Handle
+       placement offset going backwards, for out-of-order or overlapping
+       (bogus) sh_offset layouts.  It's a dumb use, but should not crash.
+       (__elfw2(LIBELFBITS,updatefile)): Likewise.
+       Fixes RHBZ#476136.
+       * libelf.h (Elf_Data): Whitespace fix.
+ 2008-12-10  Roland McGrath  <roland@redhat.com>
+       * elf_getarhdr.c (elf_getarhdr): Fix missing rename in last change.
+ 2008-10-22  Petr Machata  <pmachata@redhat.com>
+       * elf_rawfile.c (elf_rawfile): Lock around elf-> references.
+ 2008-10-21  Petr Machata  <pmachata@redhat.com>
+       * libelfP.h: Rename getehdr_rdlock to getehdr_wrlock.
+       * elf32_getehdr.c (getehdr_rdlock): Move the code to new function
+       getehdr_impl and make it a wrapper.  Rename to getehdr_wrlock.
+       (getehdr_impl): Guard elf->class init with wrlock.
+       (getehdr): Also make it a wrapper of getehdr_impl.
+       * elf32_updatenull.c (updatenull_wrlock): Call getehdr_wrlock.
+ 2008-10-20  Petr Machata  <pmachata@redhat.com>
+       * elf_getdata_rawchunk.c (elf_getdata_rawchunk): Lock around the
+       code that reads mutable elf state.  Relock to write lock to chain
+       the new chunk on the elf rawchunks list.
+ 2008-10-20  Petr Machata  <pmachata@redhat.com>
+       * elf32_checksum.c (checksum): Place a lock around the code that
+       processes data.  Make it wrlock if the code needs to xlate the
+       data before processing.
+ 2008-10-16  Petr Machata  <pmachata@redhat.com>
+       * elf_begin.c
+       (__libelf_next_arhdr): Rename to __libelf_next_arhdr_wrlock.
+       (dup_elf): Adjust the call.
+       (elf_begin): New local function lock_dup_elf.  Relocks the elf if
+       necessary before calling dup.  Call this instead of dup_elf.
+       * elf_getarhdr.c
+       (elf_getarhdr): Lock before calling __libelf_next_arhdr_wrlock.
+       * elf_next.c (elf_next): Likewise.
+       * elf_rand.c (elf_rand): Likewise.
+ 2008-10-14  Petr Machata  <pmachata@redhat.com>
+       * elf_getdata.c (__elf_getdata_rdlock): Lock before converting.
+ 2008-11-26  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2008-10-06  Roland McGrath  <roland@redhat.com>
+       * elf_getarhdr.c (elf_getarhdr): Return NULL when passed NULL.
+ 2008-08-27  Roland McGrath  <roland@redhat.com>
+       * elf_begin.c (get_shnum): Avoid misaligned reads for matching endian.
+       * libelfP.h [!ALLOW_UNALIGNED] (__libelf_type_align): Fix CLASS index.
+ 2008-08-25  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (libelf_so_LDLIBS): New variable.
+       (libelf.so): Use it in the link.
+ 2008-08-21  Petr Machata  <pmachata@redhat.com>
+       * elf_getdata.c, libelfP.h
+       (__elf_getdata_internal): Rename to __elf_getdata_rdlock.
+       (__libelf_set_rawdata_wrlock): New function.
+       (__libelf_set_rawdata): Make it a wrapper that calls *_wrlock.
+       * elf32_updatenull.c, libelfP.h
+       (__elfNN_updatenull): Rename to __elfNN_updatenull_wrlock.
+ 2008-08-21  Petr Machata  <pmachata@redhat.com>
+       * elf32_getphdr.c, libelfP.h
+       (__elfNN_getphdr_internal): Drop.  Move __elfNN_getphdr_internal
+       code to __elfNN_getphdr_wrlock.
+       (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): New functions.
+       (__elfNN_getphdr_rdlock, __elfNN_getphdr_wrlock): Make these
+       wrappers of getphdr_impl.
+ 2008-08-21  Petr Machata  <pmachata@redhat.com>
+       * elf32_getehdr.c, libelfP.h
+       (__elfNN_getehdr_internal): Rename to __elfNN_getehdr_rdlock.
+       * gelf_getehdr, libelfP.h:
+       (__gelf_getehdr_internal): Rename to __gelf_getehdr_rdlock.
+ 2008-08-21  Petr Machata  <pmachata@redhat.com>
+       * elf32_getshdr.c
+       (__elfNN_getshdr_internal): Drop.
+       (load_shdr_wrlock, scn_valid): New functions, contain bits of
+       behaviour from __elfNN_getshdr_internal.
+       (__elfNN_getshdr_rdlock, __elfNN_getshdr_wrlock): Replacements for
+       dropped _internal functions above.
+       * elf_getshnum.c
+       (__elf_getshnum_internal): Rename to __elf_getshnum_rdlock.
+ 2008-08-04  Petr Machata  <pmachata@redhat.com>
+       * libelfP.h (RWLOCK_RDLOCK, RWLOCK_WRLOCK, RWLOCK_UNLOCK): New macros.
+ 2008-07-28  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2008-03-31  Roland McGrath  <roland@redhat.com>
+       * elf32_offscn.c: Make sure shdrs have been read in.
+ 2008-02-19  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2008-02-08  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2008-01-31  Ulrich Drepper  <drepper@redhat.com>
+       * elf_strptr.c (elf_strptr): Don't fail if the ELF file is currently
+       under construction and no raw data can be read from disk.
+ 2008-01-30  Roland McGrath  <roland@redhat.com>
+       * elf.h: Update from glibc.
+ 2008-01-26  Roland McGrath  <roland@redhat.com>
+       * elf_begin.c (__libelf_next_arhdr): Rewrite conversions using a macro.
+       Fixes various pastos in wrong type in sizeof, wrong string parsed.
+ 2008-01-20  Roland McGrath  <roland@redhat.com>
+       * elf_getaroff.c: Calculate from start_offset, instead of using
+       parent's state.ar.offset field.
+ 2008-01-08  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (euinclude): Variable removed.
+       (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
+ 2008-01-03  Roland McGrath  <roland@redhat.com>
+       * common.h: Add __attribute__ ((unused)) to static functions.
+ 2007-12-20  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile.am (libelf_a_SOURCES): Add elf_scnshndx.
+       * libelfP.h (struct Elf_Scn): Add shndx_index field.
+       Declare __elf_scnshndx_internal.
+       * elf32_getshdr.c: Record location of extended section header.
+       * elf_begin.c (file_read_elf): Likewise.
+       * elf_scnshndx.c: New file.
+       * libelf.h: Declare elf_scnshndx.
+       * libelf.map: Add elf_scnshndx to version ELFUTILS_1.4.
+ 2007-11-12  Roland McGrath  <roland@redhat.com>
+       * libelf.h: Replace off64_t with loff_t throughout.
+       Only that type name is unconditionally defined by <sys/types.h>
 +2007-03-12  Roland McGrath  <roland@redhat.com>
 +
 +      * gelf_begin_embedded.c: New file.
 +      * Makefile.am (libelf_a_SOURCES): Add it.
 +      * libelf.map (ELFUTILS_1.3): Add gelf_begin_embedded.
 +      * gelf.h: Declare it.
 +
 +      * elf_begin.c (dup_elf): Renamed to ...
 +      (__libelf_dup_elf): ... here, made global.
 +      Take two new args with offset, size of image embedded in REF.
 +      (elf_begin): Update callers.
 +      * libelfP.h: Declare it.
 +
 +      * libelfP.h (struct Elf): Move ar.children member out of union.
 +      * elf_readall.c (set_address): Work on nonarchives with children.
 +      * common.h (libelf_acquire_all, libelf_release_all): Likewise.
 +      * elf_end.c (elf_end): Likewise, and handle non-archive parent.
 +
 +2007-03-09  Roland McGrath  <roland@redhat.com>
 +
 +      * gelf_getdata_memory.c: New file.
 +      * Makefile.am (libelf_a_SOURCES): Add them.
 +      * gelf.h: Declare those functions.
 +      * libelf.map (ELFUTILS_1.3): Add them.
 +
  2007-11-03  Roland McGrath  <roland@redhat.com>
  
        * libelf.h (Elf_Data): Comment fix.
index acd063e67be7ec2e7a44730752da89abee24378a,c7c83f35a43a8001be353759e8a22886258ec441..9c7e7762fa27e26fc7ca9929cb835db87f5618fa
@@@ -92,11 -79,10 +79,12 @@@ libelf_a_SOURCES = elf_version.c elf_ha
                   gelf_update_versym.c gelf_update_verneed.c \
                   gelf_update_vernaux.c gelf_update_verdef.c \
                   gelf_update_verdaux.c \
-                  elf_getshnum.c elf_getshstrndx.c \
+                  elf_getphdrnum.c elf_getshdrnum.c elf_getshdrstrndx.c \
                   gelf_checksum.c elf32_checksum.c elf64_checksum.c \
 +                 gelf_getdata_memory.c gelf_getdata_rawchunk.c \
                   libelf_crc32.c libelf_next_prime.c \
                   elf_clone.c \
++                 gelf_begin_embedded.c \
                   gelf_getlib.c gelf_update_lib.c \
                   elf32_offscn.c elf64_offscn.c gelf_offscn.c \
                   elf_getaroff.c \
diff --cc libelf/common.h
index af1fce54bdcbd35ab9b94c07a3da5011796b693f,8eef2a7a20c45f1a945b3941bf8b0bf46cc8ed63..f40c0079cc5221e6478a3393a2bce1a69db3e96a
@@@ -128,15 -135,19 +132,16 @@@ libelf_acquire_all (Elf *elf
  
  /* Release own lock and those of the children.  */
  static void
+ __attribute__ ((unused))
  libelf_release_all (Elf *elf)
  {
 -  if (elf->kind == ELF_K_AR)
 +  Elf *child = elf->children;
 +
 +  while (child != NULL)
      {
 -      Elf *child = elf->state.ar.children;
 -
 -      while (child != NULL)
 -      {
 -        if (child->ref_count != 0)
 -          libelf_release_all (child);
 -        child = child->next;
 -      }
 +      if (child->ref_count != 0)
 +      libelf_release_all (child);
 +      child = child->next;
      }
  
    rwlock_unlock (elf->lock);
index b6e7e74382943c4f3fb66878cbaaf3845ad0119e,e46add330988b23edb690030ae28eacc5fc3c4ed..80507e5d1b6e3ae8833bc0417e7ae1bbfd16c9dd
@@@ -977,20 -949,14 +951,20 @@@ __libelf_dup_elf (int fildes, Elf_Cmd c
        return ref;
      }
  
 -  /* This is an archive.  We must create a descriptor for the archive
 -     member the internal pointer of the archive file desriptor is
 -     pointing to.  First read the header of the next member if this
 -     has not happened already.  */
 -  if (ref->state.ar.elf_ar_hdr.ar_name == NULL
 -      && __libelf_next_arhdr_wrlock (ref) != 0)
 -    /* Something went wrong.  Maybe there is no member left.  */
 -    return NULL;
 +  if (ref->kind == ELF_K_AR)
 +    {
 +      /* This is an archive.  We must create a descriptor for the archive
 +       member the internal pointer of the archive file desriptor is
 +       pointing to.  First read the header of the next member if this
 +       has not happened already.  */
 +      if (ref->state.ar.elf_ar_hdr.ar_name == NULL
-         && __libelf_next_arhdr (ref) != 0)
++        && __libelf_next_arhdr_wrlock (ref) != 0)
 +      /* Something went wrong.  Maybe there is no member left.  */
 +      return NULL;
 +
 +      start_offset = ref->state.ar.offset + sizeof (struct ar_hdr);
 +      maximum_size = ref->state.ar.elf_ar_hdr.ar_size;
 +    }
  
    /* We have all the information we need about the next archive member.
       Now create a descriptor for it.  */
Simple merge
index ec149b43bdd732a7214eb9fb9767432cce5d8a22,de6d912a1aa1187e47196e8bf203728c5459a6ef..9ee91127c002b31f72a5f11a971ccfa8251eaac3
@@@ -122,7 -122,19 +122,25 @@@ ELFUTILS_1.3 
      gelf_getauxv;
      gelf_update_auxv;
      gelf_getnote;
- };
+ } ELFUTILS_1.2;
+ ELFUTILS_1.4 {
+   global:
+     elf_scnshndx;
+ } ELFUTILS_1.3;
+ ELFUTILS_1.5 {
+   global:
+     elf_getshdrnum; elf_getshdrstrndx;
+ } ELFUTILS_1.4;
+ ELFUTILS_1.6 {
+   global:
+     elf_getphdrnum;
+ } ELFUTILS_1.5;
++
++ELFUTILS_XXX {
 +    gelf_getdata_memory;
 +    gelf_getdata_rawchunk;
 +    gelf_begin_embedded;
++} ELFUTILS_1.5;
index 378d9c32c8419ecae1df2d9ca5765948c7d07ac2,2b8391bd5ee198df3ba55cde38bf5f96b02352a3..613a7d955e2650fe0e1a91377791874eedf78347
@@@ -300,16 -316,9 +316,12 @@@ struct El
    /* Reference counting for the descriptor.  */
    int ref_count;
  
 +  struct Elf *next;             /* Used in list of archive descriptors.  */
 +  struct Elf *children;       /* List of all descriptors pointing to this one. */
 +
+   /* Lock to handle multithreaded programs.  */
+   rwlock_define (,lock);
    union
    {
      struct
diff --cc tests/ChangeLog
index dc801f370b5ebdf7092146b61d6213acda8ac073,60b0847a973563d0280a4ff009fd199182d726c1..1a46dd8aca0020fd09573b8f476415d96240bb81
+ 2010-04-22  Roland McGrath  <roland@redhat.com>
+       * addrcfi.c (handle_cfi): Fix function name in error message.
+       Use dwarf_errmsg, not dwfl_errmsg, after dwarf_cfi_addrframe.
+ 2010-04-14  Roland McGrath  <roland@redhat.com>
+       * Makefile.am (EXTRA_DIST): Add run-test-flag-nobits.sh here too.
+ 2010-04-10  Ulrich Drepper  <drepper@redhat.com>
+       * msg_tst.c: Adjust expected error message.
+ 2010-04-01  Petr Machata  <pmachata@redhat.com>
+       * test-flag-nobits.c: New test.
+       * run-test-flag-nobits.sh: And its wrapper.
+       * Makefile.am (noinst_PROGRAMS, TESTS): Add them.
+       (test_flag_nobits_LDADD): New variable.
+ 2010-02-15  Roland McGrath  <roland@redhat.com>
+       * Makefile.am: Use config/eu.am for common stuff.
+       * asm-tst9.c (main): Rename local to avoid shadowing another local.
+ 2009-07-22  Roland McGrath  <roland@redhat.com>
+       * addrcfi.c: Update dwarf_frame_{cfa,register} calling convention.
+ 2009-07-08  Roland McGrath  <roland@redhat.com>
+       * addrcfi.c: New file.
+       * Makefile.am (noinst_PROGRAMS): Add it.
+       (addrcfi_LDADD): New variable.
+ 2009-05-07  Petr Machata  <pmachata@redhat.com>
+       * testfile51.bz2: New data file.
+       * dwarf-getmacros.c: New test core.
+       * run-dwarf-getmacros.sh: New test wrapper.
+       * Makefile.am (TESTS, EXTRA_DIST, noinst_PROGRAMS): Add them.
+       (dwarf_getmacros_LDADD): New variable.
+ 2009-04-23  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile [BUILD_STATIC] (libdw): Add $(zip_LIBS).
+       (rdwrmmap_LDADD): Add $(libmudflap).
+ 2009-04-21  Roland McGrath  <roland@redhat.com>
+       * testfile50.bz2: New data file.
+       * Makefile.am (EXTRA_DIST): Add it.
+       * run-dwfl-addr-sect.sh: Add a case using it.
+ 2008-12-31  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: Add tests for dppd, dpps, insertps, movntdqa,
+       mpsadbw, packusdw, pblendvb, pblendw, pcmpeqq, pcmpestri, pcmpestrm,
+       pcmpistri, pcmpistrm, pcmpgtq, phminposuw, pinsrb, pinsrd, pmaxsb,
+       pmaxsd, pmaxud, pmaxuw, pminsb, pminsd, pminud, pminuw, pmovsxbw,
+       pmovsxbd, pmovsxbq, pmovsxwd, pmovsxwq, pmovsxdq, pmovsxbw, pmovsxbd,
+       pmovsxbq, pmovsxwd, pmovsxwq, pmovsxdq, pmuldq, pmulld, popcnt, ptest,
+       roundss, roundps, roundpd, and roundsd.
+       * testfile45.S.bz2: Likewise.
+       * testfile44.expect.bz2: Adjust accordingly.
+       * testfile45.expect.bz2: Likewise.
+       * testfile44.S.bz2: Add tests for blendvpd and blendvps.
+       * testfile45.S.bz2: Likewise.
+       * testfile44.expect.bz2: Adjust accordingly.
+       * testfile45.expect.bz2: Likewise.
+ 2008-12-30  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: Add tests for blendpd and blendps.
+       * testfile45.S.bz2: Likewise.
+       * testfile44.expect.bz2: Adjust accordingly.
+       * testfile45.expect.bz2: Likewise.
+ 2008-12-19  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: Add tests for AMD 3DNOW.
+       * testfile45.S.bz2: Likewise.
+       * testfile44.expect.bz2: Adjust accordingly.
+       * testfile45.expect.bz2: Likewise.
+ 2008-11-26  Roland McGrath  <roland@redhat.com>
+       * dwfl-bug-getmodules.c: New file.
+       * Makefile.am (noinst_PROGRAMS): Add it.
+       (dwfl_bug_getmodules_LDADD): New variable.
+ 2008-09-10  Roland McGrath  <roland@redhat.com>
+       * test-subr.sh (LC_ALL): Export it set to "C".
+       * run-dwfl-addr-sect.sh: Don't do it here.
+       * run-strings-test.sh: Likewise.
+ 2008-08-21  Denys Vlasenko  <dvlasenk@redhat.com>
+       * run-addrname-test.sh: Add a new case.
+       * testfile49.bz2: New data file.
+       * Makefile.am (EXTRA_DIST): Add it.
+ 2008-04-10  Roland McGrath  <roland@redhat.com>
+       * testfile48.bz2, testfile48.bz2.debug: New data files.
+       * Makefile.am (EXTRA_DIST): Add them.
+       * run-strip-test8.sh: Use them.
+       * testfile16.bz2, testfile16.debug.bz2: Replace data files.
+       * run-strip-test.sh: Fail if stripped output has ".debug_*" sections.
+       * run-strip-test8.sh: New file.
+       * testfile47.bz2: New data file.
+       * Makefile.am (TESTS, EXTRA_DIST): Add them.
+ 2008-03-31  Roland McGrath  <roland@redhat.com>
+       * run-early-offscn.sh: New file.
+       * early-offscn.c: New file.
+       * Makefile.am (noinst_PROGRAMS, TESTS, EXTRA_DIST): Add them.
+       (early_offscn_LDADD): New variable.
+ 2008-03-19  Roland McGrath  <roland@redhat.com>
+       * run-addrname-test.sh: Add a new case.
+ 2008-02-22  Roland McGrath  <roland@redhat.com>
+       * run-elflint-test.sh: Typo fix.
+ 2008-02-21  Roland McGrath  <roland@redhat.com>
+       * run-disasm-x86.sh: Use uname instead of arch, keep tools required
+       for the build down to minimum.
+       * run-disasm-x86-64.sh: Likewise.
+ 2008-02-20  Roland McGrath  <roland@redhat.com>
+       * testfile46.bz2: New data file.
+       * Makefile.am (EXTRA_DIST): Add it.
+       * run-elflint-test.sh: Test on it.
+ 2008-02-01  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile.am: Hook up sha1-tst.c.
+       * sha1-tst.c: New file.
+ 2008-01-21  Roland McGrath  <roland@redhat.com>
+       * testfile45.S.bz2: Add tests for cltq, cqto.
+       * testfile45.expect.bz2: Adjust.
+ 2008-01-14  Ulrich Drepper  <drepper@redhat.com>
+       * testfile45.S.bz2: Add more tests.
+       * testfile45.expect.bz2: Adjust.
+ 2008-01-11  Ulrich Drepper  <drepper@redhat.com>
+       * testfile45.expect.bz2: Adjust for adding of address for %rip based
+       address mode.
+ 2008-01-10  Ulrich Drepper  <drepper@redhat.com>
+       * testfile45.S.bz2: Add more tests.
+       * testfile45.expect.bz2: Adjust.
+ 2008-01-08  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile.am (TESTS): Add run-disasm-x86-64.sh.
+       (EXTRA): Add testfile45.S.bz2, testfile45.expect.bz2,
+       run-disasm-x86-64.sh.
+       * run-disasm-x86-64.sh: New file.
+       * testfile45.S.bz2: New file.
+       * testfile45.expect.bz2: New file.
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2008-01-04  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2008-01-04  Roland McGrath  <roland@redhat.com>
+       * dwfl-bug-fd-leak.c (main): Add a cast.
+ 2008-01-03  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2008-01-01  Ulrich Drepper  <drepper@redhat.com>
+       * line2addr.c: Use %m modifier instead of %a to appease gcc.
+ 2008-01-01  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2007-12-31  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2007-12-30  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2007-12-29  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.s.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2007-12-28  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2007-12-27  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust.
+ 2007-12-26  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: New tests.
+       * testfile44.expect.bz2: Adjust
+ 2007-12-21  Ulrich Drepper  <drepper@redhat.com>
+       * testfile44.S.bz2: More tests.
+       * testfile44.expect.bz2: Adjust appropriately.
+ 2007-12-19  Ulrich Drepper  <drepper@redhat.com>
+       * Makefile.am (TESTS): Add run-disasm.sh.
+       (EXTRA_DIST): Add run-disasm.sh, testfile44.S.bz2, and
+       testfile44.expect.bz2.
+       * run-disasm.sh: New file.
+       * testfile44.S.bz2: New file.
+       * testfile44.expect.bz2: New file.
+ 2007-12-15  Roland McGrath  <roland@redhat.com>
+       * run-allregs.sh: Change expected output for powerpc spefscr.
 +2007-08-04  Roland McGrath  <roland@redhat.com>
 +
 +      * dwflmodtest.c (print_module_build_id): New function.
 +      (list_module, print_module): Call it.
 +
 +2007-05-03  Roland McGrath  <roland@redhat.com>
 +
 +      * coreregs.c (handle_core_file): Close FD.
 +
 +2007-04-08  Roland McGrath  <roland@redhat.com>
 +
 +      * coreregs.c: New file.
 +      * Makefile.am (noinst_PROGRAMS): Add it.
 +      (coreregs_LDADD): New variable.
 +
  2007-10-20  Roland McGrath  <roland@redhat.com>
  
        * run-dwfl-addr-sect.sh: Change expected output, no errors.
index 339b1b9797b00273916afa5e2a1374ec81269c9d,008008acc47287593ff235c7566405e86119dbe9..af8cd0a858243baebaba112caa4fc18fbfad684f
@@@ -59,8 -55,9 +55,10 @@@ noinst_PROGRAMS = arextract arsymtest n
                  show-abbrev hash newscn ecp dwflmodtest \
                  find-prologues funcretval allregs rdwrmmap \
                  dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
-                 dwfl-addr-sect dwfl-bug-report coreregs
- # get-ciefde
+                 dwfl-addr-sect dwfl-bug-report early-offscn \
+                 dwfl-bug-getmodules dwarf-getmacros addrcfi \
++                coreregs \
+                 test-flag-nobits
  asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
            asm-tst6 asm-tst7 asm-tst8 asm-tst9
  
@@@ -220,10 -227,12 +228,13 @@@ dwfl_bug_addr_overflow_LDADD = $(libdw
  arls_LDADD = $(libelf) $(libmudflap)
  dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
  dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+ dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
  dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
- CLEANFILES = xxx *.gcno *.gcda *gconv
+ sha1_tst_LDADD = $(libeu) $(libmudflap)
+ dwarf_getmacros_LDADD = $(libdw) $(libmudflap)
+ addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
 +coreregs_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
+ test_flag_nobits_LDADD = $(libelf) $(libmudflap)
  
  if GCOV
  check: check-am coverage