1 2011-12-02 Roland McGrath <roland@hack.frob.com>
3 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
4 to use elf64_xlatetom and PHDRS.p64.
5 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
7 2011-11-31 Mark Wielaard <mjw@redhat.com>
9 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
10 global symbols. Then only when that doesn't provide a match search
11 all local symbols too.
12 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
14 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
15 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
17 2011-11-31 Mark Wielaard <mjw@redhat.com>
19 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
20 sizeless_sym if needed and closer to desired addr.
22 2011-10-20 Mark Wielaard <mjw@redhat.com>
24 * derelocate.c (cache_sections): Intern mod->reloc_info check.
25 (dwfl_module_relocations): Don't check mod->reloc_info.
26 (dwfl_module_relocation_info): Likewise.
27 (find_section): Likewise.
29 2011-07-09 Roland McGrath <roland@hack.frob.com>
31 * image-header.c (LE32): Macro removed (now in lib/system.h).
33 2011-04-11 Mark Wielaard <mjw@redhat.com>
35 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
36 by check for zlib, bzlib or lzma defines to check it isn't empty.
37 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
39 2011-03-08 Roland McGrath <roland@redhat.com>
41 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
42 Reported by Kurt Roeckx <kurt@roeckx.be>.
44 2011-02-11 Roland McGrath <roland@redhat.com>
46 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
47 suffixes if corresponding decompression support is enabled.
49 2011-02-01 Roland McGrath <roland@redhat.com>
51 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
52 section-end address as the synchronization point, rather than sh_addr.
54 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
55 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
57 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
58 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
60 2011-01-11 Roland McGrath <roland@redhat.com>
62 * dwfl_module_getdwarf.c (open_elf): Remove section-based
63 address_sync fixup from here.
64 (find_prelink_address_sync): New function.
65 (find_debuginfo): Call it.
66 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
68 2011-01-04 Roland McGrath <roland@redhat.com>
70 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
71 logic to consider section addresses, the better to survive all the
72 possible prelink machinations.
73 * libdwflP.h (struct dwfl_file): Comment change.
75 2010-11-30 Roland McGrath <roland@redhat.com>
77 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
79 2010-11-12 Roland McGrath <roland@redhat.com>
81 * libdwflP.h (struct Dwfl_Module): New member main_bias.
82 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
83 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
85 * libdwflP.h (dwfl_deadjust_address): New function.
86 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
87 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
88 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
90 2010-11-11 Roland McGrath <roland@redhat.com>
92 * libdwflP.h (struct dwfl_file): Remove bias member.
93 Add vaddr and address_sync members instead.
94 (dwfl_adjusted_address): Calculate using vaddr.
95 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
96 (dwfl_adjusted_st_value): Use one of those calls.
97 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
98 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
99 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
100 * link_map.c (consider_executable): Adjust only MOD->low_addr for
101 detected PIE bias change.
103 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
104 * dwfl_module_info.c: Use it.
105 * cu.c (addrarange): Likewise.
106 * dwfl_dwarf_line.c: Likewise.
107 * dwfl_module_dwarf_cfi.c: Likewise.
108 * dwfl_lineinfo.c: Likewise.
109 * dwfl_nextcu.c: Likewise.
110 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
112 * libdwflP.h (dwfl_adjusted_st_value): New function.
113 * relocate.c (resolve_symbol): Use it.
114 * dwfl_module_getsym.c: Likewise.
115 * dwfl_module_addrsym.c: Likewise.
116 * dwfl_module_info.c: Likewise.
118 * libdwflP.h (dwfl_adjusted_address): New function.
119 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
120 * relocate.c (__libdwfl_relocate_value): Likewise.
121 * derelocate.c (cache_sections): Likewise.
122 (dwfl_module_address_section): Likewise.
123 * dwfl_module_getelf.c: Likewise.
124 * dwfl_module_eh_cfi.c: Likewise.
125 * link_map.c (consider_executable): Likewise.
127 2010-08-24 Roland McGrath <roland@redhat.com>
129 * dwfl_dwarf_line.c: New file.
130 * Makefile.am (libdwfl_a_SOURCES): Add it.
132 2010-08-18 Roland McGrath <roland@redhat.com>
134 * link_map.c (report_r_debug): Use found name if we have no name,
135 even if we already have an Elf handle.
137 2010-06-30 Roland McGrath <roland@redhat.com>
139 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
140 confused by -1 return from dwfl_build_id_find_elf after it opened
142 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
143 dwfl_build_id_find_debuginfo.
145 2010-06-16 Roland McGrath <roland@redhat.com>
147 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
149 2010-06-14 Roland McGrath <roland@redhat.com>
151 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
152 candidate file to that st_dev/st_ino and pretend it didn't exist
154 (find_debuginfo_in_path): Update caller, pass main file's info.
156 2010-05-20 Roland McGrath <roland@redhat.com>
158 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
159 (grovel_auxv): ... this. Take DWFL argument.
160 (dwfl_linux_proc_report): Update caller.
162 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
163 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
165 2010-05-19 Roland McGrath <roland@redhat.com>
167 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
169 2010-05-06 Roland McGrath <roland@redhat.com>
171 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
173 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
174 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
175 ID but we didn't find a file.
176 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
177 and refuse any fallback file-by-name if it lacks the matching ID.
179 * dwfl_error.c (dwfl_errno): Add INTDEF.
180 * libdwflP.h: Add INTDECL.
182 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
185 2010-05-04 Roland McGrath <roland@redhat.com>
187 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
188 ET_DYN that has a DT_DEBUG.
190 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
192 * segment.c (insert): Fix moving of values following insertion.
193 (reify_segments): Fix up MOD->segment backpointer indices after
194 later insertions in the main loop invalidate them.
196 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
197 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
199 * core-file.c (dwfl_core_file_report): Return any nonzero count of
200 modules reported, even if link_map grovelling failed and only sniffing
203 2010-04-26 Roland McGrath <roland@redhat.com>
205 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
206 Works around probably-wrong ld -r behavior for case of a DWARF address
207 constant that refers to a discarded SHF_ALLOC section.
209 2010-04-14 Roland McGrath <roland@redhat.com>
211 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
212 an upper bound on sane possible number of elements.
214 2010-03-11 Roland McGrath <roland@redhat.com>
216 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
217 the second half for 32-bit matches.
219 2010-03-10 Roland McGrath <roland@redhat.com>
221 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
222 * argp-std.c (parse_opt): Update caller.
223 * libdwfl.h: Declare dwfl_core_file_report.
226 2010-02-17 Roland McGrath <roland@redhat.com>
228 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
229 If set, find the first index not below ADDR.
230 (dwfl_segment_report_module): Update callers.
231 Pass true when calculating return value.
233 2010-02-15 Roland McGrath <roland@redhat.com>
235 * Makefile.am: Use config/eu.am for common stuff.
237 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
238 variable in failure path.
240 2010-02-02 Mark Wielaard <mjw@redhat.com>
242 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
243 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
245 2010-01-07 Roland McGrath <roland@redhat.com>
247 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
248 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
249 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
250 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
252 2010-01-06 Roland McGrath <roland@redhat.com>
254 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
255 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
257 2009-11-16 Roland McGrath <roland@redhat.com>
259 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
261 2009-11-12 Petr Machata <pmachata@redhat.com>
263 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
264 the chunk is both offset-contiguous and vaddr-contiguous.
266 2009-11-05 Roland McGrath <roland@redhat.com>
268 * link_map.c (report_r_debug): Skip entries with l_ld==0.
269 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
271 2009-09-04 Roland McGrath <roland@redhat.com>
273 * image-header.c (__libdw_image_header): Fix tranposed comparison.
275 2009-08-27 Roland McGrath <roland@redhat.com>
277 * image-header.c: New file.
278 * Makefile.am (libdwfl_a_SOURCES): Add it.
279 * libdwflP.h: Declare __libdw_image_header.
280 * open.c (decompress): Don't consume ELF on failure.
281 (what_kind): New function, broken out of ...
282 (__libdw_open_file): ... here. Call it.
283 If it fails, try __libdw_image_header and then try what_kind again.
285 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
286 leave it behind for next decompressor.
287 * open.c (decompress): Free BUFFER on failure.
289 2009-08-26 Roland McGrath <roland@redhat.com>
291 * gzip.c (find_zImage_payload): New function, broken out of ...
292 (mapped_zImage): ... here. Call it.
293 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
294 stupid method of just trying the decoder.
296 * open.c [USE_LZMA]: Try __libdw_unlzma.
297 * libdwflP.h: Declare it.
298 (DWFL_ERRORS): Add DWFL_E_LZMA.
299 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
301 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
303 * gzip.c (mapped_zImage): Limit scan to 32kb.
304 Make this unconditional, support bzip2 kernel images too.
305 (unzip): Use direct inflate method for non-mmap case too.
306 Only zlib uses the stream method.
308 2009-08-09 Roland McGrath <roland@redhat.com>
310 * dwfl_module_build_id.c: Use new macros for versioned definitions.
312 2009-07-08 Roland McGrath <roland@redhat.com>
314 * dwfl_module_dwarf_cfi.c: New file.
315 * dwfl_module_eh_cfi.c: New file.
316 * Makefile.am (libdwfl_a_SOURCES): Add them.
317 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
318 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
320 2009-07-08 Roland McGrath <roland@redhat.com>
322 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
324 2009-06-18 Mark Wielaard <mjw@redhat.com>
326 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
328 2009-06-13 Ulrich Drepper <drepper@redhat.com>
330 * derelocate.c: Don't use deprecated libelf functions.
331 * dwfl_module_getdwarf.c: Likewise.
332 * relocate.c: Likewise.
334 2009-04-23 Ulrich Drepper <drepper@redhat.com>
336 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
337 defined. Otherwise just define the latest version.
339 2009-04-22 Roland McGrath <roland@redhat.com>
341 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
344 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
345 adjust properly for non-ET_REL.
347 2009-04-21 Roland McGrath <roland@redhat.com>
349 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
351 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
352 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
354 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
356 2009-04-20 Roland McGrath <roland@redhat.com>
358 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
360 2009-04-19 Roland McGrath <roland@redhat.com>
362 * dwfl_module_getdwarf.c (find_file): Renamed to ...
363 (__libdwfl_getelf): ... this. Make it global.
364 (find_symtab, find_dw): Update callers.
365 (dwfl_module_getelf): Functions moved ...
366 * dwfl_module_getelf.c: ... here, new file.
367 * Makefile.am (libdwfl_a_SOURCES): Add it.
368 * libdwflP.h: Declare __libdwfl_getelf.
370 2009-04-14 Roland McGrath <roland@redhat.com>
372 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
373 absolute (already adjusted in place) or needing load bias adjustment.
375 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
376 gelf_getphdr failure. Fix file size limit checks.
378 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
380 2009-04-08 Roland McGrath <roland@redhat.com>
382 * dwfl_module_getsym.c: Don't adjust for bias again after
383 __libdwfl_relocate_value.
385 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
386 a non-SHF_ALLOC section.
387 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
388 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
390 2009-03-09 Roland McGrath <roland@redhat.com>
392 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
393 variable to outer scope, so we cache it for the loop.
395 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
397 2009-02-12 Roland McGrath <roland@redhat.com>
399 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
400 __libdwfl_relocate_value to find correct sh_addr value.
402 2009-02-10 Roland McGrath <roland@redhat.com>
404 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
405 If false, don't fail for NO_PHDR.
406 (dwfl_report_elf): Update caller.
407 * libdwflP.h: Update decl.
408 * offline.c (process_elf): Call it with false, so we don't refuse
409 dubiously-formed objects here.
411 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
412 finds our module. We shouldn't crash when we confuse some guesses.
414 2009-02-10 Ulrich Drepper <drepper@redhat.com>
416 * open.c (decompress): Avoid crash with empty input file.
418 2009-01-27 Roland McGrath <roland@redhat.com>
420 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
421 with zero vaddr and memsz.
423 2009-01-22 Roland McGrath <roland@redhat.com>
425 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
427 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
428 after address-matching loop.
430 * segment.c (lookup): Fix fencepost in checking for HINT match.
432 2009-01-14 Roland McGrath <roland@redhat.com>
434 * gzip.c [!BZLIB] (mapped_zImage): New function.
435 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
437 2009-01-10 Ulrich Drepper <drepper@redhat.com>
439 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
441 2009-01-08 Roland McGrath <roland@redhat.com>
443 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
444 Skip subdirectory named "source".
445 (dwfl_linux_kernel_find_elf): Likewise.
447 2009-01-06 Roland McGrath <roland@redhat.com>
449 * linux-kernel-modules.c (check_suffix): New function.
450 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
451 (dwfl_linux_kernel_report_offline): Use it.
452 (dwfl_linux_kernel_find_elf): Likewise.
454 2009-01-05 Roland McGrath <roland@redhat.com>
456 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
457 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
458 * dwfl_build_id_find_elf.c: Likewise.
459 * dwfl_module_getdwarf.c (open_elf): Likewise.
460 * dwfl_report_elf.c: Likewise.
461 * find-debuginfo.c (validate): Likewise.
462 * offline.c (__libdwfl_report_offline): Likewise.
464 * libdwflP.h: Declare __libdw_open_file.
466 * Makefile.am (libdwfl_a_SOURCES): Add it.
469 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
471 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
472 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
474 2008-12-16 Roland McGrath <roland@redhat.com>
476 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
477 symver magic to bind to ELFUTILS_0.138.
478 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
479 wrapper for ELFUTILS_0.130 version set.
481 2008-12-18 Roland McGrath <roland@redhat.com>
483 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
484 addresses are taken as relative to MOD->low_addr.
486 2008-12-15 Roland McGrath <roland@redhat.com>
488 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
491 2008-12-11 Roland McGrath <roland@redhat.com>
493 * offline.c (process_archive): Don't call elf_end and close if
494 returning NULL. Check first elf_begin call and set error code
495 specially for empty archive.
498 2008-12-02 Roland McGrath <roland@redhat.com>
500 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
502 2008-11-26 Roland McGrath <roland@redhat.com>
504 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
505 return value, and interpret encoded OFFSET argument.
507 2008-10-07 Roland McGrath <roland@redhat.com>
509 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
511 2008-09-29 Roland McGrath <roland@redhat.com>
513 * segment.c (insert): Must realloc DWFL->lookup_module here too.
514 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
516 2008-08-28 Roland McGrath <roland@redhat.com>
518 * segment.c (reify_segments): Fix last change.
520 2008-08-27 Roland McGrath <roland@redhat.com>
522 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
523 failure from pread64.
525 2008-08-26 Roland McGrath <roland@redhat.com>
527 * segment.c (reify_segments): Insert a trailing segment for a module
528 end that is above the highest current segment.
530 2008-08-25 Roland McGrath <roland@redhat.com>
532 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
533 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
534 if FILE->elf is not ELF_K_ELF.
536 * dwfl_segment_report_module.c: Add a cast.
538 2008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
540 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
541 which decides which symbol is "closest" to a given address.
543 2008-08-15 Roland McGrath <roland@redhat.com>
545 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
546 (options, parse_opt): Handle --core.
548 * core-file.c: New file.
549 * Makefile.am (libdwfl_a_SOURCES): Add it.
550 * libdwflP.h (dwfl_core_file_report): Declare it.
552 * link_map.c: New file.
553 * Makefile.am (libdwfl_a_SOURCES): Add it.
554 * libdwflP.h (dwfl_link_map_report): Declare it.
556 * libdwflP.h (MIN, MAX): New macros.
557 (Dwfl_Memory_Callback): New typedef.
558 (Dwfl_Module_Callback): New typedef.
559 (dwfl_segment_report_module): Declare it.
560 * dwfl_segment_report_module.c: New file.
561 * Makefile.am (libdwfl_a_SOURCES): Add it.
563 * derelocate.c (dwfl_module_address_section): Add INTDEF.
564 * libdwflP.h: Add INTDECL.
566 * segment.c: New file.
567 * Makefile.am (libdwfl_a_SOURCES): Add it.
568 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
569 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
570 lookup_addr, lookup_module, lookup_segndx, replace removed members
572 (struct Dwfl_Module): New member segment.
573 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
575 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
576 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
577 (dwfl_report_module): Don't touch DWFL->nmodules.
578 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
579 (compare_modules): Function removed.
580 * dwfl_getmodules.c: Rewritten.
582 * libdwflP.h: Add INTDECLs.
583 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
584 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
586 2008-08-03 Roland McGrath <roland@redhat.com>
588 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
590 2008-07-17 Roland McGrath <roland@redhat.com>
592 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
593 zero if the failure was only ENOENT.
595 2008-06-03 Roland McGrath <roland@redhat.com>
597 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
600 2008-05-22 Petr Machata <pmachata@redhat.com>
602 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
604 2008-05-06 Roland McGrath <roland@frob.com>
606 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
607 FTS_LOGICAL here too.
608 (dwfl_linux_kernel_find_elf): Likewise.
610 2008-04-29 Roland McGrath <roland@redhat.com>
612 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
613 based on canonicalize_file_name if it differs from the supplied name.
615 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
618 2008-04-27 Roland McGrath <roland@redhat.com>
620 * linux-kernel-modules.c (report_kernel): Fix crash when
621 dwfl_report_elf fails.
623 2008-04-05 Roland McGrath <roland@redhat.com>
625 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
627 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
628 Clear it after freeing.
629 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
631 2008-03-26 Roland McGrath <roland@redhat.com>
633 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
634 SHT_DYNSYM, just set *SYMSCN like the comment says.
636 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
638 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
640 2008-03-19 Roland McGrath <roland@redhat.com>
642 * dwfl_module_getsrc.c: Adjust address for module bias before search.
644 2008-03-01 Roland McGrath <roland@redhat.com>
646 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
647 prototype to avoid older compiler's complaint about reuse of the name.
648 (__libdwfl_canon_error): Likewise.
650 2008-02-19 Roland McGrath <roland@redhat.com>
652 * relocate.c (relocate_section): Check for an unhandled relocation
653 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
654 DWFL_E_UNKNOWN_MACHINE check out of loops.
656 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
657 DEBUGFILE->relocated is already set.
659 2008-01-26 Roland McGrath <roland@redhat.com>
661 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
663 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
664 incoming *FILE_NAME at the start.
666 2008-01-08 Roland McGrath <roland@redhat.com>
668 * Makefile.am (euinclude): Variable removed.
669 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
671 2007-10-23 Roland McGrath <roland@redhat.com>
673 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
674 module to appear first.
676 2007-10-20 Roland McGrath <roland@redhat.com>
678 * offline.c (process_archive_member): Take FD argument, pass it down
679 to process_file. Return Elf_Cmd, not bool.
680 Call elf_next here, always before elf_end.
681 (process_archive): Update caller. Don't close FD here unless there
684 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
686 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
687 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
688 partial relocation to one or both files.
689 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
690 relocations have been applied to the debug file if dwfl_module_getelf
691 has been used before.
693 * relocate.c (resolve_symbol): New function.
694 (relocate_section): Call it.
696 * relocate.c (relocate_getsym): Handle null MOD->symfile.
697 (relocate_section): Take new bool arg, PARTIAL. If true,
698 no error for BADRELTYPE/RELUNDEF, instead just skip them
699 and leave only those skipped relocs behind the reloc section.
700 (__libdwfl_relocate_section): Take new arg, pass it down.
701 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
702 do partial relocation on all sections.
703 * dwfl_module_getdwarf.c (load_dw): Update caller.
704 * libdwflP.h: Update decls.
705 * derelocate.c (dwfl_module_address_section): Pass new argument
706 to __libdwfl_relocate_section, true.
708 * derelocate.c (cache_sections): Don't cache reloc sections when
709 section_address callback is null.
711 2007-10-19 Roland McGrath <roland@redhat.com>
713 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
715 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
716 (struct secref): Likewise.
717 (cache_sections): Cache the relocation section referring to each
718 section we cache, if any.
719 (dwfl_module_address_section): Use __libdwfl_relocate_section as
722 * relocate.c (struct reloc_symtab_cache): New type.
723 (relocate_getsym): Use it instead of four arguments.
724 (__libdwfl_relocate): Update caller.
725 (relocate_section): New function, broken out of ...
726 (__libdwfl_relocate): ... here.
727 (__libdwfl_relocate_section): New function.
728 * libdwflP.h: Declare it.
730 2007-10-17 Roland McGrath <roland@redhat.com>
732 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
733 to relocated st_value.
735 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
738 2007-10-16 Roland McGrath <roland@redhat.com>
740 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
741 section has larger alignment requirements not met by the original BASE,
742 rather than padding more between sections.
744 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
746 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
749 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
750 at zero in ET_REL case. Adjust BASE to necessary alignment.
752 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
754 (__libdwfl_find_build_id): Update caller.
756 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
757 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
758 * offline.c (dwfl_offline_section_address): Bail early if there is
761 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
763 2007-10-09 Roland McGrath <roland@redhat.com>
765 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
766 caching SHDR->sh_addr = 0.
767 * offline.c (dwfl_offline_section_address): Never called for sh_addr
768 really at 0, don't check for it. Use MOD->debug directly, not symfile.
770 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
771 we've found SHT_SYMTAB.
773 * relocate.c (relocate_getsym): New function.
774 (__libdwfl_relocate): Use it.
775 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
776 be a pointer instead of value; cache getshstrndx result there.
777 * libdwflP.h: Update decl.
778 * derelocate.c (cache_sections): Update caller.
779 Always work on the main file, not the symfile.
780 (dwfl_module_address_section): Likewise.
781 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
783 2007-10-07 Roland McGrath <roland@redhat.com>
785 * offline.c (process_archive): Initialize MOD.
787 * linux-kernel-modules.c (get_release): New function, broken out of ...
788 (report_kernel): ... here. Call it.
789 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
790 (find_kernel_elf): Update caller.
791 (report_kernel_archive): New function.
792 (dwfl_linux_kernel_report_offline): Call it.
794 * offline.c (process_file): Take new arg PREDICATE, pass it down.
795 (process_archive): Likewise.
796 (process_archive_member): Likewise. When nonnull, let the predicate
797 decide whether to use this member.
798 (__libdwfl_report_offline): New function, broken out of ...
799 (dwfl_report_offline): ... here. Call it.
800 * libdwflP.h: Declare it.
802 * offline.c (process_archive, process_archive_member): New functions.
803 (process_elf, process_file): New functions, broken out of ...
804 (dwfl_report_offline): ... here. Call process_file, which recurses on
807 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
808 (dwfl_report_elf): ... here. Call it.
809 * libdwflP.h: Declare it.
811 2007-10-06 Roland McGrath <roland@redhat.com>
813 * derelocate.c (dwfl_module_relocations): Don't call
814 dwfl_module_getdwarf.
816 * derelocate.c (find_section): Use __libdwfl_seterrno, not
819 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
820 SHF_ALLOC, to cache sh_addr resolved to 0.
822 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
823 values nonzero already, just use its existing layout.
825 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
826 in-core shdr after applying it.
828 2007-10-04 Ulrich Drepper <drepper@redhat.com>
830 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
831 initialization of notes variable.
833 2007-10-04 Roland McGrath <roland@redhat.com>
835 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
836 fill in with vaddr of "__start_notes" symbol if found.
837 (check_notes): New function.
838 (check_kernel_notes): New function.
839 (dwfl_linux_kernel_report_kernel): Call it.
840 (check_module_notes): New function.
841 (dwfl_linux_kernel_report_modules): Call it.
843 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
844 Try dwfl_build_id_find_elf first.
846 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
847 Set kernel module e_type to ET_DYN.
849 2007-10-03 Roland McGrath <roland@redhat.com>
851 * find-debuginfo.c (validate): New function, broken out of ...
852 (find_debuginfo_in_path): ... here. New function, broken out of ...
853 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
854 dwfl_build_id_find_debuginfo first.
856 * dwfl_build_id_find_elf.c: New file.
857 * dwfl_build_id_find_debuginfo.c: New file.
858 * Makefile.am (libdwfl_a_SOURCES): Add them.
859 * libdwfl.h: Declare them.
860 * libdwflP.h: Add INTDECLs.
862 * dwfl_module_build_id.c: New file.
863 * dwfl_module_report_build_id.c: New file.
864 * Makefile.am (libdwfl_a_SOURCES): Add them.
865 * libdwfl.h: Declare them.
866 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
867 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
868 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
870 * dwfl_module_getdwarf.c (find_offsets): New function.
871 (find_dynsym): New function, calls that.
872 (find_symtab): Call it.
874 2007-09-11 Roland McGrath <roland@redhat.com>
876 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
877 address if its st_size is smaller.
879 2007-08-13 Roland McGrath <roland@redhat.com>
881 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
883 2007-08-12 Roland McGrath <roland@redhat.com>
885 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
888 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
889 a second phdr if it happens to match EHDR_VMA exactly.
891 2007-08-08 Roland McGrath <roland@redhat.com>
893 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
894 those with no names. Rewrite best symbol algorithm not to assume a
895 sorted table and to be smarter handling sizeless symbols.
897 2007-07-16 Roland McGrath <roland@redhat.com>
899 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
900 reviving an existing module.
902 2007-06-08 Roland McGrath <roland@redhat.com>
904 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
906 2007-05-17 Roland McGrath <roland@redhat.com>
908 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
909 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
910 (dwfl_linux_kernel_find_elf): Likewise.
912 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
913 getline and sscanf instead of fscanf.
915 2007-05-08 Roland McGrath <roland@redhat.com>
917 * offline.c (dwfl_offline_section_address): Don't assume section
918 numbers match between stripped and debuginfo files. Instead, assume
919 only that the ordering among SHF_ALLOC sections matches.
921 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
923 (dwfl_linux_kernel_report_offline): Update caller.
924 (dwfl_linux_kernel_report_kernel): Likewise.
926 2007-04-23 Roland McGrath <roland@redhat.com>
928 * argp-std.c (options): Fix group title string.
930 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
931 Update via STATE->input every time we set STATE->hook, not only at
934 * dwfl_module.c (free_file): Free FILE->name.
936 2007-04-16 Roland McGrath <roland@redhat.com>
938 * derelocate.c (cache_sections): Apply bias to sh_addr.
939 (compare_secrefs): Fix address comparison to avoid signed overflow.
940 (find_section): New function, broken out of ...
941 (dwfl_module_relocate_address): ... here, call it.
942 (check_module): New function, broken out of ...
943 (dwfl_module_relocate_address): ... here, call it.
944 (dwfl_module_address_section): New function.
945 * libdwfl.h: Declare it.
947 2007-03-26 Roland McGrath <roland@redhat.com>
949 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
951 2007-03-18 Roland McGrath <roland@redhat.com>
953 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
954 (find_debuginfo): ... here. Call it.
955 Don't return error for libelf errors finding .gnu_debuglink section.
957 2007-03-12 Roland McGrath <roland@redhat.com>
959 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
960 (dwfl_report_begin): ... here. Call it.
961 * libdwfl.h: Declare it.
962 * libdwflP.h: Add INTDECL.
964 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
966 * offline.c: Comment typo fix.
968 2007-03-04 Roland McGrath <roland@redhat.com>
970 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
971 (find_kernel_elf): New function, broken out of ...
972 (report_kernel): ... here. Call it.
973 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
974 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
975 virtual address bounds of kernel from symbols rounded to page size.
976 (dwfl_linux_kernel_report_kernel): Use that if it works, before
977 resorting to report_kernel.
979 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
980 ET_EXEC file with nonzero bias.
982 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
983 dwfl_module_addrsym. Guts moved to ...
984 * dwfl_module_addrsym.c: ... here; new file.
985 * Makefile.am (libdwfl_a_SOURCES): Add it.
986 * libdwfl.h: Declare dwfl_module_addrsym.
987 * libdwflP.h: Add INTDECL.
989 2007-03-03 Roland McGrath <roland@redhat.com>
991 * dwfl_module.c (free_file): New function, broken out of ...
992 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
994 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
997 2007-03-02 Roland McGrath <roland@redhat.com>
999 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
1001 2007-02-02 Roland McGrath <roland@redhat.com>
1003 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
1004 address exactly if it's no other module's low boundary.
1006 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
1007 and size cover the address, select the closest symbol with st_size==0
1008 that lies in the same section.
1010 2007-01-29 Roland McGrath <roland@redhat.com>
1012 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
1015 2007-01-20 Roland McGrath <roland@redhat.com>
1017 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
1019 * libdwfl.h (Dwfl_Callbacks): Update comment.
1020 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
1021 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1022 For ignored missing section, use -1 instead of 0.
1023 * offline.c (dwfl_offline_section_address): Expect a call for 0.
1025 2007-01-19 Roland McGrath <roland@redhat.com>
1027 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
1028 zero so a lone -e foo.so is shown without address bias.
1030 2007-01-10 Roland McGrath <roland@redhat.com>
1032 * linux-kernel-modules.c (report_kernel): Check asprintf return value
1033 directly instead of via side effect, to silence warn_unused_result.
1034 (dwfl_linux_kernel_report_offline): Likewise.
1035 (dwfl_linux_kernel_find_elf): Likewise.
1036 (dwfl_linux_kernel_module_section_address): Likewise.
1037 * find-debuginfo.c (try_open): Likewise.
1038 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
1039 (dwfl_linux_proc_report): Likewise.
1041 * libdwfl.h (dwfl_begin): Require nonnull argument.
1043 2006-12-27 Roland McGrath <roland@redhat.com>
1045 * dwfl_module.c (compare_modules): Fix address comparison to avoid
1046 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
1048 2006-10-30 Roland McGrath <roland@redhat.com>
1050 * dwfl_module.c (dwfl_report_module): Comment typo fix.
1052 2006-09-05 Roland McGrath <roland@redhat.com>
1054 * derelocate.c (cache_sections): Use alloca instead of variable-sized
1055 auto array, in function already using alloca.
1057 2006-08-14 Roland McGrath <roland@redhat.com>
1059 * linux-kernel-modules.c (try_kernel_name): If the call to
1060 dwfl_standard_find_debuginfo produces no results, try it again
1061 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
1063 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
1064 * libdwflP.h: ... to here.
1065 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
1066 repeats the first thing dwfl_standard_find_debuginfo will try.
1068 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
1069 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
1070 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
1073 2006-07-12 Ulrich Drepper <drepper@redhat.com>
1075 * cu.c: Adjust for internal_function_def removal.
1076 * dwfl_error.c: Likewise.
1077 * dwfl_module.c: Likewise.
1078 * dwfl_module_getdwarf.c: Likewise.
1079 * lines.c: Likewise.
1080 * relocate.c: Likewise.
1082 2006-07-11 Ulrich Drepper <drepper@redhat.com>
1084 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
1085 it can overflow the return value type.
1086 Patch by Tim Moore <timoore@redhat.com>.
1088 2006-06-28 Roland McGrath <roland@redhat.com>
1090 * libdwfl.h: Cosmetic changes.
1092 * dwfl_line_comp_dir.c: New file.
1093 * Makefile.am (libdwfl_a_SOURCES): Add it.
1094 * libdwfl.h: Declare dwfl_line_comp_dir.
1096 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
1098 * dwfl_linecu.c: New file.
1099 * Makefile.am (libdwfl_a_SOURCES): Add it.
1100 * libdwfl.h: Declare dwfl_linecu.
1102 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
1103 (dwfl_linecu): Define as macro.
1105 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
1107 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
1108 (dwfl_module_addrname): Function moved ...
1109 * dwfl_module_addrname.c: ... here, new file.
1110 * dwfl_module_getsym.c: New file.
1111 * Makefile.am (libdwfl_a_SOURCES): Add them.
1112 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
1113 * libdwflP.h: Add INTDECLs.
1115 2006-06-27 Roland McGrath <roland@redhat.com>
1117 * dwfl_module.c (dwfl_report_end): Whitespace fix.
1119 2006-06-13 Roland McGrath <roland@redhat.com>
1121 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1122 Use __libdwfl_seterrno for elf_memory failure.
1124 2006-05-22 Roland McGrath <roland@redhat.com>
1126 * dwfl_module_return_value_location.c
1127 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
1129 2006-05-27 Ulrich Drepper <drepper@redhat.com>
1131 * libdwfl.h: Add extern "C".
1133 2006-05-22 Ulrich Drepper <drepper@redhat.com>
1135 * cu.c (addrarange): Handle files without aranges information.
1137 2006-05-16 Ulrich Drepper <drepper@redhat.com>
1139 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
1142 2006-02-26 Roland McGrath <roland@redhat.com>
1144 * dwfl_version.c: New file.
1145 * Makefile.am (libdwfl_a_SOURCES): Add it.
1146 * libdwfl.h: Declare dwfl_version.
1148 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
1149 aligned up from DWFL->offline_next_address when checking for overlap.
1151 2005-12-22 Roland McGrath <roland@redhat.com>
1153 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
1155 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
1156 (dwfl_linux_proc_report): ... here. Call it.
1157 (dwfl_linux_proc_maps_report): New function.
1158 * libdwfl.h: Declare it.
1159 * libdwflP.h: Add INTDECL.
1160 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
1162 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
1163 failed with DWFL_E_NO_DWARF.
1165 2005-11-26 Roland McGrath <roland@redhat.com>
1167 * dwfl_end.c (dwfl_end): Free the DWFL itself.
1169 2005-11-25 Roland McGrath <roland@redhat.com>
1171 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
1173 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
1174 * libdwflP.h: Declare it.
1176 * dwfl_module_register_names.c: New file.
1177 * Makefile.am (libdwfl_a_SOURCES): Add it.
1178 * libdwfl.h: Declare dwfl_module_register_names.
1180 2005-11-21 Roland McGrath <roland@redhat.com>
1182 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1183 Don't leak malloc'd file name.
1184 If a /sys/.../sections file is missing and starts with ".init",
1185 try the variant with "_init" too; catches PPC64 kernel braindamage.
1187 2005-11-15 Roland McGrath <roland@redhat.com>
1189 * libdwfl.h: Comment fixes.
1191 * dwfl_module_return_value_location.c: Add unlikely for error case.
1193 2005-11-13 Roland McGrath <roland@redhat.com>
1195 * dwfl_return_value_location.c: New file.
1196 * Makefile.am (libdwfl_a_SOURCES): Add it.
1197 * libdwfl.h: Declare dwfl_module_return_value_location.
1198 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
1200 2005-10-20 Roland McGrath <roland@redhat.com>
1202 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
1203 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
1204 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
1206 2005-10-01 Roland McGrath <roland@redhat.com>
1208 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
1211 2005-09-19 Roland McGrath <roland@redhat.com>
1213 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1214 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
1215 the signed integer reading; they will just have to be in hexadecimal.
1216 (dwfl_linux_kernel_module_section_address): Likewise.
1218 2005-08-28 Ulrich Drepper <drepper@redhat.com>
1220 * Makefile.am (%.os): Use COMPILE.os.
1221 (COMPILE.os): Filter out gconv options.
1223 2005-08-25 Roland McGrath <roland@redhat.com>
1225 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
1226 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
1228 2005-08-24 Roland McGrath <roland@redhat.com>
1230 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
1232 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
1233 magic initializer to set -heur-stack-bound option.
1235 2005-08-22 Roland McGrath <roland@redhat.com>
1237 * dwfl_validate_address.c: New file.
1238 * Makefile.am (libdwfl_a_SOURCES): Add it.
1239 * libdwfl.h: Declare dwfl_validate_address.
1241 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
1242 * libdwflP.h: Add INTDECL.
1244 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
1245 elf_rawdata for symbol-related sections.
1247 * offline.c (dwfl_report_offline): Move offline_next_address outside
1248 module's range, in case it's an ET_EXEC using fixed segment locations.
1249 * libdwfl.h: Update comment.
1251 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
1254 2005-08-20 Roland McGrath <roland@redhat.com>
1256 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
1257 function to choose whether to report.
1258 (dwfl_linux_kernel_report_offline): Likewise.
1259 * libdwfl.h: Update decl.
1260 * argp-std.c (parse_opt): Update caller.
1262 * dwfl_getsrclines.c: New file.
1263 * dwfl_onesrcline.c: New file.
1264 * Makefile.am (libdwfl_a_SOURCES): Add them.
1265 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
1267 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
1268 MODULESDIR[0]. Call fts_close on failure.
1270 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
1271 Close ET_REL file descriptors after relocation.
1272 (find_dw): Update caller.
1273 * offline.c (dwfl_report_offline): Get the file into memory and close
1274 the file descriptor.
1276 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1277 MOD->debug.elf is already set.
1279 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1280 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1282 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1283 dwfl_linux_kernel_report_offline with offline_callbacks.
1285 * linux-kernel-modules.c (report_kernel): New function, broken out of
1287 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1288 (dwfl_linux_kernel_report_offline): New function.
1289 * libdwfl.h: Declare it.
1290 * libdwflP.h: Add INTDECL.
1292 2005-08-19 Roland McGrath <roland@redhat.com>
1294 Use standard debuginfo search path to look for vmlinux.
1295 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1297 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1299 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1301 * argp-std.c (offline_callbacks): New variable.
1302 (parse_opt): Use it for -e. Allow multiple -e options.
1304 * offline.c: New file.
1305 * Makefile.am (libdwfl_a_SOURCES): Add it.
1306 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
1307 * libdwflP.h: Add INTDECLs.
1308 (OFFLINE_REDZONE): New macro.
1309 (struct Dwfl): New member `offline_next_address'.
1310 * dwfl_begin.c (dwfl_begin): Initialize it.
1311 * dwfl_module.c (dwfl_report_begin): Likewise.
1313 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
1314 do a nominal absolute section layout starting at BASE.
1315 * libdwfl.h: Update comment.
1317 2005-08-18 Roland McGrath <roland@redhat.com>
1319 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
1320 dwfl_module_getdwarf if necessary.
1322 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
1323 * libdwfl.h: Update comment.
1325 * derelocate.c: New file.
1326 * Makefile.am (libdwfl_a_SOURCES): Add it.
1328 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
1329 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
1330 * dwfl_module_getdwarf.c (open_elf): Update initialization.
1331 (load_dw, dwfl_module_addrname): Update uses.
1332 * relocate.c (__libdwfl_relocate): Likewise.
1334 2005-08-04 Roland McGrath <roland@redhat.com>
1336 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
1337 arguments SHNDX, SHDR.
1338 (dwfl_linux_kernel_module_section_address): Update prototype.
1339 * relocate.c (__libdwfl_relocate_value): Update caller.
1340 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1341 Take the new arguments.
1343 2005-08-10 Roland McGrath <roland@redhat.com>
1345 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
1346 use it instead of MOD->debug.file.
1347 * libdwflP.h: Update decl.
1348 * dwfl_module_getdwarf.c (load_dw): Update caller.
1351 2005-08-09 Roland McGrath <roland@redhat.com>
1353 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
1354 * cu.c: Use INTUSE on dwarf_* calls.
1355 * dwfl_error.c: Likewise.
1356 * dwfl_module.c: Likewise.
1357 * dwfl_module_getdwarf.c: Likewise.
1358 * dwfl_module_getsrc_file.c: Likewise.
1359 * lines.c: Likewise.
1361 2005-08-07 Roland McGrath <roland@redhat.com>
1363 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
1364 names contain '_' or '-', look for files named either "foo-bar.ko"
1367 2005-07-29 Roland McGrath <roland@redhat.com>
1369 * loc2c.c: File removed.
1370 * loc2c.h: File removed.
1371 * loc2c-runtime.h: File removed.
1372 * test2.c: File removed.
1373 * Makefile.am (EXTRA_DIST): Variable removed.
1374 (noinst_HEADERS): Remove loc2c.h from here.
1376 2005-07-28 Ulrich Drepper <drepper@redhat.com>
1378 * libdwfl.h: Add a few missing extern for function prototypes.
1380 * libdwfl_crc32.c: New file.
1381 * libdwfl_crc32_file.c: New file.
1382 * libdwflP.h: Declare the new functions.
1383 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
1384 libdwfl_crc32_file.c.
1385 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
1386 instead of crc32_file.
1388 2005-07-28 Roland McGrath <roland@redhat.com>
1390 * ptest.c: Moved to ../tests/dwflmodtest.c.
1392 * Makefile.am (noinst_PROGRAMS): Variable removed.
1393 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
1394 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
1395 (libdwfl): Don't use libdwfl.so any more.
1396 (libdwfl.so, install, uninstall): Targets removed.
1397 (test2_SOURCES): Define EXTRA_DIST instead of this.
1398 * libdwfl.map: File removed.
1400 * libdwfl.h: Use "" for libdw.h #include.
1402 2005-07-27 Roland McGrath <roland@redhat.com>
1404 * libdwfl.map: Add dwfl_getmodules.
1406 2005-07-23 Ulrich Drepper <drepper@redhat.com>
1408 * Makefile.am: Fix rules to allow building with mudflap.
1410 2005-07-21 Roland McGrath <roland@redhat.com>
1412 * Makefile.am (noinst_HEADERS): Add loc2c.c.
1414 * test2.c (main): Check sscanf result to quiet warning.
1416 2005-07-20 Roland McGrath <roland@redhat.com>
1418 * libdwfl-branch merged, creating this direcotry.