12021-11-18 Matthias Maennich <maennich@google.com> 2 3 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): 4 Add one to modname array size. 5 62021-02-14 Alexander Miller <alex.miller@gmx.de> 7 8 * core-file.c (dwfl_core_file_report): Move NEW_VERSION before 9 definition. Replace INTDEF with NEW_INTDEF. 10 * dwfl_module_build_id.c (dwfl_module_build_id): Likewise. 11 * dwfl_report_elf.c (dwfl_report_elf): Likewise. 12 132021-09-06 Dmitry V. Levin <ldv@altlinux.org> 14 15 * linux-pid-attach.c (read_cached_memory): Remove cast of malloc 16 return value. 17 182021-06-09 Omar Sandoval <osandov@fb.com> 19 20 * link_map.c (read_addrs): Fix potential NULL pointer dereference. 21 222021-04-19 Martin Liska <mliska@suse.cz> 23 24 * dwfl_frame.c (dwfl_attach_state): Use startswith. 25 * dwfl_module_getdwarf.c (find_symtab): Likewise. 26 * linux-kernel-modules.c: Likewise. 27 * linux-pid-attach.c (linux_proc_pid_is_stopped): Likewise. 28 (dwfl_linux_proc_attach): Likewise. 29 * relocate.c (resolve_symbol): Likewise. 30 (relocate_section): Likewise. 31 322021-02-01 Érico Nogueira <ericonr@disroot.org> 33 34 * dwfl_error.c (strerror_r): Only use the GNU version when available. 35 362021-01-08 Timm Bäder <tbaeder@redhat.com> 37 38 * elf-from-memory.c (elf_from_remote_memory): Add for loop over 39 switch. inline handle_segment call, set vaddr, offset and filesz 40 directly based on class. 41 422021-01-08 Timm Bäder <tbaeder@redhat.com> 43 44 * elf-from-memory.c (elf_from_remote_memory): Use if instead of 45 switch on class. Set new vaddr, memsz, offset and filesz 46 variables. Inline handle_segment function check and set loadbase, 47 found_base, segments_end and segments_end_mem directly. 48 492020-12-16 Dmitry V. Levin <ldv@altlinux.org> 50 51 * argp-std.c (_): Remove. 52 * libdwflP.h (_): Likewise. 53 542020-12-12 Dmitry V. Levin <ldv@altlinux.org> 55 56 * libdwfl.h: Fix spelling typos in comments. 57 * dwfl_module_getdwarf.c (open_elf, find_symtab): Likewise. 58 * dwfl_report_elf.c (__libdwfl_elf_address_range): Likewise. 59 * linux-pid-attach.c (read_cached_memory): Likewise. 60 612020-12-07 Timm Bäder <tbaeder@redhat.com> 62 63 * link_map.c (report_r_debug): Pull read_addrs() function into 64 file scope. 65 662020-12-07 Timm Bäder <tbaeder@redhat.com> 67 68 * link_map.c (report_r_debug): Pull release_buffer() function into 69 file scope. Add memory_closure struct. 70 712020-12-08 Dmitry V. Levin <ldv@altlinux.org> 72 73 * debuginfod-client.c (__libdwfl_debuginfod_init): Replace 74 "libdebuginfod-" VERSION ".so" with DEBUGINFOD_SONAME in dlopen call. 75 Do not fall back to dlopen of "libdebuginfod.so". 76 772020-12-01 Timm Bäder <tbaeder@redhat.com> 78 79 * link_map.c (dwfl_link_map_report): Removed consider_phdr function 80 and inline code. 81 822020-11-28 Mark Wielaard <mark@klomp.org> 83 84 * dwfl_segment_report_module.c (dwfl_segment_report_module): 85 Use GElf_Addr to calculate note_vaddr instead of size_t. 86 872020-11-26 Timm Bäder <tbaeder@redhat.com> 88 89 * dwfl_segment_report_module.c (dwfl_segment_report_module): 90 Remove consider_notes function. Inline code for type == PT_NOTE. 91 922020-11-26 Timm Bäder <tbaeder@redhat.com> 93 94 * dwfl_segment_report_module.c (read_portion): New static function. 95 (dwfl_segment_report_module): Remove read_portion function. 96 Call static function with read_state, start and segment. 97 982020-11-26 Timm Bäder <tbaeder@redhat.com> 99 100 * dwfl_segment_report_module.c (struct read_state): New. 101 (finish_portion): New static function. 102 (dwfl_segment_report_module): Introduce read_state. Remove 103 finish_portion function. Call static function with read_state. 104 1052020-11-23 Timm Bäder <tbaeder@redhat.com> 106 107 * segment_report_module.c (dwfl_segment_report_module): Remove 108 consider_phdr, do checks inline. 109 1102020-11-23 Timm Bäder <tbaeder@redhat.com> 111 112 * segment_report_module.c (dwfl_segment_report_module): Remove 113 consider_dyn, do checks inline. 114 1152020-11-23 Timm Bäder <tbaeder@redhat.com> 116 117 * segment_report_module.c (dwfl_segment_report_module): Do one 118 loop check for d32/d64 arrays. 119 1202020-11-23 Timm Bäder <tbaeder@redhat.com> 121 122 * segment_report_module.c (dwfl_segment_report_module): Remove 123 read_phdr, do check and call memory_callback directly. 124 1252020-11-23 Timm Bäder <tbaeder@redhat.com> 126 127 * segment_report_module.c (dwfl_segment_report_module): Do one 128 loop check for p32/p64 arrays. 129 1302020-11-23 Timm Bäder <tbaeder@redhat.com> 131 132 * segment_report_module.c (dwfl_segment_report_module): Remove 133 final_read, call memory_callback directly. 134 1352020-11-23 Timm Bäder <tbaeder@redhat.com> 136 137 * segment_report_module.c (struct elf_build_id): New. 138 (dwfl_segment_report_module): Pass build_id as struct. 139 1402020-11-23 Timm Bäder <tbaeder@redhat.com> 141 142 * segment_report_module.c (dwfl_segment_report_module): Remove 143 release_buffer, call memory_callback directly. 144 1452020-11-23 Timm Bäder <tbaeder@redhat.com> 146 147 * segment_report_module.c (dwfl_segment_report_module): Remove 148 segment_read, call memory_callback directly. 149 1502020-11-19 Andreas Krebbel <krebbel@linux.ibm.com> 151 152 * linux-pid-attach.c (pid_memory_read): Shift the upper 4 bytes 153 down on big endian 64 bit targets. 154 1552020-11-12 Timm Bäder <tbaeder@redhat.com> 156 157 * dwfl_segment_report_module.c (dwfl_segment_report_module): Remove 158 finish function, replace with goto out. 159 1602020-11-12 Timm Bäder <tbaeder@redhat.com> 161 162 * dwfl_segment_report_module.c (dwfl_segment_report_module): Declare 163 p32 and p64 as pointers instead of arrays. 164 1652020-09-18 Mark Wielaard <mark@klomp.org> 166 167 * zstd.c: New file. 168 * libdwflP.h: Add DWFL_E_ZSTD and __libdw_unzstd. 169 * Makefile.am (libdwfl_a_SOURCES): add zstd.c if ZSTD. 170 * gzip.c: Add defines and includes for ZSTD. 171 (zlib_fail): Don't define for ZSTD. 172 (unzip): Change pread_retry failure from zlib_fail to fail. 173 Add ZSTD support. 174 * open.c (decompress): Also try __libdw_unzstd. 175 * linux-kernel-modules.c (check_suffix): Also TRY ".ko.zst". 176 1772020-08-20 Dmitry V. Levin <ldv@altlinux.org> 178 179 * Makefile.am (libdwfl_a_SOURCES): Conditionalize 180 debuginfod-client.c on LIBDEBUGINFOD. 181 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Conditionalize 182 __libdwfl_debuginfod_find_executable invocation on 183 ENABLE_LIBDEBUGINFOD. 184 * dwfl_end.c (dwfl_end): Conditionalize __libdwfl_debuginfod_end 185 invocation on ENABLE_LIBDEBUGINFOD. 186 * find-debuginfo.c (dwfl_standard_find_debuginfo): Conditionalize 187 __libdwfl_debuginfod_find_debuginfo invocation on 188 ENABLE_LIBDEBUGINFOD. 189 * libdwflP.h: Guard debuginfod.h include with ENABLE_LIBDEBUGINFOD. 190 (struct Dwfl): Guard debuginfod field with ENABLE_LIBDEBUGINFOD. 191 (__libdwfl_debuginfod_find_executable, 192 __libdwfl_debuginfod_find_debuginfo, __libdwfl_debuginfod_end): 193 Guard declarations with ENABLE_LIBDEBUGINFOD. 194 1952020-07-05 Mark Wielaard <mark@klomp.org> 196 197 * argp-std.c (parse_opt): Don't assert, but call fail when 198 dwfl_report_end fails. 199 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't 200 assert, but goto bad_id when snprintf fails. 201 * frame_unwind.c (__libdwfl_frame_unwind): Don't assert, but 202 return when dwfl_frame_pc fails. 203 * linux-core-attach.c (core_set_initial_registers): Don't assert, 204 but return false when gelf_getnote fails or the core note is not 205 as expected. 206 * linux-pid-attach.c (dwfl_linux_proc_attach): Don't assert, but 207 goto fail when snprintf fails. 208 2092020-06-16 Mark Wielaard <mark@klomp.org> 210 211 * frame_unwind.c (handle_cfi): Flag an error if 212 return_address_register is invalid. 213 2142020-06-16 Mark Wielaard <mark@klomp.org> 215 216 * linux-kernel-modules.c (try_kernel_name): Don't try other 217 compressed kernels if we already found an compressed image. 218 2192020-05-09 Mark Wielaard <mark@klomp.org> 220 221 * find-debuginfo.c (dwfl_standard_find_debuginfo): Return failure 222 when mod is NULL. 223 2242020-05-08 Mark Wielaard <mark@klomp.org> 225 226 * libdwfl/core-file.c (dwfl_core_file_report): Keep track of 227 new bool cleanup_user_core and cleanup dwfl->user_core in error 228 case. 229 2302020-04-30 Mark Wielaard <mark@klomp.org> 231 232 * find-debuginfo.c (dwfl_standard_find_debuginfo): When mod->dw 233 is already set then try fetching debugaltlink. 234 2352020-04-25 Mark Wielaard <mark@klomp.org> 236 237 * gzip.c (open_stream): Return DWFL_E_NOMEM instead of calling 238 zlib_fail. 239 2402020-04-16 Mark Wielaard <mark@klomp.org> 241 242 * find-debuginfo.c (dwfl_standard_find_debuginfo): Initialize bits 243 to NULL. 244 2452020-01-24 Mark Wielaard <mark@klomp.org> 246 247 * linux-kernel-modules.c (find_kernel_elf): Check release isn't NULL. 248 (report_kernel): Check release and *release aren't NULL. 249 (report_kernel_archive): Likewise. 250 2512019-12-11 Omar Sandoval <osandov@fb.com> 252 253 * libdwflP.h (Dwfl_Module): Remove coalescing state. 254 Rename lookup_tail_ndx to next_segndx. 255 * segment.c (dwfl_report_segment): Remove coalescing logic. 256 * libdwfl.h (dwfl_report_segment): Document that IDENT is ignored. 257 2582019-12-05 Mark Wielaard <mark@klomp.org> 259 260 * linux-kernel-modules.c (find_kernel_elf): Also try to find 261 vmlinux image. 262 2632019-10-28 Aaron Merey <amerey@redhat.com> 264 265 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Call debuginfod 266 client functions via dlopen to look for elf/dwarf files as fallback. 267 * find-debuginfo.c (dwfl_standard_find_debuginfo): Ditto. 268 2692019-10-07 Omar Sandoval <osandov@fb.com> 270 271 * dwfl_frame.c (dwfl_getthreads): Get rid of unnecessary 272 thread_free_all_states calls. 273 (getthread): Ditto. 274 (state_free): Remove function. 275 (thread_free_all_states): Remove function. 276 (free_states): Add function. 277 (dwfl_thread_getframes): Don't update thread->unwound while unwinding. 278 * libdwflP.h (struct Dwfl_Thread): Update comment for unwound member. 279 2802019-08-12 Mark Wielaard <mark@klomp.org> 281 282 * gzip.c (open_stream): Return DWFL_E_ERRNO on bad file operation. 283 * open.c (libdw_open_elf): New argument bad_elf_ok. Check it and 284 return DWFL_E_NOERROR in case it is set and error was DWFL_E_BADELF. 285 (__libdw_open_file): Call libdw_open_elf with bad_elf_ok false. 286 (__libdw_open_elf): Call libdw_open_elf with bad_elf_ok true. 287 2882019-08-05 Omar Sandoval <osandov@fb.com> 289 290 * dwfl_segment_report_module.c (dwfl_segment_report_module): Assign 291 mod->main.fd. 292 2932019-04-28 Mark Wielaard <mark@klomp.org> 294 295 * frame_unwind.c (expr_eval): Make sure we left shift a unsigned 296 64bit value. 297 2982019-04-28 Mark Wielaard <mark@klomp.org> 299 300 * cu.c (addrarange): Only call realloc when naranges is not zero. 301 3022019-03-27 Mark Wielaard <mark@klomp.org> 303 304 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check 305 ph_buffer_size vs xlatefrom.d_size after read_portion call. 306 3072019-02-24 Mark Wielaard <mark@klomp.org> 308 309 * linux-kernel-modules.c (intuit_kernel_bounds): Init *notes before 310 fopen. 311 (dwfl_linux_kernel_report_kernel): Remove fake note init empty asm. 312 3132019-01-25 Yonghong Song <yhs@fb.com> 314 315 * linux-proc-maps.c (proc_maps_report): Use PRIu64, not PRIi64, to 316 read the inode number. 317 3182019-01-20 Mark Wielaard <mark@klomp.org> 319 320 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check 321 dyn_filesz vs dyn_data_size after read_portion call. 322 3232019-01-16 Mark Wielaard <mark@klomp.org> 324 325 * linux-core-attach.c (core_next_thread): Pass desc to ebl_core_note. 326 (core_set_initial_registers): Likewise. 327 3282018-10-23 Mark Wielaard <mark@klomp.org> 329 330 * relocate.c (relocate_section): Only sanity check mmapped Elf files 331 for overlap. Don't error when section data was malloced, not mmapped. 332 3332018-10-20 Mark Wielaard <mark@klomp.org> 334 335 * libdwflP.h (__libdw_open_elf): New internal function declaration. 336 * open.c (what_kind): Rename close_fd to may_close_fd. 337 (__libdw_open_file): Replaced (and renamed) by a call to ... 338 (libdw_open_elf): this. And add never_close_fd argument. 339 (__libdw_open_elf): New function that calls libdw_open_elf. 340 3412018-10-18 Mark Wielaard <mark@klomp.org> 342 343 * dwfl_segment_report_module.c (consider_note): Take align as new 344 argument. Use align to set d_type and calculate padding. 345 (dwfl_segment_report_module): Pass align to consider_notes. 346 * core-file.c (dwfl_core_file_report): Check p_align to set ELF 347 type. 348 * linux-kernel-modules.c (check_notes): Check name and type of note 349 to determine padding. 350 3512018-10-19 Mark Wielaard <mark@klomp.org> 352 353 * dwfl_module_getdwarf.c (find_aux_sym): Check sh_entsize is not zero. 354 3552018-10-14 Mark Wielaard <mark@klomp.org> 356 357 * dwfl_segment_report_module.c (read_portion): Check requested 358 filesz isn't larger than buffer_available. 359 (dwfl_segment_report_module): Check data_size vs filesz after 360 read_portion call. 361 3622018-10-02 Andreas Schwab <schwab@suse.de> 363 364 * relocate.c (relocate): Handle ADD/SUB relocations. 365 3662018-09-13 Mark Wielaard <mark@klomp.org> 367 368 * dwfl_segment_report_module.c (dwfl_segment_report_module): 369 Document why we use e_shnum directly. 370 * elf-from-memory.c (elf_from_remote_memory): Likewise. 371 3722018-07-17 Ulf Hermann <ulf.hermann@qt.io> 373 374 * linux-pid-attach.c: Include sys/uio.h only on linux. 375 3762018-06-04 Mark Wielaard <mark@klomp.org> 377 378 * libdwflP.h (__libdwfl_addrsym): Remove function declaration. 379 * dwfl_module_addrsym.c (__libdwfl_addrsym): Make a static function. 380 3812018-05-27 Mark Wielaard <mark@klomp.org> 382 383 * relocate.c (__libdwfl_relocate): Always call relocate_section with 384 partial true. 385 3862018-05-17 Mark Wielaard <mark@klomp.org> 387 388 * dwfl_module (__libdwfl_module_free): Free elfdir. 389 * dwfl_module_getdwarf.c (load_dw): Close file descriptors after 390 dwarf_begin_elf call. Set Dwarf debugdir if it is NULL, this is the 391 main module file and we recorded the elfdir. 392 * libdwflP.h (struct Dwfl_Module): Add elfdir field. 393 * offline.c (process_elf): Record the elfdir before we close the 394 main ELF file descriptor. 395 3962018-04-10 Mark Wielaard <mark@klomp.org> 397 398 * frame_unwind.c (unwind): If __libdwfl_frame_reg_get fails for 399 the return address either set an error or mark the pc undefined. 400 4012018-03-17 Mark Wielaard <mark@klomp.org> 402 403 * libdwflP.h (struct __libdwfl_remote_mem_cache): New. 404 (struct __libdwfl_pid_arg): Add mem_cache field. 405 * linux-pid-attach.c (read_cached_memory): New function. 406 (clear_cached_memory): Likewise. 407 (pid_memory_read): Call read_cached_memory. 408 (pid_detach): Free mem_cache. 409 (pid_thread_detach): Call clear_cached_memory. 410 (dwfl_linux_proc_attach): Initialize mem_cache to NULL. 411 4122018-03-05 Mark Wielaard <mark@klomp.org> 413 414 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Use 415 realpath (name, NULL) instead of canonicalize_file_name (name). 416 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise. 417 4182018-01-29 Mark Wielaard <mark@klomp.org> 419 420 * cu.c (cudie_offset): Use __libdw_first_die_off_from_cu instead of 421 DIE_OFFSET_FROM_CU_OFFSET. 422 (intern_cu): Simply use a copy of the given die CU as key instead of 423 trying to construct a dummy one by hand. 424 4252018-02-15 Mark Wielaard <mark@klomp.org> 426 427 * linux-pid-attach.c: Include sys/wait.h after sys/ptrace.h. 428 4292018-02-09 Joshua Watt <JPEWhacker@gmail.com> 430 431 * dwfl_report_elf.c (__libdwfl_elf_address_range): Use FALLTHROUGH 432 macro instead of comment. 433 * frame_unwind.c (expr_eval): Likewise. 434 4352017-11-20 Mark Wielaard <mark@klomp.org> 436 437 * link_map.c (do_check64): Take a char * and calculate type and val 438 offsets before reading, possibly unaligned, values. 439 (do_check32): Likewise. 440 (check64): Remove define. 441 (check32): Likewise. 442 (auxv_format_probe): Call do_check32 and do_check64 directly with 443 a, possibly unaligned, auxv entry pointer. 444 (dwfl_link_map_report): Redefine AUXV_SCAN to not dereference a 445 possibly unaligned auxv entry pointer. 446 4472017-10-16 Mark Wielaard <mark@klomp.org> 448 449 * argp-std.c (parse_opt): For -k call argp_failure not failure to 450 keep dwfl around. 451 4522017-07-26 Yunlian Jiang <yunlian@google.com> 453 454 * argp-std.c (failure): Move to file scope. 455 (fail): Likewise. 456 4572017-04-20 Ulf Hermann <ulf.hermann@qt.io> 458 Mark Wielaard <mark@klomp.org> 459 460 * derelocate.c (compare_secrefs): Compare by end address and then by 461 section number if addresses are equal. 462 4632017-04-20 Ulf Hermann <ulf.hermann@qt.io> 464 Mark Wielaard <mark@klomp.org> 465 466 * linux-kernel-modules.c: Always return NULL from kernel_release() on 467 non-linux systems and set errno to ENOTSUP. 468 4692017-04-20 Ulf Hermann <ulf.hermann@qt.io> 470 471 * libdwflP.h: Don't include config.h. 472 * argp-std.c: Include config.h. 473 * cu.c: Likewise. 474 * derelocate.c: Likewise. 475 * dwfl_addrdie.c: Likewise. 476 * dwfl_addrdwarf.c: Likewise. 477 * dwfl_addrmodule.c: Likewise. 478 * dwfl_begin.c: Likewise. 479 * dwfl_build_id_find_debuginfo.c: Likewise. 480 * dwfl_build_id_find_elf.c: Likewise. 481 * dwfl_cumodule.c: Likewise. 482 * dwfl_dwarf_line.c: Likewise. 483 * dwfl_end.c: Likewise. 484 * dwfl_frame.c: Likewise. 485 * dwfl_frame_regs.c: Likewise. 486 * dwfl_getdwarf.c: Likewise. 487 * dwfl_getmodules.c: Likewise. 488 * dwfl_getsrc.c: Likewise. 489 * dwfl_getsrclines.c: Likewise. 490 * dwfl_line_comp_dir.c: Likewise. 491 * dwfl_linecu.c: Likewise. 492 * dwfl_lineinfo.c: Likewise. 493 * dwfl_linemodule.c: Likewise. 494 * dwfl_module.c: Likewise. 495 * dwfl_module_addrdie.c: Likewise. 496 * dwfl_module_addrname.c: Likewise. 497 * dwfl_module_addrsym.c: Likewise. 498 * dwfl_module_build_id.c: Likewise. 499 * dwfl_module_dwarf_cfi.c: Likewise. 500 * dwfl_module_eh_cfi.c: Likewise. 501 * dwfl_module_getdarf.c: Likewise. 502 * dwfl_module_getelf.c: Likewise. 503 * dwfl_module_getsrc.c: Likewise. 504 * dwfl_module_getsrc_file.c: Likewise. 505 * dwfl_module_getsym.c: Likewise. 506 * dwfl_module_info.c: Likewise. 507 * dwfl_module_nextcu.c: Likewise. 508 * dwfl_module_register_names.c: Likewise. 509 * dwfl_module_report_build_id.c: Likewise. 510 * dwfl_module_return_value_location.c: Likewise. 511 * dwfl_nextcu.c: Likewise. 512 * dwfl_onesrcline.c: Likewise. 513 * dwfl_report_elf.c: Likewise. 514 * dwfl_validate_address.c: Likewise. 515 * dwfl_version.c: Likewise. 516 * find-debuginfo.c: Likewise. 517 * gzip.c: Likewise. 518 * image-header.c: Likewise. 519 * lines.c: Likewise. 520 * linux-core-attach.c: Likewise. 521 * linux-pid-attach.c: Likewise. 522 * offline.c: Likewise. 523 * open.c: Likewise. 524 * relocate.c: Likewise. 525 * segment.c: Likewise. 526 5272017-04-20 Ulf Hermann <ulf.hermann@qt.io> 528 529 * libdwfl.h: Use __const_attribute__. 530 5312017-04-20 Ulf Hermann <ulf.hermann@qt.io> 532 533 * elf-from-memory.c: Explicitly cast phnum to size_t. 534 5352017-04-20 Ulf Hermann <ulf.hermann@qt.io> 536 537 * dwfl_module_getdwarf.c: Check shnum for 0 before subtracting from 538 it. 539 5402017-04-20 Ulf Hermann <ulf.hermann@qt.io> 541 542 * dwfl_frame.c: Drop unused sys/ptrace.h include. 543 * frame_unwind.c: Likewise. 544 * linux-pid-attach.c: Include sys/ptrace.h and sys/syscall.h only on 545 linux. 546 5472017-04-20 Ulf Hermann <ulf.hermann@qt.io> 548 549 * linux-kernel-modules.c: Include sys/types.h before fts.h 550 5512017-03-24 Mark Wielaard <mark@klomp.org> 552 553 * linux-core-attach.c (core_next_thread): If n_namesz == 0 then 554 the note name data is the empty string. 555 (dwfl_core_file_attach): Likewise. 556 5572017-02-15 Ulf Hermann <ulf.hermann@qt.io> 558 559 * linux-kernel-modules.c: Include system.h. 560 5612017-02-15 Ulf Hermann <ulf.hermann@qt.io> 562 563 * linux-kernel-modules.c: Use sysconf(_SC_PAGESIZE) to get page size. 564 * linux-proc-maps.c: Likewise. 565 5662016-12-29 Luiz Angelo Daros de Luca <luizluca@gmail.com> 567 568 * dwfl_build_id_find_elf.c: Include system.h. 569 * dwfl_module_getdwarf.c: Likewise. 570 * libdwfl_crc32_file.c: Don't define LIB_SYSTEM_H. 571 5722016-11-23 Mark Wielaard <mjw@redhat.com> 573 574 * linux-kernel-modules.c: Only include fts.h early if BAD_FTS is 575 defined. 576 5772016-10-11 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> 578 579 * core-file.c: Remove sys/param.h. 580 * dwfl_segment_report_module.c: Likewise. Add system.h include. 581 (MAX): Remove definition. 582 * frame_unwind.c: Add system.h include. 583 (MAX): Remove definition. 584 * linux-core-attach.c (MIN): Remove definition. 585 * linux-pid-attach.c (MAX): Likewise. 586 5872016-08-12 Mark Wielaard <mjw@redhat.com> 588 589 * link_map.c (dwfl_link_map_report): Fix assert, set in.d_size. 590 5912016-04-14 Mark Wielaard <mjw@redhat.com> 592 593 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Free match 594 on invalid DWARF if we allocated it. 595 5962016-04-14 Mark Wielaard <mjw@redhat.com> 597 598 * linux-proc-maps.c (proc_maps_report): Free last_file on bad file 599 mapping. 600 6012016-03-01 Steven Chamberlain <steven@pyro.eu.org> 602 603 * linux-pid-attach.c: Removed unused pid_thread_callbacks, 604 pid_thread_detach, pid_detach, pid_set_initial_registers, 605 pid_memory_read, pid_getthread, pid_next_thread in #ifndef 606 __linux__ code. 607 6082016-02-22 Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> 609 Mark Wielaard <mjw@redhat.com> 610 611 * find-debuginfo.c (find_debuginfo_in_path): Remember whether 612 debuglink_file is NULL. Try file basename (without .debug) ofr 613 absolute and relative path if debug_file was NULL. 614 * linux-kernel-modules.c (try_kernel_name): If try_debug is true call 615 dwfl_standard_find_debuginfo with NULL debuglink_file, otherwise with 616 basename of fname. 617 6182016-02-13 Mark Wielaard <mjw@redhat.com> 619 620 * linux-proc-maps.c (proc_maps_report): Free last_file when ENOEXEC. 621 6222016-02-13 Mark Wielaard <mjw@redhat.com> 623 624 * frame_unwind.c (new_unwound): Check and return unwound. 625 (handle_cfi): Check new_unwound was able to allocate new memory 626 before use. Return DWFL_E_NOMEM otherwise. 627 6282016-02-11 Mark Wielaard <mjw@redhat.com> 629 630 * relocate.c (relocate_section): Check result of all gelf_get* calls. 631 (__libdwfl_relocate): Likewise. 632 (__libdwfl_relocate_section): Likewise. 633 6342016-02-11 Mark Wielaard <mjw@redhat.com> 635 636 * relocate.c (relocate_section): Check result of gelf_update_* calls. 637 6382016-01-08 Mark Wielaard <mjw@redhat.com> 639 640 * libdwfl_a_SOURCES: Unconditionally add gzip.c. 641 * linux-kernel-modules.c (vmlinux_suffixes): We always have at least 642 .gz support. 643 (try_kernel_name): Likewise. 644 (check_suffix): Likewise. 645 * open.c (decompress): Likewise. 646 6472015-12-18 Mark Wielaard <mjw@redhat.com> 648 649 * dwfl_module_getdwarf.c (find_symtab): Uncompress symstr, xndx, sym 650 sections and aux_str, aux_xndx and aux_sym sections if necessary. 651 * relocate.c (relocate_getsym): Uncompress symtab and symtab_shndx 652 if necessary. 653 (resolve_symbol): Uncompress strtab section if necessary. 654 (relocate_section): Uncompress the section the relocations apply to 655 if necessary. 656 6572015-11-18 Chih-Hung Hsieh <chh@google.com> 658 659 * linux-proc-maps.c (proc_maps_report): Move nested function 660 'report' to file scope. 661 6622015-11-18 Chih-Hung Hsieh <chh@google.com> 663 664 * core-file.c (elf_begin_rand): Move nested function 'fail' to file 665 scope. 666 * core-file.c (dwfl_elf_phdr_memory_callback): Move nested functions 667 'update_end' and 'more' to file scope. 668 6692015-11-17 Chih-Hung Hsieh <chh@google.com> 670 671 * link_map.c (auxv_format_probe): Move nested functions 672 check64 and check32 to file scope. 673 6742015-12-08 Jose E. Marchesi <jose.marchesi@oracle.com> 675 676 * dwfl_frame.c (state_fetch_pc): Add a backend-defined offset to 677 the value of the return address register as defined by the CFI 678 abi. 679 * frame_unwind.c (handle_cfi): Likewise. 680 6812015-12-01 Mark Wielaard <mjw@redhat.com> 682 683 * link_map.c (dwfl_link_map_report): Track whether in.d_buf comes 684 from exec or memory_callback, free as appropriate. 685 6862015-12-01 Mark Wielaard <mjw@redhat.com> 687 688 * libdwflP.h (struct Dwfl_User_Core): New. 689 (struct DWfl): Replace executable_for_core with user_core. 690 * argp-std.c (parse_opt): Store core and fd in Dwfl user_core. 691 * core-file.c (dwfl_core_file_report): Check and store 692 executable_for_core in Dwfl user_core. 693 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Check and use 694 executable_for_core in Dwfl user_core. 695 * dwfl_end.c (dwfl_end): Release resources held in Dwfl user_core. 696 * link-map.c (report_r_debug): Check executable_for_core in Dwfl 697 user_core. 698 (dwfl_link_map_report): Likewise. 699 7002015-11-16 Chih-Hung Hsieh <chh@google.com> 701 702 * dwfl_module_getdwarf.c (find_prelink_address_sync): Move nested 703 function 'consider_shdr' to file scope. 704 * dwfl_module_getdwarf.c (find_dynsym): Move nested function 705 'translate_offs' to file scope. 706 7072015-11-16 Chih-Hung Hsieh <chh@google.com> 708 709 * dwfl_module_addrsym.c (__libdwfl_addrsym): Move nested functions 710 'same_section', 'binding_value', 'try_sym_value', and 'search_table' 711 to file scope. 712 7132015-11-19 Mark Wielaard <mjw@redhat.com> 714 715 * dwfl_module.c (__libdwfl_module_free): Remove Dwfl_Module Ebl from 716 eh_cfi and dwarf_cfi cache if necessary before calling dwarf_end and 717 dwarf_cfi_end. 718 7192015-11-13 Chih-Hung Hsieh <chh@google.com> 720 721 * gzip.c (unzip): Move nested functions to file scope. 722 7232015-10-21 Chih-Hung Hsieh <chh@google.com> 724 Mark Wielaard <mjw@redhat.com> 725 726 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Move nested 727 functions 'dwarf_line_file', 'dwfl_line', and 'dwfl_line_file' to 728 file scope. Rename dwarf_line_file to dwfl_dwarf_line_file. Don't 729 use INTUSE. 730 7312015-10-21 Chih-Hung Hsieh <chh@google.com> 732 733 * frame_unwind.c (expr_eval): Move nested function 'push' and 'pop' 734 to file scope. Pass used local variables in struct eval_stack. 735 7362015-10-21 Chih-Hung Hsieh <chh@google.com> 737 738 * dwfl_module.c (dwfl_report_module): Move nested function 'use' to 739 file scope. 740 7412015-10-09 Josh Stone <jistone@redhat.com> 742 743 * core-file.c (elf_begin_rand): Replace loff_t with off_t. 744 * open.c (decompress): Replace off64_t with off_t. 745 * gzip.c (unzip): Likewise. 746 * image-header.c (__libdw_image_header): Likewise. 747 * libdwflP.h: Likewise in function declarations. 748 * argp-std.c (parse_opt): Replace open64 with open. 749 * dwfl_build_id_find_elf.c (__libdwfl_open_mod_by_build_id, 750 dwfl_build_id_find_elf): Likewise. 751 * dwfl_module_getdwarf.c (open_elf_file): Likewise. 752 * dwfl_report_elf.c (dwfl_report_elf): Likewise. 753 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise. 754 * link_map.c (report_r_debug): Likewise. 755 * offline.c (dwfl_report_offline): Likewise. 756 * linux-proc-maps.c (grovel_auxv, get_pid_class, 757 dwfl_linux_proc_find_elf): Likewise. 758 (read_proc_memory): Replace off64_t with off_t. 759 * find-debuginfo.c (find_debuginfo_in_path): Replace stat64 and 760 fstat64 with stat and fstat. 761 (try_open): Likewise, and replace open64 with open. 762 * linux-kernel-modules.c: Manually define open and fopen to open64 and 763 fopen64 when needed, since the early fts.h include breaks that. 764 (try_kernel_name): Replace open64 with open. 765 (check_notes): Likewise. 766 7672015-10-09 Jose E. Marchesi <jose.marchesi@oracle.com> 768 769 * linux-proc-maps.c (read_proc_memory): Use seek+read instead of 770 pread, as the later doesn't accept negative offsets. 771 7722015-10-07 Mark Wielaard <mjw@redhat.com> 773 774 * dwfl_module_getdwarf.c (MAX): Removed. 775 (find_prelink_address_sync): Allocate exact amount of bytes for 776 phdrs and shdrs. 777 * dwfl_segment_report_module.c (dwfl_segment_report_module): 778 Likewise for phdrs. 779 * elf-from-memory.c (MAX): Removed. 780 (elf_from_remote_memory): Allocate exact amount of bytes for phdrs. 781 7822015-10-05 Chih-Hung Hsieh <chh@google.com> 783 784 * dwfl_module_getdwarf.c (find_prelink_address_sync): Do not use 785 union of variable length arrays. 786 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise. 787 * elf-from-memory.c (elf_from_remote_memory): Likewise. 788 * link_map.c (auxv_format_probe): Likewise. 789 * link_map.c (report_r_debug): Likewise. 790 * link_map.c (dwfl_link_map_report): Likewise. 791 7922015-09-18 Chih-Hung Hsieh <chh@google.com> 793 794 * relocate.c (relocate_section): Move nested function "relocate" 795 to file scope, pass all used local variables as constants. 796 Move nested "check_badreltype" to file scope, pass addresses of 797 updated used local variables. 798 * linux-kernel-modules.c (intuit_kernel_bounds): Move nested function 799 "read_address" to file scope, pass all updated local variables in 800 a state structure. 801 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Move nested 802 function "subst_name" to file scope, pass all used local variables 803 as constants. 804 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Replace 805 simple nested function "report" with a macro. Work around gcc static 806 analysis error -Werror=maybe-uninitialized. 807 8082015-09-22 Mark Wielaard <mjw@redhat.com> 809 810 * core-file.c: Remove old-style function definitions. 811 * dwfl_error.c: Likewise. 812 * dwfl_module_dwarf_cfi.c: Likewise. 813 * dwfl_module_eh_cfi.c: Likewise. 814 * dwfl_module_register_names.c: Likewise. 815 * dwfl_module_return_value_location.c: Likewise. 816 * dwfl_version.c: Likewise. 817 8182015-09-09 Chih-Hung Hsieh <chh@google.com> 819 Mark Wielaard <mjw@redhat.com> 820 821 * dwfl_frame.c (dwfl_attach_state): Remove redundant NULL tests 822 on parameters declared with __nonnull_attribute__. 823 * libdwfl.h (dwfl_module_getelf): Don't mark first argument as 824 nonnull. 825 8262015-09-08 Mark Wielaard <mjw@redhat.com> 827 828 * libdwflP.h (struct __libdwfl_pid_arg): Add elf and elf_fd. 829 * linux-pid-attach.c (pid_detach): Call elf_end and close. 830 (dwfl_linux_proc_attach): Open and save /proc/PID/exe. 831 8322015-09-04 Chih-Hung Hsieh <chh@google.com 833 834 * frame_unwind.c (expr_eval): Use llabs instead of abs. 835 8362015-08-14 Dodji Seketeli <dodji@seketeli.org> 837 838 * find-debuginfo.c (find_debuginfo_in_path): Try to locate the 839 debug info file named debuglink_file under 840 mod->dwfl->callbacks->debuginfo_path, by looking at 841 the set of sub-trees under mod->dwfl->callbacks->debuginfo_path 842 which is common to the set of non-absolute parent trees of 843 file_name. 844 8452015-06-18 Mark Wielaard <mjw@redhat.com> 846 847 * find-debuginfo.c (try_open): Free fname on all failure paths. 848 8492015-06-18 Mark Wielaard <mjw@redhat.com> 850 851 * dwfl_module_getdwarf.c (find_symtab): Check shdr is not NULL and 852 sh_entsize is not zero. 853 8542015-06-06 Mark Wielaard <mjw@redhat.com> 855 856 * find-debuginfo.c (find_debuginfo_in_path): Always free localpath, 857 localname and file_dirname. 858 8592015-06-06 Mark Wielaard <mjw@redhat.com> 860 861 * derelocate.c (cache_sections): Free sortrefs. 862 8632015-06-05 Mark Wielaard <mjw@redhat.com> 864 865 * dwfl_segment_report_module.c (dwfl_segment_report_module): 866 If the note_file exists, but the build_id doesn't match discard 867 the file and continue reporting. 868 8692015-06-01 Mark Wielaard <mjw@redhat.com> 870 871 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Copy path 872 pointer before passing to strsep. 873 8742015-05-30 Mark Wielaard <mjw@redhat.com> 875 876 * link_map.c (check32): Use read_4ubyte_unaligned_noncvt to read 877 type and value. 878 (read_addrs): Use read_(4|8)ubyte_unaligned_noncvt or to read 879 addresses. 880 8812015-05-30 Mark Wielaard <mjw@redhat.com> 882 883 * find-debuginfo.c (dwfl_standard_find_debuginfo): Check file_name is 884 not NULL before calling canonicalize_file_name. 885 8862015-05-24 Mark Wielaard <mjw@redhat.com> 887 888 * derelocate.c (check_module): Check mod is not NULL. 889 8902015-05-22 Mark Wielaard <mjw@redhat.com> 891 892 * link_map.c (dwfl_link_map_report): Allocate phdrs and dyn with 893 malloc instead of stack allocating. Call free when done with data. 894 8952015-05-22 Mark Wielaard <mjw@redhat.com> 896 897 * dwfl_segment_report_module.c (dwfl_segment_report_module): 898 Allocate phdrs with malloc, not on stack. free in finish. 899 Allocate dyn with malloc, not on stack, free after use. 900 9012015-05-22 Mark Wielaard <mjw@redhat.com> 902 903 * find-debuginfo.c (find_debuginfo_in_path): malloc or strdup, 904 instead of alloca or strdupa, local strings of unknown size. 905 Call free before return. 906 9072015-05-22 Mark Wielaard <mjw@redhat.com> 908 909 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Return 910 error when id_len too small or too large. strdup, not strdupa, 911 and free path when done. 912 9132015-05-19 Mark Wielaard <mjw@redhat.com> 914 915 * elf-from-memory.c (elf_from_remote_memory): Don't allocate all 916 phdrs on the stack. Allocate with malloc and free when done. 917 9182015-05-19 Mark Wielaard <mjw@redhat.com> 919 920 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): malloc and 921 free alternate_name. 922 9232015-05-19 Mark Wielaard <mjw@redhat.com> 924 925 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't 926 stack allocate name. Only change chars up to suffix. 927 9282015-05-18 Mark Wielaard <mjw@redhat.com> 929 930 * dwfl_module_getdwarf.c (find_prelink_address_sync): Allocate 931 phdrs and shdrs unions with malloc, not alloca. Free after use. 932 9332015-05-18 Mark Wielaard <mjw@redhat.com> 934 935 * derelocate.c (cache_sections): Allocate temporary newrefs and 936 sortrefs with malloc, not alloca. Always free them on return. 937 9382015-05-07 Mark Wielaard <mjw@redhat.com> 939 940 * cu.c (intern_cu): Check for EOF and check cuoff points to a real 941 Dwarf_Die before interning. Explicitly check EOF is expected. 942 9432015-05-05 Mark Wielaard <mjw@redhat.com> 944 945 * dwfl_lineinfo.c (dwfl_lineinfo): Check info->file is valid. 946 9472015-05-06 Roland McGrath <roland@hack.frob.com> 948 949 * dwfl_error.c (struct msgtable): Break type definition out of 950 the 'msgtable' initializer. 951 (msgtable): Make it a union of struct msgtable and a char array. 952 (msgstr): Use the full-table char array rather than the msg_0 entry. 953 9542015-04-23 Max Filippov <jcmvbkbc@gmail.com> 955 956 * core-file.c (_compat_without_executable_dwfl_core_file_report): 957 Guard with SYMBOL_VERSIONING. 958 * dwfl_module_build_id.c (_compat_vaddr_at_end_dwfl_module_build_id): 959 Likewise. 960 * dwfl_report_elf.c (_compat_without_add_p_vaddr_dwfl_report_elf): 961 Likewise. 962 9632015-04-02 Mark Wielaard <mjw@redhat.com> 964 965 * segment.c (insert): Check correct number of lookup_elts. 966 9672015-03-31 Mark Wielaard <mjw@redhat.com> 968 969 * core-file.c (core_file_read_eagerly): Special case small images. 970 9712015-01-26 Mark Wielaard <mjw@redhat.com> 972 973 * dwfl_module_getdwarf.c (find_symtab): Explicitly clear symdata, 974 syments and first_global on elferr before calling find_dynsym. 975 9762014-12-27 Mark Wielaard <mjw@redhat.com> 977 978 * dwfl_module_getsrc.c (dwfl_module_getsrc): Never match a line that 979 has end_sequence set. 980 9812015-01-04 Mark Wielaard <mjw@redhat.com> 982 983 * cu.c (intern_cu): Store result and return directly when finding 984 EOF marker. 985 (__libdwfl_nextcu): Check *nextp as returned by intern_cu isn't -1. 986 9872014-12-19 Mark Wielaard <mjw@redhat.com> 988 989 * dwfl_module_getdwarf.c (find_symtab): Always try find_dynsym last. 990 9912014-12-19 Mark Wielaard <mjw@redhat.com> 992 993 * elf-from-memory.c (handle_segment): Remove palign sanity check. 994 9952014-12-18 Mark Wielaard <mjw@redhat.com> 996 997 * relocate.c (resolve_symbol): Make sure symstrdata->d_buf != NULL. 998 9992014-12-13 Mark Wielaard <mjw@redhat.com> 1000 1001 * dwfl_module_getdwarf.c (find_dynsym): elf_getdata_rawchunk takes 1002 a size_t, make sure it doesn't overflow. 1003 10042014-12-13 Mark Wielaard <mjw@redhat.com> 1005 1006 * cu.c (cudie_offset): Make sure Dwarf_Off difference doesn't 1007 wrap around before returning as int. 1008 10092014-12-11 Josh Stone <jistone@redhat.com> 1010 1011 * dwfl_module_getsrc.c (dwfl_module_getsrc): Return the *last* line 1012 record <= addr, rather than returning immediately on matches. 1013 10142014-12-09 Mark Wielaard <mjw@redhat.com> 1015 1016 * dwfl_segment_report_module.c (handle_file_note): Check count doesn't 1017 overflow. 1018 10192014-12-07 Mark Wielaard <mjw@redhat.com> 1020 1021 * relocate.c (relocate_section): Sanity check section overlap against 1022 actually used ehsize, shentsize and phentsize. 1023 10242014-12-07 Mark Wielaard <mjw@redhat.com> 1025 1026 * offline.c (dwfl_offline_section_address): Assert shndx is not zero. 1027 * relocate.c (__libdwfl_relocate_value): Don't relocate against 1028 section zero. 1029 10302014-11-29 Mark Wielaard <mjw@redhat.com> 1031 1032 * relocate.c (relocate_section): Check relocation section and target 1033 section data don't overlap any of the ELF headers. 1034 (relocate): Check for offset + size overflow. 1035 10362014-11-22 Mark Wielaard <mjw@redhat.com> 1037 1038 * link_map.c (consider_executable): Use elf_getphdrnum. 1039 (dwfl_link_map_report): Likewise. 1040 10412014-11-18 Mark Wielaard <mjw@redhat.com> 1042 1043 * dwfl_module_getdwarf.c (find_symtab): Sanity check the data buffer, 1044 number of symbols and first_global before use. 1045 10462014-11-14 Mark Wielaard <mjw@redhat.com> 1047 1048 * dwfl_module_getdwarf.c (load_symtab): Don't use tables which have 1049 a zero sh_entsize. 1050 10512014-11-10 Mark Wielaard <mjw@redhat.com> 1052 1053 * dwfl_module_getdwarf.c (find_dynsym): New inner function 1054 translate_offs that takes an adjust argument. Try finding 1055 the symbol table with and without adjusting to main_bias. 1056 10572014-09-26 Jan Kratochvil <jan.kratochvil@redhat.com> 1058 1059 Support NT_FILE for locating files. 1060 * core-file.c (dwfl_core_file_report): New variables note_file and 1061 note_file_size, set them and pass them to dwfl_segment_report_module. 1062 * dwfl_segment_report_module.c: Include common.h and fcntl.h. 1063 (buf_has_data, buf_read_ulong, handle_file_note): New functions. 1064 (invalid_elf): New function from code of dwfl_segment_report_module. 1065 (dwfl_segment_report_module): Add parameters note_file and 1066 note_file_size. New variables elf and fd, clean them up in finish. 1067 Move some code to invalid_elf. Call handle_file_note, if it found 1068 a name verify the file by invalid_elf. Protect elf and fd against 1069 cleanup by finish if we found the file for new Dwfl_Module. 1070 * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and 1071 note_file_size. 1072 10732014-09-23 Mark Wielaard <mjw@redhat.com> 1074 1075 * dwfl_segment_report_module.c (dwfl_segment_report_module): 1076 Extract ei_class, ei_data and e_type early and use the result. 1077 10782014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com> 1079 1080 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Use IS_EXECUTABLE. 1081 * dwfl_segment_report_module.c (dwfl_segment_report_module): Set 1082 IS_EXECUTABLE. 1083 * libdwflP.h (struct Dwfl_Module): New field is_executable. 1084 10852014-08-28 Jan Kratochvil <jan.kratochvil@redhat.com> 1086 1087 * dwfl_module_getdwarf.c (find_offsets): Add parameter main_bias, use 1088 it. 1089 (find_dynsym): Pass the new parameter main_bias. 1090 10912014-08-14 Mark Wielaard <mjw@redhat.com> 1092 1093 * linux-kernel-modules.c (check-suffix): Also TRY .ko.xz. 1094 10952014-07-24 Jan Kratochvil <jan.kratochvil@redhat.com> 1096 1097 Fix report_r_debug for prelinked libraries. 1098 * link_map.c (report_r_debug): Comment out variable l_addr. 1099 Use instead new variable base recalculated from l_ld. 1100 11012014-06-24 Kurt Roeckx <kurt@roeckx.be> 1102 1103 * linux-pid-attach.c: Make it build on non linux hosts. 1104 11052014-06-17 Mark Wielaard <mjw@redhat.com> 1106 1107 * frame_unwind.c (handle_cfi): Use ebl_func_addr_mask. 1108 * dwfl_module_getsym.c (__libdwfl_getsym): Likewise. 1109 11102014-06-15 Mark Wielaard <mjw@redhat.com> 1111 1112 * linux-core-attach.c (core_memory_read): Use libdw/memory-access.h 1113 macros read_4ubyte_unaligned_noncvt and read_8ubyte_unaligned_noncvt 1114 to read possibly unaligned data. 1115 (core_next_thread): Likewise. 1116 (core_set_initial_registers): Likewise. 1117 (dwfl_core_file_attach): Likewise. 1118 11192014-06-11 Mark Wielaard <mjw@redhat.com> 1120 1121 * dwfl_frame.c (__libdwfl_process_free): Reset dwfl->attacherr. 1122 (dwfl_attach_state): Set dwfl->attacherr. 1123 (dwfl_pid): Check and return dwfl->attacherr if set. 1124 (dwfl_getthreads): Likewise. 1125 (getthread): Likewise. 1126 * libdwflP.h: Add DWFL_E_NO_CORE_FILE. 1127 (struct Dwfl): Add attacherr field. 1128 * linux-core-attach.c (dwfl_core_file_attach): Set dwfl->attacherr. 1129 Don't assert if ELF file is not ET_CORE, just return error. 1130 * linux-pid-attach.c (dwfl_linux_proc_attach): Set dwfl->attacherr. 1131 11322014-06-10 Mark Wielaard <mjw@redhat.com> 1133 1134 * argp-std.c (parse_opt): Ignore errors from dwfl_core_file_attach 1135 or dwfl_linux_proc_attach. 1136 11372014-05-15 Mark Wielaard <mjw@redhat.com> 1138 1139 * linux-proc-maps.c (grovel_auxv): Close fd on error. 1140 11412014-05-02 Mark Wielaard <mjw@redhat.com> 1142 1143 * dwfl_module_getdwarf: Remove ENABLE_DWZ ifdefs so find_debug_altlink 1144 is always called. 1145 11462014-05-01 Mark Wielaard <mjw@redhat.com> 1147 1148 * libdwflP.h (struct Dwfl_Module): Add alt, alt_fd and alt_elf fields. 1149 (__libdwfl_open_mod_by_build_id): Renamed __libdwfl_open_by_build_id. 1150 (__libdwfl_open_by_build_id): New declaration that takes an explicit 1151 build-id. 1152 * dwfl_build_id_find_debuginfo.c (dwfl_build_id_find_debuginfo): If 1153 we already have the Dwarf then look for the alt dwz multi file by 1154 build-id. 1155 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Add the 1156 build-id we are looking for as argument. 1157 (__libdwfl_open_mod_by_build_id): New function, calls 1158 __libdwfl_open_by_build_id. 1159 (dwfl_build_id_find_elf): Call __libdwfl_open_mod_by_build_id. 1160 * dwfl_module.c (__libdwfl_module_free): Release alt, alt_elf and 1161 close alt_fd if necessary. 1162 * dwfl_module_getdwarf.c (__check_build_id): Removed. 1163 (try_debugaltlink): Removed. 1164 (open_debugaltlink): Removed. 1165 (open_elf_file): First half of open_elf that just opens the elf 1166 file but doesn't setup the load address. 1167 (open_elf): Call open_elf_file. 1168 (find_debug_altlink): New function. 1169 (load_dw): Remove loading of dwz multifile. 1170 (find_dw): Call find_debug_altlink. 1171 * find-debuginfo.c (validate): Handle alt debug case using 1172 dwelf_dwarf_gnu_debugaltlink and mod->alt_elf. 1173 (find_debuginfo_in_path): Handle alt debug files possibly in .dwz 1174 subdirs. 1175 * linux-kernel-modules.c (try_kernel_name): Use fakemod.debug.name 1176 to store name to find by dwfl_standard_find_debuginfo instead of 1177 allocating an extra variable on stack. 1178 11792014-04-30 Mark Wielaard <mjw@redhat.com> 1180 1181 * dwfl_module_build_id.c (__libdwfl_find_elf_build_id): Moved to 1182 dwelf_elf_gnu_build_id.c. 1183 (__libdwfl_find_build_id): Add assert to make sure mod is never NULL. 1184 * dwfl_segment_report_module.c (dwfl_segment_report_module): Call 1185 dwelf_elf_gnu_build_id directly instead of __libdwfl_find_build_id. 1186 * dwfl_module_getdwarf.c (__check_build_id): Implement using 1187 dwelf_elf_gnu_build_id. 1188 11892014-04-15 Florian Weimer <fweimer@redhat.com> 1190 1191 * dwfl_module_getdwarf.c (__check_build_id): Moved from libdw. 1192 (try_debugaltlink): Likewise. 1193 (open_debugaltlink): Likewise. 1194 (load_dw): Locate alternate debug information using 1195 dwelf_dwarf_gnu_debugaltlink and call open_debugaltlink. 1196 11972014-04-11 Mark Wielaard <mjw@redhat.com> 1198 1199 * Makefile.am (AM_CPPFLAGS): Add libdwelf. 1200 * libdwflP.h: Include libdwelfP.h. 1201 * dwfl_module_getdwarf.c (find_debuglink): Moved to libdwelf. 1202 (find_debuginfo): Use dwelf_elf_gnu_debuglink. 1203 12042014-04-22 Mark Wielaard <mjw@redhat.com> 1205 1206 * frame_unwind.c (__libdwfl_frame_reg_get): Use uint64_t when 1207 checking bits. 1208 (__libdwfl_frame_reg_set): Likewise. 1209 12102014-04-22 Kurt Roeckx <kurt@roeckx.be> 1211 1212 * linux-pid-attach.c: Make linux only. 1213 12142014-03-14 Mark Wielaard <mjw@redhat.com> 1215 1216 * Makefile.am: Remove !MUDFLAP and MUDFLAP conditions. 1217 Remove libelf and libdw definitions when MUDFLAP is defined. 1218 * argp-std.c (__libdwfl_argp_mudflap_options): Removed. 1219 12202014-03-03 Mark Wielaard <mjw@redhat.com> 1221 1222 * elf-from-memory.c (elf_from_remote_memory): Keep track of 1223 segments_end_mem. Pass memsz to first handle_segment pass. Only 1224 extend contents_size and use shdrs if only file bits are in 1225 segment. 1226 12272014-03-11 Josh Stone <jistone@redhat.com> 1228 1229 * dwfl_module_getdwarf.c (open_elf): Only explicitly set 1230 mod->e_type when processing the main ELF file. 1231 12322014-03-04 Mark Wielaard <mjw@redhat.com> 1233 1234 * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from 1235 linux-pid-attach.c (struct pid_arg). 1236 (__libdwfl_get_pid_arg): New internal function declaration. 1237 (__libdwfl_ptrace_attach): Likewise. 1238 (__libdwfl_ptrace_detach): Likewise. 1239 * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the 1240 special exception modules that cannot be checked at this point. 1241 * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h 1242 (ptrace_attach): Renamed to... 1243 (__libdwfl_ptrace_attach): New internal function. 1244 (__libdwfl_ptrace_detach): Likewise. Extracted from ... 1245 (pid_thread_detach): Call __libdwfl_ptrace_detach now. 1246 (__libdwfl_get_pid_arg): New internal function. 1247 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special 1248 module name contains "(deleted)" and dwfl_pid gives an attached 1249 pid. If pid is set and try to (re)use ptrace attach state of 1250 process before reading memory. 1251 12522014-03-03 Mark Wielaard <mjw@redhat.com> 1253 1254 * elf-from-memory.c (elf_from_remote_memory): Take pagesize as 1255 argument. Free buffer when detecting bad elf. Check PT_LOAD 1256 alignment requirements on first handle_segment pass. Calculate 1257 loadbase, start and end of segment using pagesize, not p_align. 1258 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize 1259 to elf_from_remote_memory. 1260 12612014-02-26 Mark Wielaard <mjw@redhat.com> 1262 1263 * linux-proc-maps.c (proc_maps_report): Don't assert on bad input. 1264 12652014-02-26 Mark Wielaard <mjw@redhat.com> 1266 1267 * elf-from-memory.c (elf_from_remote_memory): Check against p64 1268 p_type in case ELFCLASS64, not against p32 p_type. 1269 12702014-01-17 Petr Machata <pmachata@redhat.com> 1271 1272 * relocate.c (relocate_section): Use gelf_fsize instead of relying 1273 on shdr->sh_entsize. 1274 12752014-01-05 Mark Wielaard <mjw@redhat.com> 1276 1277 * frame_unwind.c (handle_cfi): Only skip resetting return register 1278 if the regno is not the actual CIE return address register. 1279 12802014-01-02 Mark Wielaard <mjw@redhat.com> 1281 1282 * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi. 1283 12842013-12-30 Mark Wielaard <mjw@redhat.com> 1285 1286 * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and 1287 dwfl_core_file_attach explicitly. 1288 * core-file.c (dwfl_core_file_report): Don't call 1289 __libdwfl_attach_state_for_core implicitly. 1290 * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error. 1291 * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not 1292 process_attach_error. 1293 (dwfl_getthreads): Likewise. 1294 (getthread): Likewise. 1295 * libdwfl.h (dwfl_core_file_report): Update documentation. 1296 (dwfl_linux_proc_report): Likewise. 1297 (dwfl_core_file_attach): New function declaration. 1298 (dwfl_linux_proc_attach): Likewise. 1299 * libdwflP.h (struct Dwfl): Remove process_attach_error. 1300 (__libdwfl_attach_state_for_pid): Removed declaration. 1301 (__libdwfl_attach_state_for_core): Likewise. 1302 (dwfl_core_file_attach): New internal declaration. 1303 (dwfl_linux_proc_attach): Likewise. 1304 (attach_state_for_core): Renamed to... 1305 (dwfl_core_file_attach): ...this. Change return type. 1306 (__libdwfl_attach_state_for_core): Removed. 1307 * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped. 1308 (pid_set_initial_registers): Check assume_ptrace_stopped before 1309 calling ptrace. 1310 (pid_thread_detach): Likewise. 1311 (__libdwfl_attach_state_for_pid): Renamed to... 1312 (dwfl_linux_proc_attach): ...this. Adjust return type. 1313 * linux-proc-maps.c (dwfl_linux_proc_report): Don't call 1314 __libdwfl_attach_state_for_pid implicitly. 1315 13162013-12-28 Mark Wielaard <mjw@redhat.com> 1317 1318 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special 1319 character device files, only regular files. 1320 13212013-12-24 Mark Wielaard <mjw@redhat.com> 1322 1323 * linux-core-attach.c (core_next_thread): Check whether thread_argp 1324 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg 1325 in that case. Free thread_arg if there are no more threads. 1326 13272013-12-23 Mark Wielaard <mjw@redhat.com> 1328 1329 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free 1330 build_id before returning early. 1331 13322013-12-23 Mark Wielaard <mjw@redhat.com> 1333 1334 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual 1335 pid (thread group leader) to dwfl_attach_state. 1336 13372013-12-21 Mark Wielaard <mjw@redhat.com> 1338 1339 * frame_unwind.c (handle_cfi): Track whether the return register 1340 has been set and only allow it to be set once. 1341 13422013-12-20 Mark Wielaard <mjw@redhat.com> 1343 1344 * dwfl_frame.c (one_arg): New struct. 1345 (get_one_thread_cb): New function. 1346 (dwfl_getthread): Likewise. 1347 (one_thread): New struct. 1348 (get_one_thread_frames_cb): New function. 1349 (dwfl_getthread_frames): Likewise. 1350 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function. 1351 (dwfl_getthread_frames): Likewise. 1352 * libdwflP.h (dwfl_getthread_frames): New internal function declaration. 1353 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread 1354 to NULL. 1355 * linux-pid-attach.c (pid_getthread): New function. 1356 (pid_thread_callbacks): Initialize get_thread to pid_getthread. 1357 13582013-12-20 Mark Wielaard <mjw@redhat.com> 1359 1360 * linux-kernel-modules.c (report_kernel_archive): Correct nested 1361 asprintf result check for debug.a. 1362 13632013-12-18 Mark Wielaard <mjw@redhat.com> 1364 1365 * derelocate.c (__libdwfl_find_section_ndx): New internal function. 1366 * dwfl_module_addrname.c (dwfl_module_addrname): Use 1367 dwfl_module_addrinfo. 1368 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with... 1369 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value 1370 for comparisons, not st_value. Fill in off. Search for both value 1371 and the (adjusted) sym.st_value when different. 1372 (dwfl_module_addrsym): Implement using __libdwfl_addrsym. 1373 (dwfl_module_addrinfo): New function. 1374 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with... 1375 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested 1376 and possible. Adjust sym->st_value only when requested. Fill in addr 1377 if available. 1378 (dwfl_module_getsym_info): New function. 1379 (dwfl_module_getsym): Use __libdwfl_getsym. 1380 * libdwfl.h (dwfl_module_getsym_elf): Removed. 1381 (dwfl_module_getsym_info): New function declaration. 1382 (dwfl_module_addrinfo): Likewise. 1383 (dwfl_module_addrsym): Add documentation describing differences 1384 with addrinfo variants. 1385 (dwfl_module_addrsym_elf): Removed. 1386 * libdwflP.h (__libdwfl_getsym): New internal function declaration. 1387 (__libdwfl_addrsym): Likewise. 1388 (__libdwfl_find_section_ndx): Likewise. 1389 (dwfl_module_addrinfo): New internal declaration. 1390 (dwfl_module_getsym_info): Likewise. 1391 (dwfl_module_addrsym_elf): Removed. 1392 (dwfl_module_getsym_elf): Likewise. 1393 13942013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com> 1395 1396 * argp-std.c (offline_find_elf): Remove. 1397 (offline_callbacks): Use dwfl_build_id_find_elf instead. 1398 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code 1399 removed above. 1400 14012013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com> 1402 1403 unwinder: s390 and s390x 1404 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc. 1405 * frame_unwind.c (new_unwound): New function from ... 1406 (handle_cfi): ... here. Call it. 1407 (setfunc, getfunc, readfunc): New functions. 1408 (__libdwfl_frame_unwind): Call ebl_unwind with those functions. 1409 * linux-core-attach.c (core_set_initial_registers): Always iterate 1410 through the Ebl_Register_Location loop. Call 1411 dwfl_thread_state_register_pc there. 1412 14132013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com> 1414 1415 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA. 1416 14172013-12-17 Mark Wielaard <mjw@redhat.com> 1418 1419 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first 1420 traversal. 1421 14222013-12-16 Mark Wielaard <mjw@redhat.com> 1423 1424 * libdwfl.h (dwfl_module_getsymtab_first_global): New function 1425 definition. 1426 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New 1427 function. 1428 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal 1429 function definition. 1430 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function. 1431 14322013-12-14 Mark Wielaard <mjw@redhat.com> 1433 1434 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if 1435 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary. 1436 * frame_unwind.c (handle_cfi): Free frame result from 1437 dwarf_cfi_addrframe when done. 1438 14392013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com> 1440 1441 unwinder: ppc and ppc64 1442 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set): 1443 Call ebl_dwarf_to_regno. 1444 * linux-core-attach.c (core_set_initial_registers): Implement 1445 pc_register support. 1446 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement 1447 FIRSTREG -1. 1448 14492013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com> 1450 1451 Introduce process_attach_error. 1452 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error. 1453 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if 1454 PROCESS is NULL. 1455 * libdwflP.h (struct Dwfl): New field process_attach_error. 1456 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ... 1457 (attach_state_for_core): ... here, make it static, change return type, 1458 no longer use __libdwfl_seterrno. 1459 (__libdwfl_attach_state_for_core): New wrapper for it. 1460 14612013-11-27 Mark Wielaard <mjw@redhat.com> 1462 1463 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call... 1464 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments, 1465 keep track of symelf, addr_symelf, closest_elf and sizeless_elf 1466 instead of tracking dwfl_files. 1467 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to... 1468 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add 1469 new elfp and biasp arguments. Track elf instead of file. 1470 (dwfl_module_getsym): Call dwfl_module_getsym_elf. 1471 dwfl_module_info.c (dwfl_module_info): Pass elf to 1472 dwfl_adjusted_st_value. 1473 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx. 1474 (dwfl_module_getsym_elf): New function declaration. 1475 (dwfl_module_addrsym_elf): Likewise. 1476 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL. 1477 (dwfl_module_getsym_elf): Likewise. 1478 (dwfl_adjusted_st_value): Take and check elf not dwfl_file. 1479 (dwfl_deadjust_st_value): Likewise. 1480 (__libdwfl_module_getsym): Removed. 1481 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value. 1482 14832013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com> 1484 1485 Fix non-build-id core files on build-id system. 1486 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot 1487 be read from memory. 1488 14892013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com> 1490 1491 * dwfl_segment_report_module.c (dwfl_segment_report_module): New 1492 variable close_elf. Call __libdwfl_find_elf_build_id and compare the 1493 content, if possible. 1494 14952013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com> 1496 1497 link_map: Use proper bias, not l_addr. 1498 * core-file.c (dynamic_vaddr_get): Rename to ... 1499 (__libdwfl_dynamic_vaddr_get): ... here, make it global, 1500 internal_function. 1501 (dwfl_core_file_report): Update name in the caller. 1502 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration. 1503 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call 1504 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment. 1505 Use ELF_DYNAMIC_VADDR instead of L_ADDR. 1506 15072013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com> 1508 1509 Compatibility with older kernels such as RHEL-6. 1510 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped. 1511 (ptrace_attach): New parameter tid_was_stoppedp. Set it. 1512 (pid_set_initial_registers): Pass tid_was_stopped. 1513 (pid_thread_detach): Use tid_was_stopped. 1514 15152013-11-18 Josh Stone <jistone@redhat.com> 1516 1517 * dwfl_module_getdwarf.c (find_aux_address_sync): New function. 1518 (find_aux_sym): Use it. 1519 15202013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com> 1521 1522 Code cleanup: Remove const in prototype 1523 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from 1524 firstreg. 1525 * libdwfl.h (dwfl_thread_state_registers): Likewise. 1526 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise. 1527 15282013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com> 1529 1530 Fix dwfl_attach_state machine->elf. 1531 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf. 1532 Call ebl_openbackend instead of ebl_openbackend_machine. 1533 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf. 1534 Update the function description. 1535 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to 1536 dwfl_attach_state. 1537 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to 1538 dwfl_attach_state. 1539 15402013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com> 1541 1542 Provide __libdwfl_module_getsym to get dwfl_file *. 1543 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove. 1544 (dwfl_module_addrsym) (search_table): New variable file. Use 1545 __libdwfl_module_getsym. Use file. 1546 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ... 1547 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it. 1548 (dwfl_module_getsym): New wrapper. 1549 * libdwflP.h (__libdwfl_module_getsym): New declaration. 1550 15512013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com> 1552 1553 Fix dwfl_module_addrsym for minidebuginfo. 1554 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable 1555 addr_symfile. 1556 (dwfl_module_addrsym) (same_section): Use it. 1557 (dwfl_module_addrsym) (i_to_symfile): New function. 1558 (dwfl_module_addrsym) (search_table): Use it. 1559 15602013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 1561 Mark Wielaard <mjw@redhat.com> 1562 1563 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c, 1564 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and 1565 dwfl_frame_regs.c. 1566 * core-file.c (dwfl_core_file_report): Call 1567 __libdwfl_attach_state_for_core. 1568 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free. 1569 * dwfl_frame.c: New file. 1570 * frame_unwind.c: New file. 1571 * dwfl_frame_pc.c: New file. 1572 * linux-pid-attach.c: New file. 1573 * linux-core-attach.c: New file. 1574 * dwfl_frame_regs.c: New file. 1575 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs. 1576 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments. 1577 (Dwfl_Thread_Callbacks): New definition. 1578 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl) 1579 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers) 1580 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes) 1581 (dwfl_frame_pc): New declarations. 1582 * libdwflP.h (Dwfl_Process): New typedef. 1583 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ) 1584 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF) 1585 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND) 1586 (INVALID_ARGUMENT): New DWFL_ERROR entries. 1587 (struct Dwfl): New entry process. 1588 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame) 1589 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set) 1590 (__libdwfl_process_free, __libdwfl_frame_unwind) 1591 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core) 1592 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations. 1593 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid) 1594 (dwfl_frame_thread, dwfl_thread_state_registers) 1595 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes) 1596 (dwfl_frame_pc): New INTDECL entries. 1597 * linux-proc-maps.c (dwfl_linux_proc_report): Call 1598 __libdwfl_attach_state_for_pid. 1599 * segment.c (segment_start): Rename to ... 1600 (__libdwfl_segment_start): ... here and make it internal_function. 1601 (segment_end): Rename to ... 1602 (__libdwfl_segment_end): ... here and make it internal_function. 1603 (reify_segments, dwfl_report_segment): Rename them at the callers. 1604 16052013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 1606 1607 * core-file.c (dwfl_core_file_report): Remove the use of MAX. 1608 16092013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 1610 1611 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by 1612 retval. Fix one forgotten LISTED increase. 1613 16142013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 1615 1616 Fix core files for re-prelink-ed files. 1617 * core-file.c (dynamic_vaddr_get): New function. 1618 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call 1619 dynamic_vaddr_get instead of using L_ADDR. 1620 * libdwflP.h (struct r_debug_info_module): Remove field l_addr. 1621 * link_map.c (report_r_debug): Do not initialize l_addr. 1622 16232013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com> 1624 1625 Code cleanup. 1626 * core-file.c (dwfl_core_file_report): Reindent block of code by 1627 continue keyword. 1628 16292013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com> 1630 1631 * argp-std.c (parse_opt): Use executable parameter of 1632 dwfl_core_file_report. 1633 * core-file.c (dwfl_core_file_report): Add parameter executable. Set 1634 it to DWFL. Add NEW_VERSION for it. 1635 (_compat_without_executable_dwfl_core_file_report): New. Twice. 1636 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update 1637 the function comment. 1638 16392013-10-15 Mark Wielaard <mjw@redhat.com> 1640 1641 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file 1642 mappings. 1643 (dwfl_linux_proc_find_elf): Don't abort, just return failure. 1644 16452013-09-12 Mark Wielaard <mjw@redhat.com> 1646 1647 * cu.c (intern_cu): If dwarf_offdie fails free cu. 1648 16492013-09-12 Mark Wielaard <mjw@redhat.com> 1650 1651 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in 1652 bad_report. 1653 16542013-09-12 Mark Wielaard <mjw@redhat.com> 1655 1656 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with 1657 aux_xndxscn, not xndxscn, for aux_symxndxdata. 1658 16592013-08-25 Mark Wielaard <mjw@redhat.com> 1660 1661 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true 1662 to dwfl_report_elf. 1663 16642013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com> 1665 1666 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for 1667 conflicts all the modules, not just the first one. Compare L_LD if it 1668 is equal, not if it is in a module address range. 1669 16702013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com> 1671 1672 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function. 1673 16742013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com> 1675 1676 * core-file.c (clear_r_debug_info): Close also ELF and FD. 1677 (dwfl_core_file_report): Call __libdwfl_report_elf for 1678 R_DEBUG_INFO.MODULE. 1679 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from 1680 code of ... 1681 (__libdwfl_report_elf): ... this function. Call it. 1682 * dwfl_segment_report_module.c: Include unistd.h. 1683 (dwfl_segment_report_module): Use basename for MODULE->NAME. 1684 Clear MODULE if it has no build-id and we have segment with build-id. 1685 Ignore this segment only if MODULE still contains valid ELF. 1686 * libdwflP.h (__libdwfl_elf_address_range): New declaration. 1687 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end 1688 and disk_file_has_build_id. 1689 (dwfl_link_map_report): Extend the comment. 1690 * link_map.c (report_r_debug): Extend the comment. Always fill in new 1691 r_debug_info_module. Initialize also the new r_debug_info_module 1692 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range 1693 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL. 1694 16952013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com> 1696 1697 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function. 1698 16992013-07-02 Mark Wielaard <mjw@redhat.com> 1700 1701 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert. 1702 17032013-06-05 Mark Wielaard <mjw@redhat.com> 1704 1705 * link_map.c (report_r_debug): Always call release_buffer after 1706 memory_callback succeeded reading build_id. 1707 17082013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com> 1709 1710 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set 1711 executable_for_core before calling dwfl_core_file_report. 1712 * core-file.c (clear_r_debug_info): New function. 1713 (dwfl_core_file_report): Move raw segments reporting lower. New 1714 variable r_debug_info, pass it to dwfl_segment_report_module. Call 1715 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED. 1716 * dwfl_module_build_id.c (check_notes): Move into 1717 __libdwfl_find_elf_build_id. 1718 (__libdwfl_find_build_id): Rename to ... 1719 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits, 1720 build_id_elfaddr and build_id_len. Verify MOD vs. ELF. 1721 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and 1722 set, rename data_vaddr to data_elfaddr. Do not call found_build_id. 1723 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not 1724 adjust its data_elfaddr parameter. 1725 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id. 1726 * dwfl_segment_report_module.c (dwfl_segment_report_module): New 1727 parameter r_debug_info. New variable name_is_final. Adjust addresses 1728 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL. 1729 Do not overwrite NAME by SONAME if NAME_IS_FINAL. 1730 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration. 1731 (struct r_debug_info_module, struct r_debug_info): New definitions. 1732 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter 1733 r_debug_info. 1734 * link_map.c: Include fcntl.h. 1735 (report_r_debug): Add parameter r_debug_info, describe it in the 1736 function comment. Delete dwfl_addrmodule call and its dependent code. 1737 Verify build-id before calling dwfl_report_elf, also supply 1738 executable_for_core to it. Store r_debug_info->module info when 1739 appropriate. 1740 (dwfl_link_map_report): Add parameter r_debug_info. New variable 1741 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug 1742 caller parameters. 1743 17442013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com> 1745 1746 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr. 1747 Set it to true for ET_EXEC and ET_CORE. Provide alternative 1748 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE. 1749 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add 1750 NEW_VERSION. 1751 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with 1752 COMPAT_VERSION. 1753 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it. 1754 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr. 1755 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf. 1756 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for 1757 dwfl_report_elf. 1758 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf. 1759 17602013-04-27 Mark Wielaard <mjw@redhat.com> 1761 1762 * link_map.c: #include system.h. 1763 17642013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com> 1765 1766 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move 1767 them to lib/system.h. 1768 17692013-04-24 Mark Wielaard <mjw@redhat.com> 1770 1771 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES. 1772 17732013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com> 1774 1775 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning. 1776 17772013-03-12 Mark Wielaard <mjw@redhat.com> 1778 1779 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success. 1780 17812013-02-22 Mark Wielaard <mjw@redhat.com> 1782 1783 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define 1784 as DWFL_E_BADELF when not used. 1785 17862013-02-10 Mark Wielaard <mjw@redhat.com> 1787 1788 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in 1789 failure messages When handling ARGP_KEY_SUCCESS because arg will 1790 not have been set. 1791 17922013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com> 1793 1794 * linux-proc-maps.c: Include system.h. 1795 (PROCEXEFMT, get_pid_class): New. 1796 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call 1797 get_pid_class. 1798 17992013-01-23 Mark Wielaard <mjw@redhat.com> 1800 1801 * dwfl_module_getdwarf.c (find_aux_sym): Don't subtract one 1802 from aux_syments by default. 1803 (find_symtab): Also succeed when only aux_symdata is found. 1804 When no symtab is found always try to load auxiliary table. 1805 (dwfl_module_getsymtab): Substract one from result when both 1806 tables have symbols. 1807 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary 1808 zero entry when both tables have symbols. 1809 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only subtract 1810 one from first_global when both tables have symbols. 1811 18122013-01-16 Mark Wielaard <mjw@redhat.com> 1813 1814 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata, 1815 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global. 1816 (dwfl_adjusted_aux_sym_addr): New function. 1817 (dwfl_deadjust_aux_sym_addr): Likewise. 1818 (dwfl_adjusted_st_value): Take and check symfile argument. 1819 (dwfl_deadjust_st_value): Likewise. 1820 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and 1821 use dwfl_file as argument to set address_sync. 1822 (find_debuginfo): Call find_prelink_address_sync with debug file. 1823 (find_aux_sym): New function. 1824 (find_symtab): Use find_aux_sym if all we have is the dynsym table 1825 and fill in aux DwflModule fields. 1826 (dwfl_module_getsymtab): Return syments plus aux_syments. 1827 (load_symtab): Always set first_global. 1828 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile 1829 when using same_section. Calculate first_global based on both 1830 mod->first_global and mod->aux_first_global. 1831 * dwfl_module.c (__libdwfl_module_free): Free aux_sym. 1832 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table 1833 to retrieve symbol and name if necessary, making sure all locals 1834 from any table come before any globals. 1835 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value 1836 with symfile. 1837 * relocate.c (resolve_symbol): Likewise. 1838 18392013-01-07 Roland McGrath <roland@hack.frob.com> 1840 1841 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but 1842 still assume the data is at least 32-bit aligned anyway. 1843 (dwfl_link_map_report): Handle unaligned auxv data. 1844 18452012-12-11 Mark Wielaard <mjw@redhat.com> 1846 1847 * linux-kernel-modules.c (report_kernel): Only free fname if 1848 find_kernel_elf succeeds and allocates it. 1849 (report_kernel_archive): Fix brackets around unlikely expression. 1850 18512012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com> 1852 1853 * argp-std.c: Update Copyright year. 1854 (offline_find_elf): New function. 1855 (offline_callbacks): Use it for find_elf. 1856 (struct parse_opt): New. 1857 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct 1858 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE 1859 processing till ARGP_KEY_SUCCESS. Initialize state->input already from 1860 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the 1861 final state->input initialization optional. 1862 * dwfl_end.c: Update Copyright year. 1863 (dwfl_end): Free executable_for_core. 1864 * libdwflP.h: Update Copyright year. 1865 (struct Dwfl): New field executable_for_core. 1866 18672012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com> 1868 1869 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS 1870 calculation. 1871 18722012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com> 1873 1874 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code 1875 from ... 1876 (__libdwfl_getelf): ... here. Call it. 1877 18782012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com> 1879 1880 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__. 1881 18822012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com> 1883 1884 * dwfl_segment_report_module.c (dwfl_segment_report_module): 1885 Initialize mod->MAIN_BIAS. 1886 18872012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com> 1888 1889 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function 1890 binding_value. Use it for both zero and non-zero size symbols 1891 comparisons. 1892 18932012-10-01 Mark Wielaard <mjw@redhat.com> 1894 1895 * cu.c (cudie_offset): Don't use type_sig8, it might not be 1896 initialized and these are always real CUs, never TUs. 1897 18982012-10-01 Mark Wielaard <mjw@redhat.com> 1899 1900 * derelocate.c (find_section): Check next section exists before 1901 accessing it. 1902 19032012-08-01 Petr Machata <pmachata@redhat.com> 1904 1905 * offline.c (process_archive_member): Ignore entry "/SYM64/". 1906 19072012-03-28 Roland McGrath <roland@hack.frob.com> 1908 1909 * dwfl_segment_report_module.c 1910 (dwfl_segment_report_module: read_portion): Don't use existing buffer 1911 when FILESZ is zero (string mode) and available portion doesn't hold 1912 a terminated string. 1913 19142011-12-02 Roland McGrath <roland@hack.frob.com> 1915 1916 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case 1917 to use elf64_xlatetom and PHDRS.p64. 1918 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>. 1919 19202011-11-31 Mark Wielaard <mjw@redhat.com> 1921 1922 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all 1923 global symbols. Then only when that doesn't provide a match search 1924 all local symbols too. 1925 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg 1926 and fill it in. 1927 (find_symtab): Initialize mod->first_global and pass it to load_symtab. 1928 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field. 1929 19302011-11-31 Mark Wielaard <mjw@redhat.com> 1931 1932 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update 1933 sizeless_sym if needed and closer to desired addr. 1934 19352011-10-20 Mark Wielaard <mjw@redhat.com> 1936 1937 * derelocate.c (cache_sections): Intern mod->reloc_info check. 1938 (dwfl_module_relocations): Don't check mod->reloc_info. 1939 (dwfl_module_relocation_info): Likewise. 1940 (find_section): Likewise. 1941 19422011-07-09 Roland McGrath <roland@hack.frob.com> 1943 1944 * image-header.c (LE32): Macro removed (now in lib/system.h). 1945 19462011-04-11 Mark Wielaard <mjw@redhat.com> 1947 1948 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition 1949 by check for zlib, bzlib or lzma defines to check it isn't empty. 1950 (try_kernel_name): Use same guard for use of vmlinux_suffixes. 1951 19522011-03-08 Roland McGrath <roland@redhat.com> 1953 1954 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL. 1955 Reported by Kurt Roeckx <kurt@roeckx.be>. 1956 19572011-02-11 Roland McGrath <roland@redhat.com> 1958 1959 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz 1960 suffixes if corresponding decompression support is enabled. 1961 19622011-02-01 Roland McGrath <roland@redhat.com> 1963 1964 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the 1965 section-end address as the synchronization point, rather than sh_addr. 1966 1967 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover 1968 PT_INTERP p_vaddr separately from main phdrs and undo phdrs. 1969 1970 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in 1971 last change, so we recognize PT_INTERP in ELFCLASS64 correctly. 1972 19732011-01-11 Roland McGrath <roland@redhat.com> 1974 1975 * dwfl_module_getdwarf.c (open_elf): Remove section-based 1976 address_sync fixup from here. 1977 (find_prelink_address_sync): New function. 1978 (find_debuginfo): Call it. 1979 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error. 1980 19812011-01-04 Roland McGrath <roland@redhat.com> 1982 1983 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation 1984 logic to consider section addresses, the better to survive all the 1985 possible prelink machinations. 1986 * libdwflP.h (struct dwfl_file): Comment change. 1987 19882010-11-30 Roland McGrath <roland@redhat.com> 1989 1990 * derelocate.c (dwfl_module_relocations): Remove over-eager assert. 1991 19922010-11-12 Roland McGrath <roland@redhat.com> 1993 1994 * libdwflP.h (struct Dwfl_Module): New member main_bias. 1995 (dwfl_adjusted_address, dwfl_deadjust_address): Use it. 1996 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it. 1997 1998 * libdwflP.h (dwfl_deadjust_address): New function. 1999 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions. 2000 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr. 2001 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value. 2002 20032010-11-11 Roland McGrath <roland@redhat.com> 2004 2005 * libdwflP.h (struct dwfl_file): Remove bias member. 2006 Add vaddr and address_sync members instead. 2007 (dwfl_adjusted_address): Calculate using vaddr. 2008 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that. 2009 (dwfl_adjusted_st_value): Use one of those calls. 2010 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync. 2011 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise. 2012 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions. 2013 * link_map.c (consider_executable): Adjust only MOD->low_addr for 2014 detected PIE bias change. 2015 2016 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function. 2017 * dwfl_module_info.c: Use it. 2018 * cu.c (addrarange): Likewise. 2019 * dwfl_dwarf_line.c: Likewise. 2020 * dwfl_module_dwarf_cfi.c: Likewise. 2021 * dwfl_lineinfo.c: Likewise. 2022 * dwfl_nextcu.c: Likewise. 2023 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise. 2024 2025 * libdwflP.h (dwfl_adjusted_st_value): New function. 2026 * relocate.c (resolve_symbol): Use it. 2027 * dwfl_module_getsym.c: Likewise. 2028 * dwfl_module_addrsym.c: Likewise. 2029 * dwfl_module_info.c: Likewise. 2030 2031 * libdwflP.h (dwfl_adjusted_address): New function. 2032 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it. 2033 * relocate.c (__libdwfl_relocate_value): Likewise. 2034 * derelocate.c (cache_sections): Likewise. 2035 (dwfl_module_address_section): Likewise. 2036 * dwfl_module_getelf.c: Likewise. 2037 * dwfl_module_eh_cfi.c: Likewise. 2038 * link_map.c (consider_executable): Likewise. 2039 20402010-08-24 Roland McGrath <roland@redhat.com> 2041 2042 * dwfl_dwarf_line.c: New file. 2043 * Makefile.am (libdwfl_a_SOURCES): Add it. 2044 20452010-08-18 Roland McGrath <roland@redhat.com> 2046 2047 * link_map.c (report_r_debug): Use found name if we have no name, 2048 even if we already have an Elf handle. 2049 20502010-06-30 Roland McGrath <roland@redhat.com> 2051 2052 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be 2053 confused by -1 return from dwfl_build_id_find_elf after it opened 2054 the Elf handle. 2055 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for 2056 dwfl_build_id_find_debuginfo. 2057 20582010-06-16 Roland McGrath <roland@redhat.com> 2059 2060 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro. 2061 20622010-06-14 Roland McGrath <roland@redhat.com> 2063 2064 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare 2065 candidate file to that st_dev/st_ino and pretend it didn't exist 2066 if they match. 2067 (find_debuginfo_in_path): Update caller, pass main file's info. 2068 20692010-05-20 Roland McGrath <roland@redhat.com> 2070 2071 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ... 2072 (grovel_auxv): ... this. Take DWFL argument. 2073 (dwfl_linux_proc_report): Update caller. 2074 2075 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias 2076 based on dwfl->segment_align or manifest alignment of MOD->low_addr. 2077 20782010-05-19 Roland McGrath <roland@redhat.com> 2079 2080 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten. 2081 20822010-05-06 Roland McGrath <roland@redhat.com> 2083 2084 * segment.c (insert): Clear inserted elements of DWFL->lookup_module. 2085 2086 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF. 2087 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build 2088 ID but we didn't find a file. 2089 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check 2090 and refuse any fallback file-by-name if it lacks the matching ID. 2091 2092 * dwfl_error.c (dwfl_errno): Add INTDEF. 2093 * libdwflP.h: Add INTDECL. 2094 2095 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in 2096 failure cases. 2097 20982010-05-04 Roland McGrath <roland@redhat.com> 2099 2100 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an 2101 ET_DYN that has a DT_DEBUG. 2102 2103 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop. 2104 2105 * segment.c (insert): Fix moving of values following insertion. 2106 (reify_segments): Fix up MOD->segment backpointer indices after 2107 later insertions in the main loop invalidate them. 2108 2109 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and 2110 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly. 2111 2112 * core-file.c (dwfl_core_file_report): Return any nonzero count of 2113 modules reported, even if link_map grovelling failed and only sniffing 2114 found anything. 2115 21162010-04-26 Roland McGrath <roland@redhat.com> 2117 2118 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc. 2119 Works around probably-wrong ld -r behavior for case of a DWARF address 2120 constant that refers to a discarded SHF_ALLOC section. 2121 21222010-04-14 Roland McGrath <roland@redhat.com> 2123 2124 * link_map.c (report_r_debug): Limit iterations on the l_next chain to 2125 an upper bound on sane possible number of elements. 2126 21272010-03-11 Roland McGrath <roland@redhat.com> 2128 2129 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan 2130 the second half for 32-bit matches. 2131 21322010-03-10 Roland McGrath <roland@redhat.com> 2133 2134 * core-file.c (dwfl_core_file_report): Punt EHDR argument. 2135 * argp-std.c (parse_opt): Update caller. 2136 * libdwfl.h: Declare dwfl_core_file_report. 2137 * libdwflP.h: Don't. 2138 21392010-02-17 Roland McGrath <roland@redhat.com> 2140 2141 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument. 2142 If set, find the first index not below ADDR. 2143 (dwfl_segment_report_module): Update callers. 2144 Pass true when calculating return value. 2145 21462010-02-15 Roland McGrath <roland@redhat.com> 2147 2148 * Makefile.am: Use config/eu.am for common stuff. 2149 2150 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized 2151 variable in failure path. 2152 21532010-02-02 Mark Wielaard <mjw@redhat.com> 2154 2155 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias. 2156 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise 2157 21582010-01-07 Roland McGrath <roland@redhat.com> 2159 2160 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum. 2161 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise. 2162 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise. 2163 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise. 2164 21652010-01-06 Roland McGrath <roland@redhat.com> 2166 2167 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value. 2168 (relocate_section): Let unresolved SHN_COMMON symbol stay 0. 2169 21702009-11-16 Roland McGrath <roland@redhat.com> 2171 2172 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn. 2173 21742009-11-12 Petr Machata <pmachata@redhat.com> 2175 2176 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if 2177 the chunk is both offset-contiguous and vaddr-contiguous. 2178 21792009-11-05 Roland McGrath <roland@redhat.com> 2180 2181 * link_map.c (report_r_debug): Skip entries with l_ld==0. 2182 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure. 2183 21842009-09-04 Roland McGrath <roland@redhat.com> 2185 2186 * image-header.c (__libdw_image_header): Fix tranposed comparison. 2187 21882009-08-27 Roland McGrath <roland@redhat.com> 2189 2190 * image-header.c: New file. 2191 * Makefile.am (libdwfl_a_SOURCES): Add it. 2192 * libdwflP.h: Declare __libdw_image_header. 2193 * open.c (decompress): Don't consume ELF on failure. 2194 (what_kind): New function, broken out of ... 2195 (__libdw_open_file): ... here. Call it. 2196 If it fails, try __libdw_image_header and then try what_kind again. 2197 2198 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER, 2199 leave it behind for next decompressor. 2200 * open.c (decompress): Free BUFFER on failure. 2201 22022009-08-26 Roland McGrath <roland@redhat.com> 2203 2204 * gzip.c (find_zImage_payload): New function, broken out of ... 2205 (mapped_zImage): ... here. Call it. 2206 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with 2207 stupid method of just trying the decoder. 2208 2209 * open.c [USE_LZMA]: Try __libdw_unlzma. 2210 * libdwflP.h: Declare it. 2211 (DWFL_ERRORS): Add DWFL_E_LZMA. 2212 * gzip.c [LZMA]: Implement liblzma version for XZ file format. 2213 * lzma.c: New file. 2214 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it. 2215 2216 * gzip.c (mapped_zImage): Limit scan to 32kb. 2217 Make this unconditional, support bzip2 kernel images too. 2218 (unzip): Use direct inflate method for non-mmap case too. 2219 Only zlib uses the stream method. 2220 22212009-08-09 Roland McGrath <roland@redhat.com> 2222 2223 * dwfl_module_build_id.c: Use new macros for versioned definitions. 2224 22252009-07-08 Roland McGrath <roland@redhat.com> 2226 2227 * dwfl_module_dwarf_cfi.c: New file. 2228 * dwfl_module_eh_cfi.c: New file. 2229 * Makefile.am (libdwfl_a_SOURCES): Add them. 2230 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi. 2231 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi. 2232 22332009-07-08 Roland McGrath <roland@redhat.com> 2234 2235 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better. 2236 22372009-06-18 Mark Wielaard <mjw@redhat.com> 2238 2239 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap. 2240 22412009-06-13 Ulrich Drepper <drepper@redhat.com> 2242 2243 * derelocate.c: Don't use deprecated libelf functions. 2244 * dwfl_module_getdwarf.c: Likewise. 2245 * relocate.c: Likewise. 2246 22472009-04-23 Ulrich Drepper <drepper@redhat.com> 2248 2249 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is 2250 defined. Otherwise just define the latest version. 2251 22522009-04-22 Roland McGrath <roland@redhat.com> 2253 2254 * relocate.c (resolve_symbol): Apply correct bias to st_value found in 2255 a non-ET_REL module. 2256 2257 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to 2258 adjust properly for non-ET_REL. 2259 22602009-04-21 Roland McGrath <roland@redhat.com> 2261 2262 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC. 2263 2264 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL. 2265 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only 2266 for ET_REL. 2267 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise. 2268 22692009-04-20 Roland McGrath <roland@redhat.com> 2270 2271 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function. 2272 22732009-04-19 Roland McGrath <roland@redhat.com> 2274 2275 * dwfl_module_getdwarf.c (find_file): Renamed to ... 2276 (__libdwfl_getelf): ... this. Make it global. 2277 (find_symtab, find_dw): Update callers. 2278 (dwfl_module_getelf): Functions moved ... 2279 * dwfl_module_getelf.c: ... here, new file. 2280 * Makefile.am (libdwfl_a_SOURCES): Add it. 2281 * libdwflP.h: Declare __libdwfl_getelf. 2282 22832009-04-14 Roland McGrath <roland@redhat.com> 2284 2285 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either 2286 absolute (already adjusted in place) or needing load bias adjustment. 2287 2288 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for 2289 gelf_getphdr failure. Fix file size limit checks. 2290 2291 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check. 2292 22932009-04-08 Roland McGrath <roland@redhat.com> 2294 2295 * dwfl_module_getsym.c: Don't adjust for bias again after 2296 __libdwfl_relocate_value. 2297 2298 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from 2299 a non-SHF_ALLOC section. 2300 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX. 2301 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise. 2302 23032009-03-09 Roland McGrath <roland@redhat.com> 2304 2305 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX 2306 variable to outer scope, so we cache it for the loop. 2307 2308 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr. 2309 23102009-02-12 Roland McGrath <roland@redhat.com> 2311 2312 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use 2313 __libdwfl_relocate_value to find correct sh_addr value. 2314 23152009-02-10 Roland McGrath <roland@redhat.com> 2316 2317 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY. 2318 If false, don't fail for NO_PHDR. 2319 (dwfl_report_elf): Update caller. 2320 * libdwflP.h: Update decl. 2321 * offline.c (process_elf): Call it with false, so we don't refuse 2322 dubiously-formed objects here. 2323 2324 * link_map.c (consider_executable): Don't assert dwfl_addrsegment 2325 finds our module. We shouldn't crash when we confuse some guesses. 2326 23272009-02-10 Ulrich Drepper <drepper@redhat.com> 2328 2329 * open.c (decompress): Avoid crash with empty input file. 2330 23312009-01-27 Roland McGrath <roland@redhat.com> 2332 2333 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD 2334 with zero vaddr and memsz. 2335 23362009-01-22 Roland McGrath <roland@redhat.com> 2337 2338 * open.c (decompress): Move BUFFER, SIZE decls outside #if. 2339 2340 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments 2341 after address-matching loop. 2342 2343 * segment.c (lookup): Fix fencepost in checking for HINT match. 2344 23452009-01-14 Roland McGrath <roland@redhat.com> 2346 2347 * gzip.c [!BZLIB] (mapped_zImage): New function. 2348 (unzip) [!BZLIB]: Grok Linux kernel zImage format. 2349 23502009-01-10 Ulrich Drepper <drepper@redhat.com> 2351 2352 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code. 2353 23542009-01-08 Roland McGrath <roland@redhat.com> 2355 2356 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): 2357 Skip subdirectory named "source". 2358 (dwfl_linux_kernel_find_elf): Likewise. 2359 23602009-01-06 Roland McGrath <roland@redhat.com> 2361 2362 * linux-kernel-modules.c (check_suffix): New function. 2363 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes. 2364 (dwfl_linux_kernel_report_offline): Use it. 2365 (dwfl_linux_kernel_find_elf): Likewise. 2366 23672009-01-05 Roland McGrath <roland@redhat.com> 2368 2369 * argp-std.c (parse_opt): Use __libdw_open_file for core file. 2370 * dwfl_build_id_find_debuginfo.c: Use it to open the file. 2371 * dwfl_build_id_find_elf.c: Likewise. 2372 * dwfl_module_getdwarf.c (open_elf): Likewise. 2373 * dwfl_report_elf.c: Likewise. 2374 * find-debuginfo.c (validate): Likewise. 2375 * offline.c (__libdwfl_report_offline): Likewise. 2376 2377 * libdwflP.h: Declare __libdw_open_file. 2378 * open.c: New file. 2379 * Makefile.am (libdwfl_a_SOURCES): Add it. 2380 2381 * gzip.c: New file. 2382 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it. 2383 * bzip2.c: New file. 2384 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it. 2385 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2. 2386 23872008-12-16 Roland McGrath <roland@redhat.com> 2388 2389 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and 2390 symver magic to bind to ELFUTILS_0.138. 2391 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible 2392 wrapper for ELFUTILS_0.130 version set. 2393 23942008-12-18 Roland McGrath <roland@redhat.com> 2395 2396 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN 2397 addresses are taken as relative to MOD->low_addr. 2398 23992008-12-15 Roland McGrath <roland@redhat.com> 2400 2401 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not 2402 debug.bias. 2403 24042008-12-11 Roland McGrath <roland@redhat.com> 2405 2406 * offline.c (process_archive): Don't call elf_end and close if 2407 returning NULL. Check first elf_begin call and set error code 2408 specially for empty archive. 2409 Fixes RHBZ#465878. 2410 24112008-12-02 Roland McGrath <roland@redhat.com> 2412 2413 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change. 2414 24152008-11-26 Roland McGrath <roland@redhat.com> 2416 2417 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in 2418 return value, and interpret encoded OFFSET argument. 2419 24202008-10-07 Roland McGrath <roland@redhat.com> 2421 2422 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation. 2423 24242008-09-29 Roland McGrath <roland@redhat.com> 2425 2426 * segment.c (insert): Must realloc DWFL->lookup_module here too. 2427 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls. 2428 24292008-08-28 Roland McGrath <roland@redhat.com> 2430 2431 * segment.c (reify_segments): Fix last change. 2432 24332008-08-27 Roland McGrath <roland@redhat.com> 2434 2435 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM 2436 failure from pread64. 2437 24382008-08-26 Roland McGrath <roland@redhat.com> 2439 2440 * segment.c (reify_segments): Insert a trailing segment for a module 2441 end that is above the highest current segment. 2442 24432008-08-25 Roland McGrath <roland@redhat.com> 2444 2445 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for 2446 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF 2447 if FILE->elf is not ELF_K_ELF. 2448 2449 * dwfl_segment_report_module.c: Add a cast. 2450 24512008-08-21 Denys Vlasenko <dvlasenk@redhat.com> 2452 2453 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic 2454 which decides which symbol is "closest" to a given address. 2455 24562008-08-15 Roland McGrath <roland@redhat.com> 2457 2458 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf. 2459 (options, parse_opt): Handle --core. 2460 2461 * core-file.c: New file. 2462 * Makefile.am (libdwfl_a_SOURCES): Add it. 2463 * libdwflP.h (dwfl_core_file_report): Declare it. 2464 2465 * link_map.c: New file. 2466 * Makefile.am (libdwfl_a_SOURCES): Add it. 2467 * libdwflP.h (dwfl_link_map_report): Declare it. 2468 2469 * libdwflP.h (MIN, MAX): New macros. 2470 (Dwfl_Memory_Callback): New typedef. 2471 (Dwfl_Module_Callback): New typedef. 2472 (dwfl_segment_report_module): Declare it. 2473 * dwfl_segment_report_module.c: New file. 2474 * Makefile.am (libdwfl_a_SOURCES): Add it. 2475 2476 * derelocate.c (dwfl_module_address_section): Add INTDEF. 2477 * libdwflP.h: Add INTDECL. 2478 2479 * segment.c: New file. 2480 * Makefile.am (libdwfl_a_SOURCES): Add it. 2481 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment. 2482 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc, 2483 lookup_addr, lookup_module, lookup_segndx, replace removed members 2484 modules, nmodules. 2485 (struct Dwfl_Module): New member segment. 2486 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist 2487 to each free module. 2488 * dwfl_module.c (dwfl_report_begin_add): Do nothing. 2489 (dwfl_report_begin): Don't call it. Truncate the segment table instead. 2490 (dwfl_report_module): Don't touch DWFL->nmodules. 2491 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules. 2492 (compare_modules): Function removed. 2493 * dwfl_getmodules.c: Rewritten. 2494 Add INTDEF. 2495 * libdwflP.h: Add INTDECLs. 2496 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules. 2497 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment. 2498 24992008-08-03 Roland McGrath <roland@redhat.com> 2500 2501 * linux-kernel-modules.c: Include <fts.h> before <config.h>. 2502 25032008-07-17 Roland McGrath <roland@redhat.com> 2504 2505 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to 2506 zero if the failure was only ENOENT. 2507 25082008-06-03 Roland McGrath <roland@redhat.com> 2509 2510 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined 2511 symbols. 2512 25132008-05-22 Petr Machata <pmachata@redhat.com> 2514 2515 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0. 2516 25172008-05-06 Roland McGrath <roland@frob.com> 2518 2519 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use 2520 FTS_LOGICAL here too. 2521 (dwfl_linux_kernel_find_elf): Likewise. 2522 25232008-04-29 Roland McGrath <roland@redhat.com> 2524 2525 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search 2526 based on canonicalize_file_name if it differs from the supplied name. 2527 2528 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so 2529 we accept symlinks. 2530 25312008-04-27 Roland McGrath <roland@redhat.com> 2532 2533 * linux-kernel-modules.c (report_kernel): Fix crash when 2534 dwfl_report_elf fails. 2535 25362008-04-05 Roland McGrath <roland@redhat.com> 2537 2538 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE. 2539 2540 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits. 2541 Clear it after freeing. 2542 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise. 2543 25442008-03-26 Roland McGrath <roland@redhat.com> 2545 2546 * dwfl_module_getdwarf.c (load_symtab): Don't return success for 2547 SHT_DYNSYM, just set *SYMSCN like the comment says. 2548 2549 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array. 2550 2551 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure. 2552 25532008-03-19 Roland McGrath <roland@redhat.com> 2554 2555 * dwfl_module_getsrc.c: Adjust address for module bias before search. 2556 25572008-03-01 Roland McGrath <roland@redhat.com> 2558 2559 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from 2560 prototype to avoid older compiler's complaint about reuse of the name. 2561 (__libdwfl_canon_error): Likewise. 2562 25632008-02-19 Roland McGrath <roland@redhat.com> 2564 2565 * relocate.c (relocate_section): Check for an unhandled relocation 2566 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE -> 2567 DWFL_E_UNKNOWN_MACHINE check out of loops. 2568 2569 * dwfl_module_getdwarf.c (load_dw): Skip relocation if 2570 DEBUGFILE->relocated is already set. 2571 25722008-01-26 Roland McGrath <roland@redhat.com> 2573 2574 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null. 2575 2576 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear 2577 incoming *FILE_NAME at the start. 2578 25792008-01-08 Roland McGrath <roland@redhat.com> 2580 2581 * Makefile.am (euinclude): Variable removed. 2582 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS. 2583 25842007-10-23 Roland McGrath <roland@redhat.com> 2585 2586 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel 2587 module to appear first. 2588 25892007-10-20 Roland McGrath <roland@redhat.com> 2590 2591 * offline.c (process_archive_member): Take FD argument, pass it down 2592 to process_file. Return Elf_Cmd, not bool. 2593 Call elf_next here, always before elf_end. 2594 (process_archive): Update caller. Don't close FD here unless there 2595 are no member refs. 2596 2597 * dwfl_module.c (free_file): Close fd only when elf_end returns zero. 2598 2599 * libdwflP.h (struct dwfl_file): New bool member `relocated'. 2600 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply 2601 partial relocation to one or both files. 2602 (dwfl_module_getdwarf): For ET_REL, make sure extra sections' 2603 relocations have been applied to the debug file if dwfl_module_getelf 2604 has been used before. 2605 2606 * relocate.c (resolve_symbol): New function. 2607 (relocate_section): Call it. 2608 2609 * relocate.c (relocate_getsym): Handle null MOD->symfile. 2610 (relocate_section): Take new bool arg, PARTIAL. If true, 2611 no error for BADRELTYPE/RELUNDEF, instead just skip them 2612 and leave only those skipped relocs behind the reloc section. 2613 (__libdwfl_relocate_section): Take new arg, pass it down. 2614 (__libdwfl_relocate): Take new bool arg, DEBUG. If false, 2615 do partial relocation on all sections. 2616 * dwfl_module_getdwarf.c (load_dw): Update caller. 2617 * libdwflP.h: Update decls. 2618 * derelocate.c (dwfl_module_address_section): Pass new argument 2619 to __libdwfl_relocate_section, true. 2620 2621 * derelocate.c (cache_sections): Don't cache reloc sections when 2622 section_address callback is null. 2623 26242007-10-19 Roland McGrath <roland@redhat.com> 2625 2626 * relocate.c (relocate_section): Fix fencepost error in r_offset check. 2627 2628 * derelocate.c (struct dwfl_relocation): Add member `relocs'. 2629 (struct secref): Likewise. 2630 (cache_sections): Cache the relocation section referring to each 2631 section we cache, if any. 2632 (dwfl_module_address_section): Use __libdwfl_relocate_section as 2633 necessary. 2634 2635 * relocate.c (struct reloc_symtab_cache): New type. 2636 (relocate_getsym): Use it instead of four arguments. 2637 (__libdwfl_relocate): Update caller. 2638 (relocate_section): New function, broken out of ... 2639 (__libdwfl_relocate): ... here. 2640 (__libdwfl_relocate_section): New function. 2641 * libdwflP.h: Declare it. 2642 26432007-10-17 Roland McGrath <roland@redhat.com> 2644 2645 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias 2646 to relocated st_value. 2647 2648 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for 2649 ET_REL to 0x100. 2650 26512007-10-16 Roland McGrath <roland@redhat.com> 2652 2653 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later 2654 section has larger alignment requirements not met by the original BASE, 2655 rather than padding more between sections. 2656 2657 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation. 2658 2659 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias 2660 to sh_addr value. 2661 2662 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE 2663 at zero in ET_REL case. Adjust BASE to necessary alignment. 2664 2665 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value 2666 for DATA_VADDR. 2667 (__libdwfl_find_build_id): Update caller. 2668 2669 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset. 2670 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise. 2671 * offline.c (dwfl_offline_section_address): Bail early if there is 2672 separate debug file. 2673 2674 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF. 2675 26762007-10-09 Roland McGrath <roland@redhat.com> 2677 2678 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when 2679 caching SHDR->sh_addr = 0. 2680 * offline.c (dwfl_offline_section_address): Never called for sh_addr 2681 really at 0, don't check for it. Use MOD->debug directly, not symfile. 2682 2683 * dwfl_module_getdwarf.c (load_symtab): Return success properly when 2684 we've found SHT_SYMTAB. 2685 2686 * relocate.c (relocate_getsym): New function. 2687 (__libdwfl_relocate): Use it. 2688 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX 2689 be a pointer instead of value; cache getshstrndx result there. 2690 * libdwflP.h: Update decl. 2691 * derelocate.c (cache_sections): Update caller. 2692 Always work on the main file, not the symfile. 2693 (dwfl_module_address_section): Likewise. 2694 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller. 2695 26962007-10-07 Roland McGrath <roland@redhat.com> 2697 2698 * offline.c (process_archive): Initialize MOD. 2699 2700 * linux-kernel-modules.c (get_release): New function, broken out of ... 2701 (report_kernel): ... here. Call it. 2702 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set. 2703 (find_kernel_elf): Update caller. 2704 (report_kernel_archive): New function. 2705 (dwfl_linux_kernel_report_offline): Call it. 2706 2707 * offline.c (process_file): Take new arg PREDICATE, pass it down. 2708 (process_archive): Likewise. 2709 (process_archive_member): Likewise. When nonnull, let the predicate 2710 decide whether to use this member. 2711 (__libdwfl_report_offline): New function, broken out of ... 2712 (dwfl_report_offline): ... here. Call it. 2713 * libdwflP.h: Declare it. 2714 2715 * offline.c (process_archive, process_archive_member): New functions. 2716 (process_elf, process_file): New functions, broken out of ... 2717 (dwfl_report_offline): ... here. Call process_file, which recurses on 2718 ELF_K_AR files. 2719 2720 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ... 2721 (dwfl_report_elf): ... here. Call it. 2722 * libdwflP.h: Declare it. 2723 27242007-10-06 Roland McGrath <roland@redhat.com> 2725 2726 * derelocate.c (dwfl_module_relocations): Don't call 2727 dwfl_module_getdwarf. 2728 2729 * derelocate.c (find_section): Use __libdwfl_seterrno, not 2730 __libdw_seterrno. 2731 2732 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not 2733 SHF_ALLOC, to cache sh_addr resolved to 0. 2734 2735 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr 2736 values nonzero already, just use its existing layout. 2737 2738 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its 2739 in-core shdr after applying it. 2740 27412007-10-04 Ulrich Drepper <drepper@redhat.com> 2742 2743 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake 2744 initialization of notes variable. 2745 27462007-10-04 Roland McGrath <roland@redhat.com> 2747 2748 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES, 2749 fill in with vaddr of "__start_notes" symbol if found. 2750 (check_notes): New function. 2751 (check_kernel_notes): New function. 2752 (dwfl_linux_kernel_report_kernel): Call it. 2753 (check_module_notes): New function. 2754 (dwfl_linux_kernel_report_modules): Call it. 2755 2756 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): 2757 Try dwfl_build_id_find_elf first. 2758 2759 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT. 2760 Set kernel module e_type to ET_DYN. 2761 27622007-10-03 Roland McGrath <roland@redhat.com> 2763 2764 * find-debuginfo.c (validate): New function, broken out of ... 2765 (find_debuginfo_in_path): ... here. New function, broken out of ... 2766 (dwfl_standard_find_debuginfo): ... here. Call it, after trying 2767 dwfl_build_id_find_debuginfo first. 2768 2769 * dwfl_build_id_find_elf.c: New file. 2770 * dwfl_build_id_find_debuginfo.c: New file. 2771 * Makefile.am (libdwfl_a_SOURCES): Add them. 2772 * libdwfl.h: Declare them. 2773 * libdwflP.h: Add INTDECLs. 2774 2775 * dwfl_module_build_id.c: New file. 2776 * dwfl_module_report_build_id.c: New file. 2777 * Makefile.am (libdwfl_a_SOURCES): Add them. 2778 * libdwfl.h: Declare them. 2779 * libdwflP.h (struct Dwfl_Module): New members build_id_bits, 2780 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id. 2781 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits. 2782 2783 * dwfl_module_getdwarf.c (find_offsets): New function. 2784 (find_dynsym): New function, calls that. 2785 (find_symtab): Call it. 2786 27872007-09-11 Roland McGrath <roland@redhat.com> 2788 2789 * dwfl_module_addrsym.c: Prefer a later global symbol at the same 2790 address if its st_size is smaller. 2791 27922007-08-13 Roland McGrath <roland@redhat.com> 2793 2794 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler. 2795 27962007-08-12 Roland McGrath <roland@redhat.com> 2797 2798 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use 2799 FTS_LOGICAL. 2800 2801 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on 2802 a second phdr if it happens to match EHDR_VMA exactly. 2803 28042007-08-08 Roland McGrath <roland@redhat.com> 2805 2806 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and 2807 those with no names. Rewrite best symbol algorithm not to assume a 2808 sorted table and to be smarter handling sizeless symbols. 2809 28102007-07-16 Roland McGrath <roland@redhat.com> 2811 2812 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when 2813 reviving an existing module. 2814 28152007-06-08 Roland McGrath <roland@redhat.com> 2816 2817 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME. 2818 28192007-05-17 Roland McGrath <roland@redhat.com> 2820 2821 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at 2822 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel. 2823 (dwfl_linux_kernel_find_elf): Likewise. 2824 2825 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use 2826 getline and sscanf instead of fscanf. 2827 28282007-05-08 Roland McGrath <roland@redhat.com> 2829 2830 * offline.c (dwfl_offline_section_address): Don't assume section 2831 numbers match between stripped and debuginfo files. Instead, assume 2832 only that the ordering among SHF_ALLOC sections matches. 2833 2834 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to 2835 pointer to string. 2836 (dwfl_linux_kernel_report_offline): Update caller. 2837 (dwfl_linux_kernel_report_kernel): Likewise. 2838 28392007-04-23 Roland McGrath <roland@redhat.com> 2840 2841 * argp-std.c (options): Fix group title string. 2842 2843 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl. 2844 Update via STATE->input every time we set STATE->hook, not only at 2845 ARGP_KEY_SUCCESS. 2846 2847 * dwfl_module.c (free_file): Free FILE->name. 2848 28492007-04-16 Roland McGrath <roland@redhat.com> 2850 2851 * derelocate.c (cache_sections): Apply bias to sh_addr. 2852 (compare_secrefs): Fix address comparison to avoid signed overflow. 2853 (find_section): New function, broken out of ... 2854 (dwfl_module_relocate_address): ... here, call it. 2855 (check_module): New function, broken out of ... 2856 (dwfl_module_relocate_address): ... here, call it. 2857 (dwfl_module_address_section): New function. 2858 * libdwfl.h: Declare it. 2859 28602007-03-26 Roland McGrath <roland@redhat.com> 2861 2862 * dwfl_module.c (__libdwfl_module_free): Free MOD itself. 2863 28642007-03-18 Roland McGrath <roland@redhat.com> 2865 2866 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of 2867 (find_debuginfo): ... here. Call it. 2868 Don't return error for libelf errors finding .gnu_debuglink section. 2869 28702007-03-12 Roland McGrath <roland@redhat.com> 2871 2872 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ... 2873 (dwfl_report_begin): ... here. Call it. 2874 * libdwfl.h: Declare it. 2875 * libdwflP.h: Add INTDECL. 2876 2877 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo. 2878 2879 * offline.c: Comment typo fix. 2880 28812007-03-04 Roland McGrath <roland@redhat.com> 2882 2883 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel". 2884 (find_kernel_elf): New function, broken out of ... 2885 (report_kernel): ... here. Call it. 2886 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME. 2887 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess 2888 virtual address bounds of kernel from symbols rounded to page size. 2889 (dwfl_linux_kernel_report_kernel): Use that if it works, before 2890 resorting to report_kernel. 2891 2892 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an 2893 ET_EXEC file with nonzero bias. 2894 2895 * dwfl_module_addrname.c (dwfl_module_addrname): Just call 2896 dwfl_module_addrsym. Guts moved to ... 2897 * dwfl_module_addrsym.c: ... here; new file. 2898 * Makefile.am (libdwfl_a_SOURCES): Add it. 2899 * libdwfl.h: Declare dwfl_module_addrsym. 2900 * libdwflP.h: Add INTDECL. 2901 29022007-03-03 Roland McGrath <roland@redhat.com> 2903 2904 * dwfl_module.c (free_file): New function, broken out of ... 2905 (__libdwfl_module_free): ... here. In it, close fd after elf_end. 2906 2907 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1 2908 on libelf failure. 2909 29102007-03-02 Roland McGrath <roland@redhat.com> 2911 2912 * linux-kernel-modules.c: Fix bogus error test for asprintf call. 2913 29142007-02-02 Roland McGrath <roland@redhat.com> 2915 2916 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary 2917 address exactly if it's no other module's low boundary. 2918 2919 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value 2920 and size cover the address, select the closest symbol with st_size==0 2921 that lies in the same section. 2922 29232007-01-29 Roland McGrath <roland@redhat.com> 2924 2925 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION, 2926 not PACKAGE_STRING. 2927 29282007-01-20 Roland McGrath <roland@redhat.com> 2929 2930 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1 2931 as omitted, not 0. 2932 * libdwfl.h (Dwfl_Callbacks): Update comment. 2933 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections. 2934 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address): 2935 For ignored missing section, use -1 instead of 0. 2936 * offline.c (dwfl_offline_section_address): Expect a call for 0. 2937 29382007-01-19 Roland McGrath <roland@redhat.com> 2939 2940 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to 2941 zero so a lone -e foo.so is shown without address bias. 2942 29432007-01-10 Roland McGrath <roland@redhat.com> 2944 2945 * linux-kernel-modules.c (report_kernel): Check asprintf return value 2946 directly instead of via side effect, to silence warn_unused_result. 2947 (dwfl_linux_kernel_report_offline): Likewise. 2948 (dwfl_linux_kernel_find_elf): Likewise. 2949 (dwfl_linux_kernel_module_section_address): Likewise. 2950 * find-debuginfo.c (try_open): Likewise. 2951 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise. 2952 (dwfl_linux_proc_report): Likewise. 2953 2954 * libdwfl.h (dwfl_begin): Require nonnull argument. 2955 29562006-12-27 Roland McGrath <roland@redhat.com> 2957 2958 * dwfl_module.c (compare_modules): Fix address comparison to avoid 2959 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>. 2960 29612006-10-30 Roland McGrath <roland@redhat.com> 2962 2963 * dwfl_module.c (dwfl_report_module): Comment typo fix. 2964 29652006-09-05 Roland McGrath <roland@redhat.com> 2966 2967 * derelocate.c (cache_sections): Use alloca instead of variable-sized 2968 auto array, in function already using alloca. 2969 29702006-08-14 Roland McGrath <roland@redhat.com> 2971 2972 * linux-kernel-modules.c (try_kernel_name): If the call to 2973 dwfl_standard_find_debuginfo produces no results, try it again 2974 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix. 2975 2976 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ... 2977 * libdwflP.h: ... to here. 2978 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it 2979 repeats the first thing dwfl_standard_find_debuginfo will try. 2980 2981 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro. 2982 (dwfl_linux_kernel_module_section_address): If a /sys file is missing 2983 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the 2984 section name. 2985 29862006-07-12 Ulrich Drepper <drepper@redhat.com> 2987 2988 * cu.c: Adjust for internal_function_def removal. 2989 * dwfl_error.c: Likewise. 2990 * dwfl_module.c: Likewise. 2991 * dwfl_module_getdwarf.c: Likewise. 2992 * lines.c: Likewise. 2993 * relocate.c: Likewise. 2994 29952006-07-11 Ulrich Drepper <drepper@redhat.com> 2996 2997 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value, 2998 it can overflow the return value type. 2999 Patch by Tim Moore <timoore@redhat.com>. 3000 30012006-06-28 Roland McGrath <roland@redhat.com> 3002 3003 * libdwfl.h: Cosmetic changes. 3004 3005 * dwfl_line_comp_dir.c: New file. 3006 * Makefile.am (libdwfl_a_SOURCES): Add it. 3007 * libdwfl.h: Declare dwfl_line_comp_dir. 3008 3009 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn. 3010 3011 * dwfl_linecu.c: New file. 3012 * Makefile.am (libdwfl_a_SOURCES): Add it. 3013 * libdwfl.h: Declare dwfl_linecu. 3014 3015 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu. 3016 (dwfl_linecu): Define as macro. 3017 3018 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym. 3019 3020 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function. 3021 (dwfl_module_addrname): Function moved ... 3022 * dwfl_module_addrname.c: ... here, new file. 3023 * dwfl_module_getsym.c: New file. 3024 * Makefile.am (libdwfl_a_SOURCES): Add them. 3025 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym. 3026 * libdwflP.h: Add INTDECLs. 3027 30282006-06-27 Roland McGrath <roland@redhat.com> 3029 3030 * dwfl_module.c (dwfl_report_end): Whitespace fix. 3031 30322006-06-13 Roland McGrath <roland@redhat.com> 3033 3034 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo. 3035 Use __libdwfl_seterrno for elf_memory failure. 3036 30372006-05-22 Roland McGrath <roland@redhat.com> 3038 3039 * dwfl_module_return_value_location.c 3040 (dwfl_module_return_value_location): Use __libdwfl_module_getebl. 3041 30422006-05-27 Ulrich Drepper <drepper@redhat.com> 3043 3044 * libdwfl.h: Add extern "C". 3045 30462006-05-22 Ulrich Drepper <drepper@redhat.com> 3047 3048 * cu.c (addrarange): Handle files without aranges information. 3049 30502006-05-16 Ulrich Drepper <drepper@redhat.com> 3051 3052 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of 3053 ->modules is NULL. 3054 30552006-02-26 Roland McGrath <roland@redhat.com> 3056 3057 * dwfl_version.c: New file. 3058 * Makefile.am (libdwfl_a_SOURCES): Add it. 3059 * libdwfl.h: Declare dwfl_version. 3060 3061 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having 3062 aligned up from DWFL->offline_next_address when checking for overlap. 3063 30642005-12-22 Roland McGrath <roland@redhat.com> 3065 3066 * argp-std.c (parse_opt): Call dwfl_end in failure cases. 3067 3068 * linux-proc-maps.c (proc_maps_report): New function, broken out of ... 3069 (dwfl_linux_proc_report): ... here. Call it. 3070 (dwfl_linux_proc_maps_report): New function. 3071 * libdwfl.h: Declare it. 3072 * libdwflP.h: Add INTDECL. 3073 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map. 3074 3075 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf 3076 failed with DWFL_E_NO_DWARF. 3077 30782005-11-26 Roland McGrath <roland@redhat.com> 3079 3080 * dwfl_end.c (dwfl_end): Free the DWFL itself. 3081 30822005-11-25 Roland McGrath <roland@redhat.com> 3083 3084 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function. 3085 (load_dw): Use it. 3086 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise. 3087 * libdwflP.h: Declare it. 3088 3089 * dwfl_module_register_names.c: New file. 3090 * Makefile.am (libdwfl_a_SOURCES): Add it. 3091 * libdwfl.h: Declare dwfl_module_register_names. 3092 30932005-11-21 Roland McGrath <roland@redhat.com> 3094 3095 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address): 3096 Don't leak malloc'd file name. 3097 If a /sys/.../sections file is missing and starts with ".init", 3098 try the variant with "_init" too; catches PPC64 kernel braindamage. 3099 31002005-11-15 Roland McGrath <roland@redhat.com> 3101 3102 * libdwfl.h: Comment fixes. 3103 3104 * dwfl_module_return_value_location.c: Add unlikely for error case. 3105 31062005-11-13 Roland McGrath <roland@redhat.com> 3107 3108 * dwfl_return_value_location.c: New file. 3109 * Makefile.am (libdwfl_a_SOURCES): Add it. 3110 * libdwfl.h: Declare dwfl_module_return_value_location. 3111 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE. 3112 31132005-10-20 Roland McGrath <roland@redhat.com> 3114 3115 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE. 3116 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE 3117 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE. 3118 31192005-10-01 Roland McGrath <roland@redhat.com> 3120 3121 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail 3122 with errno 0. 3123 31242005-09-19 Roland McGrath <roland@redhat.com> 3125 3126 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use 3127 PRIx64 instead of PRIi64, lest addresses with high bits set overflow 3128 the signed integer reading; they will just have to be in hexadecimal. 3129 (dwfl_linux_kernel_module_section_address): Likewise. 3130 31312005-08-28 Ulrich Drepper <drepper@redhat.com> 3132 3133 * Makefile.am (%.os): Use COMPILE.os. 3134 (COMPILE.os): Filter out gconv options. 3135 31362005-08-25 Roland McGrath <roland@redhat.com> 3137 3138 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end. 3139 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info. 3140 31412005-08-24 Roland McGrath <roland@redhat.com> 3142 3143 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it. 3144 3145 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function, 3146 magic initializer to set -heur-stack-bound option. 3147 31482005-08-22 Roland McGrath <roland@redhat.com> 3149 3150 * dwfl_validate_address.c: New file. 3151 * Makefile.am (libdwfl_a_SOURCES): Add it. 3152 * libdwfl.h: Declare dwfl_validate_address. 3153 3154 * derelocate.c (dwfl_module_relocate_address): Add INTDEF. 3155 * libdwflP.h: Add INTDECL. 3156 3157 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of 3158 elf_rawdata for symbol-related sections. 3159 3160 * offline.c (dwfl_report_offline): Move offline_next_address outside 3161 module's range, in case it's an ET_EXEC using fixed segment locations. 3162 * libdwfl.h: Update comment. 3163 3164 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's 3165 required alignment. 3166 31672005-08-20 Roland McGrath <roland@redhat.com> 3168 3169 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE, 3170 function to choose whether to report. 3171 (dwfl_linux_kernel_report_offline): Likewise. 3172 * libdwfl.h: Update decl. 3173 * argp-std.c (parse_opt): Update caller. 3174 3175 * dwfl_getsrclines.c: New file. 3176 * dwfl_onesrcline.c: New file. 3177 * Makefile.am (libdwfl_a_SOURCES): Add them. 3178 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline. 3179 3180 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak 3181 MODULESDIR[0]. Call fts_close on failure. 3182 3183 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *. 3184 Close ET_REL file descriptors after relocation. 3185 (find_dw): Update caller. 3186 * offline.c (dwfl_report_offline): Get the file into memory and close 3187 the file descriptor. 3188 3189 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when 3190 MOD->debug.elf is already set. 3191 3192 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY. 3193 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR. 3194 3195 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use 3196 dwfl_linux_kernel_report_offline with offline_callbacks. 3197 3198 * linux-kernel-modules.c (report_kernel): New function, broken out of 3199 ... 3200 (dwfl_linux_kernel_report_kernel): ... here. Use it. 3201 (dwfl_linux_kernel_report_offline): New function. 3202 * libdwfl.h: Declare it. 3203 * libdwflP.h: Add INTDECL. 3204 32052005-08-19 Roland McGrath <roland@redhat.com> 3206 3207 Use standard debuginfo search path to look for vmlinux. 3208 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if 3209 passed zero. 3210 * linux-kernel-modules.c (try_kernel_name): New function, broken out 3211 of ... 3212 (dwfl_linux_kernel_report_kernel): ... here. Use it. 3213 3214 * argp-std.c (offline_callbacks): New variable. 3215 (parse_opt): Use it for -e. Allow multiple -e options. 3216 3217 * offline.c: New file. 3218 * Makefile.am (libdwfl_a_SOURCES): Add it. 3219 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline. 3220 * libdwflP.h: Add INTDECLs. 3221 (OFFLINE_REDZONE): New macro. 3222 (struct Dwfl): New member `offline_next_address'. 3223 * dwfl_begin.c (dwfl_begin): Initialize it. 3224 * dwfl_module.c (dwfl_report_begin): Likewise. 3225 3226 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL, 3227 do a nominal absolute section layout starting at BASE. 3228 * libdwfl.h: Update comment. 3229 32302005-08-18 Roland McGrath <roland@redhat.com> 3231 3232 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do 3233 dwfl_module_getdwarf if necessary. 3234 3235 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0. 3236 * libdwfl.h: Update comment. 3237 3238 * derelocate.c: New file. 3239 * Makefile.am (libdwfl_a_SOURCES): Add it. 3240 3241 * libdwflP.h (struct Dwfl_Module): isrel -> e_type. 3242 * dwfl_report_elf.c (dwfl_report_elf): Initialize it. 3243 * dwfl_module_getdwarf.c (open_elf): Update initialization. 3244 (load_dw, dwfl_module_addrname): Update uses. 3245 * relocate.c (__libdwfl_relocate): Likewise. 3246 32472005-08-04 Roland McGrath <roland@redhat.com> 3248 3249 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional 3250 arguments SHNDX, SHDR. 3251 (dwfl_linux_kernel_module_section_address): Update prototype. 3252 * relocate.c (__libdwfl_relocate_value): Update caller. 3253 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address): 3254 Take the new arguments. 3255 32562005-08-10 Roland McGrath <roland@redhat.com> 3257 3258 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE, 3259 use it instead of MOD->debug.file. 3260 * libdwflP.h: Update decl. 3261 * dwfl_module_getdwarf.c (load_dw): Update caller. 3262 Fixes bug #165598. 3263 32642005-08-09 Roland McGrath <roland@redhat.com> 3265 3266 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs. 3267 * cu.c: Use INTUSE on dwarf_* calls. 3268 * dwfl_error.c: Likewise. 3269 * dwfl_module.c: Likewise. 3270 * dwfl_module_getdwarf.c: Likewise. 3271 * dwfl_module_getsrc_file.c: Likewise. 3272 * lines.c: Likewise. 3273 32742005-08-07 Roland McGrath <roland@redhat.com> 3275 3276 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module 3277 names contain '_' or '-', look for files named either "foo-bar.ko" 3278 or "foo_bar.ko". 3279 32802005-07-29 Roland McGrath <roland@redhat.com> 3281 3282 * loc2c.c: File removed. 3283 * loc2c.h: File removed. 3284 * loc2c-runtime.h: File removed. 3285 * test2.c: File removed. 3286 * Makefile.am (EXTRA_DIST): Variable removed. 3287 (noinst_HEADERS): Remove loc2c.h from here. 3288 32892005-07-28 Ulrich Drepper <drepper@redhat.com> 3290 3291 * libdwfl.h: Add a few missing extern for function prototypes. 3292 3293 * libdwfl_crc32.c: New file. 3294 * libdwfl_crc32_file.c: New file. 3295 * libdwflP.h: Declare the new functions. 3296 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and 3297 libdwfl_crc32_file.c. 3298 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file 3299 instead of crc32_file. 3300 33012005-07-28 Roland McGrath <roland@redhat.com> 3302 3303 * ptest.c: Moved to ../tests/dwflmodtest.c. 3304 3305 * Makefile.am (noinst_PROGRAMS): Variable removed. 3306 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise. 3307 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise. 3308 (libdwfl): Don't use libdwfl.so any more. 3309 (libdwfl.so, install, uninstall): Targets removed. 3310 (test2_SOURCES): Define EXTRA_DIST instead of this. 3311 * libdwfl.map: File removed. 3312 3313 * libdwfl.h: Use "" for libdw.h #include. 3314 33152005-07-27 Roland McGrath <roland@redhat.com> 3316 3317 * libdwfl.map: Add dwfl_getmodules. 3318 33192005-07-23 Ulrich Drepper <drepper@redhat.com> 3320 3321 * Makefile.am: Fix rules to allow building with mudflap. 3322 33232005-07-21 Roland McGrath <roland@redhat.com> 3324 3325 * Makefile.am (noinst_HEADERS): Add loc2c.c. 3326 3327 * test2.c (main): Check sscanf result to quiet warning. 3328 33292005-07-20 Roland McGrath <roland@redhat.com> 3330 3331 * libdwfl-branch merged, creating this direcotry. 3332