1 2018-07-17 Ulf Hermann <ulf.hermann@qt.io>
3 * linux-pid-attach.c: Include sys/uio.h only on linux.
5 2018-06-04 Mark Wielaard <mark@klomp.org>
7 * libdwflP.h (__libdwfl_addrsym): Remove function declaration.
8 * dwfl_module_addrsym.c (__libdwfl_addrsym): Make a static function.
10 2018-05-27 Mark Wielaard <mark@klomp.org>
12 * relocate.c (__libdwfl_relocate): Always call relocate_section with
15 2018-05-17 Mark Wielaard <mark@klomp.org>
17 * dwfl_module (__libdwfl_module_free): Free elfdir.
18 * dwfl_module_getdwarf.c (load_dw): Close file descriptors after
19 dwarf_begin_elf call. Set Dwarf debugdir if it is NULL, this is the
20 main module file and we recorded the elfdir.
21 * libdwflP.h (struct Dwfl_Module): Add elfdir field.
22 * offline.c (process_elf): Record the elfdir before we close the
23 main ELF file descriptor.
25 2018-04-10 Mark Wielaard <mark@klomp.org>
27 * frame_unwind.c (unwind): If __libdwfl_frame_reg_get fails for
28 the return address either set an error or mark the pc undefined.
30 2018-03-17 Mark Wielaard <mark@klomp.org>
32 * libdwflP.h (struct __libdwfl_remote_mem_cache): New.
33 (struct __libdwfl_pid_arg): Add mem_cache field.
34 * linux-pid-attach.c (read_cached_memory): New function.
35 (clear_cached_memory): Likewise.
36 (pid_memory_read): Call read_cached_memory.
37 (pid_detach): Free mem_cache.
38 (pid_thread_detach): Call clear_cached_memory.
39 (dwfl_linux_proc_attach): Initialize mem_cache to NULL.
41 2018-03-05 Mark Wielaard <mark@klomp.org>
43 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Use
44 realpath (name, NULL) instead of canonicalize_file_name (name).
45 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise.
47 2018-01-29 Mark Wielaard <mark@klomp.org>
49 * cu.c (cudie_offset): Use __libdw_first_die_off_from_cu instead of
50 DIE_OFFSET_FROM_CU_OFFSET.
51 (intern_cu): Simply use a copy of the given die CU as key instead of
52 trying to construct a dummy one by hand.
54 2018-02-15 Mark Wielaard <mark@klomp.org>
56 * linux-pid-attach.c: Include sys/wait.h after sys/ptrace.h.
58 2018-02-09 Joshua Watt <JPEWhacker@gmail.com>
60 * dwfl_report_elf.c (__libdwfl_elf_address_range): Use FALLTHROUGH
61 macro instead of comment.
62 * frame_unwind.c (expr_eval): Likewise.
64 2017-11-20 Mark Wielaard <mark@klomp.org>
66 * link_map.c (do_check64): Take a char * and calculate type and val
67 offsets before reading, possibly unaligned, values.
68 (do_check32): Likewise.
69 (check64): Remove define.
71 (auxv_format_probe): Call do_check32 and do_check64 directly with
72 a, possibly unaligned, auxv entry pointer.
73 (dwfl_link_map_report): Redefine AUXV_SCAN to not dereference a
74 possibly unaligned auxv entry pointer.
76 2017-10-16 Mark Wielaard <mark@klomp.org>
78 * argp-std.c (parse_opt): For -k call argp_failure not failure to
81 2017-07-26 Yunlian Jiang <yunlian@google.com>
83 * argp-std.c (failure): Move to file scope.
86 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
87 Mark Wielaard <mark@klomp.org>
89 * derelocate.c (compare_secrefs): Compare by end address and then by
90 section number if addresses are equal.
92 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
93 Mark Wielaard <mark@klomp.org>
95 * linux-kernel-modules.c: Always return NULL from kernel_release() on
96 non-linux systems and set errno to ENOTSUP.
98 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
100 * libdwflP.h: Don't include config.h.
101 * argp-std.c: Include config.h.
103 * derelocate.c: Likewise.
104 * dwfl_addrdie.c: Likewise.
105 * dwfl_addrdwarf.c: Likewise.
106 * dwfl_addrmodule.c: Likewise.
107 * dwfl_begin.c: Likewise.
108 * dwfl_build_id_find_debuginfo.c: Likewise.
109 * dwfl_build_id_find_elf.c: Likewise.
110 * dwfl_cumodule.c: Likewise.
111 * dwfl_dwarf_line.c: Likewise.
112 * dwfl_end.c: Likewise.
113 * dwfl_frame.c: Likewise.
114 * dwfl_frame_regs.c: Likewise.
115 * dwfl_getdwarf.c: Likewise.
116 * dwfl_getmodules.c: Likewise.
117 * dwfl_getsrc.c: Likewise.
118 * dwfl_getsrclines.c: Likewise.
119 * dwfl_line_comp_dir.c: Likewise.
120 * dwfl_linecu.c: Likewise.
121 * dwfl_lineinfo.c: Likewise.
122 * dwfl_linemodule.c: Likewise.
123 * dwfl_module.c: Likewise.
124 * dwfl_module_addrdie.c: Likewise.
125 * dwfl_module_addrname.c: Likewise.
126 * dwfl_module_addrsym.c: Likewise.
127 * dwfl_module_build_id.c: Likewise.
128 * dwfl_module_dwarf_cfi.c: Likewise.
129 * dwfl_module_eh_cfi.c: Likewise.
130 * dwfl_module_getdarf.c: Likewise.
131 * dwfl_module_getelf.c: Likewise.
132 * dwfl_module_getsrc.c: Likewise.
133 * dwfl_module_getsrc_file.c: Likewise.
134 * dwfl_module_getsym.c: Likewise.
135 * dwfl_module_info.c: Likewise.
136 * dwfl_module_nextcu.c: Likewise.
137 * dwfl_module_register_names.c: Likewise.
138 * dwfl_module_report_build_id.c: Likewise.
139 * dwfl_module_return_value_location.c: Likewise.
140 * dwfl_nextcu.c: Likewise.
141 * dwfl_onesrcline.c: Likewise.
142 * dwfl_report_elf.c: Likewise.
143 * dwfl_validate_address.c: Likewise.
144 * dwfl_version.c: Likewise.
145 * find-debuginfo.c: Likewise.
147 * image-header.c: Likewise.
149 * linux-core-attach.c: Likewise.
150 * linux-pid-attach.c: Likewise.
151 * offline.c: Likewise.
153 * relocate.c: Likewise.
154 * segment.c: Likewise.
156 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
158 * libdwfl.h: Use __const_attribute__.
160 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
162 * elf-from-memory.c: Explicitly cast phnum to size_t.
164 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
166 * dwfl_module_getdwarf.c: Check shnum for 0 before subtracting from
169 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
171 * dwfl_frame.c: Drop unused sys/ptrace.h include.
172 * frame_unwind.c: Likewise.
173 * linux-pid-attach.c: Include sys/ptrace.h and sys/syscall.h only on
176 2017-04-20 Ulf Hermann <ulf.hermann@qt.io>
178 * linux-kernel-modules.c: Include sys/types.h before fts.h
180 2017-03-24 Mark Wielaard <mark@klomp.org>
182 * linux-core-attach.c (core_next_thread): If n_namesz == 0 then
183 the note name data is the empty string.
184 (dwfl_core_file_attach): Likewise.
186 2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
188 * linux-kernel-modules.c: Include system.h.
190 2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
192 * linux-kernel-modules.c: Use sysconf(_SC_PAGESIZE) to get page size.
193 * linux-proc-maps.c: Likewise.
195 2016-12-29 Luiz Angelo Daros de Luca <luizluca@gmail.com>
197 * dwfl_build_id_find_elf.c: Include system.h.
198 * dwfl_module_getdwarf.c: Likewise.
199 * libdwfl_crc32_file.c: Don't define LIB_SYSTEM_H.
201 2016-11-23 Mark Wielaard <mjw@redhat.com>
203 * linux-kernel-modules.c: Only include fts.h early if BAD_FTS is
206 2016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
208 * core-file.c: Remove sys/param.h.
209 * dwfl_segment_report_module.c: Likewise. Add system.h include.
210 (MAX): Remove definition.
211 * frame_unwind.c: Add system.h include.
212 (MAX): Remove definition.
213 * linux-core-attach.c (MIN): Remove definition.
214 * linux-pid-attach.c (MAX): Likewise.
216 2016-08-12 Mark Wielaard <mjw@redhat.com>
218 * link_map.c (dwfl_link_map_report): Fix assert, set in.d_size.
220 2016-04-14 Mark Wielaard <mjw@redhat.com>
222 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Free match
223 on invalid DWARF if we allocated it.
225 2016-04-14 Mark Wielaard <mjw@redhat.com>
227 * linux-proc-maps.c (proc_maps_report): Free last_file on bad file
230 2016-03-01 Steven Chamberlain <steven@pyro.eu.org>
232 * linux-pid-attach.c: Removed unused pid_thread_callbacks,
233 pid_thread_detach, pid_detach, pid_set_initial_registers,
234 pid_memory_read, pid_getthread, pid_next_thread in #ifndef
237 2016-02-22 Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
238 Mark Wielaard <mjw@redhat.com>
240 * find-debuginfo.c (find_debuginfo_in_path): Remember whether
241 debuglink_file is NULL. Try file basename (without .debug) ofr
242 absolute and relative path if debug_file was NULL.
243 * linux-kernel-modules.c (try_kernel_name): If try_debug is true call
244 dwfl_standard_find_debuginfo with NULL debuglink_file, otherwise with
247 2016-02-13 Mark Wielaard <mjw@redhat.com>
249 * linux-proc-maps.c (proc_maps_report): Free last_file when ENOEXEC.
251 2016-02-13 Mark Wielaard <mjw@redhat.com>
253 * frame_unwind.c (new_unwound): Check and return unwound.
254 (handle_cfi): Check new_unwound was able to allocate new memory
255 before use. Return DWFL_E_NOMEM otherwise.
257 2016-02-11 Mark Wielaard <mjw@redhat.com>
259 * relocate.c (relocate_section): Check result of all gelf_get* calls.
260 (__libdwfl_relocate): Likewise.
261 (__libdwfl_relocate_section): Likewise.
263 2016-02-11 Mark Wielaard <mjw@redhat.com>
265 * relocate.c (relocate_section): Check result of gelf_update_* calls.
267 2016-01-08 Mark Wielaard <mjw@redhat.com>
269 * libdwfl_a_SOURCES: Unconditionally add gzip.c.
270 * linux-kernel-modules.c (vmlinux_suffixes): We always have at least
272 (try_kernel_name): Likewise.
273 (check_suffix): Likewise.
274 * open.c (decompress): Likewise.
276 2015-12-18 Mark Wielaard <mjw@redhat.com>
278 * dwfl_module_getdwarf.c (find_symtab): Uncompress symstr, xndx, sym
279 sections and aux_str, aux_xndx and aux_sym sections if necessary.
280 * relocate.c (relocate_getsym): Uncompress symtab and symtab_shndx
282 (resolve_symbol): Uncompress strtab section if necessary.
283 (relocate_section): Uncompress the section the relocations apply to
286 2015-11-18 Chih-Hung Hsieh <chh@google.com>
288 * linux-proc-maps.c (proc_maps_report): Move nested function
289 'report' to file scope.
291 2015-11-18 Chih-Hung Hsieh <chh@google.com>
293 * core-file.c (elf_begin_rand): Move nested function 'fail' to file
295 * core-file.c (dwfl_elf_phdr_memory_callback): Move nested functions
296 'update_end' and 'more' to file scope.
298 2015-11-17 Chih-Hung Hsieh <chh@google.com>
300 * link_map.c (auxv_format_probe): Move nested functions
301 check64 and check32 to file scope.
303 2015-12-08 Jose E. Marchesi <jose.marchesi@oracle.com>
305 * dwfl_frame.c (state_fetch_pc): Add a backend-defined offset to
306 the value of the return address register as defined by the CFI
308 * frame_unwind.c (handle_cfi): Likewise.
310 2015-12-01 Mark Wielaard <mjw@redhat.com>
312 * link_map.c (dwfl_link_map_report): Track whether in.d_buf comes
313 from exec or memory_callback, free as appropriate.
315 2015-12-01 Mark Wielaard <mjw@redhat.com>
317 * libdwflP.h (struct Dwfl_User_Core): New.
318 (struct DWfl): Replace executable_for_core with user_core.
319 * argp-std.c (parse_opt): Store core and fd in Dwfl user_core.
320 * core-file.c (dwfl_core_file_report): Check and store
321 executable_for_core in Dwfl user_core.
322 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Check and use
323 executable_for_core in Dwfl user_core.
324 * dwfl_end.c (dwfl_end): Release resources held in Dwfl user_core.
325 * link-map.c (report_r_debug): Check executable_for_core in Dwfl
327 (dwfl_link_map_report): Likewise.
329 2015-11-16 Chih-Hung Hsieh <chh@google.com>
331 * dwfl_module_getdwarf.c (find_prelink_address_sync): Move nested
332 function 'consider_shdr' to file scope.
333 * dwfl_module_getdwarf.c (find_dynsym): Move nested function
334 'translate_offs' to file scope.
336 2015-11-16 Chih-Hung Hsieh <chh@google.com>
338 * dwfl_module_addrsym.c (__libdwfl_addrsym): Move nested functions
339 'same_section', 'binding_value', 'try_sym_value', and 'search_table'
342 2015-11-19 Mark Wielaard <mjw@redhat.com>
344 * dwfl_module.c (__libdwfl_module_free): Remove Dwfl_Module Ebl from
345 eh_cfi and dwarf_cfi cache if necessary before calling dwarf_end and
348 2015-11-13 Chih-Hung Hsieh <chh@google.com>
350 * gzip.c (unzip): Move nested functions to file scope.
352 2015-10-21 Chih-Hung Hsieh <chh@google.com>
353 Mark Wielaard <mjw@redhat.com>
355 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Move nested
356 functions 'dwarf_line_file', 'dwfl_line', and 'dwfl_line_file' to
357 file scope. Rename dwarf_line_file to dwfl_dwarf_line_file. Don't
360 2015-10-21 Chih-Hung Hsieh <chh@google.com>
362 * frame_unwind.c (expr_eval): Move nested function 'push' and 'pop'
363 to file scope. Pass used local variables in struct eval_stack.
365 2015-10-21 Chih-Hung Hsieh <chh@google.com>
367 * dwfl_module.c (dwfl_report_module): Move nested function 'use' to
370 2015-10-09 Josh Stone <jistone@redhat.com>
372 * core-file.c (elf_begin_rand): Replace loff_t with off_t.
373 * open.c (decompress): Replace off64_t with off_t.
374 * gzip.c (unzip): Likewise.
375 * image-header.c (__libdw_image_header): Likewise.
376 * libdwflP.h: Likewise in function declarations.
377 * argp-std.c (parse_opt): Replace open64 with open.
378 * dwfl_build_id_find_elf.c (__libdwfl_open_mod_by_build_id,
379 dwfl_build_id_find_elf): Likewise.
380 * dwfl_module_getdwarf.c (open_elf_file): Likewise.
381 * dwfl_report_elf.c (dwfl_report_elf): Likewise.
382 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
383 * link_map.c (report_r_debug): Likewise.
384 * offline.c (dwfl_report_offline): Likewise.
385 * linux-proc-maps.c (grovel_auxv, get_pid_class,
386 dwfl_linux_proc_find_elf): Likewise.
387 (read_proc_memory): Replace off64_t with off_t.
388 * find-debuginfo.c (find_debuginfo_in_path): Replace stat64 and
389 fstat64 with stat and fstat.
390 (try_open): Likewise, and replace open64 with open.
391 * linux-kernel-modules.c: Manually define open and fopen to open64 and
392 fopen64 when needed, since the early fts.h include breaks that.
393 (try_kernel_name): Replace open64 with open.
394 (check_notes): Likewise.
396 2015-10-09 Jose E. Marchesi <jose.marchesi@oracle.com>
398 * linux-proc-maps.c (read_proc_memory): Use seek+read instead of
399 pread, as the later doesn't accept negative offsets.
401 2015-10-07 Mark Wielaard <mjw@redhat.com>
403 * dwfl_module_getdwarf.c (MAX): Removed.
404 (find_prelink_address_sync): Allocate exact amount of bytes for
406 * dwfl_segment_report_module.c (dwfl_segment_report_module):
408 * elf-from-memory.c (MAX): Removed.
409 (elf_from_remote_memory): Allocate exact amount of bytes for phdrs.
411 2015-10-05 Chih-Hung Hsieh <chh@google.com>
413 * dwfl_module_getdwarf.c (find_prelink_address_sync): Do not use
414 union of variable length arrays.
415 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
416 * elf-from-memory.c (elf_from_remote_memory): Likewise.
417 * link_map.c (auxv_format_probe): Likewise.
418 * link_map.c (report_r_debug): Likewise.
419 * link_map.c (dwfl_link_map_report): Likewise.
421 2015-09-18 Chih-Hung Hsieh <chh@google.com>
423 * relocate.c (relocate_section): Move nested function "relocate"
424 to file scope, pass all used local variables as constants.
425 Move nested "check_badreltype" to file scope, pass addresses of
426 updated used local variables.
427 * linux-kernel-modules.c (intuit_kernel_bounds): Move nested function
428 "read_address" to file scope, pass all updated local variables in
430 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Move nested
431 function "subst_name" to file scope, pass all used local variables
433 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Replace
434 simple nested function "report" with a macro. Work around gcc static
435 analysis error -Werror=maybe-uninitialized.
437 2015-09-22 Mark Wielaard <mjw@redhat.com>
439 * core-file.c: Remove old-style function definitions.
440 * dwfl_error.c: Likewise.
441 * dwfl_module_dwarf_cfi.c: Likewise.
442 * dwfl_module_eh_cfi.c: Likewise.
443 * dwfl_module_register_names.c: Likewise.
444 * dwfl_module_return_value_location.c: Likewise.
445 * dwfl_version.c: Likewise.
447 2015-09-09 Chih-Hung Hsieh <chh@google.com>
448 Mark Wielaard <mjw@redhat.com>
450 * dwfl_frame.c (dwfl_attach_state): Remove redundant NULL tests
451 on parameters declared with __nonnull_attribute__.
452 * libdwfl.h (dwfl_module_getelf): Don't mark first argument as
455 2015-09-08 Mark Wielaard <mjw@redhat.com>
457 * libdwflP.h (struct __libdwfl_pid_arg): Add elf and elf_fd.
458 * linux-pid-attach.c (pid_detach): Call elf_end and close.
459 (dwfl_linux_proc_attach): Open and save /proc/PID/exe.
461 2015-09-04 Chih-Hung Hsieh <chh@google.com
463 * frame_unwind.c (expr_eval): Use llabs instead of abs.
465 2015-08-14 Dodji Seketeli <dodji@seketeli.org>
467 * find-debuginfo.c (find_debuginfo_in_path): Try to locate the
468 debug info file named debuglink_file under
469 mod->dwfl->callbacks->debuginfo_path, by looking at
470 the set of sub-trees under mod->dwfl->callbacks->debuginfo_path
471 which is common to the set of non-absolute parent trees of
474 2015-06-18 Mark Wielaard <mjw@redhat.com>
476 * find-debuginfo.c (try_open): Free fname on all failure paths.
478 2015-06-18 Mark Wielaard <mjw@redhat.com>
480 * dwfl_module_getdwarf.c (find_symtab): Check shdr is not NULL and
481 sh_entsize is not zero.
483 2015-06-06 Mark Wielaard <mjw@redhat.com>
485 * find-debuginfo.c (find_debuginfo_in_path): Always free localpath,
486 localname and file_dirname.
488 2015-06-06 Mark Wielaard <mjw@redhat.com>
490 * derelocate.c (cache_sections): Free sortrefs.
492 2015-06-05 Mark Wielaard <mjw@redhat.com>
494 * dwfl_segment_report_module.c (dwfl_segment_report_module):
495 If the note_file exists, but the build_id doesn't match discard
496 the file and continue reporting.
498 2015-06-01 Mark Wielaard <mjw@redhat.com>
500 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Copy path
501 pointer before passing to strsep.
503 2015-05-30 Mark Wielaard <mjw@redhat.com>
505 * link_map.c (check32): Use read_4ubyte_unaligned_noncvt to read
507 (read_addrs): Use read_(4|8)ubyte_unaligned_noncvt or to read
510 2015-05-30 Mark Wielaard <mjw@redhat.com>
512 * find-debuginfo.c (dwfl_standard_find_debuginfo): Check file_name is
513 not NULL before calling canonicalize_file_name.
515 2015-05-24 Mark Wielaard <mjw@redhat.com>
517 * derelocate.c (check_module): Check mod is not NULL.
519 2015-05-22 Mark Wielaard <mjw@redhat.com>
521 * link_map.c (dwfl_link_map_report): Allocate phdrs and dyn with
522 malloc instead of stack allocating. Call free when done with data.
524 2015-05-22 Mark Wielaard <mjw@redhat.com>
526 * dwfl_segment_report_module.c (dwfl_segment_report_module):
527 Allocate phdrs with malloc, not on stack. free in finish.
528 Allocate dyn with malloc, not on stack, free after use.
530 2015-05-22 Mark Wielaard <mjw@redhat.com>
532 * find-debuginfo.c (find_debuginfo_in_path): malloc or strdup,
533 instead of alloca or strdupa, local strings of unknown size.
534 Call free before return.
536 2015-05-22 Mark Wielaard <mjw@redhat.com>
538 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Return
539 error when id_len too small or too large. strdup, not strdupa,
540 and free path when done.
542 2015-05-19 Mark Wielaard <mjw@redhat.com>
544 * elf-from-memory.c (elf_from_remote_memory): Don't allocate all
545 phdrs on the stack. Allocate with malloc and free when done.
547 2015-05-19 Mark Wielaard <mjw@redhat.com>
549 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): malloc and
552 2015-05-19 Mark Wielaard <mjw@redhat.com>
554 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't
555 stack allocate name. Only change chars up to suffix.
557 2015-05-18 Mark Wielaard <mjw@redhat.com>
559 * dwfl_module_getdwarf.c (find_prelink_address_sync): Allocate
560 phdrs and shdrs unions with malloc, not alloca. Free after use.
562 2015-05-18 Mark Wielaard <mjw@redhat.com>
564 * derelocate.c (cache_sections): Allocate temporary newrefs and
565 sortrefs with malloc, not alloca. Always free them on return.
567 2015-05-07 Mark Wielaard <mjw@redhat.com>
569 * cu.c (intern_cu): Check for EOF and check cuoff points to a real
570 Dwarf_Die before interning. Explicitly check EOF is expected.
572 2015-05-05 Mark Wielaard <mjw@redhat.com>
574 * dwfl_lineinfo.c (dwfl_lineinfo): Check info->file is valid.
576 2015-05-06 Roland McGrath <roland@hack.frob.com>
578 * dwfl_error.c (struct msgtable): Break type definition out of
579 the 'msgtable' initializer.
580 (msgtable): Make it a union of struct msgtable and a char array.
581 (msgstr): Use the full-table char array rather than the msg_0 entry.
583 2015-04-23 Max Filippov <jcmvbkbc@gmail.com>
585 * core-file.c (_compat_without_executable_dwfl_core_file_report):
586 Guard with SYMBOL_VERSIONING.
587 * dwfl_module_build_id.c (_compat_vaddr_at_end_dwfl_module_build_id):
589 * dwfl_report_elf.c (_compat_without_add_p_vaddr_dwfl_report_elf):
592 2015-04-02 Mark Wielaard <mjw@redhat.com>
594 * segment.c (insert): Check correct number of lookup_elts.
596 2015-03-31 Mark Wielaard <mjw@redhat.com>
598 * core-file.c (core_file_read_eagerly): Special case small images.
600 2015-01-26 Mark Wielaard <mjw@redhat.com>
602 * dwfl_module_getdwarf.c (find_symtab): Explicitly clear symdata,
603 syments and first_global on elferr before calling find_dynsym.
605 2014-12-27 Mark Wielaard <mjw@redhat.com>
607 * dwfl_module_getsrc.c (dwfl_module_getsrc): Never match a line that
608 has end_sequence set.
610 2015-01-04 Mark Wielaard <mjw@redhat.com>
612 * cu.c (intern_cu): Store result and return directly when finding
614 (__libdwfl_nextcu): Check *nextp as returned by intern_cu isn't -1.
616 2014-12-19 Mark Wielaard <mjw@redhat.com>
618 * dwfl_module_getdwarf.c (find_symtab): Always try find_dynsym last.
620 2014-12-19 Mark Wielaard <mjw@redhat.com>
622 * elf-from-memory.c (handle_segment): Remove palign sanity check.
624 2014-12-18 Mark Wielaard <mjw@redhat.com>
626 * relocate.c (resolve_symbol): Make sure symstrdata->d_buf != NULL.
628 2014-12-13 Mark Wielaard <mjw@redhat.com>
630 * dwfl_module_getdwarf.c (find_dynsym): elf_getdata_rawchunk takes
631 a size_t, make sure it doesn't overflow.
633 2014-12-13 Mark Wielaard <mjw@redhat.com>
635 * cu.c (cudie_offset): Make sure Dwarf_Off difference doesn't
636 wrap around before returning as int.
638 2014-12-11 Josh Stone <jistone@redhat.com>
640 * dwfl_module_getsrc.c (dwfl_module_getsrc): Return the *last* line
641 record <= addr, rather than returning immediately on matches.
643 2014-12-09 Mark Wielaard <mjw@redhat.com>
645 * dwfl_segment_report_module.c (handle_file_note): Check count doesn't
648 2014-12-07 Mark Wielaard <mjw@redhat.com>
650 * relocate.c (relocate_section): Sanity check section overlap against
651 actually used ehsize, shentsize and phentsize.
653 2014-12-07 Mark Wielaard <mjw@redhat.com>
655 * offline.c (dwfl_offline_section_address): Assert shndx is not zero.
656 * relocate.c (__libdwfl_relocate_value): Don't relocate against
659 2014-11-29 Mark Wielaard <mjw@redhat.com>
661 * relocate.c (relocate_section): Check relocation section and target
662 section data don't overlap any of the ELF headers.
663 (relocate): Check for offset + size overflow.
665 2014-11-22 Mark Wielaard <mjw@redhat.com>
667 * link_map.c (consider_executable): Use elf_getphdrnum.
668 (dwfl_link_map_report): Likewise.
670 2014-11-18 Mark Wielaard <mjw@redhat.com>
672 * dwfl_module_getdwarf.c (find_symtab): Sanity check the data buffer,
673 number of symbols and first_global before use.
675 2014-11-14 Mark Wielaard <mjw@redhat.com>
677 * dwfl_module_getdwarf.c (load_symtab): Don't use tables which have
680 2014-11-10 Mark Wielaard <mjw@redhat.com>
682 * dwfl_module_getdwarf.c (find_dynsym): New inner function
683 translate_offs that takes an adjust argument. Try finding
684 the symbol table with and without adjusting to main_bias.
686 2014-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
688 Support NT_FILE for locating files.
689 * core-file.c (dwfl_core_file_report): New variables note_file and
690 note_file_size, set them and pass them to dwfl_segment_report_module.
691 * dwfl_segment_report_module.c: Include common.h and fcntl.h.
692 (buf_has_data, buf_read_ulong, handle_file_note): New functions.
693 (invalid_elf): New function from code of dwfl_segment_report_module.
694 (dwfl_segment_report_module): Add parameters note_file and
695 note_file_size. New variables elf and fd, clean them up in finish.
696 Move some code to invalid_elf. Call handle_file_note, if it found
697 a name verify the file by invalid_elf. Protect elf and fd against
698 cleanup by finish if we found the file for new Dwfl_Module.
699 * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and
702 2014-09-23 Mark Wielaard <mjw@redhat.com>
704 * dwfl_segment_report_module.c (dwfl_segment_report_module):
705 Extract ei_class, ei_data and e_type early and use the result.
707 2014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com>
709 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Use IS_EXECUTABLE.
710 * dwfl_segment_report_module.c (dwfl_segment_report_module): Set
712 * libdwflP.h (struct Dwfl_Module): New field is_executable.
714 2014-08-28 Jan Kratochvil <jan.kratochvil@redhat.com>
716 * dwfl_module_getdwarf.c (find_offsets): Add parameter main_bias, use
718 (find_dynsym): Pass the new parameter main_bias.
720 2014-08-14 Mark Wielaard <mjw@redhat.com>
722 * linux-kernel-modules.c (check-suffix): Also TRY .ko.xz.
724 2014-07-24 Jan Kratochvil <jan.kratochvil@redhat.com>
726 Fix report_r_debug for prelinked libraries.
727 * link_map.c (report_r_debug): Comment out variable l_addr.
728 Use instead new variable base recalculated from l_ld.
730 2014-06-24 Kurt Roeckx <kurt@roeckx.be>
732 * linux-pid-attach.c: Make it build on non linux hosts.
734 2014-06-17 Mark Wielaard <mjw@redhat.com>
736 * frame_unwind.c (handle_cfi): Use ebl_func_addr_mask.
737 * dwfl_module_getsym.c (__libdwfl_getsym): Likewise.
739 2014-06-15 Mark Wielaard <mjw@redhat.com>
741 * linux-core-attach.c (core_memory_read): Use libdw/memory-access.h
742 macros read_4ubyte_unaligned_noncvt and read_8ubyte_unaligned_noncvt
743 to read possibly unaligned data.
744 (core_next_thread): Likewise.
745 (core_set_initial_registers): Likewise.
746 (dwfl_core_file_attach): Likewise.
748 2014-06-11 Mark Wielaard <mjw@redhat.com>
750 * dwfl_frame.c (__libdwfl_process_free): Reset dwfl->attacherr.
751 (dwfl_attach_state): Set dwfl->attacherr.
752 (dwfl_pid): Check and return dwfl->attacherr if set.
753 (dwfl_getthreads): Likewise.
754 (getthread): Likewise.
755 * libdwflP.h: Add DWFL_E_NO_CORE_FILE.
756 (struct Dwfl): Add attacherr field.
757 * linux-core-attach.c (dwfl_core_file_attach): Set dwfl->attacherr.
758 Don't assert if ELF file is not ET_CORE, just return error.
759 * linux-pid-attach.c (dwfl_linux_proc_attach): Set dwfl->attacherr.
761 2014-06-10 Mark Wielaard <mjw@redhat.com>
763 * argp-std.c (parse_opt): Ignore errors from dwfl_core_file_attach
764 or dwfl_linux_proc_attach.
766 2014-05-15 Mark Wielaard <mjw@redhat.com>
768 * linux-proc-maps.c (grovel_auxv): Close fd on error.
770 2014-05-02 Mark Wielaard <mjw@redhat.com>
772 * dwfl_module_getdwarf: Remove ENABLE_DWZ ifdefs so find_debug_altlink
775 2014-05-01 Mark Wielaard <mjw@redhat.com>
777 * libdwflP.h (struct Dwfl_Module): Add alt, alt_fd and alt_elf fields.
778 (__libdwfl_open_mod_by_build_id): Renamed __libdwfl_open_by_build_id.
779 (__libdwfl_open_by_build_id): New declaration that takes an explicit
781 * dwfl_build_id_find_debuginfo.c (dwfl_build_id_find_debuginfo): If
782 we already have the Dwarf then look for the alt dwz multi file by
784 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Add the
785 build-id we are looking for as argument.
786 (__libdwfl_open_mod_by_build_id): New function, calls
787 __libdwfl_open_by_build_id.
788 (dwfl_build_id_find_elf): Call __libdwfl_open_mod_by_build_id.
789 * dwfl_module.c (__libdwfl_module_free): Release alt, alt_elf and
790 close alt_fd if necessary.
791 * dwfl_module_getdwarf.c (__check_build_id): Removed.
792 (try_debugaltlink): Removed.
793 (open_debugaltlink): Removed.
794 (open_elf_file): First half of open_elf that just opens the elf
795 file but doesn't setup the load address.
796 (open_elf): Call open_elf_file.
797 (find_debug_altlink): New function.
798 (load_dw): Remove loading of dwz multifile.
799 (find_dw): Call find_debug_altlink.
800 * find-debuginfo.c (validate): Handle alt debug case using
801 dwelf_dwarf_gnu_debugaltlink and mod->alt_elf.
802 (find_debuginfo_in_path): Handle alt debug files possibly in .dwz
804 * linux-kernel-modules.c (try_kernel_name): Use fakemod.debug.name
805 to store name to find by dwfl_standard_find_debuginfo instead of
806 allocating an extra variable on stack.
808 2014-04-30 Mark Wielaard <mjw@redhat.com>
810 * dwfl_module_build_id.c (__libdwfl_find_elf_build_id): Moved to
811 dwelf_elf_gnu_build_id.c.
812 (__libdwfl_find_build_id): Add assert to make sure mod is never NULL.
813 * dwfl_segment_report_module.c (dwfl_segment_report_module): Call
814 dwelf_elf_gnu_build_id directly instead of __libdwfl_find_build_id.
815 * dwfl_module_getdwarf.c (__check_build_id): Implement using
816 dwelf_elf_gnu_build_id.
818 2014-04-15 Florian Weimer <fweimer@redhat.com>
820 * dwfl_module_getdwarf.c (__check_build_id): Moved from libdw.
821 (try_debugaltlink): Likewise.
822 (open_debugaltlink): Likewise.
823 (load_dw): Locate alternate debug information using
824 dwelf_dwarf_gnu_debugaltlink and call open_debugaltlink.
826 2014-04-11 Mark Wielaard <mjw@redhat.com>
828 * Makefile.am (AM_CPPFLAGS): Add libdwelf.
829 * libdwflP.h: Include libdwelfP.h.
830 * dwfl_module_getdwarf.c (find_debuglink): Moved to libdwelf.
831 (find_debuginfo): Use dwelf_elf_gnu_debuglink.
833 2014-04-22 Mark Wielaard <mjw@redhat.com>
835 * frame_unwind.c (__libdwfl_frame_reg_get): Use uint64_t when
837 (__libdwfl_frame_reg_set): Likewise.
839 2014-04-22 Kurt Roeckx <kurt@roeckx.be>
841 * linux-pid-attach.c: Make linux only.
843 2014-03-14 Mark Wielaard <mjw@redhat.com>
845 * Makefile.am: Remove !MUDFLAP and MUDFLAP conditions.
846 Remove libelf and libdw definitions when MUDFLAP is defined.
847 * argp-std.c (__libdwfl_argp_mudflap_options): Removed.
849 2014-03-03 Mark Wielaard <mjw@redhat.com>
851 * elf-from-memory.c (elf_from_remote_memory): Keep track of
852 segments_end_mem. Pass memsz to first handle_segment pass. Only
853 extend contents_size and use shdrs if only file bits are in
856 2014-03-11 Josh Stone <jistone@redhat.com>
858 * dwfl_module_getdwarf.c (open_elf): Only explicitly set
859 mod->e_type when processing the main ELF file.
861 2014-03-04 Mark Wielaard <mjw@redhat.com>
863 * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from
864 linux-pid-attach.c (struct pid_arg).
865 (__libdwfl_get_pid_arg): New internal function declaration.
866 (__libdwfl_ptrace_attach): Likewise.
867 (__libdwfl_ptrace_detach): Likewise.
868 * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the
869 special exception modules that cannot be checked at this point.
870 * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h
871 (ptrace_attach): Renamed to...
872 (__libdwfl_ptrace_attach): New internal function.
873 (__libdwfl_ptrace_detach): Likewise. Extracted from ...
874 (pid_thread_detach): Call __libdwfl_ptrace_detach now.
875 (__libdwfl_get_pid_arg): New internal function.
876 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special
877 module name contains "(deleted)" and dwfl_pid gives an attached
878 pid. If pid is set and try to (re)use ptrace attach state of
879 process before reading memory.
881 2014-03-03 Mark Wielaard <mjw@redhat.com>
883 * elf-from-memory.c (elf_from_remote_memory): Take pagesize as
884 argument. Free buffer when detecting bad elf. Check PT_LOAD
885 alignment requirements on first handle_segment pass. Calculate
886 loadbase, start and end of segment using pagesize, not p_align.
887 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize
888 to elf_from_remote_memory.
890 2014-02-26 Mark Wielaard <mjw@redhat.com>
892 * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
894 2014-02-26 Mark Wielaard <mjw@redhat.com>
896 * elf-from-memory.c (elf_from_remote_memory): Check against p64
897 p_type in case ELFCLASS64, not against p32 p_type.
899 2014-01-17 Petr Machata <pmachata@redhat.com>
901 * relocate.c (relocate_section): Use gelf_fsize instead of relying
904 2014-01-05 Mark Wielaard <mjw@redhat.com>
906 * frame_unwind.c (handle_cfi): Only skip resetting return register
907 if the regno is not the actual CIE return address register.
909 2014-01-02 Mark Wielaard <mjw@redhat.com>
911 * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi.
913 2013-12-30 Mark Wielaard <mjw@redhat.com>
915 * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and
916 dwfl_core_file_attach explicitly.
917 * core-file.c (dwfl_core_file_report): Don't call
918 __libdwfl_attach_state_for_core implicitly.
919 * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error.
920 * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not
921 process_attach_error.
922 (dwfl_getthreads): Likewise.
923 (getthread): Likewise.
924 * libdwfl.h (dwfl_core_file_report): Update documentation.
925 (dwfl_linux_proc_report): Likewise.
926 (dwfl_core_file_attach): New function declaration.
927 (dwfl_linux_proc_attach): Likewise.
928 * libdwflP.h (struct Dwfl): Remove process_attach_error.
929 (__libdwfl_attach_state_for_pid): Removed declaration.
930 (__libdwfl_attach_state_for_core): Likewise.
931 (dwfl_core_file_attach): New internal declaration.
932 (dwfl_linux_proc_attach): Likewise.
933 (attach_state_for_core): Renamed to...
934 (dwfl_core_file_attach): ...this. Change return type.
935 (__libdwfl_attach_state_for_core): Removed.
936 * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped.
937 (pid_set_initial_registers): Check assume_ptrace_stopped before
939 (pid_thread_detach): Likewise.
940 (__libdwfl_attach_state_for_pid): Renamed to...
941 (dwfl_linux_proc_attach): ...this. Adjust return type.
942 * linux-proc-maps.c (dwfl_linux_proc_report): Don't call
943 __libdwfl_attach_state_for_pid implicitly.
945 2013-12-28 Mark Wielaard <mjw@redhat.com>
947 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special
948 character device files, only regular files.
950 2013-12-24 Mark Wielaard <mjw@redhat.com>
952 * linux-core-attach.c (core_next_thread): Check whether thread_argp
953 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
954 in that case. Free thread_arg if there are no more threads.
956 2013-12-23 Mark Wielaard <mjw@redhat.com>
958 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
959 build_id before returning early.
961 2013-12-23 Mark Wielaard <mjw@redhat.com>
963 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
964 pid (thread group leader) to dwfl_attach_state.
966 2013-12-21 Mark Wielaard <mjw@redhat.com>
968 * frame_unwind.c (handle_cfi): Track whether the return register
969 has been set and only allow it to be set once.
971 2013-12-20 Mark Wielaard <mjw@redhat.com>
973 * dwfl_frame.c (one_arg): New struct.
974 (get_one_thread_cb): New function.
975 (dwfl_getthread): Likewise.
976 (one_thread): New struct.
977 (get_one_thread_frames_cb): New function.
978 (dwfl_getthread_frames): Likewise.
979 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
980 (dwfl_getthread_frames): Likewise.
981 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
982 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
984 * linux-pid-attach.c (pid_getthread): New function.
985 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
987 2013-12-20 Mark Wielaard <mjw@redhat.com>
989 * linux-kernel-modules.c (report_kernel_archive): Correct nested
990 asprintf result check for debug.a.
992 2013-12-18 Mark Wielaard <mjw@redhat.com>
994 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
995 * dwfl_module_addrname.c (dwfl_module_addrname): Use
996 dwfl_module_addrinfo.
997 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
998 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
999 for comparisons, not st_value. Fill in off. Search for both value
1000 and the (adjusted) sym.st_value when different.
1001 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
1002 (dwfl_module_addrinfo): New function.
1003 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
1004 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
1005 and possible. Adjust sym->st_value only when requested. Fill in addr
1007 (dwfl_module_getsym_info): New function.
1008 (dwfl_module_getsym): Use __libdwfl_getsym.
1009 * libdwfl.h (dwfl_module_getsym_elf): Removed.
1010 (dwfl_module_getsym_info): New function declaration.
1011 (dwfl_module_addrinfo): Likewise.
1012 (dwfl_module_addrsym): Add documentation describing differences
1013 with addrinfo variants.
1014 (dwfl_module_addrsym_elf): Removed.
1015 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
1016 (__libdwfl_addrsym): Likewise.
1017 (__libdwfl_find_section_ndx): Likewise.
1018 (dwfl_module_addrinfo): New internal declaration.
1019 (dwfl_module_getsym_info): Likewise.
1020 (dwfl_module_addrsym_elf): Removed.
1021 (dwfl_module_getsym_elf): Likewise.
1023 2013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
1025 * argp-std.c (offline_find_elf): Remove.
1026 (offline_callbacks): Use dwfl_build_id_find_elf instead.
1027 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
1030 2013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
1032 unwinder: s390 and s390x
1033 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
1034 * frame_unwind.c (new_unwound): New function from ...
1035 (handle_cfi): ... here. Call it.
1036 (setfunc, getfunc, readfunc): New functions.
1037 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
1038 * linux-core-attach.c (core_set_initial_registers): Always iterate
1039 through the Ebl_Register_Location loop. Call
1040 dwfl_thread_state_register_pc there.
1042 2013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1044 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
1046 2013-12-17 Mark Wielaard <mjw@redhat.com>
1048 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
1051 2013-12-16 Mark Wielaard <mjw@redhat.com>
1053 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
1055 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
1057 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
1058 function definition.
1059 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
1061 2013-12-14 Mark Wielaard <mjw@redhat.com>
1063 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
1064 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
1065 * frame_unwind.c (handle_cfi): Free frame result from
1066 dwarf_cfi_addrframe when done.
1068 2013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
1070 unwinder: ppc and ppc64
1071 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
1072 Call ebl_dwarf_to_regno.
1073 * linux-core-attach.c (core_set_initial_registers): Implement
1074 pc_register support.
1075 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
1078 2013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1080 Introduce process_attach_error.
1081 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
1082 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
1084 * libdwflP.h (struct Dwfl): New field process_attach_error.
1085 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
1086 (attach_state_for_core): ... here, make it static, change return type,
1087 no longer use __libdwfl_seterrno.
1088 (__libdwfl_attach_state_for_core): New wrapper for it.
1090 2013-11-27 Mark Wielaard <mjw@redhat.com>
1092 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
1093 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
1094 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
1095 instead of tracking dwfl_files.
1096 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
1097 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
1098 new elfp and biasp arguments. Track elf instead of file.
1099 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
1100 dwfl_module_info.c (dwfl_module_info): Pass elf to
1101 dwfl_adjusted_st_value.
1102 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
1103 (dwfl_module_getsym_elf): New function declaration.
1104 (dwfl_module_addrsym_elf): Likewise.
1105 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
1106 (dwfl_module_getsym_elf): Likewise.
1107 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
1108 (dwfl_deadjust_st_value): Likewise.
1109 (__libdwfl_module_getsym): Removed.
1110 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
1112 2013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
1114 Fix non-build-id core files on build-id system.
1115 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
1116 be read from memory.
1118 2013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
1120 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
1121 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
1122 content, if possible.
1124 2013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
1126 link_map: Use proper bias, not l_addr.
1127 * core-file.c (dynamic_vaddr_get): Rename to ...
1128 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
1130 (dwfl_core_file_report): Update name in the caller.
1131 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
1132 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
1133 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
1134 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
1136 2013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
1138 Compatibility with older kernels such as RHEL-6.
1139 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
1140 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
1141 (pid_set_initial_registers): Pass tid_was_stopped.
1142 (pid_thread_detach): Use tid_was_stopped.
1144 2013-11-18 Josh Stone <jistone@redhat.com>
1146 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
1147 (find_aux_sym): Use it.
1149 2013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
1151 Code cleanup: Remove const in prototype
1152 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
1154 * libdwfl.h (dwfl_thread_state_registers): Likewise.
1155 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
1157 2013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
1159 Fix dwfl_attach_state machine->elf.
1160 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
1161 Call ebl_openbackend instead of ebl_openbackend_machine.
1162 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
1163 Update the function description.
1164 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
1166 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
1169 2013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
1171 Provide __libdwfl_module_getsym to get dwfl_file *.
1172 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
1173 (dwfl_module_addrsym) (search_table): New variable file. Use
1174 __libdwfl_module_getsym. Use file.
1175 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
1176 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
1177 (dwfl_module_getsym): New wrapper.
1178 * libdwflP.h (__libdwfl_module_getsym): New declaration.
1180 2013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
1182 Fix dwfl_module_addrsym for minidebuginfo.
1183 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
1185 (dwfl_module_addrsym) (same_section): Use it.
1186 (dwfl_module_addrsym) (i_to_symfile): New function.
1187 (dwfl_module_addrsym) (search_table): Use it.
1189 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1190 Mark Wielaard <mjw@redhat.com>
1192 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
1193 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
1195 * core-file.c (dwfl_core_file_report): Call
1196 __libdwfl_attach_state_for_core.
1197 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
1198 * dwfl_frame.c: New file.
1199 * frame_unwind.c: New file.
1200 * dwfl_frame_pc.c: New file.
1201 * linux-pid-attach.c: New file.
1202 * linux-core-attach.c: New file.
1203 * dwfl_frame_regs.c: New file.
1204 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
1205 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
1206 (Dwfl_Thread_Callbacks): New definition.
1207 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
1208 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
1209 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
1210 (dwfl_frame_pc): New declarations.
1211 * libdwflP.h (Dwfl_Process): New typedef.
1212 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
1213 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
1214 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
1215 (INVALID_ARGUMENT): New DWFL_ERROR entries.
1216 (struct Dwfl): New entry process.
1217 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
1218 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
1219 (__libdwfl_process_free, __libdwfl_frame_unwind)
1220 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
1221 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
1222 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
1223 (dwfl_frame_thread, dwfl_thread_state_registers)
1224 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
1225 (dwfl_frame_pc): New INTDECL entries.
1226 * linux-proc-maps.c (dwfl_linux_proc_report): Call
1227 __libdwfl_attach_state_for_pid.
1228 * segment.c (segment_start): Rename to ...
1229 (__libdwfl_segment_start): ... here and make it internal_function.
1230 (segment_end): Rename to ...
1231 (__libdwfl_segment_end): ... here and make it internal_function.
1232 (reify_segments, dwfl_report_segment): Rename them at the callers.
1234 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1236 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
1238 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1240 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
1241 retval. Fix one forgotten LISTED increase.
1243 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1245 Fix core files for re-prelink-ed files.
1246 * core-file.c (dynamic_vaddr_get): New function.
1247 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
1248 dynamic_vaddr_get instead of using L_ADDR.
1249 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
1250 * link_map.c (report_r_debug): Do not initialize l_addr.
1252 2013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
1255 * core-file.c (dwfl_core_file_report): Reindent block of code by
1258 2013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1260 * argp-std.c (parse_opt): Use executable parameter of
1261 dwfl_core_file_report.
1262 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
1263 it to DWFL. Add NEW_VERSION for it.
1264 (_compat_without_executable_dwfl_core_file_report): New. Twice.
1265 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
1266 the function comment.
1268 2013-10-15 Mark Wielaard <mjw@redhat.com>
1270 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
1272 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
1274 2013-09-12 Mark Wielaard <mjw@redhat.com>
1276 * cu.c (intern_cu): If dwarf_offdie fails free cu.
1278 2013-09-12 Mark Wielaard <mjw@redhat.com>
1280 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
1283 2013-09-12 Mark Wielaard <mjw@redhat.com>
1285 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
1286 aux_xndxscn, not xndxscn, for aux_symxndxdata.
1288 2013-08-25 Mark Wielaard <mjw@redhat.com>
1290 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
1293 2013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
1295 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
1296 conflicts all the modules, not just the first one. Compare L_LD if it
1297 is equal, not if it is in a module address range.
1299 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
1301 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
1303 2013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
1305 * core-file.c (clear_r_debug_info): Close also ELF and FD.
1306 (dwfl_core_file_report): Call __libdwfl_report_elf for
1307 R_DEBUG_INFO.MODULE.
1308 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
1310 (__libdwfl_report_elf): ... this function. Call it.
1311 * dwfl_segment_report_module.c: Include unistd.h.
1312 (dwfl_segment_report_module): Use basename for MODULE->NAME.
1313 Clear MODULE if it has no build-id and we have segment with build-id.
1314 Ignore this segment only if MODULE still contains valid ELF.
1315 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
1316 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
1317 and disk_file_has_build_id.
1318 (dwfl_link_map_report): Extend the comment.
1319 * link_map.c (report_r_debug): Extend the comment. Always fill in new
1320 r_debug_info_module. Initialize also the new r_debug_info_module
1321 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
1322 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
1324 2013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
1326 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
1328 2013-07-02 Mark Wielaard <mjw@redhat.com>
1330 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
1332 2013-06-05 Mark Wielaard <mjw@redhat.com>
1334 * link_map.c (report_r_debug): Always call release_buffer after
1335 memory_callback succeeded reading build_id.
1337 2013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1339 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
1340 executable_for_core before calling dwfl_core_file_report.
1341 * core-file.c (clear_r_debug_info): New function.
1342 (dwfl_core_file_report): Move raw segments reporting lower. New
1343 variable r_debug_info, pass it to dwfl_segment_report_module. Call
1344 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
1345 * dwfl_module_build_id.c (check_notes): Move into
1346 __libdwfl_find_elf_build_id.
1347 (__libdwfl_find_build_id): Rename to ...
1348 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
1349 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
1350 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
1351 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
1352 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
1353 adjust its data_elfaddr parameter.
1354 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
1355 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
1356 parameter r_debug_info. New variable name_is_final. Adjust addresses
1357 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
1358 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
1359 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
1360 (struct r_debug_info_module, struct r_debug_info): New definitions.
1361 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
1363 * link_map.c: Include fcntl.h.
1364 (report_r_debug): Add parameter r_debug_info, describe it in the
1365 function comment. Delete dwfl_addrmodule call and its dependent code.
1366 Verify build-id before calling dwfl_report_elf, also supply
1367 executable_for_core to it. Store r_debug_info->module info when
1369 (dwfl_link_map_report): Add parameter r_debug_info. New variable
1370 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
1373 2013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1375 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
1376 Set it to true for ET_EXEC and ET_CORE. Provide alternative
1377 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
1378 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
1380 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
1382 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
1383 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
1384 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
1385 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
1387 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
1389 2013-04-27 Mark Wielaard <mjw@redhat.com>
1391 * link_map.c: #include system.h.
1393 2013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
1395 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
1396 them to lib/system.h.
1398 2013-04-24 Mark Wielaard <mjw@redhat.com>
1400 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1402 2013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
1404 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
1406 2013-03-12 Mark Wielaard <mjw@redhat.com>
1408 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
1410 2013-02-22 Mark Wielaard <mjw@redhat.com>
1412 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
1413 as DWFL_E_BADELF when not used.
1415 2013-02-10 Mark Wielaard <mjw@redhat.com>
1417 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
1418 failure messages When handling ARGP_KEY_SUCCESS because arg will
1421 2013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
1423 * linux-proc-maps.c: Include system.h.
1424 (PROCEXEFMT, get_pid_class): New.
1425 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
1428 2013-01-23 Mark Wielaard <mjw@redhat.com>
1430 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
1431 from aux_syments by default.
1432 (find_symtab): Also succeed when only aux_symdata is found.
1433 When no symtab is found always try to load auxiliary table.
1434 (dwfl_module_getsymtab): Substract one from result when both
1435 tables have symbols.
1436 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
1437 zero entry when both tables have symbols.
1438 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
1439 one from first_global when both tables have symbols.
1441 2013-01-16 Mark Wielaard <mjw@redhat.com>
1443 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
1444 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
1445 (dwfl_adjusted_aux_sym_addr): New function.
1446 (dwfl_deadjust_aux_sym_addr): Likewise.
1447 (dwfl_adjusted_st_value): Take and check symfile argument.
1448 (dwfl_deadjust_st_value): Likewise.
1449 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
1450 use dwfl_file as argument to set address_sync.
1451 (find_debuginfo): Call find_prelink_address_sync with debug file.
1452 (find_aux_sym): New function.
1453 (find_symtab): Use find_aux_sym if all we have is the dynsym table
1454 and fill in aux DwflModule fields.
1455 (dwfl_module_getsymtab): Return syments plus aux_syments.
1456 (load_symtab): Always set first_global.
1457 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
1458 when using same_section. Calculate first_global based on both
1459 mod->first_global and mod->aux_first_global.
1460 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
1461 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
1462 to retrieve symbol and name if necessary, making sure all locals
1463 from any table come before any globals.
1464 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
1466 * relocate.c (resolve_symbol): Likewise.
1468 2013-01-07 Roland McGrath <roland@hack.frob.com>
1470 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
1471 still assume the data is at least 32-bit aligned anyway.
1472 (dwfl_link_map_report): Handle unaligned auxv data.
1474 2012-12-11 Mark Wielaard <mjw@redhat.com>
1476 * linux-kernel-modules.c (report_kernel): Only free fname if
1477 find_kernel_elf succeeds and allocates it.
1478 (report_kernel_archive): Fix brackets around unlikely expression.
1480 2012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
1482 * argp-std.c: Update Copyright year.
1483 (offline_find_elf): New function.
1484 (offline_callbacks): Use it for find_elf.
1485 (struct parse_opt): New.
1486 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
1487 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
1488 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
1489 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
1490 final state->input initialization optional.
1491 * dwfl_end.c: Update Copyright year.
1492 (dwfl_end): Free executable_for_core.
1493 * libdwflP.h: Update Copyright year.
1494 (struct Dwfl): New field executable_for_core.
1496 2012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
1498 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
1501 2012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1503 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
1505 (__libdwfl_getelf): ... here. Call it.
1507 2012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
1509 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
1511 2012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
1513 * dwfl_segment_report_module.c (dwfl_segment_report_module):
1514 Initialize mod->MAIN_BIAS.
1516 2012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
1518 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
1519 binding_value. Use it for both zero and non-zero size symbols
1522 2012-10-01 Mark Wielaard <mjw@redhat.com>
1524 * cu.c (cudie_offset): Don't use type_sig8, it might not be
1525 initialized and these are always real CUs, never TUs.
1527 2012-10-01 Mark Wielaard <mjw@redhat.com>
1529 * derelocate.c (find_section): Check next section exists before
1532 2012-08-01 Petr Machata <pmachata@redhat.com>
1534 * offline.c (process_archive_member): Ignore entry "/SYM64/".
1536 2012-03-28 Roland McGrath <roland@hack.frob.com>
1538 * dwfl_segment_report_module.c
1539 (dwfl_segment_report_module: read_portion): Don't use existing buffer
1540 when FILESZ is zero (string mode) and available portion doesn't hold
1541 a terminated string.
1543 2011-12-02 Roland McGrath <roland@hack.frob.com>
1545 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
1546 to use elf64_xlatetom and PHDRS.p64.
1547 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
1549 2011-11-31 Mark Wielaard <mjw@redhat.com>
1551 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
1552 global symbols. Then only when that doesn't provide a match search
1553 all local symbols too.
1554 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
1556 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
1557 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
1559 2011-11-31 Mark Wielaard <mjw@redhat.com>
1561 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
1562 sizeless_sym if needed and closer to desired addr.
1564 2011-10-20 Mark Wielaard <mjw@redhat.com>
1566 * derelocate.c (cache_sections): Intern mod->reloc_info check.
1567 (dwfl_module_relocations): Don't check mod->reloc_info.
1568 (dwfl_module_relocation_info): Likewise.
1569 (find_section): Likewise.
1571 2011-07-09 Roland McGrath <roland@hack.frob.com>
1573 * image-header.c (LE32): Macro removed (now in lib/system.h).
1575 2011-04-11 Mark Wielaard <mjw@redhat.com>
1577 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
1578 by check for zlib, bzlib or lzma defines to check it isn't empty.
1579 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
1581 2011-03-08 Roland McGrath <roland@redhat.com>
1583 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
1584 Reported by Kurt Roeckx <kurt@roeckx.be>.
1586 2011-02-11 Roland McGrath <roland@redhat.com>
1588 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
1589 suffixes if corresponding decompression support is enabled.
1591 2011-02-01 Roland McGrath <roland@redhat.com>
1593 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
1594 section-end address as the synchronization point, rather than sh_addr.
1596 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
1597 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
1599 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
1600 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
1602 2011-01-11 Roland McGrath <roland@redhat.com>
1604 * dwfl_module_getdwarf.c (open_elf): Remove section-based
1605 address_sync fixup from here.
1606 (find_prelink_address_sync): New function.
1607 (find_debuginfo): Call it.
1608 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
1610 2011-01-04 Roland McGrath <roland@redhat.com>
1612 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
1613 logic to consider section addresses, the better to survive all the
1614 possible prelink machinations.
1615 * libdwflP.h (struct dwfl_file): Comment change.
1617 2010-11-30 Roland McGrath <roland@redhat.com>
1619 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
1621 2010-11-12 Roland McGrath <roland@redhat.com>
1623 * libdwflP.h (struct Dwfl_Module): New member main_bias.
1624 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
1625 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
1627 * libdwflP.h (dwfl_deadjust_address): New function.
1628 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
1629 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
1630 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
1632 2010-11-11 Roland McGrath <roland@redhat.com>
1634 * libdwflP.h (struct dwfl_file): Remove bias member.
1635 Add vaddr and address_sync members instead.
1636 (dwfl_adjusted_address): Calculate using vaddr.
1637 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
1638 (dwfl_adjusted_st_value): Use one of those calls.
1639 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
1640 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
1641 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
1642 * link_map.c (consider_executable): Adjust only MOD->low_addr for
1643 detected PIE bias change.
1645 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
1646 * dwfl_module_info.c: Use it.
1647 * cu.c (addrarange): Likewise.
1648 * dwfl_dwarf_line.c: Likewise.
1649 * dwfl_module_dwarf_cfi.c: Likewise.
1650 * dwfl_lineinfo.c: Likewise.
1651 * dwfl_nextcu.c: Likewise.
1652 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
1654 * libdwflP.h (dwfl_adjusted_st_value): New function.
1655 * relocate.c (resolve_symbol): Use it.
1656 * dwfl_module_getsym.c: Likewise.
1657 * dwfl_module_addrsym.c: Likewise.
1658 * dwfl_module_info.c: Likewise.
1660 * libdwflP.h (dwfl_adjusted_address): New function.
1661 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
1662 * relocate.c (__libdwfl_relocate_value): Likewise.
1663 * derelocate.c (cache_sections): Likewise.
1664 (dwfl_module_address_section): Likewise.
1665 * dwfl_module_getelf.c: Likewise.
1666 * dwfl_module_eh_cfi.c: Likewise.
1667 * link_map.c (consider_executable): Likewise.
1669 2010-08-24 Roland McGrath <roland@redhat.com>
1671 * dwfl_dwarf_line.c: New file.
1672 * Makefile.am (libdwfl_a_SOURCES): Add it.
1674 2010-08-18 Roland McGrath <roland@redhat.com>
1676 * link_map.c (report_r_debug): Use found name if we have no name,
1677 even if we already have an Elf handle.
1679 2010-06-30 Roland McGrath <roland@redhat.com>
1681 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
1682 confused by -1 return from dwfl_build_id_find_elf after it opened
1684 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
1685 dwfl_build_id_find_debuginfo.
1687 2010-06-16 Roland McGrath <roland@redhat.com>
1689 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
1691 2010-06-14 Roland McGrath <roland@redhat.com>
1693 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
1694 candidate file to that st_dev/st_ino and pretend it didn't exist
1696 (find_debuginfo_in_path): Update caller, pass main file's info.
1698 2010-05-20 Roland McGrath <roland@redhat.com>
1700 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
1701 (grovel_auxv): ... this. Take DWFL argument.
1702 (dwfl_linux_proc_report): Update caller.
1704 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
1705 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
1707 2010-05-19 Roland McGrath <roland@redhat.com>
1709 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
1711 2010-05-06 Roland McGrath <roland@redhat.com>
1713 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
1715 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
1716 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
1717 ID but we didn't find a file.
1718 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
1719 and refuse any fallback file-by-name if it lacks the matching ID.
1721 * dwfl_error.c (dwfl_errno): Add INTDEF.
1722 * libdwflP.h: Add INTDECL.
1724 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
1727 2010-05-04 Roland McGrath <roland@redhat.com>
1729 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
1730 ET_DYN that has a DT_DEBUG.
1732 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
1734 * segment.c (insert): Fix moving of values following insertion.
1735 (reify_segments): Fix up MOD->segment backpointer indices after
1736 later insertions in the main loop invalidate them.
1738 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
1739 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
1741 * core-file.c (dwfl_core_file_report): Return any nonzero count of
1742 modules reported, even if link_map grovelling failed and only sniffing
1745 2010-04-26 Roland McGrath <roland@redhat.com>
1747 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
1748 Works around probably-wrong ld -r behavior for case of a DWARF address
1749 constant that refers to a discarded SHF_ALLOC section.
1751 2010-04-14 Roland McGrath <roland@redhat.com>
1753 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
1754 an upper bound on sane possible number of elements.
1756 2010-03-11 Roland McGrath <roland@redhat.com>
1758 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
1759 the second half for 32-bit matches.
1761 2010-03-10 Roland McGrath <roland@redhat.com>
1763 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
1764 * argp-std.c (parse_opt): Update caller.
1765 * libdwfl.h: Declare dwfl_core_file_report.
1766 * libdwflP.h: Don't.
1768 2010-02-17 Roland McGrath <roland@redhat.com>
1770 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
1771 If set, find the first index not below ADDR.
1772 (dwfl_segment_report_module): Update callers.
1773 Pass true when calculating return value.
1775 2010-02-15 Roland McGrath <roland@redhat.com>
1777 * Makefile.am: Use config/eu.am for common stuff.
1779 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
1780 variable in failure path.
1782 2010-02-02 Mark Wielaard <mjw@redhat.com>
1784 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
1785 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
1787 2010-01-07 Roland McGrath <roland@redhat.com>
1789 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
1790 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1791 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
1792 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1794 2010-01-06 Roland McGrath <roland@redhat.com>
1796 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
1797 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
1799 2009-11-16 Roland McGrath <roland@redhat.com>
1801 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
1803 2009-11-12 Petr Machata <pmachata@redhat.com>
1805 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
1806 the chunk is both offset-contiguous and vaddr-contiguous.
1808 2009-11-05 Roland McGrath <roland@redhat.com>
1810 * link_map.c (report_r_debug): Skip entries with l_ld==0.
1811 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
1813 2009-09-04 Roland McGrath <roland@redhat.com>
1815 * image-header.c (__libdw_image_header): Fix tranposed comparison.
1817 2009-08-27 Roland McGrath <roland@redhat.com>
1819 * image-header.c: New file.
1820 * Makefile.am (libdwfl_a_SOURCES): Add it.
1821 * libdwflP.h: Declare __libdw_image_header.
1822 * open.c (decompress): Don't consume ELF on failure.
1823 (what_kind): New function, broken out of ...
1824 (__libdw_open_file): ... here. Call it.
1825 If it fails, try __libdw_image_header and then try what_kind again.
1827 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
1828 leave it behind for next decompressor.
1829 * open.c (decompress): Free BUFFER on failure.
1831 2009-08-26 Roland McGrath <roland@redhat.com>
1833 * gzip.c (find_zImage_payload): New function, broken out of ...
1834 (mapped_zImage): ... here. Call it.
1835 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
1836 stupid method of just trying the decoder.
1838 * open.c [USE_LZMA]: Try __libdw_unlzma.
1839 * libdwflP.h: Declare it.
1840 (DWFL_ERRORS): Add DWFL_E_LZMA.
1841 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
1843 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
1845 * gzip.c (mapped_zImage): Limit scan to 32kb.
1846 Make this unconditional, support bzip2 kernel images too.
1847 (unzip): Use direct inflate method for non-mmap case too.
1848 Only zlib uses the stream method.
1850 2009-08-09 Roland McGrath <roland@redhat.com>
1852 * dwfl_module_build_id.c: Use new macros for versioned definitions.
1854 2009-07-08 Roland McGrath <roland@redhat.com>
1856 * dwfl_module_dwarf_cfi.c: New file.
1857 * dwfl_module_eh_cfi.c: New file.
1858 * Makefile.am (libdwfl_a_SOURCES): Add them.
1859 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
1860 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
1862 2009-07-08 Roland McGrath <roland@redhat.com>
1864 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
1866 2009-06-18 Mark Wielaard <mjw@redhat.com>
1868 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
1870 2009-06-13 Ulrich Drepper <drepper@redhat.com>
1872 * derelocate.c: Don't use deprecated libelf functions.
1873 * dwfl_module_getdwarf.c: Likewise.
1874 * relocate.c: Likewise.
1876 2009-04-23 Ulrich Drepper <drepper@redhat.com>
1878 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
1879 defined. Otherwise just define the latest version.
1881 2009-04-22 Roland McGrath <roland@redhat.com>
1883 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
1884 a non-ET_REL module.
1886 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
1887 adjust properly for non-ET_REL.
1889 2009-04-21 Roland McGrath <roland@redhat.com>
1891 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
1893 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
1894 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
1896 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1898 2009-04-20 Roland McGrath <roland@redhat.com>
1900 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
1902 2009-04-19 Roland McGrath <roland@redhat.com>
1904 * dwfl_module_getdwarf.c (find_file): Renamed to ...
1905 (__libdwfl_getelf): ... this. Make it global.
1906 (find_symtab, find_dw): Update callers.
1907 (dwfl_module_getelf): Functions moved ...
1908 * dwfl_module_getelf.c: ... here, new file.
1909 * Makefile.am (libdwfl_a_SOURCES): Add it.
1910 * libdwflP.h: Declare __libdwfl_getelf.
1912 2009-04-14 Roland McGrath <roland@redhat.com>
1914 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
1915 absolute (already adjusted in place) or needing load bias adjustment.
1917 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
1918 gelf_getphdr failure. Fix file size limit checks.
1920 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
1922 2009-04-08 Roland McGrath <roland@redhat.com>
1924 * dwfl_module_getsym.c: Don't adjust for bias again after
1925 __libdwfl_relocate_value.
1927 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
1928 a non-SHF_ALLOC section.
1929 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
1930 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
1932 2009-03-09 Roland McGrath <roland@redhat.com>
1934 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
1935 variable to outer scope, so we cache it for the loop.
1937 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
1939 2009-02-12 Roland McGrath <roland@redhat.com>
1941 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
1942 __libdwfl_relocate_value to find correct sh_addr value.
1944 2009-02-10 Roland McGrath <roland@redhat.com>
1946 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
1947 If false, don't fail for NO_PHDR.
1948 (dwfl_report_elf): Update caller.
1949 * libdwflP.h: Update decl.
1950 * offline.c (process_elf): Call it with false, so we don't refuse
1951 dubiously-formed objects here.
1953 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1954 finds our module. We shouldn't crash when we confuse some guesses.
1956 2009-02-10 Ulrich Drepper <drepper@redhat.com>
1958 * open.c (decompress): Avoid crash with empty input file.
1960 2009-01-27 Roland McGrath <roland@redhat.com>
1962 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1963 with zero vaddr and memsz.
1965 2009-01-22 Roland McGrath <roland@redhat.com>
1967 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1969 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1970 after address-matching loop.
1972 * segment.c (lookup): Fix fencepost in checking for HINT match.
1974 2009-01-14 Roland McGrath <roland@redhat.com>
1976 * gzip.c [!BZLIB] (mapped_zImage): New function.
1977 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1979 2009-01-10 Ulrich Drepper <drepper@redhat.com>
1981 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1983 2009-01-08 Roland McGrath <roland@redhat.com>
1985 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1986 Skip subdirectory named "source".
1987 (dwfl_linux_kernel_find_elf): Likewise.
1989 2009-01-06 Roland McGrath <roland@redhat.com>
1991 * linux-kernel-modules.c (check_suffix): New function.
1992 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1993 (dwfl_linux_kernel_report_offline): Use it.
1994 (dwfl_linux_kernel_find_elf): Likewise.
1996 2009-01-05 Roland McGrath <roland@redhat.com>
1998 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1999 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
2000 * dwfl_build_id_find_elf.c: Likewise.
2001 * dwfl_module_getdwarf.c (open_elf): Likewise.
2002 * dwfl_report_elf.c: Likewise.
2003 * find-debuginfo.c (validate): Likewise.
2004 * offline.c (__libdwfl_report_offline): Likewise.
2006 * libdwflP.h: Declare __libdw_open_file.
2008 * Makefile.am (libdwfl_a_SOURCES): Add it.
2011 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
2012 * bzip2.c: New file.
2013 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
2014 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
2016 2008-12-16 Roland McGrath <roland@redhat.com>
2018 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
2019 symver magic to bind to ELFUTILS_0.138.
2020 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
2021 wrapper for ELFUTILS_0.130 version set.
2023 2008-12-18 Roland McGrath <roland@redhat.com>
2025 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
2026 addresses are taken as relative to MOD->low_addr.
2028 2008-12-15 Roland McGrath <roland@redhat.com>
2030 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
2033 2008-12-11 Roland McGrath <roland@redhat.com>
2035 * offline.c (process_archive): Don't call elf_end and close if
2036 returning NULL. Check first elf_begin call and set error code
2037 specially for empty archive.
2040 2008-12-02 Roland McGrath <roland@redhat.com>
2042 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
2044 2008-11-26 Roland McGrath <roland@redhat.com>
2046 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
2047 return value, and interpret encoded OFFSET argument.
2049 2008-10-07 Roland McGrath <roland@redhat.com>
2051 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
2053 2008-09-29 Roland McGrath <roland@redhat.com>
2055 * segment.c (insert): Must realloc DWFL->lookup_module here too.
2056 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
2058 2008-08-28 Roland McGrath <roland@redhat.com>
2060 * segment.c (reify_segments): Fix last change.
2062 2008-08-27 Roland McGrath <roland@redhat.com>
2064 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
2065 failure from pread64.
2067 2008-08-26 Roland McGrath <roland@redhat.com>
2069 * segment.c (reify_segments): Insert a trailing segment for a module
2070 end that is above the highest current segment.
2072 2008-08-25 Roland McGrath <roland@redhat.com>
2074 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
2075 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
2076 if FILE->elf is not ELF_K_ELF.
2078 * dwfl_segment_report_module.c: Add a cast.
2080 2008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
2082 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
2083 which decides which symbol is "closest" to a given address.
2085 2008-08-15 Roland McGrath <roland@redhat.com>
2087 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
2088 (options, parse_opt): Handle --core.
2090 * core-file.c: New file.
2091 * Makefile.am (libdwfl_a_SOURCES): Add it.
2092 * libdwflP.h (dwfl_core_file_report): Declare it.
2094 * link_map.c: New file.
2095 * Makefile.am (libdwfl_a_SOURCES): Add it.
2096 * libdwflP.h (dwfl_link_map_report): Declare it.
2098 * libdwflP.h (MIN, MAX): New macros.
2099 (Dwfl_Memory_Callback): New typedef.
2100 (Dwfl_Module_Callback): New typedef.
2101 (dwfl_segment_report_module): Declare it.
2102 * dwfl_segment_report_module.c: New file.
2103 * Makefile.am (libdwfl_a_SOURCES): Add it.
2105 * derelocate.c (dwfl_module_address_section): Add INTDEF.
2106 * libdwflP.h: Add INTDECL.
2108 * segment.c: New file.
2109 * Makefile.am (libdwfl_a_SOURCES): Add it.
2110 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
2111 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
2112 lookup_addr, lookup_module, lookup_segndx, replace removed members
2114 (struct Dwfl_Module): New member segment.
2115 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
2116 to each free module.
2117 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
2118 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
2119 (dwfl_report_module): Don't touch DWFL->nmodules.
2120 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
2121 (compare_modules): Function removed.
2122 * dwfl_getmodules.c: Rewritten.
2124 * libdwflP.h: Add INTDECLs.
2125 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
2126 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
2128 2008-08-03 Roland McGrath <roland@redhat.com>
2130 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
2132 2008-07-17 Roland McGrath <roland@redhat.com>
2134 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
2135 zero if the failure was only ENOENT.
2137 2008-06-03 Roland McGrath <roland@redhat.com>
2139 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
2142 2008-05-22 Petr Machata <pmachata@redhat.com>
2144 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
2146 2008-05-06 Roland McGrath <roland@frob.com>
2148 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
2149 FTS_LOGICAL here too.
2150 (dwfl_linux_kernel_find_elf): Likewise.
2152 2008-04-29 Roland McGrath <roland@redhat.com>
2154 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
2155 based on canonicalize_file_name if it differs from the supplied name.
2157 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
2160 2008-04-27 Roland McGrath <roland@redhat.com>
2162 * linux-kernel-modules.c (report_kernel): Fix crash when
2163 dwfl_report_elf fails.
2165 2008-04-05 Roland McGrath <roland@redhat.com>
2167 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
2169 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
2170 Clear it after freeing.
2171 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
2173 2008-03-26 Roland McGrath <roland@redhat.com>
2175 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
2176 SHT_DYNSYM, just set *SYMSCN like the comment says.
2178 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
2180 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
2182 2008-03-19 Roland McGrath <roland@redhat.com>
2184 * dwfl_module_getsrc.c: Adjust address for module bias before search.
2186 2008-03-01 Roland McGrath <roland@redhat.com>
2188 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
2189 prototype to avoid older compiler's complaint about reuse of the name.
2190 (__libdwfl_canon_error): Likewise.
2192 2008-02-19 Roland McGrath <roland@redhat.com>
2194 * relocate.c (relocate_section): Check for an unhandled relocation
2195 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
2196 DWFL_E_UNKNOWN_MACHINE check out of loops.
2198 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
2199 DEBUGFILE->relocated is already set.
2201 2008-01-26 Roland McGrath <roland@redhat.com>
2203 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
2205 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
2206 incoming *FILE_NAME at the start.
2208 2008-01-08 Roland McGrath <roland@redhat.com>
2210 * Makefile.am (euinclude): Variable removed.
2211 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
2213 2007-10-23 Roland McGrath <roland@redhat.com>
2215 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
2216 module to appear first.
2218 2007-10-20 Roland McGrath <roland@redhat.com>
2220 * offline.c (process_archive_member): Take FD argument, pass it down
2221 to process_file. Return Elf_Cmd, not bool.
2222 Call elf_next here, always before elf_end.
2223 (process_archive): Update caller. Don't close FD here unless there
2226 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
2228 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
2229 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
2230 partial relocation to one or both files.
2231 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
2232 relocations have been applied to the debug file if dwfl_module_getelf
2233 has been used before.
2235 * relocate.c (resolve_symbol): New function.
2236 (relocate_section): Call it.
2238 * relocate.c (relocate_getsym): Handle null MOD->symfile.
2239 (relocate_section): Take new bool arg, PARTIAL. If true,
2240 no error for BADRELTYPE/RELUNDEF, instead just skip them
2241 and leave only those skipped relocs behind the reloc section.
2242 (__libdwfl_relocate_section): Take new arg, pass it down.
2243 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
2244 do partial relocation on all sections.
2245 * dwfl_module_getdwarf.c (load_dw): Update caller.
2246 * libdwflP.h: Update decls.
2247 * derelocate.c (dwfl_module_address_section): Pass new argument
2248 to __libdwfl_relocate_section, true.
2250 * derelocate.c (cache_sections): Don't cache reloc sections when
2251 section_address callback is null.
2253 2007-10-19 Roland McGrath <roland@redhat.com>
2255 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
2257 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
2258 (struct secref): Likewise.
2259 (cache_sections): Cache the relocation section referring to each
2260 section we cache, if any.
2261 (dwfl_module_address_section): Use __libdwfl_relocate_section as
2264 * relocate.c (struct reloc_symtab_cache): New type.
2265 (relocate_getsym): Use it instead of four arguments.
2266 (__libdwfl_relocate): Update caller.
2267 (relocate_section): New function, broken out of ...
2268 (__libdwfl_relocate): ... here.
2269 (__libdwfl_relocate_section): New function.
2270 * libdwflP.h: Declare it.
2272 2007-10-17 Roland McGrath <roland@redhat.com>
2274 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
2275 to relocated st_value.
2277 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
2280 2007-10-16 Roland McGrath <roland@redhat.com>
2282 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
2283 section has larger alignment requirements not met by the original BASE,
2284 rather than padding more between sections.
2286 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
2288 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
2291 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
2292 at zero in ET_REL case. Adjust BASE to necessary alignment.
2294 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
2296 (__libdwfl_find_build_id): Update caller.
2298 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
2299 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
2300 * offline.c (dwfl_offline_section_address): Bail early if there is
2301 separate debug file.
2303 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
2305 2007-10-09 Roland McGrath <roland@redhat.com>
2307 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
2308 caching SHDR->sh_addr = 0.
2309 * offline.c (dwfl_offline_section_address): Never called for sh_addr
2310 really at 0, don't check for it. Use MOD->debug directly, not symfile.
2312 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
2313 we've found SHT_SYMTAB.
2315 * relocate.c (relocate_getsym): New function.
2316 (__libdwfl_relocate): Use it.
2317 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
2318 be a pointer instead of value; cache getshstrndx result there.
2319 * libdwflP.h: Update decl.
2320 * derelocate.c (cache_sections): Update caller.
2321 Always work on the main file, not the symfile.
2322 (dwfl_module_address_section): Likewise.
2323 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
2325 2007-10-07 Roland McGrath <roland@redhat.com>
2327 * offline.c (process_archive): Initialize MOD.
2329 * linux-kernel-modules.c (get_release): New function, broken out of ...
2330 (report_kernel): ... here. Call it.
2331 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
2332 (find_kernel_elf): Update caller.
2333 (report_kernel_archive): New function.
2334 (dwfl_linux_kernel_report_offline): Call it.
2336 * offline.c (process_file): Take new arg PREDICATE, pass it down.
2337 (process_archive): Likewise.
2338 (process_archive_member): Likewise. When nonnull, let the predicate
2339 decide whether to use this member.
2340 (__libdwfl_report_offline): New function, broken out of ...
2341 (dwfl_report_offline): ... here. Call it.
2342 * libdwflP.h: Declare it.
2344 * offline.c (process_archive, process_archive_member): New functions.
2345 (process_elf, process_file): New functions, broken out of ...
2346 (dwfl_report_offline): ... here. Call process_file, which recurses on
2349 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
2350 (dwfl_report_elf): ... here. Call it.
2351 * libdwflP.h: Declare it.
2353 2007-10-06 Roland McGrath <roland@redhat.com>
2355 * derelocate.c (dwfl_module_relocations): Don't call
2356 dwfl_module_getdwarf.
2358 * derelocate.c (find_section): Use __libdwfl_seterrno, not
2361 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
2362 SHF_ALLOC, to cache sh_addr resolved to 0.
2364 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
2365 values nonzero already, just use its existing layout.
2367 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
2368 in-core shdr after applying it.
2370 2007-10-04 Ulrich Drepper <drepper@redhat.com>
2372 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
2373 initialization of notes variable.
2375 2007-10-04 Roland McGrath <roland@redhat.com>
2377 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
2378 fill in with vaddr of "__start_notes" symbol if found.
2379 (check_notes): New function.
2380 (check_kernel_notes): New function.
2381 (dwfl_linux_kernel_report_kernel): Call it.
2382 (check_module_notes): New function.
2383 (dwfl_linux_kernel_report_modules): Call it.
2385 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
2386 Try dwfl_build_id_find_elf first.
2388 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
2389 Set kernel module e_type to ET_DYN.
2391 2007-10-03 Roland McGrath <roland@redhat.com>
2393 * find-debuginfo.c (validate): New function, broken out of ...
2394 (find_debuginfo_in_path): ... here. New function, broken out of ...
2395 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
2396 dwfl_build_id_find_debuginfo first.
2398 * dwfl_build_id_find_elf.c: New file.
2399 * dwfl_build_id_find_debuginfo.c: New file.
2400 * Makefile.am (libdwfl_a_SOURCES): Add them.
2401 * libdwfl.h: Declare them.
2402 * libdwflP.h: Add INTDECLs.
2404 * dwfl_module_build_id.c: New file.
2405 * dwfl_module_report_build_id.c: New file.
2406 * Makefile.am (libdwfl_a_SOURCES): Add them.
2407 * libdwfl.h: Declare them.
2408 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
2409 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
2410 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
2412 * dwfl_module_getdwarf.c (find_offsets): New function.
2413 (find_dynsym): New function, calls that.
2414 (find_symtab): Call it.
2416 2007-09-11 Roland McGrath <roland@redhat.com>
2418 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
2419 address if its st_size is smaller.
2421 2007-08-13 Roland McGrath <roland@redhat.com>
2423 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
2425 2007-08-12 Roland McGrath <roland@redhat.com>
2427 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
2430 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
2431 a second phdr if it happens to match EHDR_VMA exactly.
2433 2007-08-08 Roland McGrath <roland@redhat.com>
2435 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
2436 those with no names. Rewrite best symbol algorithm not to assume a
2437 sorted table and to be smarter handling sizeless symbols.
2439 2007-07-16 Roland McGrath <roland@redhat.com>
2441 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
2442 reviving an existing module.
2444 2007-06-08 Roland McGrath <roland@redhat.com>
2446 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
2448 2007-05-17 Roland McGrath <roland@redhat.com>
2450 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
2451 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
2452 (dwfl_linux_kernel_find_elf): Likewise.
2454 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2455 getline and sscanf instead of fscanf.
2457 2007-05-08 Roland McGrath <roland@redhat.com>
2459 * offline.c (dwfl_offline_section_address): Don't assume section
2460 numbers match between stripped and debuginfo files. Instead, assume
2461 only that the ordering among SHF_ALLOC sections matches.
2463 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
2465 (dwfl_linux_kernel_report_offline): Update caller.
2466 (dwfl_linux_kernel_report_kernel): Likewise.
2468 2007-04-23 Roland McGrath <roland@redhat.com>
2470 * argp-std.c (options): Fix group title string.
2472 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
2473 Update via STATE->input every time we set STATE->hook, not only at
2476 * dwfl_module.c (free_file): Free FILE->name.
2478 2007-04-16 Roland McGrath <roland@redhat.com>
2480 * derelocate.c (cache_sections): Apply bias to sh_addr.
2481 (compare_secrefs): Fix address comparison to avoid signed overflow.
2482 (find_section): New function, broken out of ...
2483 (dwfl_module_relocate_address): ... here, call it.
2484 (check_module): New function, broken out of ...
2485 (dwfl_module_relocate_address): ... here, call it.
2486 (dwfl_module_address_section): New function.
2487 * libdwfl.h: Declare it.
2489 2007-03-26 Roland McGrath <roland@redhat.com>
2491 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
2493 2007-03-18 Roland McGrath <roland@redhat.com>
2495 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
2496 (find_debuginfo): ... here. Call it.
2497 Don't return error for libelf errors finding .gnu_debuglink section.
2499 2007-03-12 Roland McGrath <roland@redhat.com>
2501 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
2502 (dwfl_report_begin): ... here. Call it.
2503 * libdwfl.h: Declare it.
2504 * libdwflP.h: Add INTDECL.
2506 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2508 * offline.c: Comment typo fix.
2510 2007-03-04 Roland McGrath <roland@redhat.com>
2512 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
2513 (find_kernel_elf): New function, broken out of ...
2514 (report_kernel): ... here. Call it.
2515 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
2516 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
2517 virtual address bounds of kernel from symbols rounded to page size.
2518 (dwfl_linux_kernel_report_kernel): Use that if it works, before
2519 resorting to report_kernel.
2521 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
2522 ET_EXEC file with nonzero bias.
2524 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
2525 dwfl_module_addrsym. Guts moved to ...
2526 * dwfl_module_addrsym.c: ... here; new file.
2527 * Makefile.am (libdwfl_a_SOURCES): Add it.
2528 * libdwfl.h: Declare dwfl_module_addrsym.
2529 * libdwflP.h: Add INTDECL.
2531 2007-03-03 Roland McGrath <roland@redhat.com>
2533 * dwfl_module.c (free_file): New function, broken out of ...
2534 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
2536 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
2539 2007-03-02 Roland McGrath <roland@redhat.com>
2541 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
2543 2007-02-02 Roland McGrath <roland@redhat.com>
2545 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
2546 address exactly if it's no other module's low boundary.
2548 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
2549 and size cover the address, select the closest symbol with st_size==0
2550 that lies in the same section.
2552 2007-01-29 Roland McGrath <roland@redhat.com>
2554 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
2557 2007-01-20 Roland McGrath <roland@redhat.com>
2559 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
2561 * libdwfl.h (Dwfl_Callbacks): Update comment.
2562 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
2563 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2564 For ignored missing section, use -1 instead of 0.
2565 * offline.c (dwfl_offline_section_address): Expect a call for 0.
2567 2007-01-19 Roland McGrath <roland@redhat.com>
2569 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
2570 zero so a lone -e foo.so is shown without address bias.
2572 2007-01-10 Roland McGrath <roland@redhat.com>
2574 * linux-kernel-modules.c (report_kernel): Check asprintf return value
2575 directly instead of via side effect, to silence warn_unused_result.
2576 (dwfl_linux_kernel_report_offline): Likewise.
2577 (dwfl_linux_kernel_find_elf): Likewise.
2578 (dwfl_linux_kernel_module_section_address): Likewise.
2579 * find-debuginfo.c (try_open): Likewise.
2580 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
2581 (dwfl_linux_proc_report): Likewise.
2583 * libdwfl.h (dwfl_begin): Require nonnull argument.
2585 2006-12-27 Roland McGrath <roland@redhat.com>
2587 * dwfl_module.c (compare_modules): Fix address comparison to avoid
2588 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
2590 2006-10-30 Roland McGrath <roland@redhat.com>
2592 * dwfl_module.c (dwfl_report_module): Comment typo fix.
2594 2006-09-05 Roland McGrath <roland@redhat.com>
2596 * derelocate.c (cache_sections): Use alloca instead of variable-sized
2597 auto array, in function already using alloca.
2599 2006-08-14 Roland McGrath <roland@redhat.com>
2601 * linux-kernel-modules.c (try_kernel_name): If the call to
2602 dwfl_standard_find_debuginfo produces no results, try it again
2603 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
2605 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
2606 * libdwflP.h: ... to here.
2607 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
2608 repeats the first thing dwfl_standard_find_debuginfo will try.
2610 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
2611 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
2612 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
2615 2006-07-12 Ulrich Drepper <drepper@redhat.com>
2617 * cu.c: Adjust for internal_function_def removal.
2618 * dwfl_error.c: Likewise.
2619 * dwfl_module.c: Likewise.
2620 * dwfl_module_getdwarf.c: Likewise.
2621 * lines.c: Likewise.
2622 * relocate.c: Likewise.
2624 2006-07-11 Ulrich Drepper <drepper@redhat.com>
2626 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
2627 it can overflow the return value type.
2628 Patch by Tim Moore <timoore@redhat.com>.
2630 2006-06-28 Roland McGrath <roland@redhat.com>
2632 * libdwfl.h: Cosmetic changes.
2634 * dwfl_line_comp_dir.c: New file.
2635 * Makefile.am (libdwfl_a_SOURCES): Add it.
2636 * libdwfl.h: Declare dwfl_line_comp_dir.
2638 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
2640 * dwfl_linecu.c: New file.
2641 * Makefile.am (libdwfl_a_SOURCES): Add it.
2642 * libdwfl.h: Declare dwfl_linecu.
2644 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
2645 (dwfl_linecu): Define as macro.
2647 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
2649 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
2650 (dwfl_module_addrname): Function moved ...
2651 * dwfl_module_addrname.c: ... here, new file.
2652 * dwfl_module_getsym.c: New file.
2653 * Makefile.am (libdwfl_a_SOURCES): Add them.
2654 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
2655 * libdwflP.h: Add INTDECLs.
2657 2006-06-27 Roland McGrath <roland@redhat.com>
2659 * dwfl_module.c (dwfl_report_end): Whitespace fix.
2661 2006-06-13 Roland McGrath <roland@redhat.com>
2663 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2664 Use __libdwfl_seterrno for elf_memory failure.
2666 2006-05-22 Roland McGrath <roland@redhat.com>
2668 * dwfl_module_return_value_location.c
2669 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
2671 2006-05-27 Ulrich Drepper <drepper@redhat.com>
2673 * libdwfl.h: Add extern "C".
2675 2006-05-22 Ulrich Drepper <drepper@redhat.com>
2677 * cu.c (addrarange): Handle files without aranges information.
2679 2006-05-16 Ulrich Drepper <drepper@redhat.com>
2681 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
2684 2006-02-26 Roland McGrath <roland@redhat.com>
2686 * dwfl_version.c: New file.
2687 * Makefile.am (libdwfl_a_SOURCES): Add it.
2688 * libdwfl.h: Declare dwfl_version.
2690 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
2691 aligned up from DWFL->offline_next_address when checking for overlap.
2693 2005-12-22 Roland McGrath <roland@redhat.com>
2695 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
2697 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
2698 (dwfl_linux_proc_report): ... here. Call it.
2699 (dwfl_linux_proc_maps_report): New function.
2700 * libdwfl.h: Declare it.
2701 * libdwflP.h: Add INTDECL.
2702 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
2704 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
2705 failed with DWFL_E_NO_DWARF.
2707 2005-11-26 Roland McGrath <roland@redhat.com>
2709 * dwfl_end.c (dwfl_end): Free the DWFL itself.
2711 2005-11-25 Roland McGrath <roland@redhat.com>
2713 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
2715 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
2716 * libdwflP.h: Declare it.
2718 * dwfl_module_register_names.c: New file.
2719 * Makefile.am (libdwfl_a_SOURCES): Add it.
2720 * libdwfl.h: Declare dwfl_module_register_names.
2722 2005-11-21 Roland McGrath <roland@redhat.com>
2724 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2725 Don't leak malloc'd file name.
2726 If a /sys/.../sections file is missing and starts with ".init",
2727 try the variant with "_init" too; catches PPC64 kernel braindamage.
2729 2005-11-15 Roland McGrath <roland@redhat.com>
2731 * libdwfl.h: Comment fixes.
2733 * dwfl_module_return_value_location.c: Add unlikely for error case.
2735 2005-11-13 Roland McGrath <roland@redhat.com>
2737 * dwfl_return_value_location.c: New file.
2738 * Makefile.am (libdwfl_a_SOURCES): Add it.
2739 * libdwfl.h: Declare dwfl_module_return_value_location.
2740 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
2742 2005-10-20 Roland McGrath <roland@redhat.com>
2744 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
2745 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
2746 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
2748 2005-10-01 Roland McGrath <roland@redhat.com>
2750 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
2753 2005-09-19 Roland McGrath <roland@redhat.com>
2755 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2756 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
2757 the signed integer reading; they will just have to be in hexadecimal.
2758 (dwfl_linux_kernel_module_section_address): Likewise.
2760 2005-08-28 Ulrich Drepper <drepper@redhat.com>
2762 * Makefile.am (%.os): Use COMPILE.os.
2763 (COMPILE.os): Filter out gconv options.
2765 2005-08-25 Roland McGrath <roland@redhat.com>
2767 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
2768 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
2770 2005-08-24 Roland McGrath <roland@redhat.com>
2772 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
2774 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
2775 magic initializer to set -heur-stack-bound option.
2777 2005-08-22 Roland McGrath <roland@redhat.com>
2779 * dwfl_validate_address.c: New file.
2780 * Makefile.am (libdwfl_a_SOURCES): Add it.
2781 * libdwfl.h: Declare dwfl_validate_address.
2783 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
2784 * libdwflP.h: Add INTDECL.
2786 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
2787 elf_rawdata for symbol-related sections.
2789 * offline.c (dwfl_report_offline): Move offline_next_address outside
2790 module's range, in case it's an ET_EXEC using fixed segment locations.
2791 * libdwfl.h: Update comment.
2793 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
2796 2005-08-20 Roland McGrath <roland@redhat.com>
2798 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
2799 function to choose whether to report.
2800 (dwfl_linux_kernel_report_offline): Likewise.
2801 * libdwfl.h: Update decl.
2802 * argp-std.c (parse_opt): Update caller.
2804 * dwfl_getsrclines.c: New file.
2805 * dwfl_onesrcline.c: New file.
2806 * Makefile.am (libdwfl_a_SOURCES): Add them.
2807 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
2809 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
2810 MODULESDIR[0]. Call fts_close on failure.
2812 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
2813 Close ET_REL file descriptors after relocation.
2814 (find_dw): Update caller.
2815 * offline.c (dwfl_report_offline): Get the file into memory and close
2816 the file descriptor.
2818 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
2819 MOD->debug.elf is already set.
2821 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
2822 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
2824 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
2825 dwfl_linux_kernel_report_offline with offline_callbacks.
2827 * linux-kernel-modules.c (report_kernel): New function, broken out of
2829 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2830 (dwfl_linux_kernel_report_offline): New function.
2831 * libdwfl.h: Declare it.
2832 * libdwflP.h: Add INTDECL.
2834 2005-08-19 Roland McGrath <roland@redhat.com>
2836 Use standard debuginfo search path to look for vmlinux.
2837 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
2839 * linux-kernel-modules.c (try_kernel_name): New function, broken out
2841 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2843 * argp-std.c (offline_callbacks): New variable.
2844 (parse_opt): Use it for -e. Allow multiple -e options.
2846 * offline.c: New file.
2847 * Makefile.am (libdwfl_a_SOURCES): Add it.
2848 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
2849 * libdwflP.h: Add INTDECLs.
2850 (OFFLINE_REDZONE): New macro.
2851 (struct Dwfl): New member `offline_next_address'.
2852 * dwfl_begin.c (dwfl_begin): Initialize it.
2853 * dwfl_module.c (dwfl_report_begin): Likewise.
2855 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
2856 do a nominal absolute section layout starting at BASE.
2857 * libdwfl.h: Update comment.
2859 2005-08-18 Roland McGrath <roland@redhat.com>
2861 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
2862 dwfl_module_getdwarf if necessary.
2864 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
2865 * libdwfl.h: Update comment.
2867 * derelocate.c: New file.
2868 * Makefile.am (libdwfl_a_SOURCES): Add it.
2870 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
2871 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
2872 * dwfl_module_getdwarf.c (open_elf): Update initialization.
2873 (load_dw, dwfl_module_addrname): Update uses.
2874 * relocate.c (__libdwfl_relocate): Likewise.
2876 2005-08-04 Roland McGrath <roland@redhat.com>
2878 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
2879 arguments SHNDX, SHDR.
2880 (dwfl_linux_kernel_module_section_address): Update prototype.
2881 * relocate.c (__libdwfl_relocate_value): Update caller.
2882 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2883 Take the new arguments.
2885 2005-08-10 Roland McGrath <roland@redhat.com>
2887 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
2888 use it instead of MOD->debug.file.
2889 * libdwflP.h: Update decl.
2890 * dwfl_module_getdwarf.c (load_dw): Update caller.
2893 2005-08-09 Roland McGrath <roland@redhat.com>
2895 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
2896 * cu.c: Use INTUSE on dwarf_* calls.
2897 * dwfl_error.c: Likewise.
2898 * dwfl_module.c: Likewise.
2899 * dwfl_module_getdwarf.c: Likewise.
2900 * dwfl_module_getsrc_file.c: Likewise.
2901 * lines.c: Likewise.
2903 2005-08-07 Roland McGrath <roland@redhat.com>
2905 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
2906 names contain '_' or '-', look for files named either "foo-bar.ko"
2909 2005-07-29 Roland McGrath <roland@redhat.com>
2911 * loc2c.c: File removed.
2912 * loc2c.h: File removed.
2913 * loc2c-runtime.h: File removed.
2914 * test2.c: File removed.
2915 * Makefile.am (EXTRA_DIST): Variable removed.
2916 (noinst_HEADERS): Remove loc2c.h from here.
2918 2005-07-28 Ulrich Drepper <drepper@redhat.com>
2920 * libdwfl.h: Add a few missing extern for function prototypes.
2922 * libdwfl_crc32.c: New file.
2923 * libdwfl_crc32_file.c: New file.
2924 * libdwflP.h: Declare the new functions.
2925 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
2926 libdwfl_crc32_file.c.
2927 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
2928 instead of crc32_file.
2930 2005-07-28 Roland McGrath <roland@redhat.com>
2932 * ptest.c: Moved to ../tests/dwflmodtest.c.
2934 * Makefile.am (noinst_PROGRAMS): Variable removed.
2935 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
2936 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
2937 (libdwfl): Don't use libdwfl.so any more.
2938 (libdwfl.so, install, uninstall): Targets removed.
2939 (test2_SOURCES): Define EXTRA_DIST instead of this.
2940 * libdwfl.map: File removed.
2942 * libdwfl.h: Use "" for libdw.h #include.
2944 2005-07-27 Roland McGrath <roland@redhat.com>
2946 * libdwfl.map: Add dwfl_getmodules.
2948 2005-07-23 Ulrich Drepper <drepper@redhat.com>
2950 * Makefile.am: Fix rules to allow building with mudflap.
2952 2005-07-21 Roland McGrath <roland@redhat.com>
2954 * Makefile.am (noinst_HEADERS): Add loc2c.c.
2956 * test2.c (main): Check sscanf result to quiet warning.
2958 2005-07-20 Roland McGrath <roland@redhat.com>
2960 * libdwfl-branch merged, creating this direcotry.