1 2016-01-08 Mark Wielaard <mjw@redhat.com>
3 * libdwfl_a_SOURCES: Unconditionally add gzip.c.
4 * linux-kernel-modules.c (vmlinux_suffixes): We always have at least
6 (try_kernel_name): Likewise.
7 (check_suffix): Likewise.
8 * open.c (decompress): Likewise.
10 2015-12-18 Mark Wielaard <mjw@redhat.com>
12 * dwfl_module_getdwarf.c (find_symtab): Uncompress symstr, xndx, sym
13 sections and aux_str, aux_xndx and aux_sym sections if necessary.
14 * relocate.c (relocate_getsym): Uncompress symtab and symtab_shndx
16 (resolve_symbol): Uncompress strtab section if necessary.
17 (relocate_section): Uncompress the section the relocations apply to
20 2015-11-18 Chih-Hung Hsieh <chh@google.com>
22 * linux-proc-maps.c (proc_maps_report): Move nested function
23 'report' to file scope.
25 2015-11-18 Chih-Hung Hsieh <chh@google.com>
27 * core-file.c (elf_begin_rand): Move nested function 'fail' to file
29 * core-file.c (dwfl_elf_phdr_memory_callback): Move nested functions
30 'update_end' and 'more' to file scope.
32 2015-11-17 Chih-Hung Hsieh <chh@google.com>
34 * link_map.c (auxv_format_probe): Move nested functions
35 check64 and check32 to file scope.
37 2015-12-08 Jose E. Marchesi <jose.marchesi@oracle.com>
39 * dwfl_frame.c (state_fetch_pc): Add a backend-defined offset to
40 the value of the return address register as defined by the CFI
42 * frame_unwind.c (handle_cfi): Likewise.
44 2015-12-01 Mark Wielaard <mjw@redhat.com>
46 * link_map.c (dwfl_link_map_report): Track whether in.d_buf comes
47 from exec or memory_callback, free as appropriate.
49 2015-12-01 Mark Wielaard <mjw@redhat.com>
51 * libdwflP.h (struct Dwfl_User_Core): New.
52 (struct DWfl): Replace executable_for_core with user_core.
53 * argp-std.c (parse_opt): Store core and fd in Dwfl user_core.
54 * core-file.c (dwfl_core_file_report): Check and store
55 executable_for_core in Dwfl user_core.
56 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Check and use
57 executable_for_core in Dwfl user_core.
58 * dwfl_end.c (dwfl_end): Release resources held in Dwfl user_core.
59 * link-map.c (report_r_debug): Check executable_for_core in Dwfl
61 (dwfl_link_map_report): Likewise.
63 2015-11-16 Chih-Hung Hsieh <chh@google.com>
65 * dwfl_module_getdwarf.c (find_prelink_address_sync): Move nested
66 function 'consider_shdr' to file scope.
67 * dwfl_module_getdwarf.c (find_dynsym): Move nested function
68 'translate_offs' to file scope.
70 2015-11-16 Chih-Hung Hsieh <chh@google.com>
72 * dwfl_module_addrsym.c (__libdwfl_addrsym): Move nested functions
73 'same_section', 'binding_value', 'try_sym_value', and 'search_table'
76 2015-11-19 Mark Wielaard <mjw@redhat.com>
78 * dwfl_module.c (__libdwfl_module_free): Remove Dwfl_Module Ebl from
79 eh_cfi and dwarf_cfi cache if necessary before calling dwarf_end and
82 2015-11-13 Chih-Hung Hsieh <chh@google.com>
84 * gzip.c (unzip): Move nested functions to file scope.
86 2015-10-21 Chih-Hung Hsieh <chh@google.com>
87 Mark Wielaard <mjw@redhat.com>
89 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Move nested
90 functions 'dwarf_line_file', 'dwfl_line', and 'dwfl_line_file' to
91 file scope. Rename dwarf_line_file to dwfl_dwarf_line_file. Don't
94 2015-10-21 Chih-Hung Hsieh <chh@google.com>
96 * frame_unwind.c (expr_eval): Move nested function 'push' and 'pop'
97 to file scope. Pass used local variables in struct eval_stack.
99 2015-10-21 Chih-Hung Hsieh <chh@google.com>
101 * dwfl_module.c (dwfl_report_module): Move nested function 'use' to
104 2015-10-09 Josh Stone <jistone@redhat.com>
106 * core-file.c (elf_begin_rand): Replace loff_t with off_t.
107 * open.c (decompress): Replace off64_t with off_t.
108 * gzip.c (unzip): Likewise.
109 * image-header.c (__libdw_image_header): Likewise.
110 * libdwflP.h: Likewise in function declarations.
111 * argp-std.c (parse_opt): Replace open64 with open.
112 * dwfl_build_id_find_elf.c (__libdwfl_open_mod_by_build_id,
113 dwfl_build_id_find_elf): Likewise.
114 * dwfl_module_getdwarf.c (open_elf_file): Likewise.
115 * dwfl_report_elf.c (dwfl_report_elf): Likewise.
116 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
117 * link_map.c (report_r_debug): Likewise.
118 * offline.c (dwfl_report_offline): Likewise.
119 * linux-proc-maps.c (grovel_auxv, get_pid_class,
120 dwfl_linux_proc_find_elf): Likewise.
121 (read_proc_memory): Replace off64_t with off_t.
122 * find-debuginfo.c (find_debuginfo_in_path): Replace stat64 and
123 fstat64 with stat and fstat.
124 (try_open): Likewise, and replace open64 with open.
125 * linux-kernel-modules.c: Manually define open and fopen to open64 and
126 fopen64 when needed, since the early fts.h include breaks that.
127 (try_kernel_name): Replace open64 with open.
128 (check_notes): Likewise.
130 2015-10-09 Jose E. Marchesi <jose.marchesi@oracle.com>
132 * linux-proc-maps.c (read_proc_memory): Use seek+read instead of
133 pread, as the later doesn't accept negative offsets.
135 2015-10-07 Mark Wielaard <mjw@redhat.com>
137 * dwfl_module_getdwarf.c (MAX): Removed.
138 (find_prelink_address_sync): Allocate exact amount of bytes for
140 * dwfl_segment_report_module.c (dwfl_segment_report_module):
142 * elf-from-memory.c (MAX): Removed.
143 (elf_from_remote_memory): Allocate exact amount of bytes for phdrs.
145 2015-10-05 Chih-Hung Hsieh <chh@google.com>
147 * dwfl_module_getdwarf.c (find_prelink_address_sync): Do not use
148 union of variable length arrays.
149 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
150 * elf-from-memory.c (elf_from_remote_memory): Likewise.
151 * link_map.c (auxv_format_probe): Likewise.
152 * link_map.c (report_r_debug): Likewise.
153 * link_map.c (dwfl_link_map_report): Likewise.
155 2015-09-18 Chih-Hung Hsieh <chh@google.com>
157 * relocate.c (relocate_section): Move nested function "relocate"
158 to file scope, pass all used local variables as constants.
159 Move nested "check_badreltype" to file scope, pass addresses of
160 updated used local variables.
161 * linux-kernel-modules.c (intuit_kernel_bounds): Move nested function
162 "read_address" to file scope, pass all updated local variables in
164 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Move nested
165 function "subst_name" to file scope, pass all used local variables
167 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Replace
168 simple nested function "report" with a macro. Work around gcc static
169 analysis error -Werror=maybe-uninitialized.
171 2015-09-22 Mark Wielaard <mjw@redhat.com>
173 * core-file.c: Remove old-style function definitions.
174 * dwfl_error.c: Likewise.
175 * dwfl_module_dwarf_cfi.c: Likewise.
176 * dwfl_module_eh_cfi.c: Likewise.
177 * dwfl_module_register_names.c: Likewise.
178 * dwfl_module_return_value_location.c: Likewise.
179 * dwfl_version.c: Likewise.
181 2015-09-09 Chih-Hung Hsieh <chh@google.com>
182 Mark Wielaard <mjw@redhat.com>
184 * dwfl_frame.c (dwfl_attach_state): Remove redundant NULL tests
185 on parameters declared with __nonnull_attribute__.
186 * libdwfl.h (dwfl_module_getelf): Don't mark first argument as
189 2015-09-08 Mark Wielaard <mjw@redhat.com>
191 * libdwflP.h (struct __libdwfl_pid_arg): Add elf and elf_fd.
192 * linux-pid-attach.c (pid_detach): Call elf_end and close.
193 (dwfl_linux_proc_attach): Open and save /proc/PID/exe.
195 2015-09-04 Chih-Hung Hsieh <chh@google.com
197 * frame_unwind.c (expr_eval): Use llabs instead of abs.
199 2015-08-14 Dodji Seketeli <dodji@seketeli.org>
201 * find-debuginfo.c (find_debuginfo_in_path): Try to locate the
202 debug info file named debuglink_file under
203 mod->dwfl->callbacks->debuginfo_path, by looking at
204 the set of sub-trees under mod->dwfl->callbacks->debuginfo_path
205 which is common to the set of non-absolute parent trees of
208 2015-06-18 Mark Wielaard <mjw@redhat.com>
210 * find-debuginfo.c (try_open): Free fname on all failure paths.
212 2015-06-18 Mark Wielaard <mjw@redhat.com>
214 * dwfl_module_getdwarf.c (find_symtab): Check shdr is not NULL and
215 sh_entsize is not zero.
217 2015-06-06 Mark Wielaard <mjw@redhat.com>
219 * find-debuginfo.c (find_debuginfo_in_path): Always free localpath,
220 localname and file_dirname.
222 2015-06-06 Mark Wielaard <mjw@redhat.com>
224 * derelocate.c (cache_sections): Free sortrefs.
226 2015-06-05 Mark Wielaard <mjw@redhat.com>
228 * dwfl_segment_report_module.c (dwfl_segment_report_module):
229 If the note_file exists, but the build_id doesn't match discard
230 the file and continue reporting.
232 2015-06-01 Mark Wielaard <mjw@redhat.com>
234 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Copy path
235 pointer before passing to strsep.
237 2015-05-30 Mark Wielaard <mjw@redhat.com>
239 * link_map.c (check32): Use read_4ubyte_unaligned_noncvt to read
241 (read_addrs): Use read_(4|8)ubyte_unaligned_noncvt or to read
244 2015-05-30 Mark Wielaard <mjw@redhat.com>
246 * find-debuginfo.c (dwfl_standard_find_debuginfo): Check file_name is
247 not NULL before calling canonicalize_file_name.
249 2015-05-24 Mark Wielaard <mjw@redhat.com>
251 * derelocate.c (check_module): Check mod is not NULL.
253 2015-05-22 Mark Wielaard <mjw@redhat.com>
255 * link_map.c (dwfl_link_map_report): Allocate phdrs and dyn with
256 malloc instead of stack allocating. Call free when done with data.
258 2015-05-22 Mark Wielaard <mjw@redhat.com>
260 * dwfl_segment_report_module.c (dwfl_segment_report_module):
261 Allocate phdrs with malloc, not on stack. free in finish.
262 Allocate dyn with malloc, not on stack, free after use.
264 2015-05-22 Mark Wielaard <mjw@redhat.com>
266 * find-debuginfo.c (find_debuginfo_in_path): malloc or strdup,
267 instead of alloca or strdupa, local strings of unknown size.
268 Call free before return.
270 2015-05-22 Mark Wielaard <mjw@redhat.com>
272 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Return
273 error when id_len too small or too large. strdup, not strdupa,
274 and free path when done.
276 2015-05-19 Mark Wielaard <mjw@redhat.com>
278 * elf-from-memory.c (elf_from_remote_memory): Don't allocate all
279 phdrs on the stack. Allocate with malloc and free when done.
281 2015-05-19 Mark Wielaard <mjw@redhat.com>
283 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): malloc and
286 2015-05-19 Mark Wielaard <mjw@redhat.com>
288 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't
289 stack allocate name. Only change chars up to suffix.
291 2015-05-18 Mark Wielaard <mjw@redhat.com>
293 * dwfl_module_getdwarf.c (find_prelink_address_sync): Allocate
294 phdrs and shdrs unions with malloc, not alloca. Free after use.
296 2015-05-18 Mark Wielaard <mjw@redhat.com>
298 * derelocate.c (cache_sections): Allocate temporary newrefs and
299 sortrefs with malloc, not alloca. Always free them on return.
301 2015-05-07 Mark Wielaard <mjw@redhat.com>
303 * cu.c (intern_cu): Check for EOF and check cuoff points to a real
304 Dwarf_Die before interning. Explicitly check EOF is expected.
306 2015-05-05 Mark Wielaard <mjw@redhat.com>
308 * dwfl_lineinfo.c (dwfl_lineinfo): Check info->file is valid.
310 2015-05-06 Roland McGrath <roland@hack.frob.com>
312 * dwfl_error.c (struct msgtable): Break type definition out of
313 the 'msgtable' initializer.
314 (msgtable): Make it a union of struct msgtable and a char array.
315 (msgstr): Use the full-table char array rather than the msg_0 entry.
317 2015-04-23 Max Filippov <jcmvbkbc@gmail.com>
319 * core-file.c (_compat_without_executable_dwfl_core_file_report):
320 Guard with SYMBOL_VERSIONING.
321 * dwfl_module_build_id.c (_compat_vaddr_at_end_dwfl_module_build_id):
323 * dwfl_report_elf.c (_compat_without_add_p_vaddr_dwfl_report_elf):
326 2015-04-02 Mark Wielaard <mjw@redhat.com>
328 * segment.c (insert): Check correct number of lookup_elts.
330 2015-03-31 Mark Wielaard <mjw@redhat.com>
332 * core-file.c (core_file_read_eagerly): Special case small images.
334 2015-01-26 Mark Wielaard <mjw@redhat.com>
336 * dwfl_module_getdwarf.c (find_symtab): Explicitly clear symdata,
337 syments and first_global on elferr before calling find_dynsym.
339 2014-12-27 Mark Wielaard <mjw@redhat.com>
341 * dwfl_module_getsrc.c (dwfl_module_getsrc): Never match a line that
342 has end_sequence set.
344 2015-01-04 Mark Wielaard <mjw@redhat.com>
346 * cu.c (intern_cu): Store result and return directly when finding
348 (__libdwfl_nextcu): Check *nextp as returned by intern_cu isn't -1.
350 2014-12-19 Mark Wielaard <mjw@redhat.com>
352 * dwfl_module_getdwarf.c (find_symtab): Always try find_dynsym last.
354 2014-12-19 Mark Wielaard <mjw@redhat.com>
356 * elf-from-memory.c (handle_segment): Remove palign sanity check.
358 2014-12-18 Mark Wielaard <mjw@redhat.com>
360 * relocate.c (resolve_symbol): Make sure symstrdata->d_buf != NULL.
362 2014-12-13 Mark Wielaard <mjw@redhat.com>
364 * dwfl_module_getdwarf.c (find_dynsym): elf_getdata_rawchunk takes
365 a size_t, make sure it doesn't overflow.
367 2014-12-13 Mark Wielaard <mjw@redhat.com>
369 * cu.c (cudie_offset): Make sure Dwarf_Off difference doesn't
370 wrap around before returning as int.
372 2014-12-11 Josh Stone <jistone@redhat.com>
374 * dwfl_module_getsrc.c (dwfl_module_getsrc): Return the *last* line
375 record <= addr, rather than returning immediately on matches.
377 2014-12-09 Mark Wielaard <mjw@redhat.com>
379 * dwfl_segment_report_module.c (handle_file_note): Check count doesn't
382 2014-12-07 Mark Wielaard <mjw@redhat.com>
384 * relocate.c (relocate_section): Sanity check section overlap against
385 actually used ehsize, shentsize and phentsize.
387 2014-12-07 Mark Wielaard <mjw@redhat.com>
389 * offline.c (dwfl_offline_section_address): Assert shndx is not zero.
390 * relocate.c (__libdwfl_relocate_value): Don't relocate against
393 2014-11-29 Mark Wielaard <mjw@redhat.com>
395 * relocate.c (relocate_section): Check relocation section and target
396 section data don't overlap any of the ELF headers.
397 (relocate): Check for offset + size overflow.
399 2014-11-22 Mark Wielaard <mjw@redhat.com>
401 * link_map.c (consider_executable): Use elf_getphdrnum.
402 (dwfl_link_map_report): Likewise.
404 2014-11-18 Mark Wielaard <mjw@redhat.com>
406 * dwfl_module_getdwarf.c (find_symtab): Sanity check the data buffer,
407 number of symbols and first_global before use.
409 2014-11-14 Mark Wielaard <mjw@redhat.com>
411 * dwfl_module_getdwarf.c (load_symtab): Don't use tables which have
414 2014-11-10 Mark Wielaard <mjw@redhat.com>
416 * dwfl_module_getdwarf.c (find_dynsym): New inner function
417 translate_offs that takes an adjust argument. Try finding
418 the symbol table with and without adjusting to main_bias.
420 2014-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
422 Support NT_FILE for locating files.
423 * core-file.c (dwfl_core_file_report): New variables note_file and
424 note_file_size, set them and pass them to dwfl_segment_report_module.
425 * dwfl_segment_report_module.c: Include common.h and fcntl.h.
426 (buf_has_data, buf_read_ulong, handle_file_note): New functions.
427 (invalid_elf): New function from code of dwfl_segment_report_module.
428 (dwfl_segment_report_module): Add parameters note_file and
429 note_file_size. New variables elf and fd, clean them up in finish.
430 Move some code to invalid_elf. Call handle_file_note, if it found
431 a name verify the file by invalid_elf. Protect elf and fd against
432 cleanup by finish if we found the file for new Dwfl_Module.
433 * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and
436 2014-09-23 Mark Wielaard <mjw@redhat.com>
438 * dwfl_segment_report_module.c (dwfl_segment_report_module):
439 Extract ei_class, ei_data and e_type early and use the result.
441 2014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com>
443 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Use IS_EXECUTABLE.
444 * dwfl_segment_report_module.c (dwfl_segment_report_module): Set
446 * libdwflP.h (struct Dwfl_Module): New field is_executable.
448 2014-08-28 Jan Kratochvil <jan.kratochvil@redhat.com>
450 * dwfl_module_getdwarf.c (find_offsets): Add parameter main_bias, use
452 (find_dynsym): Pass the new parameter main_bias.
454 2014-08-14 Mark Wielaard <mjw@redhat.com>
456 * linux-kernel-modules.c (check-suffix): Also TRY .ko.xz.
458 2014-07-24 Jan Kratochvil <jan.kratochvil@redhat.com>
460 Fix report_r_debug for prelinked libraries.
461 * link_map.c (report_r_debug): Comment out variable l_addr.
462 Use instead new variable base recalculated from l_ld.
464 2014-06-24 Kurt Roeckx <kurt@roeckx.be>
466 * linux-pid-attach.c: Make it build on non linux hosts.
468 2014-06-17 Mark Wielaard <mjw@redhat.com>
470 * frame_unwind.c (handle_cfi): Use ebl_func_addr_mask.
471 * dwfl_module_getsym.c (__libdwfl_getsym): Likewise.
473 2014-06-15 Mark Wielaard <mjw@redhat.com>
475 * linux-core-attach.c (core_memory_read): Use libdw/memory-access.h
476 macros read_4ubyte_unaligned_noncvt and read_8ubyte_unaligned_noncvt
477 to read possibly unaligned data.
478 (core_next_thread): Likewise.
479 (core_set_initial_registers): Likewise.
480 (dwfl_core_file_attach): Likewise.
482 2014-06-11 Mark Wielaard <mjw@redhat.com>
484 * dwfl_frame.c (__libdwfl_process_free): Reset dwfl->attacherr.
485 (dwfl_attach_state): Set dwfl->attacherr.
486 (dwfl_pid): Check and return dwfl->attacherr if set.
487 (dwfl_getthreads): Likewise.
488 (getthread): Likewise.
489 * libdwflP.h: Add DWFL_E_NO_CORE_FILE.
490 (struct Dwfl): Add attacherr field.
491 * linux-core-attach.c (dwfl_core_file_attach): Set dwfl->attacherr.
492 Don't assert if ELF file is not ET_CORE, just return error.
493 * linux-pid-attach.c (dwfl_linux_proc_attach): Set dwfl->attacherr.
495 2014-06-10 Mark Wielaard <mjw@redhat.com>
497 * argp-std.c (parse_opt): Ignore errors from dwfl_core_file_attach
498 or dwfl_linux_proc_attach.
500 2014-05-15 Mark Wielaard <mjw@redhat.com>
502 * linux-proc-maps.c (grovel_auxv): Close fd on error.
504 2014-05-02 Mark Wielaard <mjw@redhat.com>
506 * dwfl_module_getdwarf: Remove ENABLE_DWZ ifdefs so find_debug_altlink
509 2014-05-01 Mark Wielaard <mjw@redhat.com>
511 * libdwflP.h (struct Dwfl_Module): Add alt, alt_fd and alt_elf fields.
512 (__libdwfl_open_mod_by_build_id): Renamed __libdwfl_open_by_build_id.
513 (__libdwfl_open_by_build_id): New declaration that takes an explicit
515 * dwfl_build_id_find_debuginfo.c (dwfl_build_id_find_debuginfo): If
516 we already have the Dwarf then look for the alt dwz multi file by
518 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Add the
519 build-id we are looking for as argument.
520 (__libdwfl_open_mod_by_build_id): New function, calls
521 __libdwfl_open_by_build_id.
522 (dwfl_build_id_find_elf): Call __libdwfl_open_mod_by_build_id.
523 * dwfl_module.c (__libdwfl_module_free): Release alt, alt_elf and
524 close alt_fd if necessary.
525 * dwfl_module_getdwarf.c (__check_build_id): Removed.
526 (try_debugaltlink): Removed.
527 (open_debugaltlink): Removed.
528 (open_elf_file): First half of open_elf that just opens the elf
529 file but doesn't setup the load address.
530 (open_elf): Call open_elf_file.
531 (find_debug_altlink): New function.
532 (load_dw): Remove loading of dwz multifile.
533 (find_dw): Call find_debug_altlink.
534 * find-debuginfo.c (validate): Handle alt debug case using
535 dwelf_dwarf_gnu_debugaltlink and mod->alt_elf.
536 (find_debuginfo_in_path): Handle alt debug files possibly in .dwz
538 * linux-kernel-modules.c (try_kernel_name): Use fakemod.debug.name
539 to store name to find by dwfl_standard_find_debuginfo instead of
540 allocating an extra variable on stack.
542 2014-04-30 Mark Wielaard <mjw@redhat.com>
544 * dwfl_module_build_id.c (__libdwfl_find_elf_build_id): Moved to
545 dwelf_elf_gnu_build_id.c.
546 (__libdwfl_find_build_id): Add assert to make sure mod is never NULL.
547 * dwfl_segment_report_module.c (dwfl_segment_report_module): Call
548 dwelf_elf_gnu_build_id directly instead of __libdwfl_find_build_id.
549 * dwfl_module_getdwarf.c (__check_build_id): Implement using
550 dwelf_elf_gnu_build_id.
552 2014-04-15 Florian Weimer <fweimer@redhat.com>
554 * dwfl_module_getdwarf.c (__check_build_id): Moved from libdw.
555 (try_debugaltlink): Likewise.
556 (open_debugaltlink): Likewise.
557 (load_dw): Locate alternate debug information using
558 dwelf_dwarf_gnu_debugaltlink and call open_debugaltlink.
560 2014-04-11 Mark Wielaard <mjw@redhat.com>
562 * Makefile.am (AM_CPPFLAGS): Add libdwelf.
563 * libdwflP.h: Include libdwelfP.h.
564 * dwfl_module_getdwarf.c (find_debuglink): Moved to libdwelf.
565 (find_debuginfo): Use dwelf_elf_gnu_debuglink.
567 2014-04-22 Mark Wielaard <mjw@redhat.com>
569 * frame_unwind.c (__libdwfl_frame_reg_get): Use uint64_t when
571 (__libdwfl_frame_reg_set): Likewise.
573 2014-04-22 Kurt Roeckx <kurt@roeckx.be>
575 * linux-pid-attach.c: Make linux only.
577 2014-03-14 Mark Wielaard <mjw@redhat.com>
579 * Makefile.am: Remove !MUDFLAP and MUDFLAP conditions.
580 Remove libelf and libdw definitions when MUDFLAP is defined.
581 * argp-std.c (__libdwfl_argp_mudflap_options): Removed.
583 2014-03-03 Mark Wielaard <mjw@redhat.com>
585 * elf-from-memory.c (elf_from_remote_memory): Keep track of
586 segments_end_mem. Pass memsz to first handle_segment pass. Only
587 extend contents_size and use shdrs if only file bits are in
590 2014-03-11 Josh Stone <jistone@redhat.com>
592 * dwfl_module_getdwarf.c (open_elf): Only explicitly set
593 mod->e_type when processing the main ELF file.
595 2014-03-04 Mark Wielaard <mjw@redhat.com>
597 * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from
598 linux-pid-attach.c (struct pid_arg).
599 (__libdwfl_get_pid_arg): New internal function declaration.
600 (__libdwfl_ptrace_attach): Likewise.
601 (__libdwfl_ptrace_detach): Likewise.
602 * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the
603 special exception modules that cannot be checked at this point.
604 * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h
605 (ptrace_attach): Renamed to...
606 (__libdwfl_ptrace_attach): New internal function.
607 (__libdwfl_ptrace_detach): Likewise. Extracted from ...
608 (pid_thread_detach): Call __libdwfl_ptrace_detach now.
609 (__libdwfl_get_pid_arg): New internal function.
610 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special
611 module name contains "(deleted)" and dwfl_pid gives an attached
612 pid. If pid is set and try to (re)use ptrace attach state of
613 process before reading memory.
615 2014-03-03 Mark Wielaard <mjw@redhat.com>
617 * elf-from-memory.c (elf_from_remote_memory): Take pagesize as
618 argument. Free buffer when detecting bad elf. Check PT_LOAD
619 alignment requirements on first handle_segment pass. Calculate
620 loadbase, start and end of segment using pagesize, not p_align.
621 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize
622 to elf_from_remote_memory.
624 2014-02-26 Mark Wielaard <mjw@redhat.com>
626 * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
628 2014-02-26 Mark Wielaard <mjw@redhat.com>
630 * elf-from-memory.c (elf_from_remote_memory): Check against p64
631 p_type in case ELFCLASS64, not against p32 p_type.
633 2014-01-17 Petr Machata <pmachata@redhat.com>
635 * relocate.c (relocate_section): Use gelf_fsize instead of relying
638 2014-01-05 Mark Wielaard <mjw@redhat.com>
640 * frame_unwind.c (handle_cfi): Only skip resetting return register
641 if the regno is not the actual CIE return address register.
643 2014-01-02 Mark Wielaard <mjw@redhat.com>
645 * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi.
647 2013-12-30 Mark Wielaard <mjw@redhat.com>
649 * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and
650 dwfl_core_file_attach explicitly.
651 * core-file.c (dwfl_core_file_report): Don't call
652 __libdwfl_attach_state_for_core implicitly.
653 * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error.
654 * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not
655 process_attach_error.
656 (dwfl_getthreads): Likewise.
657 (getthread): Likewise.
658 * libdwfl.h (dwfl_core_file_report): Update documentation.
659 (dwfl_linux_proc_report): Likewise.
660 (dwfl_core_file_attach): New function declaration.
661 (dwfl_linux_proc_attach): Likewise.
662 * libdwflP.h (struct Dwfl): Remove process_attach_error.
663 (__libdwfl_attach_state_for_pid): Removed declaration.
664 (__libdwfl_attach_state_for_core): Likewise.
665 (dwfl_core_file_attach): New internal declaration.
666 (dwfl_linux_proc_attach): Likewise.
667 (attach_state_for_core): Renamed to...
668 (dwfl_core_file_attach): ...this. Change return type.
669 (__libdwfl_attach_state_for_core): Removed.
670 * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped.
671 (pid_set_initial_registers): Check assume_ptrace_stopped before
673 (pid_thread_detach): Likewise.
674 (__libdwfl_attach_state_for_pid): Renamed to...
675 (dwfl_linux_proc_attach): ...this. Adjust return type.
676 * linux-proc-maps.c (dwfl_linux_proc_report): Don't call
677 __libdwfl_attach_state_for_pid implicitly.
679 2013-12-28 Mark Wielaard <mjw@redhat.com>
681 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special
682 character device files, only regular files.
684 2013-12-24 Mark Wielaard <mjw@redhat.com>
686 * linux-core-attach.c (core_next_thread): Check whether thread_argp
687 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
688 in that case. Free thread_arg if there are no more threads.
690 2013-12-23 Mark Wielaard <mjw@redhat.com>
692 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
693 build_id before returning early.
695 2013-12-23 Mark Wielaard <mjw@redhat.com>
697 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
698 pid (thread group leader) to dwfl_attach_state.
700 2013-12-21 Mark Wielaard <mjw@redhat.com>
702 * frame_unwind.c (handle_cfi): Track whether the return register
703 has been set and only allow it to be set once.
705 2013-12-20 Mark Wielaard <mjw@redhat.com>
707 * dwfl_frame.c (one_arg): New struct.
708 (get_one_thread_cb): New function.
709 (dwfl_getthread): Likewise.
710 (one_thread): New struct.
711 (get_one_thread_frames_cb): New function.
712 (dwfl_getthread_frames): Likewise.
713 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
714 (dwfl_getthread_frames): Likewise.
715 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
716 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
718 * linux-pid-attach.c (pid_getthread): New function.
719 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
721 2013-12-20 Mark Wielaard <mjw@redhat.com>
723 * linux-kernel-modules.c (report_kernel_archive): Correct nested
724 asprintf result check for debug.a.
726 2013-12-18 Mark Wielaard <mjw@redhat.com>
728 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
729 * dwfl_module_addrname.c (dwfl_module_addrname): Use
730 dwfl_module_addrinfo.
731 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
732 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
733 for comparisons, not st_value. Fill in off. Search for both value
734 and the (adjusted) sym.st_value when different.
735 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
736 (dwfl_module_addrinfo): New function.
737 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
738 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
739 and possible. Adjust sym->st_value only when requested. Fill in addr
741 (dwfl_module_getsym_info): New function.
742 (dwfl_module_getsym): Use __libdwfl_getsym.
743 * libdwfl.h (dwfl_module_getsym_elf): Removed.
744 (dwfl_module_getsym_info): New function declaration.
745 (dwfl_module_addrinfo): Likewise.
746 (dwfl_module_addrsym): Add documentation describing differences
747 with addrinfo variants.
748 (dwfl_module_addrsym_elf): Removed.
749 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
750 (__libdwfl_addrsym): Likewise.
751 (__libdwfl_find_section_ndx): Likewise.
752 (dwfl_module_addrinfo): New internal declaration.
753 (dwfl_module_getsym_info): Likewise.
754 (dwfl_module_addrsym_elf): Removed.
755 (dwfl_module_getsym_elf): Likewise.
757 2013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
759 * argp-std.c (offline_find_elf): Remove.
760 (offline_callbacks): Use dwfl_build_id_find_elf instead.
761 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
764 2013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
766 unwinder: s390 and s390x
767 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
768 * frame_unwind.c (new_unwound): New function from ...
769 (handle_cfi): ... here. Call it.
770 (setfunc, getfunc, readfunc): New functions.
771 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
772 * linux-core-attach.c (core_set_initial_registers): Always iterate
773 through the Ebl_Register_Location loop. Call
774 dwfl_thread_state_register_pc there.
776 2013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
778 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
780 2013-12-17 Mark Wielaard <mjw@redhat.com>
782 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
785 2013-12-16 Mark Wielaard <mjw@redhat.com>
787 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
789 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
791 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
793 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
795 2013-12-14 Mark Wielaard <mjw@redhat.com>
797 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
798 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
799 * frame_unwind.c (handle_cfi): Free frame result from
800 dwarf_cfi_addrframe when done.
802 2013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
804 unwinder: ppc and ppc64
805 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
806 Call ebl_dwarf_to_regno.
807 * linux-core-attach.c (core_set_initial_registers): Implement
809 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
812 2013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
814 Introduce process_attach_error.
815 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
816 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
818 * libdwflP.h (struct Dwfl): New field process_attach_error.
819 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
820 (attach_state_for_core): ... here, make it static, change return type,
821 no longer use __libdwfl_seterrno.
822 (__libdwfl_attach_state_for_core): New wrapper for it.
824 2013-11-27 Mark Wielaard <mjw@redhat.com>
826 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
827 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
828 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
829 instead of tracking dwfl_files.
830 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
831 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
832 new elfp and biasp arguments. Track elf instead of file.
833 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
834 dwfl_module_info.c (dwfl_module_info): Pass elf to
835 dwfl_adjusted_st_value.
836 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
837 (dwfl_module_getsym_elf): New function declaration.
838 (dwfl_module_addrsym_elf): Likewise.
839 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
840 (dwfl_module_getsym_elf): Likewise.
841 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
842 (dwfl_deadjust_st_value): Likewise.
843 (__libdwfl_module_getsym): Removed.
844 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
846 2013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
848 Fix non-build-id core files on build-id system.
849 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
852 2013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
854 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
855 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
856 content, if possible.
858 2013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
860 link_map: Use proper bias, not l_addr.
861 * core-file.c (dynamic_vaddr_get): Rename to ...
862 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
864 (dwfl_core_file_report): Update name in the caller.
865 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
866 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
867 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
868 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
870 2013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
872 Compatibility with older kernels such as RHEL-6.
873 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
874 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
875 (pid_set_initial_registers): Pass tid_was_stopped.
876 (pid_thread_detach): Use tid_was_stopped.
878 2013-11-18 Josh Stone <jistone@redhat.com>
880 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
881 (find_aux_sym): Use it.
883 2013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
885 Code cleanup: Remove const in prototype
886 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
888 * libdwfl.h (dwfl_thread_state_registers): Likewise.
889 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
891 2013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
893 Fix dwfl_attach_state machine->elf.
894 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
895 Call ebl_openbackend instead of ebl_openbackend_machine.
896 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
897 Update the function description.
898 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
900 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
903 2013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
905 Provide __libdwfl_module_getsym to get dwfl_file *.
906 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
907 (dwfl_module_addrsym) (search_table): New variable file. Use
908 __libdwfl_module_getsym. Use file.
909 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
910 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
911 (dwfl_module_getsym): New wrapper.
912 * libdwflP.h (__libdwfl_module_getsym): New declaration.
914 2013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
916 Fix dwfl_module_addrsym for minidebuginfo.
917 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
919 (dwfl_module_addrsym) (same_section): Use it.
920 (dwfl_module_addrsym) (i_to_symfile): New function.
921 (dwfl_module_addrsym) (search_table): Use it.
923 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
924 Mark Wielaard <mjw@redhat.com>
926 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
927 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
929 * core-file.c (dwfl_core_file_report): Call
930 __libdwfl_attach_state_for_core.
931 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
932 * dwfl_frame.c: New file.
933 * frame_unwind.c: New file.
934 * dwfl_frame_pc.c: New file.
935 * linux-pid-attach.c: New file.
936 * linux-core-attach.c: New file.
937 * dwfl_frame_regs.c: New file.
938 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
939 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
940 (Dwfl_Thread_Callbacks): New definition.
941 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
942 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
943 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
944 (dwfl_frame_pc): New declarations.
945 * libdwflP.h (Dwfl_Process): New typedef.
946 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
947 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
948 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
949 (INVALID_ARGUMENT): New DWFL_ERROR entries.
950 (struct Dwfl): New entry process.
951 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
952 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
953 (__libdwfl_process_free, __libdwfl_frame_unwind)
954 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
955 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
956 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
957 (dwfl_frame_thread, dwfl_thread_state_registers)
958 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
959 (dwfl_frame_pc): New INTDECL entries.
960 * linux-proc-maps.c (dwfl_linux_proc_report): Call
961 __libdwfl_attach_state_for_pid.
962 * segment.c (segment_start): Rename to ...
963 (__libdwfl_segment_start): ... here and make it internal_function.
964 (segment_end): Rename to ...
965 (__libdwfl_segment_end): ... here and make it internal_function.
966 (reify_segments, dwfl_report_segment): Rename them at the callers.
968 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
970 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
972 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
974 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
975 retval. Fix one forgotten LISTED increase.
977 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
979 Fix core files for re-prelink-ed files.
980 * core-file.c (dynamic_vaddr_get): New function.
981 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
982 dynamic_vaddr_get instead of using L_ADDR.
983 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
984 * link_map.c (report_r_debug): Do not initialize l_addr.
986 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
989 * core-file.c (dwfl_core_file_report): Reindent block of code by
992 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
994 * argp-std.c (parse_opt): Use executable parameter of
995 dwfl_core_file_report.
996 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
997 it to DWFL. Add NEW_VERSION for it.
998 (_compat_without_executable_dwfl_core_file_report): New. Twice.
999 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
1000 the function comment.
1002 2013-10-15 Mark Wielaard <mjw@redhat.com>
1004 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
1006 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
1008 2013-09-12 Mark Wielaard <mjw@redhat.com>
1010 * cu.c (intern_cu): If dwarf_offdie fails free cu.
1012 2013-09-12 Mark Wielaard <mjw@redhat.com>
1014 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
1017 2013-09-12 Mark Wielaard <mjw@redhat.com>
1019 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
1020 aux_xndxscn, not xndxscn, for aux_symxndxdata.
1022 2013-08-25 Mark Wielaard <mjw@redhat.com>
1024 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
1027 2013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
1029 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
1030 conflicts all the modules, not just the first one. Compare L_LD if it
1031 is equal, not if it is in a module address range.
1033 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
1035 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
1037 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
1039 * core-file.c (clear_r_debug_info): Close also ELF and FD.
1040 (dwfl_core_file_report): Call __libdwfl_report_elf for
1041 R_DEBUG_INFO.MODULE.
1042 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
1044 (__libdwfl_report_elf): ... this function. Call it.
1045 * dwfl_segment_report_module.c: Include unistd.h.
1046 (dwfl_segment_report_module): Use basename for MODULE->NAME.
1047 Clear MODULE if it has no build-id and we have segment with build-id.
1048 Ignore this segment only if MODULE still contains valid ELF.
1049 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
1050 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
1051 and disk_file_has_build_id.
1052 (dwfl_link_map_report): Extend the comment.
1053 * link_map.c (report_r_debug): Extend the comment. Always fill in new
1054 r_debug_info_module. Initialize also the new r_debug_info_module
1055 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
1056 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
1058 2013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
1060 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
1062 2013-07-02 Mark Wielaard <mjw@redhat.com>
1064 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
1066 2013-06-05 Mark Wielaard <mjw@redhat.com>
1068 * link_map.c (report_r_debug): Always call release_buffer after
1069 memory_callback succeeded reading build_id.
1071 2013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1073 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
1074 executable_for_core before calling dwfl_core_file_report.
1075 * core-file.c (clear_r_debug_info): New function.
1076 (dwfl_core_file_report): Move raw segments reporting lower. New
1077 variable r_debug_info, pass it to dwfl_segment_report_module. Call
1078 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
1079 * dwfl_module_build_id.c (check_notes): Move into
1080 __libdwfl_find_elf_build_id.
1081 (__libdwfl_find_build_id): Rename to ...
1082 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
1083 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
1084 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
1085 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
1086 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
1087 adjust its data_elfaddr parameter.
1088 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
1089 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
1090 parameter r_debug_info. New variable name_is_final. Adjust addresses
1091 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
1092 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
1093 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
1094 (struct r_debug_info_module, struct r_debug_info): New definitions.
1095 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
1097 * link_map.c: Include fcntl.h.
1098 (report_r_debug): Add parameter r_debug_info, describe it in the
1099 function comment. Delete dwfl_addrmodule call and its dependent code.
1100 Verify build-id before calling dwfl_report_elf, also supply
1101 executable_for_core to it. Store r_debug_info->module info when
1103 (dwfl_link_map_report): Add parameter r_debug_info. New variable
1104 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
1107 2013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1109 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
1110 Set it to true for ET_EXEC and ET_CORE. Provide alternative
1111 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
1112 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
1114 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
1116 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
1117 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
1118 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
1119 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
1121 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
1123 2013-04-27 Mark Wielaard <mjw@redhat.com>
1125 * link_map.c: #include system.h.
1127 2013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
1129 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
1130 them to lib/system.h.
1132 2013-04-24 Mark Wielaard <mjw@redhat.com>
1134 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1136 2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
1138 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
1140 2013-03-12 Mark Wielaard <mjw@redhat.com>
1142 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
1144 2013-02-22 Mark Wielaard <mjw@redhat.com>
1146 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
1147 as DWFL_E_BADELF when not used.
1149 2013-02-10 Mark Wielaard <mjw@redhat.com>
1151 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
1152 failure messages When handling ARGP_KEY_SUCCESS because arg will
1155 2013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1157 * linux-proc-maps.c: Include system.h.
1158 (PROCEXEFMT, get_pid_class): New.
1159 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
1162 2013-01-23 Mark Wielaard <mjw@redhat.com>
1164 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
1165 from aux_syments by default.
1166 (find_symtab): Also succeed when only aux_symdata is found.
1167 When no symtab is found always try to load auxiliary table.
1168 (dwfl_module_getsymtab): Substract one from result when both
1169 tables have symbols.
1170 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
1171 zero entry when both tables have symbols.
1172 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
1173 one from first_global when both tables have symbols.
1175 2013-01-16 Mark Wielaard <mjw@redhat.com>
1177 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
1178 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
1179 (dwfl_adjusted_aux_sym_addr): New function.
1180 (dwfl_deadjust_aux_sym_addr): Likewise.
1181 (dwfl_adjusted_st_value): Take and check symfile argument.
1182 (dwfl_deadjust_st_value): Likewise.
1183 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
1184 use dwfl_file as argument to set address_sync.
1185 (find_debuginfo): Call find_prelink_address_sync with debug file.
1186 (find_aux_sym): New function.
1187 (find_symtab): Use find_aux_sym if all we have is the dynsym table
1188 and fill in aux DwflModule fields.
1189 (dwfl_module_getsymtab): Return syments plus aux_syments.
1190 (load_symtab): Always set first_global.
1191 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
1192 when using same_section. Calculate first_global based on both
1193 mod->first_global and mod->aux_first_global.
1194 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
1195 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
1196 to retrieve symbol and name if necessary, making sure all locals
1197 from any table come before any globals.
1198 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
1200 * relocate.c (resolve_symbol): Likewise.
1202 2013-01-07 Roland McGrath <roland@hack.frob.com>
1204 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
1205 still assume the data is at least 32-bit aligned anyway.
1206 (dwfl_link_map_report): Handle unaligned auxv data.
1208 2012-12-11 Mark Wielaard <mjw@redhat.com>
1210 * linux-kernel-modules.c (report_kernel): Only free fname if
1211 find_kernel_elf succeeds and allocates it.
1212 (report_kernel_archive): Fix brackets around unlikely expression.
1214 2012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
1216 * argp-std.c: Update Copyright year.
1217 (offline_find_elf): New function.
1218 (offline_callbacks): Use it for find_elf.
1219 (struct parse_opt): New.
1220 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
1221 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
1222 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
1223 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
1224 final state->input initialization optional.
1225 * dwfl_end.c: Update Copyright year.
1226 (dwfl_end): Free executable_for_core.
1227 * libdwflP.h: Update Copyright year.
1228 (struct Dwfl): New field executable_for_core.
1230 2012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
1232 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
1235 2012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1237 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
1239 (__libdwfl_getelf): ... here. Call it.
1241 2012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1243 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
1245 2012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
1247 * dwfl_segment_report_module.c (dwfl_segment_report_module):
1248 Initialize mod->MAIN_BIAS.
1250 2012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
1252 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
1253 binding_value. Use it for both zero and non-zero size symbols
1256 2012-10-01 Mark Wielaard <mjw@redhat.com>
1258 * cu.c (cudie_offset): Don't use type_sig8, it might not be
1259 initialized and these are always real CUs, never TUs.
1261 2012-10-01 Mark Wielaard <mjw@redhat.com>
1263 * derelocate.c (find_section): Check next section exists before
1266 2012-08-01 Petr Machata <pmachata@redhat.com>
1268 * offline.c (process_archive_member): Ignore entry "/SYM64/".
1270 2012-03-28 Roland McGrath <roland@hack.frob.com>
1272 * dwfl_segment_report_module.c
1273 (dwfl_segment_report_module: read_portion): Don't use existing buffer
1274 when FILESZ is zero (string mode) and available portion doesn't hold
1275 a terminated string.
1277 2011-12-02 Roland McGrath <roland@hack.frob.com>
1279 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
1280 to use elf64_xlatetom and PHDRS.p64.
1281 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
1283 2011-11-31 Mark Wielaard <mjw@redhat.com>
1285 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
1286 global symbols. Then only when that doesn't provide a match search
1287 all local symbols too.
1288 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
1290 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
1291 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
1293 2011-11-31 Mark Wielaard <mjw@redhat.com>
1295 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
1296 sizeless_sym if needed and closer to desired addr.
1298 2011-10-20 Mark Wielaard <mjw@redhat.com>
1300 * derelocate.c (cache_sections): Intern mod->reloc_info check.
1301 (dwfl_module_relocations): Don't check mod->reloc_info.
1302 (dwfl_module_relocation_info): Likewise.
1303 (find_section): Likewise.
1305 2011-07-09 Roland McGrath <roland@hack.frob.com>
1307 * image-header.c (LE32): Macro removed (now in lib/system.h).
1309 2011-04-11 Mark Wielaard <mjw@redhat.com>
1311 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
1312 by check for zlib, bzlib or lzma defines to check it isn't empty.
1313 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
1315 2011-03-08 Roland McGrath <roland@redhat.com>
1317 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
1318 Reported by Kurt Roeckx <kurt@roeckx.be>.
1320 2011-02-11 Roland McGrath <roland@redhat.com>
1322 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
1323 suffixes if corresponding decompression support is enabled.
1325 2011-02-01 Roland McGrath <roland@redhat.com>
1327 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
1328 section-end address as the synchronization point, rather than sh_addr.
1330 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
1331 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
1333 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
1334 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
1336 2011-01-11 Roland McGrath <roland@redhat.com>
1338 * dwfl_module_getdwarf.c (open_elf): Remove section-based
1339 address_sync fixup from here.
1340 (find_prelink_address_sync): New function.
1341 (find_debuginfo): Call it.
1342 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
1344 2011-01-04 Roland McGrath <roland@redhat.com>
1346 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
1347 logic to consider section addresses, the better to survive all the
1348 possible prelink machinations.
1349 * libdwflP.h (struct dwfl_file): Comment change.
1351 2010-11-30 Roland McGrath <roland@redhat.com>
1353 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
1355 2010-11-12 Roland McGrath <roland@redhat.com>
1357 * libdwflP.h (struct Dwfl_Module): New member main_bias.
1358 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
1359 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
1361 * libdwflP.h (dwfl_deadjust_address): New function.
1362 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
1363 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
1364 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
1366 2010-11-11 Roland McGrath <roland@redhat.com>
1368 * libdwflP.h (struct dwfl_file): Remove bias member.
1369 Add vaddr and address_sync members instead.
1370 (dwfl_adjusted_address): Calculate using vaddr.
1371 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
1372 (dwfl_adjusted_st_value): Use one of those calls.
1373 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
1374 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
1375 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
1376 * link_map.c (consider_executable): Adjust only MOD->low_addr for
1377 detected PIE bias change.
1379 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
1380 * dwfl_module_info.c: Use it.
1381 * cu.c (addrarange): Likewise.
1382 * dwfl_dwarf_line.c: Likewise.
1383 * dwfl_module_dwarf_cfi.c: Likewise.
1384 * dwfl_lineinfo.c: Likewise.
1385 * dwfl_nextcu.c: Likewise.
1386 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
1388 * libdwflP.h (dwfl_adjusted_st_value): New function.
1389 * relocate.c (resolve_symbol): Use it.
1390 * dwfl_module_getsym.c: Likewise.
1391 * dwfl_module_addrsym.c: Likewise.
1392 * dwfl_module_info.c: Likewise.
1394 * libdwflP.h (dwfl_adjusted_address): New function.
1395 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
1396 * relocate.c (__libdwfl_relocate_value): Likewise.
1397 * derelocate.c (cache_sections): Likewise.
1398 (dwfl_module_address_section): Likewise.
1399 * dwfl_module_getelf.c: Likewise.
1400 * dwfl_module_eh_cfi.c: Likewise.
1401 * link_map.c (consider_executable): Likewise.
1403 2010-08-24 Roland McGrath <roland@redhat.com>
1405 * dwfl_dwarf_line.c: New file.
1406 * Makefile.am (libdwfl_a_SOURCES): Add it.
1408 2010-08-18 Roland McGrath <roland@redhat.com>
1410 * link_map.c (report_r_debug): Use found name if we have no name,
1411 even if we already have an Elf handle.
1413 2010-06-30 Roland McGrath <roland@redhat.com>
1415 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
1416 confused by -1 return from dwfl_build_id_find_elf after it opened
1418 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
1419 dwfl_build_id_find_debuginfo.
1421 2010-06-16 Roland McGrath <roland@redhat.com>
1423 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
1425 2010-06-14 Roland McGrath <roland@redhat.com>
1427 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
1428 candidate file to that st_dev/st_ino and pretend it didn't exist
1430 (find_debuginfo_in_path): Update caller, pass main file's info.
1432 2010-05-20 Roland McGrath <roland@redhat.com>
1434 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
1435 (grovel_auxv): ... this. Take DWFL argument.
1436 (dwfl_linux_proc_report): Update caller.
1438 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
1439 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
1441 2010-05-19 Roland McGrath <roland@redhat.com>
1443 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
1445 2010-05-06 Roland McGrath <roland@redhat.com>
1447 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
1449 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
1450 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
1451 ID but we didn't find a file.
1452 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
1453 and refuse any fallback file-by-name if it lacks the matching ID.
1455 * dwfl_error.c (dwfl_errno): Add INTDEF.
1456 * libdwflP.h: Add INTDECL.
1458 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
1461 2010-05-04 Roland McGrath <roland@redhat.com>
1463 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
1464 ET_DYN that has a DT_DEBUG.
1466 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
1468 * segment.c (insert): Fix moving of values following insertion.
1469 (reify_segments): Fix up MOD->segment backpointer indices after
1470 later insertions in the main loop invalidate them.
1472 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
1473 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
1475 * core-file.c (dwfl_core_file_report): Return any nonzero count of
1476 modules reported, even if link_map grovelling failed and only sniffing
1479 2010-04-26 Roland McGrath <roland@redhat.com>
1481 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
1482 Works around probably-wrong ld -r behavior for case of a DWARF address
1483 constant that refers to a discarded SHF_ALLOC section.
1485 2010-04-14 Roland McGrath <roland@redhat.com>
1487 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
1488 an upper bound on sane possible number of elements.
1490 2010-03-11 Roland McGrath <roland@redhat.com>
1492 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
1493 the second half for 32-bit matches.
1495 2010-03-10 Roland McGrath <roland@redhat.com>
1497 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
1498 * argp-std.c (parse_opt): Update caller.
1499 * libdwfl.h: Declare dwfl_core_file_report.
1500 * libdwflP.h: Don't.
1502 2010-02-17 Roland McGrath <roland@redhat.com>
1504 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
1505 If set, find the first index not below ADDR.
1506 (dwfl_segment_report_module): Update callers.
1507 Pass true when calculating return value.
1509 2010-02-15 Roland McGrath <roland@redhat.com>
1511 * Makefile.am: Use config/eu.am for common stuff.
1513 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
1514 variable in failure path.
1516 2010-02-02 Mark Wielaard <mjw@redhat.com>
1518 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
1519 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
1521 2010-01-07 Roland McGrath <roland@redhat.com>
1523 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
1524 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1525 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
1526 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1528 2010-01-06 Roland McGrath <roland@redhat.com>
1530 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
1531 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
1533 2009-11-16 Roland McGrath <roland@redhat.com>
1535 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
1537 2009-11-12 Petr Machata <pmachata@redhat.com>
1539 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
1540 the chunk is both offset-contiguous and vaddr-contiguous.
1542 2009-11-05 Roland McGrath <roland@redhat.com>
1544 * link_map.c (report_r_debug): Skip entries with l_ld==0.
1545 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
1547 2009-09-04 Roland McGrath <roland@redhat.com>
1549 * image-header.c (__libdw_image_header): Fix tranposed comparison.
1551 2009-08-27 Roland McGrath <roland@redhat.com>
1553 * image-header.c: New file.
1554 * Makefile.am (libdwfl_a_SOURCES): Add it.
1555 * libdwflP.h: Declare __libdw_image_header.
1556 * open.c (decompress): Don't consume ELF on failure.
1557 (what_kind): New function, broken out of ...
1558 (__libdw_open_file): ... here. Call it.
1559 If it fails, try __libdw_image_header and then try what_kind again.
1561 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
1562 leave it behind for next decompressor.
1563 * open.c (decompress): Free BUFFER on failure.
1565 2009-08-26 Roland McGrath <roland@redhat.com>
1567 * gzip.c (find_zImage_payload): New function, broken out of ...
1568 (mapped_zImage): ... here. Call it.
1569 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
1570 stupid method of just trying the decoder.
1572 * open.c [USE_LZMA]: Try __libdw_unlzma.
1573 * libdwflP.h: Declare it.
1574 (DWFL_ERRORS): Add DWFL_E_LZMA.
1575 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
1577 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
1579 * gzip.c (mapped_zImage): Limit scan to 32kb.
1580 Make this unconditional, support bzip2 kernel images too.
1581 (unzip): Use direct inflate method for non-mmap case too.
1582 Only zlib uses the stream method.
1584 2009-08-09 Roland McGrath <roland@redhat.com>
1586 * dwfl_module_build_id.c: Use new macros for versioned definitions.
1588 2009-07-08 Roland McGrath <roland@redhat.com>
1590 * dwfl_module_dwarf_cfi.c: New file.
1591 * dwfl_module_eh_cfi.c: New file.
1592 * Makefile.am (libdwfl_a_SOURCES): Add them.
1593 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
1594 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
1596 2009-07-08 Roland McGrath <roland@redhat.com>
1598 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
1600 2009-06-18 Mark Wielaard <mjw@redhat.com>
1602 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
1604 2009-06-13 Ulrich Drepper <drepper@redhat.com>
1606 * derelocate.c: Don't use deprecated libelf functions.
1607 * dwfl_module_getdwarf.c: Likewise.
1608 * relocate.c: Likewise.
1610 2009-04-23 Ulrich Drepper <drepper@redhat.com>
1612 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
1613 defined. Otherwise just define the latest version.
1615 2009-04-22 Roland McGrath <roland@redhat.com>
1617 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
1618 a non-ET_REL module.
1620 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
1621 adjust properly for non-ET_REL.
1623 2009-04-21 Roland McGrath <roland@redhat.com>
1625 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
1627 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
1628 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
1630 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1632 2009-04-20 Roland McGrath <roland@redhat.com>
1634 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
1636 2009-04-19 Roland McGrath <roland@redhat.com>
1638 * dwfl_module_getdwarf.c (find_file): Renamed to ...
1639 (__libdwfl_getelf): ... this. Make it global.
1640 (find_symtab, find_dw): Update callers.
1641 (dwfl_module_getelf): Functions moved ...
1642 * dwfl_module_getelf.c: ... here, new file.
1643 * Makefile.am (libdwfl_a_SOURCES): Add it.
1644 * libdwflP.h: Declare __libdwfl_getelf.
1646 2009-04-14 Roland McGrath <roland@redhat.com>
1648 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
1649 absolute (already adjusted in place) or needing load bias adjustment.
1651 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
1652 gelf_getphdr failure. Fix file size limit checks.
1654 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
1656 2009-04-08 Roland McGrath <roland@redhat.com>
1658 * dwfl_module_getsym.c: Don't adjust for bias again after
1659 __libdwfl_relocate_value.
1661 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
1662 a non-SHF_ALLOC section.
1663 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
1664 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
1666 2009-03-09 Roland McGrath <roland@redhat.com>
1668 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
1669 variable to outer scope, so we cache it for the loop.
1671 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
1673 2009-02-12 Roland McGrath <roland@redhat.com>
1675 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
1676 __libdwfl_relocate_value to find correct sh_addr value.
1678 2009-02-10 Roland McGrath <roland@redhat.com>
1680 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
1681 If false, don't fail for NO_PHDR.
1682 (dwfl_report_elf): Update caller.
1683 * libdwflP.h: Update decl.
1684 * offline.c (process_elf): Call it with false, so we don't refuse
1685 dubiously-formed objects here.
1687 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1688 finds our module. We shouldn't crash when we confuse some guesses.
1690 2009-02-10 Ulrich Drepper <drepper@redhat.com>
1692 * open.c (decompress): Avoid crash with empty input file.
1694 2009-01-27 Roland McGrath <roland@redhat.com>
1696 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1697 with zero vaddr and memsz.
1699 2009-01-22 Roland McGrath <roland@redhat.com>
1701 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1703 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1704 after address-matching loop.
1706 * segment.c (lookup): Fix fencepost in checking for HINT match.
1708 2009-01-14 Roland McGrath <roland@redhat.com>
1710 * gzip.c [!BZLIB] (mapped_zImage): New function.
1711 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1713 2009-01-10 Ulrich Drepper <drepper@redhat.com>
1715 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1717 2009-01-08 Roland McGrath <roland@redhat.com>
1719 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1720 Skip subdirectory named "source".
1721 (dwfl_linux_kernel_find_elf): Likewise.
1723 2009-01-06 Roland McGrath <roland@redhat.com>
1725 * linux-kernel-modules.c (check_suffix): New function.
1726 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1727 (dwfl_linux_kernel_report_offline): Use it.
1728 (dwfl_linux_kernel_find_elf): Likewise.
1730 2009-01-05 Roland McGrath <roland@redhat.com>
1732 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1733 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1734 * dwfl_build_id_find_elf.c: Likewise.
1735 * dwfl_module_getdwarf.c (open_elf): Likewise.
1736 * dwfl_report_elf.c: Likewise.
1737 * find-debuginfo.c (validate): Likewise.
1738 * offline.c (__libdwfl_report_offline): Likewise.
1740 * libdwflP.h: Declare __libdw_open_file.
1742 * Makefile.am (libdwfl_a_SOURCES): Add it.
1745 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1746 * bzip2.c: New file.
1747 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1748 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1750 2008-12-16 Roland McGrath <roland@redhat.com>
1752 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1753 symver magic to bind to ELFUTILS_0.138.
1754 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1755 wrapper for ELFUTILS_0.130 version set.
1757 2008-12-18 Roland McGrath <roland@redhat.com>
1759 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1760 addresses are taken as relative to MOD->low_addr.
1762 2008-12-15 Roland McGrath <roland@redhat.com>
1764 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1767 2008-12-11 Roland McGrath <roland@redhat.com>
1769 * offline.c (process_archive): Don't call elf_end and close if
1770 returning NULL. Check first elf_begin call and set error code
1771 specially for empty archive.
1774 2008-12-02 Roland McGrath <roland@redhat.com>
1776 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1778 2008-11-26 Roland McGrath <roland@redhat.com>
1780 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1781 return value, and interpret encoded OFFSET argument.
1783 2008-10-07 Roland McGrath <roland@redhat.com>
1785 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1787 2008-09-29 Roland McGrath <roland@redhat.com>
1789 * segment.c (insert): Must realloc DWFL->lookup_module here too.
1790 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1792 2008-08-28 Roland McGrath <roland@redhat.com>
1794 * segment.c (reify_segments): Fix last change.
1796 2008-08-27 Roland McGrath <roland@redhat.com>
1798 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1799 failure from pread64.
1801 2008-08-26 Roland McGrath <roland@redhat.com>
1803 * segment.c (reify_segments): Insert a trailing segment for a module
1804 end that is above the highest current segment.
1806 2008-08-25 Roland McGrath <roland@redhat.com>
1808 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1809 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
1810 if FILE->elf is not ELF_K_ELF.
1812 * dwfl_segment_report_module.c: Add a cast.
1814 2008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
1816 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1817 which decides which symbol is "closest" to a given address.
1819 2008-08-15 Roland McGrath <roland@redhat.com>
1821 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1822 (options, parse_opt): Handle --core.
1824 * core-file.c: New file.
1825 * Makefile.am (libdwfl_a_SOURCES): Add it.
1826 * libdwflP.h (dwfl_core_file_report): Declare it.
1828 * link_map.c: New file.
1829 * Makefile.am (libdwfl_a_SOURCES): Add it.
1830 * libdwflP.h (dwfl_link_map_report): Declare it.
1832 * libdwflP.h (MIN, MAX): New macros.
1833 (Dwfl_Memory_Callback): New typedef.
1834 (Dwfl_Module_Callback): New typedef.
1835 (dwfl_segment_report_module): Declare it.
1836 * dwfl_segment_report_module.c: New file.
1837 * Makefile.am (libdwfl_a_SOURCES): Add it.
1839 * derelocate.c (dwfl_module_address_section): Add INTDEF.
1840 * libdwflP.h: Add INTDECL.
1842 * segment.c: New file.
1843 * Makefile.am (libdwfl_a_SOURCES): Add it.
1844 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1845 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1846 lookup_addr, lookup_module, lookup_segndx, replace removed members
1848 (struct Dwfl_Module): New member segment.
1849 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
1850 to each free module.
1851 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1852 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
1853 (dwfl_report_module): Don't touch DWFL->nmodules.
1854 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1855 (compare_modules): Function removed.
1856 * dwfl_getmodules.c: Rewritten.
1858 * libdwflP.h: Add INTDECLs.
1859 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1860 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
1862 2008-08-03 Roland McGrath <roland@redhat.com>
1864 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1866 2008-07-17 Roland McGrath <roland@redhat.com>
1868 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1869 zero if the failure was only ENOENT.
1871 2008-06-03 Roland McGrath <roland@redhat.com>
1873 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1876 2008-05-22 Petr Machata <pmachata@redhat.com>
1878 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1880 2008-05-06 Roland McGrath <roland@frob.com>
1882 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1883 FTS_LOGICAL here too.
1884 (dwfl_linux_kernel_find_elf): Likewise.
1886 2008-04-29 Roland McGrath <roland@redhat.com>
1888 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1889 based on canonicalize_file_name if it differs from the supplied name.
1891 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1894 2008-04-27 Roland McGrath <roland@redhat.com>
1896 * linux-kernel-modules.c (report_kernel): Fix crash when
1897 dwfl_report_elf fails.
1899 2008-04-05 Roland McGrath <roland@redhat.com>
1901 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1903 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1904 Clear it after freeing.
1905 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1907 2008-03-26 Roland McGrath <roland@redhat.com>
1909 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1910 SHT_DYNSYM, just set *SYMSCN like the comment says.
1912 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1914 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1916 2008-03-19 Roland McGrath <roland@redhat.com>
1918 * dwfl_module_getsrc.c: Adjust address for module bias before search.
1920 2008-03-01 Roland McGrath <roland@redhat.com>
1922 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1923 prototype to avoid older compiler's complaint about reuse of the name.
1924 (__libdwfl_canon_error): Likewise.
1926 2008-02-19 Roland McGrath <roland@redhat.com>
1928 * relocate.c (relocate_section): Check for an unhandled relocation
1929 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
1930 DWFL_E_UNKNOWN_MACHINE check out of loops.
1932 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1933 DEBUGFILE->relocated is already set.
1935 2008-01-26 Roland McGrath <roland@redhat.com>
1937 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1939 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1940 incoming *FILE_NAME at the start.
1942 2008-01-08 Roland McGrath <roland@redhat.com>
1944 * Makefile.am (euinclude): Variable removed.
1945 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1947 2007-10-23 Roland McGrath <roland@redhat.com>
1949 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1950 module to appear first.
1952 2007-10-20 Roland McGrath <roland@redhat.com>
1954 * offline.c (process_archive_member): Take FD argument, pass it down
1955 to process_file. Return Elf_Cmd, not bool.
1956 Call elf_next here, always before elf_end.
1957 (process_archive): Update caller. Don't close FD here unless there
1960 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
1962 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
1963 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
1964 partial relocation to one or both files.
1965 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
1966 relocations have been applied to the debug file if dwfl_module_getelf
1967 has been used before.
1969 * relocate.c (resolve_symbol): New function.
1970 (relocate_section): Call it.
1972 * relocate.c (relocate_getsym): Handle null MOD->symfile.
1973 (relocate_section): Take new bool arg, PARTIAL. If true,
1974 no error for BADRELTYPE/RELUNDEF, instead just skip them
1975 and leave only those skipped relocs behind the reloc section.
1976 (__libdwfl_relocate_section): Take new arg, pass it down.
1977 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
1978 do partial relocation on all sections.
1979 * dwfl_module_getdwarf.c (load_dw): Update caller.
1980 * libdwflP.h: Update decls.
1981 * derelocate.c (dwfl_module_address_section): Pass new argument
1982 to __libdwfl_relocate_section, true.
1984 * derelocate.c (cache_sections): Don't cache reloc sections when
1985 section_address callback is null.
1987 2007-10-19 Roland McGrath <roland@redhat.com>
1989 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
1991 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
1992 (struct secref): Likewise.
1993 (cache_sections): Cache the relocation section referring to each
1994 section we cache, if any.
1995 (dwfl_module_address_section): Use __libdwfl_relocate_section as
1998 * relocate.c (struct reloc_symtab_cache): New type.
1999 (relocate_getsym): Use it instead of four arguments.
2000 (__libdwfl_relocate): Update caller.
2001 (relocate_section): New function, broken out of ...
2002 (__libdwfl_relocate): ... here.
2003 (__libdwfl_relocate_section): New function.
2004 * libdwflP.h: Declare it.
2006 2007-10-17 Roland McGrath <roland@redhat.com>
2008 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
2009 to relocated st_value.
2011 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
2014 2007-10-16 Roland McGrath <roland@redhat.com>
2016 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
2017 section has larger alignment requirements not met by the original BASE,
2018 rather than padding more between sections.
2020 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
2022 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
2025 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
2026 at zero in ET_REL case. Adjust BASE to necessary alignment.
2028 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
2030 (__libdwfl_find_build_id): Update caller.
2032 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
2033 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
2034 * offline.c (dwfl_offline_section_address): Bail early if there is
2035 separate debug file.
2037 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
2039 2007-10-09 Roland McGrath <roland@redhat.com>
2041 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
2042 caching SHDR->sh_addr = 0.
2043 * offline.c (dwfl_offline_section_address): Never called for sh_addr
2044 really at 0, don't check for it. Use MOD->debug directly, not symfile.
2046 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
2047 we've found SHT_SYMTAB.
2049 * relocate.c (relocate_getsym): New function.
2050 (__libdwfl_relocate): Use it.
2051 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
2052 be a pointer instead of value; cache getshstrndx result there.
2053 * libdwflP.h: Update decl.
2054 * derelocate.c (cache_sections): Update caller.
2055 Always work on the main file, not the symfile.
2056 (dwfl_module_address_section): Likewise.
2057 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
2059 2007-10-07 Roland McGrath <roland@redhat.com>
2061 * offline.c (process_archive): Initialize MOD.
2063 * linux-kernel-modules.c (get_release): New function, broken out of ...
2064 (report_kernel): ... here. Call it.
2065 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
2066 (find_kernel_elf): Update caller.
2067 (report_kernel_archive): New function.
2068 (dwfl_linux_kernel_report_offline): Call it.
2070 * offline.c (process_file): Take new arg PREDICATE, pass it down.
2071 (process_archive): Likewise.
2072 (process_archive_member): Likewise. When nonnull, let the predicate
2073 decide whether to use this member.
2074 (__libdwfl_report_offline): New function, broken out of ...
2075 (dwfl_report_offline): ... here. Call it.
2076 * libdwflP.h: Declare it.
2078 * offline.c (process_archive, process_archive_member): New functions.
2079 (process_elf, process_file): New functions, broken out of ...
2080 (dwfl_report_offline): ... here. Call process_file, which recurses on
2083 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
2084 (dwfl_report_elf): ... here. Call it.
2085 * libdwflP.h: Declare it.
2087 2007-10-06 Roland McGrath <roland@redhat.com>
2089 * derelocate.c (dwfl_module_relocations): Don't call
2090 dwfl_module_getdwarf.
2092 * derelocate.c (find_section): Use __libdwfl_seterrno, not
2095 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
2096 SHF_ALLOC, to cache sh_addr resolved to 0.
2098 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
2099 values nonzero already, just use its existing layout.
2101 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
2102 in-core shdr after applying it.
2104 2007-10-04 Ulrich Drepper <drepper@redhat.com>
2106 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
2107 initialization of notes variable.
2109 2007-10-04 Roland McGrath <roland@redhat.com>
2111 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
2112 fill in with vaddr of "__start_notes" symbol if found.
2113 (check_notes): New function.
2114 (check_kernel_notes): New function.
2115 (dwfl_linux_kernel_report_kernel): Call it.
2116 (check_module_notes): New function.
2117 (dwfl_linux_kernel_report_modules): Call it.
2119 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
2120 Try dwfl_build_id_find_elf first.
2122 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
2123 Set kernel module e_type to ET_DYN.
2125 2007-10-03 Roland McGrath <roland@redhat.com>
2127 * find-debuginfo.c (validate): New function, broken out of ...
2128 (find_debuginfo_in_path): ... here. New function, broken out of ...
2129 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
2130 dwfl_build_id_find_debuginfo first.
2132 * dwfl_build_id_find_elf.c: New file.
2133 * dwfl_build_id_find_debuginfo.c: New file.
2134 * Makefile.am (libdwfl_a_SOURCES): Add them.
2135 * libdwfl.h: Declare them.
2136 * libdwflP.h: Add INTDECLs.
2138 * dwfl_module_build_id.c: New file.
2139 * dwfl_module_report_build_id.c: New file.
2140 * Makefile.am (libdwfl_a_SOURCES): Add them.
2141 * libdwfl.h: Declare them.
2142 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
2143 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
2144 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
2146 * dwfl_module_getdwarf.c (find_offsets): New function.
2147 (find_dynsym): New function, calls that.
2148 (find_symtab): Call it.
2150 2007-09-11 Roland McGrath <roland@redhat.com>
2152 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
2153 address if its st_size is smaller.
2155 2007-08-13 Roland McGrath <roland@redhat.com>
2157 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
2159 2007-08-12 Roland McGrath <roland@redhat.com>
2161 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
2164 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
2165 a second phdr if it happens to match EHDR_VMA exactly.
2167 2007-08-08 Roland McGrath <roland@redhat.com>
2169 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
2170 those with no names. Rewrite best symbol algorithm not to assume a
2171 sorted table and to be smarter handling sizeless symbols.
2173 2007-07-16 Roland McGrath <roland@redhat.com>
2175 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
2176 reviving an existing module.
2178 2007-06-08 Roland McGrath <roland@redhat.com>
2180 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
2182 2007-05-17 Roland McGrath <roland@redhat.com>
2184 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
2185 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
2186 (dwfl_linux_kernel_find_elf): Likewise.
2188 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2189 getline and sscanf instead of fscanf.
2191 2007-05-08 Roland McGrath <roland@redhat.com>
2193 * offline.c (dwfl_offline_section_address): Don't assume section
2194 numbers match between stripped and debuginfo files. Instead, assume
2195 only that the ordering among SHF_ALLOC sections matches.
2197 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
2199 (dwfl_linux_kernel_report_offline): Update caller.
2200 (dwfl_linux_kernel_report_kernel): Likewise.
2202 2007-04-23 Roland McGrath <roland@redhat.com>
2204 * argp-std.c (options): Fix group title string.
2206 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
2207 Update via STATE->input every time we set STATE->hook, not only at
2210 * dwfl_module.c (free_file): Free FILE->name.
2212 2007-04-16 Roland McGrath <roland@redhat.com>
2214 * derelocate.c (cache_sections): Apply bias to sh_addr.
2215 (compare_secrefs): Fix address comparison to avoid signed overflow.
2216 (find_section): New function, broken out of ...
2217 (dwfl_module_relocate_address): ... here, call it.
2218 (check_module): New function, broken out of ...
2219 (dwfl_module_relocate_address): ... here, call it.
2220 (dwfl_module_address_section): New function.
2221 * libdwfl.h: Declare it.
2223 2007-03-26 Roland McGrath <roland@redhat.com>
2225 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
2227 2007-03-18 Roland McGrath <roland@redhat.com>
2229 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
2230 (find_debuginfo): ... here. Call it.
2231 Don't return error for libelf errors finding .gnu_debuglink section.
2233 2007-03-12 Roland McGrath <roland@redhat.com>
2235 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
2236 (dwfl_report_begin): ... here. Call it.
2237 * libdwfl.h: Declare it.
2238 * libdwflP.h: Add INTDECL.
2240 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2242 * offline.c: Comment typo fix.
2244 2007-03-04 Roland McGrath <roland@redhat.com>
2246 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
2247 (find_kernel_elf): New function, broken out of ...
2248 (report_kernel): ... here. Call it.
2249 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
2250 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
2251 virtual address bounds of kernel from symbols rounded to page size.
2252 (dwfl_linux_kernel_report_kernel): Use that if it works, before
2253 resorting to report_kernel.
2255 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
2256 ET_EXEC file with nonzero bias.
2258 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
2259 dwfl_module_addrsym. Guts moved to ...
2260 * dwfl_module_addrsym.c: ... here; new file.
2261 * Makefile.am (libdwfl_a_SOURCES): Add it.
2262 * libdwfl.h: Declare dwfl_module_addrsym.
2263 * libdwflP.h: Add INTDECL.
2265 2007-03-03 Roland McGrath <roland@redhat.com>
2267 * dwfl_module.c (free_file): New function, broken out of ...
2268 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
2270 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
2273 2007-03-02 Roland McGrath <roland@redhat.com>
2275 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
2277 2007-02-02 Roland McGrath <roland@redhat.com>
2279 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
2280 address exactly if it's no other module's low boundary.
2282 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
2283 and size cover the address, select the closest symbol with st_size==0
2284 that lies in the same section.
2286 2007-01-29 Roland McGrath <roland@redhat.com>
2288 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
2291 2007-01-20 Roland McGrath <roland@redhat.com>
2293 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
2295 * libdwfl.h (Dwfl_Callbacks): Update comment.
2296 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
2297 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2298 For ignored missing section, use -1 instead of 0.
2299 * offline.c (dwfl_offline_section_address): Expect a call for 0.
2301 2007-01-19 Roland McGrath <roland@redhat.com>
2303 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
2304 zero so a lone -e foo.so is shown without address bias.
2306 2007-01-10 Roland McGrath <roland@redhat.com>
2308 * linux-kernel-modules.c (report_kernel): Check asprintf return value
2309 directly instead of via side effect, to silence warn_unused_result.
2310 (dwfl_linux_kernel_report_offline): Likewise.
2311 (dwfl_linux_kernel_find_elf): Likewise.
2312 (dwfl_linux_kernel_module_section_address): Likewise.
2313 * find-debuginfo.c (try_open): Likewise.
2314 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
2315 (dwfl_linux_proc_report): Likewise.
2317 * libdwfl.h (dwfl_begin): Require nonnull argument.
2319 2006-12-27 Roland McGrath <roland@redhat.com>
2321 * dwfl_module.c (compare_modules): Fix address comparison to avoid
2322 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
2324 2006-10-30 Roland McGrath <roland@redhat.com>
2326 * dwfl_module.c (dwfl_report_module): Comment typo fix.
2328 2006-09-05 Roland McGrath <roland@redhat.com>
2330 * derelocate.c (cache_sections): Use alloca instead of variable-sized
2331 auto array, in function already using alloca.
2333 2006-08-14 Roland McGrath <roland@redhat.com>
2335 * linux-kernel-modules.c (try_kernel_name): If the call to
2336 dwfl_standard_find_debuginfo produces no results, try it again
2337 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
2339 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
2340 * libdwflP.h: ... to here.
2341 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
2342 repeats the first thing dwfl_standard_find_debuginfo will try.
2344 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
2345 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
2346 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
2349 2006-07-12 Ulrich Drepper <drepper@redhat.com>
2351 * cu.c: Adjust for internal_function_def removal.
2352 * dwfl_error.c: Likewise.
2353 * dwfl_module.c: Likewise.
2354 * dwfl_module_getdwarf.c: Likewise.
2355 * lines.c: Likewise.
2356 * relocate.c: Likewise.
2358 2006-07-11 Ulrich Drepper <drepper@redhat.com>
2360 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
2361 it can overflow the return value type.
2362 Patch by Tim Moore <timoore@redhat.com>.
2364 2006-06-28 Roland McGrath <roland@redhat.com>
2366 * libdwfl.h: Cosmetic changes.
2368 * dwfl_line_comp_dir.c: New file.
2369 * Makefile.am (libdwfl_a_SOURCES): Add it.
2370 * libdwfl.h: Declare dwfl_line_comp_dir.
2372 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
2374 * dwfl_linecu.c: New file.
2375 * Makefile.am (libdwfl_a_SOURCES): Add it.
2376 * libdwfl.h: Declare dwfl_linecu.
2378 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
2379 (dwfl_linecu): Define as macro.
2381 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
2383 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
2384 (dwfl_module_addrname): Function moved ...
2385 * dwfl_module_addrname.c: ... here, new file.
2386 * dwfl_module_getsym.c: New file.
2387 * Makefile.am (libdwfl_a_SOURCES): Add them.
2388 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
2389 * libdwflP.h: Add INTDECLs.
2391 2006-06-27 Roland McGrath <roland@redhat.com>
2393 * dwfl_module.c (dwfl_report_end): Whitespace fix.
2395 2006-06-13 Roland McGrath <roland@redhat.com>
2397 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2398 Use __libdwfl_seterrno for elf_memory failure.
2400 2006-05-22 Roland McGrath <roland@redhat.com>
2402 * dwfl_module_return_value_location.c
2403 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
2405 2006-05-27 Ulrich Drepper <drepper@redhat.com>
2407 * libdwfl.h: Add extern "C".
2409 2006-05-22 Ulrich Drepper <drepper@redhat.com>
2411 * cu.c (addrarange): Handle files without aranges information.
2413 2006-05-16 Ulrich Drepper <drepper@redhat.com>
2415 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
2418 2006-02-26 Roland McGrath <roland@redhat.com>
2420 * dwfl_version.c: New file.
2421 * Makefile.am (libdwfl_a_SOURCES): Add it.
2422 * libdwfl.h: Declare dwfl_version.
2424 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
2425 aligned up from DWFL->offline_next_address when checking for overlap.
2427 2005-12-22 Roland McGrath <roland@redhat.com>
2429 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
2431 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
2432 (dwfl_linux_proc_report): ... here. Call it.
2433 (dwfl_linux_proc_maps_report): New function.
2434 * libdwfl.h: Declare it.
2435 * libdwflP.h: Add INTDECL.
2436 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
2438 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
2439 failed with DWFL_E_NO_DWARF.
2441 2005-11-26 Roland McGrath <roland@redhat.com>
2443 * dwfl_end.c (dwfl_end): Free the DWFL itself.
2445 2005-11-25 Roland McGrath <roland@redhat.com>
2447 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
2449 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
2450 * libdwflP.h: Declare it.
2452 * dwfl_module_register_names.c: New file.
2453 * Makefile.am (libdwfl_a_SOURCES): Add it.
2454 * libdwfl.h: Declare dwfl_module_register_names.
2456 2005-11-21 Roland McGrath <roland@redhat.com>
2458 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2459 Don't leak malloc'd file name.
2460 If a /sys/.../sections file is missing and starts with ".init",
2461 try the variant with "_init" too; catches PPC64 kernel braindamage.
2463 2005-11-15 Roland McGrath <roland@redhat.com>
2465 * libdwfl.h: Comment fixes.
2467 * dwfl_module_return_value_location.c: Add unlikely for error case.
2469 2005-11-13 Roland McGrath <roland@redhat.com>
2471 * dwfl_return_value_location.c: New file.
2472 * Makefile.am (libdwfl_a_SOURCES): Add it.
2473 * libdwfl.h: Declare dwfl_module_return_value_location.
2474 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
2476 2005-10-20 Roland McGrath <roland@redhat.com>
2478 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
2479 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
2480 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
2482 2005-10-01 Roland McGrath <roland@redhat.com>
2484 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
2487 2005-09-19 Roland McGrath <roland@redhat.com>
2489 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2490 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
2491 the signed integer reading; they will just have to be in hexadecimal.
2492 (dwfl_linux_kernel_module_section_address): Likewise.
2494 2005-08-28 Ulrich Drepper <drepper@redhat.com>
2496 * Makefile.am (%.os): Use COMPILE.os.
2497 (COMPILE.os): Filter out gconv options.
2499 2005-08-25 Roland McGrath <roland@redhat.com>
2501 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
2502 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
2504 2005-08-24 Roland McGrath <roland@redhat.com>
2506 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
2508 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
2509 magic initializer to set -heur-stack-bound option.
2511 2005-08-22 Roland McGrath <roland@redhat.com>
2513 * dwfl_validate_address.c: New file.
2514 * Makefile.am (libdwfl_a_SOURCES): Add it.
2515 * libdwfl.h: Declare dwfl_validate_address.
2517 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
2518 * libdwflP.h: Add INTDECL.
2520 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
2521 elf_rawdata for symbol-related sections.
2523 * offline.c (dwfl_report_offline): Move offline_next_address outside
2524 module's range, in case it's an ET_EXEC using fixed segment locations.
2525 * libdwfl.h: Update comment.
2527 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
2530 2005-08-20 Roland McGrath <roland@redhat.com>
2532 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
2533 function to choose whether to report.
2534 (dwfl_linux_kernel_report_offline): Likewise.
2535 * libdwfl.h: Update decl.
2536 * argp-std.c (parse_opt): Update caller.
2538 * dwfl_getsrclines.c: New file.
2539 * dwfl_onesrcline.c: New file.
2540 * Makefile.am (libdwfl_a_SOURCES): Add them.
2541 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
2543 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
2544 MODULESDIR[0]. Call fts_close on failure.
2546 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
2547 Close ET_REL file descriptors after relocation.
2548 (find_dw): Update caller.
2549 * offline.c (dwfl_report_offline): Get the file into memory and close
2550 the file descriptor.
2552 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
2553 MOD->debug.elf is already set.
2555 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
2556 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
2558 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
2559 dwfl_linux_kernel_report_offline with offline_callbacks.
2561 * linux-kernel-modules.c (report_kernel): New function, broken out of
2563 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2564 (dwfl_linux_kernel_report_offline): New function.
2565 * libdwfl.h: Declare it.
2566 * libdwflP.h: Add INTDECL.
2568 2005-08-19 Roland McGrath <roland@redhat.com>
2570 Use standard debuginfo search path to look for vmlinux.
2571 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
2573 * linux-kernel-modules.c (try_kernel_name): New function, broken out
2575 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2577 * argp-std.c (offline_callbacks): New variable.
2578 (parse_opt): Use it for -e. Allow multiple -e options.
2580 * offline.c: New file.
2581 * Makefile.am (libdwfl_a_SOURCES): Add it.
2582 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
2583 * libdwflP.h: Add INTDECLs.
2584 (OFFLINE_REDZONE): New macro.
2585 (struct Dwfl): New member `offline_next_address'.
2586 * dwfl_begin.c (dwfl_begin): Initialize it.
2587 * dwfl_module.c (dwfl_report_begin): Likewise.
2589 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
2590 do a nominal absolute section layout starting at BASE.
2591 * libdwfl.h: Update comment.
2593 2005-08-18 Roland McGrath <roland@redhat.com>
2595 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
2596 dwfl_module_getdwarf if necessary.
2598 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
2599 * libdwfl.h: Update comment.
2601 * derelocate.c: New file.
2602 * Makefile.am (libdwfl_a_SOURCES): Add it.
2604 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
2605 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
2606 * dwfl_module_getdwarf.c (open_elf): Update initialization.
2607 (load_dw, dwfl_module_addrname): Update uses.
2608 * relocate.c (__libdwfl_relocate): Likewise.
2610 2005-08-04 Roland McGrath <roland@redhat.com>
2612 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
2613 arguments SHNDX, SHDR.
2614 (dwfl_linux_kernel_module_section_address): Update prototype.
2615 * relocate.c (__libdwfl_relocate_value): Update caller.
2616 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2617 Take the new arguments.
2619 2005-08-10 Roland McGrath <roland@redhat.com>
2621 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
2622 use it instead of MOD->debug.file.
2623 * libdwflP.h: Update decl.
2624 * dwfl_module_getdwarf.c (load_dw): Update caller.
2627 2005-08-09 Roland McGrath <roland@redhat.com>
2629 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
2630 * cu.c: Use INTUSE on dwarf_* calls.
2631 * dwfl_error.c: Likewise.
2632 * dwfl_module.c: Likewise.
2633 * dwfl_module_getdwarf.c: Likewise.
2634 * dwfl_module_getsrc_file.c: Likewise.
2635 * lines.c: Likewise.
2637 2005-08-07 Roland McGrath <roland@redhat.com>
2639 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
2640 names contain '_' or '-', look for files named either "foo-bar.ko"
2643 2005-07-29 Roland McGrath <roland@redhat.com>
2645 * loc2c.c: File removed.
2646 * loc2c.h: File removed.
2647 * loc2c-runtime.h: File removed.
2648 * test2.c: File removed.
2649 * Makefile.am (EXTRA_DIST): Variable removed.
2650 (noinst_HEADERS): Remove loc2c.h from here.
2652 2005-07-28 Ulrich Drepper <drepper@redhat.com>
2654 * libdwfl.h: Add a few missing extern for function prototypes.
2656 * libdwfl_crc32.c: New file.
2657 * libdwfl_crc32_file.c: New file.
2658 * libdwflP.h: Declare the new functions.
2659 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
2660 libdwfl_crc32_file.c.
2661 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
2662 instead of crc32_file.
2664 2005-07-28 Roland McGrath <roland@redhat.com>
2666 * ptest.c: Moved to ../tests/dwflmodtest.c.
2668 * Makefile.am (noinst_PROGRAMS): Variable removed.
2669 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
2670 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
2671 (libdwfl): Don't use libdwfl.so any more.
2672 (libdwfl.so, install, uninstall): Targets removed.
2673 (test2_SOURCES): Define EXTRA_DIST instead of this.
2674 * libdwfl.map: File removed.
2676 * libdwfl.h: Use "" for libdw.h #include.
2678 2005-07-27 Roland McGrath <roland@redhat.com>
2680 * libdwfl.map: Add dwfl_getmodules.
2682 2005-07-23 Ulrich Drepper <drepper@redhat.com>
2684 * Makefile.am: Fix rules to allow building with mudflap.
2686 2005-07-21 Roland McGrath <roland@redhat.com>
2688 * Makefile.am (noinst_HEADERS): Add loc2c.c.
2690 * test2.c (main): Check sscanf result to quiet warning.
2692 2005-07-20 Roland McGrath <roland@redhat.com>
2694 * libdwfl-branch merged, creating this direcotry.