1 2009-08-27 Roland McGrath <roland@redhat.com>
3 * image-header.c: New file.
4 * Makefile.am (libdwfl_a_SOURCES): Add it.
5 * libdwflP.h: Declare __libdw_image_header.
6 * open.c (decompress): Don't consume ELF on failure.
7 (what_kind): New function, broken out of ...
8 (__libdw_open_file): ... here. Call it.
9 If it fails, try __libdw_image_header and then try what_kind again.
11 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
12 leave it behind for next decompressor.
13 * open.c (decompress): Free BUFFER on failure.
15 2009-08-26 Roland McGrath <roland@redhat.com>
17 * gzip.c (find_zImage_payload): New function, broken out of ...
18 (mapped_zImage): ... here. Call it.
19 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
20 stupid method of just trying the decoder.
22 * open.c [USE_LZMA]: Try __libdw_unlzma.
23 * libdwflP.h: Declare it.
24 (DWFL_ERRORS): Add DWFL_E_LZMA.
25 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
27 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
29 * gzip.c (mapped_zImage): Limit scan to 32kb.
30 Make this unconditional, support bzip2 kernel images too.
31 (unzip): Use direct inflate method for non-mmap case too.
32 Only zlib uses the stream method.
34 2009-08-09 Roland McGrath <roland@redhat.com>
36 * dwfl_module_build_id.c: Use new macros for versioned definitions.
38 2009-07-08 Roland McGrath <roland@redhat.com>
40 * dwfl_module_dwarf_cfi.c: New file.
41 * dwfl_module_eh_cfi.c: New file.
42 * Makefile.am (libdwfl_a_SOURCES): Add them.
43 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
44 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
46 2009-07-08 Roland McGrath <roland@redhat.com>
48 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
50 2009-06-18 Mark Wielaard <mjw@redhat.com>
52 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
54 2009-06-13 Ulrich Drepper <drepper@redhat.com>
56 * derelocate.c: Don't use deprecated libelf functions.
57 * dwfl_module_getdwarf.c: Likewise.
58 * relocate.c: Likewise.
60 2009-04-23 Ulrich Drepper <drepper@redhat.com>
62 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
63 defined. Otherwise just define the latest version.
65 2009-04-22 Roland McGrath <roland@redhat.com>
67 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
70 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
71 adjust properly for non-ET_REL.
73 2009-04-21 Roland McGrath <roland@redhat.com>
75 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
77 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
78 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
80 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
82 2009-04-20 Roland McGrath <roland@redhat.com>
84 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
86 2009-04-19 Roland McGrath <roland@redhat.com>
88 * dwfl_module_getdwarf.c (find_file): Renamed to ...
89 (__libdwfl_getelf): ... this. Make it global.
90 (find_symtab, find_dw): Update callers.
91 (dwfl_module_getelf): Functions moved ...
92 * dwfl_module_getelf.c: ... here, new file.
93 * Makefile.am (libdwfl_a_SOURCES): Add it.
94 * libdwflP.h: Declare __libdwfl_getelf.
96 2009-04-14 Roland McGrath <roland@redhat.com>
98 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
99 absolute (already adjusted in place) or needing load bias adjustment.
101 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
102 gelf_getphdr failure. Fix file size limit checks.
104 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
106 2009-04-08 Roland McGrath <roland@redhat.com>
108 * dwfl_module_getsym.c: Don't adjust for bias again after
109 __libdwfl_relocate_value.
111 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
112 a non-SHF_ALLOC section.
113 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
114 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
116 2009-03-09 Roland McGrath <roland@redhat.com>
118 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
119 variable to outer scope, so we cache it for the loop.
121 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
123 2009-02-12 Roland McGrath <roland@redhat.com>
125 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
126 __libdwfl_relocate_value to find correct sh_addr value.
128 2009-02-10 Roland McGrath <roland@redhat.com>
130 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
131 If false, don't fail for NO_PHDR.
132 (dwfl_report_elf): Update caller.
133 * libdwflP.h: Update decl.
134 * offline.c (process_elf): Call it with false, so we don't refuse
135 dubiously-formed objects here.
137 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
138 finds our module. We shouldn't crash when we confuse some guesses.
140 2009-02-10 Ulrich Drepper <drepper@redhat.com>
142 * open.c (decompress): Avoid crash with empty input file.
144 2009-01-27 Roland McGrath <roland@redhat.com>
146 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
147 with zero vaddr and memsz.
149 2009-01-22 Roland McGrath <roland@redhat.com>
151 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
153 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
154 after address-matching loop.
156 * segment.c (lookup): Fix fencepost in checking for HINT match.
158 2009-01-14 Roland McGrath <roland@redhat.com>
160 * gzip.c [!BZLIB] (mapped_zImage): New function.
161 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
163 2009-01-10 Ulrich Drepper <drepper@redhat.com>
165 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
167 2009-01-08 Roland McGrath <roland@redhat.com>
169 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
170 Skip subdirectory named "source".
171 (dwfl_linux_kernel_find_elf): Likewise.
173 2009-01-06 Roland McGrath <roland@redhat.com>
175 * linux-kernel-modules.c (check_suffix): New function.
176 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
177 (dwfl_linux_kernel_report_offline): Use it.
178 (dwfl_linux_kernel_find_elf): Likewise.
180 2009-01-05 Roland McGrath <roland@redhat.com>
182 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
183 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
184 * dwfl_build_id_find_elf.c: Likewise.
185 * dwfl_module_getdwarf.c (open_elf): Likewise.
186 * dwfl_report_elf.c: Likewise.
187 * find-debuginfo.c (validate): Likewise.
188 * offline.c (__libdwfl_report_offline): Likewise.
190 * libdwflP.h: Declare __libdw_open_file.
192 * Makefile.am (libdwfl_a_SOURCES): Add it.
195 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
197 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
198 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
200 2008-12-16 Roland McGrath <roland@redhat.com>
202 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
203 symver magic to bind to ELFUTILS_0.138.
204 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
205 wrapper for ELFUTILS_0.130 version set.
207 2008-12-18 Roland McGrath <roland@redhat.com>
209 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
210 addresses are taken as relative to MOD->low_addr.
212 2008-12-15 Roland McGrath <roland@redhat.com>
214 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
217 2008-12-11 Roland McGrath <roland@redhat.com>
219 * offline.c (process_archive): Don't call elf_end and close if
220 returning NULL. Check first elf_begin call and set error code
221 specially for empty archive.
224 2008-12-02 Roland McGrath <roland@redhat.com>
226 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
228 2008-11-26 Roland McGrath <roland@redhat.com>
230 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
231 return value, and interpret encoded OFFSET argument.
233 2008-10-07 Roland McGrath <roland@redhat.com>
235 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
237 2008-09-29 Roland McGrath <roland@redhat.com>
239 * segment.c (insert): Must realloc DWFL->lookup_module here too.
240 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
242 2008-08-28 Roland McGrath <roland@redhat.com>
244 * segment.c (reify_segments): Fix last change.
246 2008-08-27 Roland McGrath <roland@redhat.com>
248 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
249 failure from pread64.
251 2008-08-26 Roland McGrath <roland@redhat.com>
253 * segment.c (reify_segments): Insert a trailing segment for a module
254 end that is above the highest current segment.
256 2008-08-25 Roland McGrath <roland@redhat.com>
258 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
259 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
260 if FILE->elf is not ELF_K_ELF.
262 * dwfl_segment_report_module.c: Add a cast.
264 2008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
266 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
267 which decides which symbol is "closest" to a given address.
269 2008-08-15 Roland McGrath <roland@redhat.com>
271 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
272 (options, parse_opt): Handle --core.
274 * core-file.c: New file.
275 * Makefile.am (libdwfl_a_SOURCES): Add it.
276 * libdwflP.h (dwfl_core_file_report): Declare it.
278 * link_map.c: New file.
279 * Makefile.am (libdwfl_a_SOURCES): Add it.
280 * libdwflP.h (dwfl_link_map_report): Declare it.
282 * libdwflP.h (MIN, MAX): New macros.
283 (Dwfl_Memory_Callback): New typedef.
284 (Dwfl_Module_Callback): New typedef.
285 (dwfl_segment_report_module): Declare it.
286 * dwfl_segment_report_module.c: New file.
287 * Makefile.am (libdwfl_a_SOURCES): Add it.
289 * derelocate.c (dwfl_module_address_section): Add INTDEF.
290 * libdwflP.h: Add INTDECL.
292 * segment.c: New file.
293 * Makefile.am (libdwfl_a_SOURCES): Add it.
294 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
295 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
296 lookup_addr, lookup_module, lookup_segndx, replace removed members
298 (struct Dwfl_Module): New member segment.
299 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
301 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
302 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
303 (dwfl_report_module): Don't touch DWFL->nmodules.
304 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
305 (compare_modules): Function removed.
306 * dwfl_getmodules.c: Rewritten.
308 * libdwflP.h: Add INTDECLs.
309 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
310 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
312 2008-08-03 Roland McGrath <roland@redhat.com>
314 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
316 2008-07-17 Roland McGrath <roland@redhat.com>
318 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
319 zero if the failure was only ENOENT.
321 2008-06-03 Roland McGrath <roland@redhat.com>
323 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
326 2008-05-22 Petr Machata <pmachata@redhat.com>
328 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
330 2008-05-06 Roland McGrath <roland@frob.com>
332 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
333 FTS_LOGICAL here too.
334 (dwfl_linux_kernel_find_elf): Likewise.
336 2008-04-29 Roland McGrath <roland@redhat.com>
338 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
339 based on canonicalize_file_name if it differs from the supplied name.
341 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
344 2008-04-27 Roland McGrath <roland@redhat.com>
346 * linux-kernel-modules.c (report_kernel): Fix crash when
347 dwfl_report_elf fails.
349 2008-04-05 Roland McGrath <roland@redhat.com>
351 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
353 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
354 Clear it after freeing.
355 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
357 2008-03-26 Roland McGrath <roland@redhat.com>
359 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
360 SHT_DYNSYM, just set *SYMSCN like the comment says.
362 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
364 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
366 2008-03-19 Roland McGrath <roland@redhat.com>
368 * dwfl_module_getsrc.c: Adjust address for module bias before search.
370 2008-03-01 Roland McGrath <roland@redhat.com>
372 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
373 prototype to avoid older compiler's complaint about reuse of the name.
374 (__libdwfl_canon_error): Likewise.
376 2008-02-19 Roland McGrath <roland@redhat.com>
378 * relocate.c (relocate_section): Check for an unhandled relocation
379 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
380 DWFL_E_UNKNOWN_MACHINE check out of loops.
382 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
383 DEBUGFILE->relocated is already set.
385 2008-01-26 Roland McGrath <roland@redhat.com>
387 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
389 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
390 incoming *FILE_NAME at the start.
392 2008-01-08 Roland McGrath <roland@redhat.com>
394 * Makefile.am (euinclude): Variable removed.
395 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
397 2007-10-23 Roland McGrath <roland@redhat.com>
399 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
400 module to appear first.
402 2007-10-20 Roland McGrath <roland@redhat.com>
404 * offline.c (process_archive_member): Take FD argument, pass it down
405 to process_file. Return Elf_Cmd, not bool.
406 Call elf_next here, always before elf_end.
407 (process_archive): Update caller. Don't close FD here unless there
410 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
412 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
413 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
414 partial relocation to one or both files.
415 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
416 relocations have been applied to the debug file if dwfl_module_getelf
417 has been used before.
419 * relocate.c (resolve_symbol): New function.
420 (relocate_section): Call it.
422 * relocate.c (relocate_getsym): Handle null MOD->symfile.
423 (relocate_section): Take new bool arg, PARTIAL. If true,
424 no error for BADRELTYPE/RELUNDEF, instead just skip them
425 and leave only those skipped relocs behind the reloc section.
426 (__libdwfl_relocate_section): Take new arg, pass it down.
427 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
428 do partial relocation on all sections.
429 * dwfl_module_getdwarf.c (load_dw): Update caller.
430 * libdwflP.h: Update decls.
431 * derelocate.c (dwfl_module_address_section): Pass new argument
432 to __libdwfl_relocate_section, true.
434 * derelocate.c (cache_sections): Don't cache reloc sections when
435 section_address callback is null.
437 2007-10-19 Roland McGrath <roland@redhat.com>
439 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
441 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
442 (struct secref): Likewise.
443 (cache_sections): Cache the relocation section referring to each
444 section we cache, if any.
445 (dwfl_module_address_section): Use __libdwfl_relocate_section as
448 * relocate.c (struct reloc_symtab_cache): New type.
449 (relocate_getsym): Use it instead of four arguments.
450 (__libdwfl_relocate): Update caller.
451 (relocate_section): New function, broken out of ...
452 (__libdwfl_relocate): ... here.
453 (__libdwfl_relocate_section): New function.
454 * libdwflP.h: Declare it.
456 2007-10-17 Roland McGrath <roland@redhat.com>
458 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
459 to relocated st_value.
461 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
464 2007-10-16 Roland McGrath <roland@redhat.com>
466 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
467 section has larger alignment requirements not met by the original BASE,
468 rather than padding more between sections.
470 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
472 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
475 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
476 at zero in ET_REL case. Adjust BASE to necessary alignment.
478 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
480 (__libdwfl_find_build_id): Update caller.
482 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
483 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
484 * offline.c (dwfl_offline_section_address): Bail early if there is
487 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
489 2007-10-09 Roland McGrath <roland@redhat.com>
491 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
492 caching SHDR->sh_addr = 0.
493 * offline.c (dwfl_offline_section_address): Never called for sh_addr
494 really at 0, don't check for it. Use MOD->debug directly, not symfile.
496 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
497 we've found SHT_SYMTAB.
499 * relocate.c (relocate_getsym): New function.
500 (__libdwfl_relocate): Use it.
501 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
502 be a pointer instead of value; cache getshstrndx result there.
503 * libdwflP.h: Update decl.
504 * derelocate.c (cache_sections): Update caller.
505 Always work on the main file, not the symfile.
506 (dwfl_module_address_section): Likewise.
507 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
509 2007-10-07 Roland McGrath <roland@redhat.com>
511 * offline.c (process_archive): Initialize MOD.
513 * linux-kernel-modules.c (get_release): New function, broken out of ...
514 (report_kernel): ... here. Call it.
515 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
516 (find_kernel_elf): Update caller.
517 (report_kernel_archive): New function.
518 (dwfl_linux_kernel_report_offline): Call it.
520 * offline.c (process_file): Take new arg PREDICATE, pass it down.
521 (process_archive): Likewise.
522 (process_archive_member): Likewise. When nonnull, let the predicate
523 decide whether to use this member.
524 (__libdwfl_report_offline): New function, broken out of ...
525 (dwfl_report_offline): ... here. Call it.
526 * libdwflP.h: Declare it.
528 * offline.c (process_archive, process_archive_member): New functions.
529 (process_elf, process_file): New functions, broken out of ...
530 (dwfl_report_offline): ... here. Call process_file, which recurses on
533 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
534 (dwfl_report_elf): ... here. Call it.
535 * libdwflP.h: Declare it.
537 2007-10-06 Roland McGrath <roland@redhat.com>
539 * derelocate.c (dwfl_module_relocations): Don't call
540 dwfl_module_getdwarf.
542 * derelocate.c (find_section): Use __libdwfl_seterrno, not
545 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
546 SHF_ALLOC, to cache sh_addr resolved to 0.
548 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
549 values nonzero already, just use its existing layout.
551 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
552 in-core shdr after applying it.
554 2007-10-04 Ulrich Drepper <drepper@redhat.com>
556 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
557 initialization of notes variable.
559 2007-10-04 Roland McGrath <roland@redhat.com>
561 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
562 fill in with vaddr of "__start_notes" symbol if found.
563 (check_notes): New function.
564 (check_kernel_notes): New function.
565 (dwfl_linux_kernel_report_kernel): Call it.
566 (check_module_notes): New function.
567 (dwfl_linux_kernel_report_modules): Call it.
569 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
570 Try dwfl_build_id_find_elf first.
572 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
573 Set kernel module e_type to ET_DYN.
575 2007-10-03 Roland McGrath <roland@redhat.com>
577 * find-debuginfo.c (validate): New function, broken out of ...
578 (find_debuginfo_in_path): ... here. New function, broken out of ...
579 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
580 dwfl_build_id_find_debuginfo first.
582 * dwfl_build_id_find_elf.c: New file.
583 * dwfl_build_id_find_debuginfo.c: New file.
584 * Makefile.am (libdwfl_a_SOURCES): Add them.
585 * libdwfl.h: Declare them.
586 * libdwflP.h: Add INTDECLs.
588 * dwfl_module_build_id.c: New file.
589 * dwfl_module_report_build_id.c: New file.
590 * Makefile.am (libdwfl_a_SOURCES): Add them.
591 * libdwfl.h: Declare them.
592 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
593 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
594 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
596 * dwfl_module_getdwarf.c (find_offsets): New function.
597 (find_dynsym): New function, calls that.
598 (find_symtab): Call it.
600 2007-09-11 Roland McGrath <roland@redhat.com>
602 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
603 address if its st_size is smaller.
605 2007-08-13 Roland McGrath <roland@redhat.com>
607 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
609 2007-08-12 Roland McGrath <roland@redhat.com>
611 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
614 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
615 a second phdr if it happens to match EHDR_VMA exactly.
617 2007-08-08 Roland McGrath <roland@redhat.com>
619 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
620 those with no names. Rewrite best symbol algorithm not to assume a
621 sorted table and to be smarter handling sizeless symbols.
623 2007-07-16 Roland McGrath <roland@redhat.com>
625 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
626 reviving an existing module.
628 2007-06-08 Roland McGrath <roland@redhat.com>
630 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
632 2007-05-17 Roland McGrath <roland@redhat.com>
634 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
635 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
636 (dwfl_linux_kernel_find_elf): Likewise.
638 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
639 getline and sscanf instead of fscanf.
641 2007-05-08 Roland McGrath <roland@redhat.com>
643 * offline.c (dwfl_offline_section_address): Don't assume section
644 numbers match between stripped and debuginfo files. Instead, assume
645 only that the ordering among SHF_ALLOC sections matches.
647 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
649 (dwfl_linux_kernel_report_offline): Update caller.
650 (dwfl_linux_kernel_report_kernel): Likewise.
652 2007-04-23 Roland McGrath <roland@redhat.com>
654 * argp-std.c (options): Fix group title string.
656 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
657 Update via STATE->input every time we set STATE->hook, not only at
660 * dwfl_module.c (free_file): Free FILE->name.
662 2007-04-16 Roland McGrath <roland@redhat.com>
664 * derelocate.c (cache_sections): Apply bias to sh_addr.
665 (compare_secrefs): Fix address comparison to avoid signed overflow.
666 (find_section): New function, broken out of ...
667 (dwfl_module_relocate_address): ... here, call it.
668 (check_module): New function, broken out of ...
669 (dwfl_module_relocate_address): ... here, call it.
670 (dwfl_module_address_section): New function.
671 * libdwfl.h: Declare it.
673 2007-03-26 Roland McGrath <roland@redhat.com>
675 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
677 2007-03-18 Roland McGrath <roland@redhat.com>
679 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
680 (find_debuginfo): ... here. Call it.
681 Don't return error for libelf errors finding .gnu_debuglink section.
683 2007-03-12 Roland McGrath <roland@redhat.com>
685 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
686 (dwfl_report_begin): ... here. Call it.
687 * libdwfl.h: Declare it.
688 * libdwflP.h: Add INTDECL.
690 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
692 * offline.c: Comment typo fix.
694 2007-03-04 Roland McGrath <roland@redhat.com>
696 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
697 (find_kernel_elf): New function, broken out of ...
698 (report_kernel): ... here. Call it.
699 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
700 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
701 virtual address bounds of kernel from symbols rounded to page size.
702 (dwfl_linux_kernel_report_kernel): Use that if it works, before
703 resorting to report_kernel.
705 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
706 ET_EXEC file with nonzero bias.
708 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
709 dwfl_module_addrsym. Guts moved to ...
710 * dwfl_module_addrsym.c: ... here; new file.
711 * Makefile.am (libdwfl_a_SOURCES): Add it.
712 * libdwfl.h: Declare dwfl_module_addrsym.
713 * libdwflP.h: Add INTDECL.
715 2007-03-03 Roland McGrath <roland@redhat.com>
717 * dwfl_module.c (free_file): New function, broken out of ...
718 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
720 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
723 2007-03-02 Roland McGrath <roland@redhat.com>
725 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
727 2007-02-02 Roland McGrath <roland@redhat.com>
729 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
730 address exactly if it's no other module's low boundary.
732 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
733 and size cover the address, select the closest symbol with st_size==0
734 that lies in the same section.
736 2007-01-29 Roland McGrath <roland@redhat.com>
738 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
741 2007-01-20 Roland McGrath <roland@redhat.com>
743 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
745 * libdwfl.h (Dwfl_Callbacks): Update comment.
746 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
747 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
748 For ignored missing section, use -1 instead of 0.
749 * offline.c (dwfl_offline_section_address): Expect a call for 0.
751 2007-01-19 Roland McGrath <roland@redhat.com>
753 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
754 zero so a lone -e foo.so is shown without address bias.
756 2007-01-10 Roland McGrath <roland@redhat.com>
758 * linux-kernel-modules.c (report_kernel): Check asprintf return value
759 directly instead of via side effect, to silence warn_unused_result.
760 (dwfl_linux_kernel_report_offline): Likewise.
761 (dwfl_linux_kernel_find_elf): Likewise.
762 (dwfl_linux_kernel_module_section_address): Likewise.
763 * find-debuginfo.c (try_open): Likewise.
764 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
765 (dwfl_linux_proc_report): Likewise.
767 * libdwfl.h (dwfl_begin): Require nonnull argument.
769 2006-12-27 Roland McGrath <roland@redhat.com>
771 * dwfl_module.c (compare_modules): Fix address comparison to avoid
772 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
774 2006-10-30 Roland McGrath <roland@redhat.com>
776 * dwfl_module.c (dwfl_report_module): Comment typo fix.
778 2006-09-05 Roland McGrath <roland@redhat.com>
780 * derelocate.c (cache_sections): Use alloca instead of variable-sized
781 auto array, in function already using alloca.
783 2006-08-14 Roland McGrath <roland@redhat.com>
785 * linux-kernel-modules.c (try_kernel_name): If the call to
786 dwfl_standard_find_debuginfo produces no results, try it again
787 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
789 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
790 * libdwflP.h: ... to here.
791 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
792 repeats the first thing dwfl_standard_find_debuginfo will try.
794 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
795 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
796 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
799 2006-07-12 Ulrich Drepper <drepper@redhat.com>
801 * cu.c: Adjust for internal_function_def removal.
802 * dwfl_error.c: Likewise.
803 * dwfl_module.c: Likewise.
804 * dwfl_module_getdwarf.c: Likewise.
806 * relocate.c: Likewise.
808 2006-07-11 Ulrich Drepper <drepper@redhat.com>
810 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
811 it can overflow the return value type.
812 Patch by Tim Moore <timoore@redhat.com>.
814 2006-06-28 Roland McGrath <roland@redhat.com>
816 * libdwfl.h: Cosmetic changes.
818 * dwfl_line_comp_dir.c: New file.
819 * Makefile.am (libdwfl_a_SOURCES): Add it.
820 * libdwfl.h: Declare dwfl_line_comp_dir.
822 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
824 * dwfl_linecu.c: New file.
825 * Makefile.am (libdwfl_a_SOURCES): Add it.
826 * libdwfl.h: Declare dwfl_linecu.
828 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
829 (dwfl_linecu): Define as macro.
831 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
833 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
834 (dwfl_module_addrname): Function moved ...
835 * dwfl_module_addrname.c: ... here, new file.
836 * dwfl_module_getsym.c: New file.
837 * Makefile.am (libdwfl_a_SOURCES): Add them.
838 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
839 * libdwflP.h: Add INTDECLs.
841 2006-06-27 Roland McGrath <roland@redhat.com>
843 * dwfl_module.c (dwfl_report_end): Whitespace fix.
845 2006-06-13 Roland McGrath <roland@redhat.com>
847 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
848 Use __libdwfl_seterrno for elf_memory failure.
850 2006-05-22 Roland McGrath <roland@redhat.com>
852 * dwfl_module_return_value_location.c
853 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
855 2006-05-27 Ulrich Drepper <drepper@redhat.com>
857 * libdwfl.h: Add extern "C".
859 2006-05-22 Ulrich Drepper <drepper@redhat.com>
861 * cu.c (addrarange): Handle files without aranges information.
863 2006-05-16 Ulrich Drepper <drepper@redhat.com>
865 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
868 2006-02-26 Roland McGrath <roland@redhat.com>
870 * dwfl_version.c: New file.
871 * Makefile.am (libdwfl_a_SOURCES): Add it.
872 * libdwfl.h: Declare dwfl_version.
874 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
875 aligned up from DWFL->offline_next_address when checking for overlap.
877 2005-12-22 Roland McGrath <roland@redhat.com>
879 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
881 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
882 (dwfl_linux_proc_report): ... here. Call it.
883 (dwfl_linux_proc_maps_report): New function.
884 * libdwfl.h: Declare it.
885 * libdwflP.h: Add INTDECL.
886 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
888 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
889 failed with DWFL_E_NO_DWARF.
891 2005-11-26 Roland McGrath <roland@redhat.com>
893 * dwfl_end.c (dwfl_end): Free the DWFL itself.
895 2005-11-25 Roland McGrath <roland@redhat.com>
897 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
899 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
900 * libdwflP.h: Declare it.
902 * dwfl_module_register_names.c: New file.
903 * Makefile.am (libdwfl_a_SOURCES): Add it.
904 * libdwfl.h: Declare dwfl_module_register_names.
906 2005-11-21 Roland McGrath <roland@redhat.com>
908 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
909 Don't leak malloc'd file name.
910 If a /sys/.../sections file is missing and starts with ".init",
911 try the variant with "_init" too; catches PPC64 kernel braindamage.
913 2005-11-15 Roland McGrath <roland@redhat.com>
915 * libdwfl.h: Comment fixes.
917 * dwfl_module_return_value_location.c: Add unlikely for error case.
919 2005-11-13 Roland McGrath <roland@redhat.com>
921 * dwfl_return_value_location.c: New file.
922 * Makefile.am (libdwfl_a_SOURCES): Add it.
923 * libdwfl.h: Declare dwfl_module_return_value_location.
924 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
926 2005-10-20 Roland McGrath <roland@redhat.com>
928 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
929 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
930 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
932 2005-10-01 Roland McGrath <roland@redhat.com>
934 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
937 2005-09-19 Roland McGrath <roland@redhat.com>
939 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
940 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
941 the signed integer reading; they will just have to be in hexadecimal.
942 (dwfl_linux_kernel_module_section_address): Likewise.
944 2005-08-28 Ulrich Drepper <drepper@redhat.com>
946 * Makefile.am (%.os): Use COMPILE.os.
947 (COMPILE.os): Filter out gconv options.
949 2005-08-25 Roland McGrath <roland@redhat.com>
951 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
952 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
954 2005-08-24 Roland McGrath <roland@redhat.com>
956 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
958 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
959 magic initializer to set -heur-stack-bound option.
961 2005-08-22 Roland McGrath <roland@redhat.com>
963 * dwfl_validate_address.c: New file.
964 * Makefile.am (libdwfl_a_SOURCES): Add it.
965 * libdwfl.h: Declare dwfl_validate_address.
967 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
968 * libdwflP.h: Add INTDECL.
970 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
971 elf_rawdata for symbol-related sections.
973 * offline.c (dwfl_report_offline): Move offline_next_address outside
974 module's range, in case it's an ET_EXEC using fixed segment locations.
975 * libdwfl.h: Update comment.
977 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
980 2005-08-20 Roland McGrath <roland@redhat.com>
982 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
983 function to choose whether to report.
984 (dwfl_linux_kernel_report_offline): Likewise.
985 * libdwfl.h: Update decl.
986 * argp-std.c (parse_opt): Update caller.
988 * dwfl_getsrclines.c: New file.
989 * dwfl_onesrcline.c: New file.
990 * Makefile.am (libdwfl_a_SOURCES): Add them.
991 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
993 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
994 MODULESDIR[0]. Call fts_close on failure.
996 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
997 Close ET_REL file descriptors after relocation.
998 (find_dw): Update caller.
999 * offline.c (dwfl_report_offline): Get the file into memory and close
1000 the file descriptor.
1002 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1003 MOD->debug.elf is already set.
1005 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1006 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1008 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1009 dwfl_linux_kernel_report_offline with offline_callbacks.
1011 * linux-kernel-modules.c (report_kernel): New function, broken out of
1013 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1014 (dwfl_linux_kernel_report_offline): New function.
1015 * libdwfl.h: Declare it.
1016 * libdwflP.h: Add INTDECL.
1018 2005-08-19 Roland McGrath <roland@redhat.com>
1020 Use standard debuginfo search path to look for vmlinux.
1021 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1023 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1025 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1027 * argp-std.c (offline_callbacks): New variable.
1028 (parse_opt): Use it for -e. Allow multiple -e options.
1030 * offline.c: New file.
1031 * Makefile.am (libdwfl_a_SOURCES): Add it.
1032 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
1033 * libdwflP.h: Add INTDECLs.
1034 (OFFLINE_REDZONE): New macro.
1035 (struct Dwfl): New member `offline_next_address'.
1036 * dwfl_begin.c (dwfl_begin): Initialize it.
1037 * dwfl_module.c (dwfl_report_begin): Likewise.
1039 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
1040 do a nominal absolute section layout starting at BASE.
1041 * libdwfl.h: Update comment.
1043 2005-08-18 Roland McGrath <roland@redhat.com>
1045 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
1046 dwfl_module_getdwarf if necessary.
1048 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
1049 * libdwfl.h: Update comment.
1051 * derelocate.c: New file.
1052 * Makefile.am (libdwfl_a_SOURCES): Add it.
1054 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
1055 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
1056 * dwfl_module_getdwarf.c (open_elf): Update initialization.
1057 (load_dw, dwfl_module_addrname): Update uses.
1058 * relocate.c (__libdwfl_relocate): Likewise.
1060 2005-08-04 Roland McGrath <roland@redhat.com>
1062 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
1063 arguments SHNDX, SHDR.
1064 (dwfl_linux_kernel_module_section_address): Update prototype.
1065 * relocate.c (__libdwfl_relocate_value): Update caller.
1066 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1067 Take the new arguments.
1069 2005-08-10 Roland McGrath <roland@redhat.com>
1071 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
1072 use it instead of MOD->debug.file.
1073 * libdwflP.h: Update decl.
1074 * dwfl_module_getdwarf.c (load_dw): Update caller.
1077 2005-08-09 Roland McGrath <roland@redhat.com>
1079 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
1080 * cu.c: Use INTUSE on dwarf_* calls.
1081 * dwfl_error.c: Likewise.
1082 * dwfl_module.c: Likewise.
1083 * dwfl_module_getdwarf.c: Likewise.
1084 * dwfl_module_getsrc_file.c: Likewise.
1085 * lines.c: Likewise.
1087 2005-08-07 Roland McGrath <roland@redhat.com>
1089 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
1090 names contain '_' or '-', look for files named either "foo-bar.ko"
1093 2005-07-29 Roland McGrath <roland@redhat.com>
1095 * loc2c.c: File removed.
1096 * loc2c.h: File removed.
1097 * loc2c-runtime.h: File removed.
1098 * test2.c: File removed.
1099 * Makefile.am (EXTRA_DIST): Variable removed.
1100 (noinst_HEADERS): Remove loc2c.h from here.
1102 2005-07-28 Ulrich Drepper <drepper@redhat.com>
1104 * libdwfl.h: Add a few missing extern for function prototypes.
1106 * libdwfl_crc32.c: New file.
1107 * libdwfl_crc32_file.c: New file.
1108 * libdwflP.h: Declare the new functions.
1109 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
1110 libdwfl_crc32_file.c.
1111 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
1112 instead of crc32_file.
1114 2005-07-28 Roland McGrath <roland@redhat.com>
1116 * ptest.c: Moved to ../tests/dwflmodtest.c.
1118 * Makefile.am (noinst_PROGRAMS): Variable removed.
1119 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
1120 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
1121 (libdwfl): Don't use libdwfl.so any more.
1122 (libdwfl.so, install, uninstall): Targets removed.
1123 (test2_SOURCES): Define EXTRA_DIST instead of this.
1124 * libdwfl.map: File removed.
1126 * libdwfl.h: Use "" for libdw.h #include.
1128 2005-07-27 Roland McGrath <roland@redhat.com>
1130 * libdwfl.map: Add dwfl_getmodules.
1132 2005-07-23 Ulrich Drepper <drepper@redhat.com>
1134 * Makefile.am: Fix rules to allow building with mudflap.
1136 2005-07-21 Roland McGrath <roland@redhat.com>
1138 * Makefile.am (noinst_HEADERS): Add loc2c.c.
1140 * test2.c (main): Check sscanf result to quiet warning.
1142 2005-07-20 Roland McGrath <roland@redhat.com>
1144 * libdwfl-branch merged, creating this direcotry.