bdfc92f1b7f146cbe8977476732cbc15502419f2
[platform/upstream/elfutils.git] / libdwfl / ChangeLog
1 2016-04-14  Mark Wielaard  <mjw@redhat.com>
2
3         * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Free match
4         on invalid DWARF if we allocated it.
5
6 2016-04-14  Mark Wielaard  <mjw@redhat.com>
7
8         * linux-proc-maps.c (proc_maps_report): Free last_file on bad file
9         mapping.
10
11 2016-03-01  Steven Chamberlain  <steven@pyro.eu.org>
12
13         * linux-pid-attach.c: Removed unused pid_thread_callbacks,
14         pid_thread_detach, pid_detach, pid_set_initial_registers,
15         pid_memory_read, pid_getthread, pid_next_thread in #ifndef
16         __linux__ code.
17
18 2016-02-22  Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
19             Mark Wielaard  <mjw@redhat.com>
20
21         * find-debuginfo.c (find_debuginfo_in_path): Remember whether
22         debuglink_file is NULL. Try file basename (without .debug) ofr
23         absolute and relative path if debug_file was NULL.
24         * linux-kernel-modules.c (try_kernel_name): If try_debug is true call
25         dwfl_standard_find_debuginfo with NULL debuglink_file, otherwise with
26         basename of fname.
27
28 2016-02-13  Mark Wielaard  <mjw@redhat.com>
29
30         * linux-proc-maps.c (proc_maps_report): Free last_file when ENOEXEC.
31
32 2016-02-13  Mark Wielaard  <mjw@redhat.com>
33
34         * frame_unwind.c (new_unwound): Check and return unwound.
35         (handle_cfi): Check new_unwound was able to allocate new memory
36         before use. Return DWFL_E_NOMEM otherwise.
37
38 2016-02-11  Mark Wielaard  <mjw@redhat.com>
39
40         * relocate.c (relocate_section): Check result of all gelf_get* calls.
41         (__libdwfl_relocate): Likewise.
42         (__libdwfl_relocate_section): Likewise.
43
44 2016-02-11  Mark Wielaard  <mjw@redhat.com>
45
46         * relocate.c (relocate_section): Check result of gelf_update_* calls.
47
48 2016-01-08  Mark Wielaard  <mjw@redhat.com>
49
50         * libdwfl_a_SOURCES: Unconditionally add gzip.c.
51         * linux-kernel-modules.c (vmlinux_suffixes): We always have at least
52         .gz support.
53         (try_kernel_name): Likewise.
54         (check_suffix): Likewise.
55         * open.c (decompress): Likewise.
56
57 2015-12-18  Mark Wielaard  <mjw@redhat.com>
58
59         * dwfl_module_getdwarf.c (find_symtab): Uncompress symstr, xndx, sym
60         sections and aux_str, aux_xndx and aux_sym sections if necessary.
61         * relocate.c (relocate_getsym): Uncompress symtab and symtab_shndx
62         if necessary.
63         (resolve_symbol): Uncompress strtab section if necessary.
64         (relocate_section): Uncompress the section the relocations apply to
65         if necessary.
66
67 2015-11-18  Chih-Hung Hsieh <chh@google.com>
68
69         * linux-proc-maps.c (proc_maps_report): Move nested function
70         'report' to file scope.
71
72 2015-11-18  Chih-Hung Hsieh <chh@google.com>
73
74         * core-file.c (elf_begin_rand): Move nested function 'fail' to file
75         scope.
76         * core-file.c (dwfl_elf_phdr_memory_callback): Move nested functions
77         'update_end' and 'more' to file scope.
78
79 2015-11-17  Chih-Hung Hsieh <chh@google.com>
80
81         * link_map.c (auxv_format_probe): Move nested functions
82         check64 and check32 to file scope.
83
84 2015-12-08  Jose E. Marchesi  <jose.marchesi@oracle.com>
85
86         * dwfl_frame.c (state_fetch_pc): Add a backend-defined offset to
87         the value of the return address register as defined by the CFI
88         abi.
89         * frame_unwind.c (handle_cfi): Likewise.
90
91 2015-12-01  Mark Wielaard  <mjw@redhat.com>
92
93         * link_map.c (dwfl_link_map_report): Track whether in.d_buf comes
94         from exec or memory_callback, free as appropriate.
95
96 2015-12-01  Mark Wielaard  <mjw@redhat.com>
97
98         * libdwflP.h (struct Dwfl_User_Core): New.
99         (struct DWfl): Replace executable_for_core with user_core.
100         * argp-std.c (parse_opt): Store core and fd in Dwfl user_core.
101         * core-file.c (dwfl_core_file_report): Check and store
102         executable_for_core in Dwfl user_core.
103         * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Check and use
104         executable_for_core in Dwfl user_core.
105         * dwfl_end.c (dwfl_end): Release resources held in Dwfl user_core.
106         * link-map.c (report_r_debug): Check executable_for_core in Dwfl
107         user_core.
108         (dwfl_link_map_report): Likewise.
109
110 2015-11-16  Chih-Hung Hsieh <chh@google.com>
111
112         * dwfl_module_getdwarf.c (find_prelink_address_sync): Move nested
113         function 'consider_shdr' to file scope.
114         * dwfl_module_getdwarf.c (find_dynsym): Move nested function
115         'translate_offs' to file scope.
116
117 2015-11-16  Chih-Hung Hsieh <chh@google.com>
118
119         * dwfl_module_addrsym.c (__libdwfl_addrsym): Move nested functions
120         'same_section', 'binding_value', 'try_sym_value', and 'search_table'
121         to file scope.
122
123 2015-11-19  Mark Wielaard  <mjw@redhat.com>
124
125         * dwfl_module.c (__libdwfl_module_free): Remove Dwfl_Module Ebl from
126         eh_cfi and dwarf_cfi cache if necessary before calling dwarf_end and
127         dwarf_cfi_end.
128
129 2015-11-13  Chih-Hung Hsieh <chh@google.com>
130
131         * gzip.c (unzip): Move nested functions to file scope.
132
133 2015-10-21  Chih-Hung Hsieh <chh@google.com>
134             Mark Wielaard  <mjw@redhat.com>
135
136         * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Move nested
137         functions 'dwarf_line_file', 'dwfl_line', and 'dwfl_line_file' to
138         file scope. Rename dwarf_line_file to dwfl_dwarf_line_file. Don't
139         use INTUSE.
140
141 2015-10-21  Chih-Hung Hsieh <chh@google.com>
142
143         * frame_unwind.c (expr_eval): Move nested function 'push' and 'pop'
144         to file scope. Pass used local variables in struct eval_stack.
145
146 2015-10-21  Chih-Hung Hsieh <chh@google.com>
147
148         * dwfl_module.c (dwfl_report_module): Move nested function 'use' to
149         file scope.
150
151 2015-10-09  Josh Stone  <jistone@redhat.com>
152
153         * core-file.c (elf_begin_rand): Replace loff_t with off_t.
154         * open.c (decompress): Replace off64_t with off_t.
155         * gzip.c (unzip): Likewise.
156         * image-header.c (__libdw_image_header): Likewise.
157         * libdwflP.h: Likewise in function declarations.
158         * argp-std.c (parse_opt): Replace open64 with open.
159         * dwfl_build_id_find_elf.c (__libdwfl_open_mod_by_build_id,
160         dwfl_build_id_find_elf): Likewise.
161         * dwfl_module_getdwarf.c (open_elf_file): Likewise.
162         * dwfl_report_elf.c (dwfl_report_elf): Likewise.
163         * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
164         * link_map.c (report_r_debug): Likewise.
165         * offline.c (dwfl_report_offline): Likewise.
166         * linux-proc-maps.c (grovel_auxv, get_pid_class,
167         dwfl_linux_proc_find_elf): Likewise.
168         (read_proc_memory): Replace off64_t with off_t.
169         * find-debuginfo.c (find_debuginfo_in_path): Replace stat64 and
170         fstat64 with stat and fstat.
171         (try_open): Likewise, and replace open64 with open.
172         * linux-kernel-modules.c: Manually define open and fopen to open64 and
173         fopen64 when needed, since the early fts.h include breaks that.
174         (try_kernel_name): Replace open64 with open.
175         (check_notes): Likewise.
176
177 2015-10-09  Jose E. Marchesi  <jose.marchesi@oracle.com>
178
179         * linux-proc-maps.c (read_proc_memory): Use seek+read instead of
180         pread, as the later doesn't accept negative offsets.
181
182 2015-10-07  Mark Wielaard  <mjw@redhat.com>
183
184         * dwfl_module_getdwarf.c (MAX): Removed.
185         (find_prelink_address_sync): Allocate exact amount of bytes for
186         phdrs and shdrs.
187         * dwfl_segment_report_module.c (dwfl_segment_report_module):
188         Likewise for phdrs.
189         * elf-from-memory.c (MAX): Removed.
190         (elf_from_remote_memory): Allocate exact amount of bytes for phdrs.
191
192 2015-10-05  Chih-Hung Hsieh <chh@google.com>
193
194         * dwfl_module_getdwarf.c (find_prelink_address_sync): Do not use
195         union of variable length arrays.
196         * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
197         * elf-from-memory.c (elf_from_remote_memory): Likewise.
198         * link_map.c (auxv_format_probe): Likewise.
199         * link_map.c (report_r_debug): Likewise.
200         * link_map.c (dwfl_link_map_report): Likewise.
201
202 2015-09-18  Chih-Hung Hsieh  <chh@google.com>
203
204         * relocate.c (relocate_section): Move nested function "relocate"
205         to file scope, pass all used local variables as constants.
206         Move nested "check_badreltype" to file scope, pass addresses of
207         updated used local variables.
208         * linux-kernel-modules.c (intuit_kernel_bounds): Move nested function
209         "read_address" to file scope, pass all updated local variables in
210         a state structure.
211         * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Move nested
212         function "subst_name" to file scope, pass all used local variables
213         as constants.
214         * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Replace
215         simple nested function "report" with a macro. Work around gcc static
216         analysis error -Werror=maybe-uninitialized.
217
218 2015-09-22  Mark Wielaard  <mjw@redhat.com>
219
220         * core-file.c: Remove old-style function definitions.
221         * dwfl_error.c: Likewise.
222         * dwfl_module_dwarf_cfi.c: Likewise.
223         * dwfl_module_eh_cfi.c: Likewise.
224         * dwfl_module_register_names.c: Likewise.
225         * dwfl_module_return_value_location.c: Likewise.
226         * dwfl_version.c: Likewise.
227
228 2015-09-09  Chih-Hung Hsieh  <chh@google.com>
229             Mark Wielaard  <mjw@redhat.com>
230
231         * dwfl_frame.c (dwfl_attach_state): Remove redundant NULL tests
232         on parameters declared with __nonnull_attribute__.
233         * libdwfl.h (dwfl_module_getelf): Don't mark first argument as
234         nonnull.
235
236 2015-09-08  Mark Wielaard  <mjw@redhat.com>
237
238         * libdwflP.h (struct __libdwfl_pid_arg): Add elf and elf_fd.
239         * linux-pid-attach.c (pid_detach): Call elf_end and close.
240         (dwfl_linux_proc_attach): Open and save /proc/PID/exe.
241
242 2015-09-04  Chih-Hung Hsieh  <chh@google.com
243
244         * frame_unwind.c (expr_eval): Use llabs instead of abs.
245
246 2015-08-14  Dodji Seketeli  <dodji@seketeli.org>
247
248         * find-debuginfo.c (find_debuginfo_in_path): Try to locate the
249         debug info file named debuglink_file under
250         mod->dwfl->callbacks->debuginfo_path, by looking at
251         the set of sub-trees under mod->dwfl->callbacks->debuginfo_path
252         which is common to the set of non-absolute parent trees of
253         file_name.
254
255 2015-06-18  Mark Wielaard  <mjw@redhat.com>
256
257         * find-debuginfo.c (try_open): Free fname on all failure paths.
258
259 2015-06-18  Mark Wielaard  <mjw@redhat.com>
260
261         * dwfl_module_getdwarf.c (find_symtab): Check shdr is not NULL and
262         sh_entsize is not zero.
263
264 2015-06-06  Mark Wielaard  <mjw@redhat.com>
265
266         * find-debuginfo.c (find_debuginfo_in_path): Always free localpath,
267         localname and file_dirname.
268
269 2015-06-06  Mark Wielaard  <mjw@redhat.com>
270
271         * derelocate.c (cache_sections): Free sortrefs.
272
273 2015-06-05  Mark Wielaard  <mjw@redhat.com>
274
275         * dwfl_segment_report_module.c (dwfl_segment_report_module):
276         If the note_file exists, but the build_id doesn't match discard
277         the file and continue reporting.
278
279 2015-06-01  Mark Wielaard  <mjw@redhat.com>
280
281         * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Copy path
282         pointer before passing to strsep.
283
284 2015-05-30  Mark Wielaard  <mjw@redhat.com>
285
286         * link_map.c (check32): Use read_4ubyte_unaligned_noncvt to read
287         type and value.
288         (read_addrs): Use read_(4|8)ubyte_unaligned_noncvt or to read
289         adresses.
290
291 2015-05-30  Mark Wielaard  <mjw@redhat.com>
292
293         * find-debuginfo.c (dwfl_standard_find_debuginfo): Check file_name is
294         not NULL before calling canonicalize_file_name.
295
296 2015-05-24  Mark Wielaard  <mjw@redhat.com>
297
298         * derelocate.c (check_module): Check mod is not NULL.
299
300 2015-05-22  Mark Wielaard  <mjw@redhat.com>
301
302         * link_map.c (dwfl_link_map_report): Allocate phdrs and dyn with
303         malloc instead of stack allocating. Call free when done with data.
304
305 2015-05-22  Mark Wielaard  <mjw@redhat.com>
306
307         * dwfl_segment_report_module.c (dwfl_segment_report_module):
308         Allocate phdrs with malloc, not on stack. free in finish.
309         Allocate dyn with malloc, not on stack, free after use.
310
311 2015-05-22  Mark Wielaard  <mjw@redhat.com>
312
313         * find-debuginfo.c (find_debuginfo_in_path): malloc or strdup,
314         instead of alloca or strdupa, local strings of unknown size.
315         Call free before return.
316
317 2015-05-22  Mark Wielaard  <mjw@redhat.com>
318
319         * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Return
320         error when id_len too small or too large. strdup, not strdupa,
321         and free path when done.
322
323 2015-05-19  Mark Wielaard  <mjw@redhat.com>
324
325         * elf-from-memory.c (elf_from_remote_memory): Don't allocate all
326         phdrs on the stack. Allocate with malloc and free when done.
327
328 2015-05-19  Mark Wielaard  <mjw@redhat.com>
329
330         * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): malloc and
331         free alternate_name.
332
333 2015-05-19  Mark Wielaard  <mjw@redhat.com>
334
335         * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't
336         stack allocate name. Only change chars up to suffix.
337
338 2015-05-18  Mark Wielaard  <mjw@redhat.com>
339
340         * dwfl_module_getdwarf.c (find_prelink_address_sync): Allocate
341         phdrs and shdrs unions with malloc, not alloca. Free after use.
342
343 2015-05-18  Mark Wielaard  <mjw@redhat.com>
344
345         * derelocate.c (cache_sections): Allocate temporary newrefs and
346         sortrefs with malloc, not alloca. Always free them on return.
347
348 2015-05-07  Mark Wielaard  <mjw@redhat.com>
349
350         * cu.c (intern_cu): Check for EOF and check cuoff points to a real
351         Dwarf_Die before interning. Explicitly check EOF is expected.
352
353 2015-05-05  Mark Wielaard  <mjw@redhat.com>
354
355         * dwfl_lineinfo.c (dwfl_lineinfo): Check info->file is valid.
356
357 2015-05-06  Roland McGrath  <roland@hack.frob.com>
358
359         * dwfl_error.c (struct msgtable): Break type definition out of
360         the 'msgtable' initializer.
361         (msgtable): Make it a union of struct msgtable and a char array.
362         (msgstr): Use the full-table char array rather than the msg_0 entry.
363
364 2015-04-23  Max Filippov  <jcmvbkbc@gmail.com>
365
366         * core-file.c (_compat_without_executable_dwfl_core_file_report):
367         Guard with SYMBOL_VERSIONING.
368         * dwfl_module_build_id.c (_compat_vaddr_at_end_dwfl_module_build_id):
369         Likewise.
370         * dwfl_report_elf.c (_compat_without_add_p_vaddr_dwfl_report_elf):
371         Likewise.
372
373 2015-04-02  Mark Wielaard  <mjw@redhat.com>
374
375         * segment.c (insert): Check correct number of lookup_elts.
376
377 2015-03-31  Mark Wielaard  <mjw@redhat.com>
378
379         * core-file.c (core_file_read_eagerly): Special case small images.
380
381 2015-01-26  Mark Wielaard  <mjw@redhat.com>
382
383         * dwfl_module_getdwarf.c (find_symtab): Explicitly clear symdata,
384         syments and first_global on elferr before calling find_dynsym.
385
386 2014-12-27  Mark Wielaard  <mjw@redhat.com>
387
388         * dwfl_module_getsrc.c (dwfl_module_getsrc): Never match a line that
389         has end_sequence set.
390
391 2015-01-04  Mark Wielaard  <mjw@redhat.com>
392
393         * cu.c (intern_cu): Store result and return directly when finding
394         EOF marker.
395         (__libdwfl_nextcu): Check *nextp as returned by intern_cu isn't -1.
396
397 2014-12-19  Mark Wielaard  <mjw@redhat.com>
398
399         * dwfl_module_getdwarf.c (find_symtab): Always try find_dynsym last.
400
401 2014-12-19  Mark Wielaard  <mjw@redhat.com>
402
403         * elf-from-memory.c (handle_segment): Remove palign sanity check.
404
405 2014-12-18  Mark Wielaard  <mjw@redhat.com>
406
407         * relocate.c (resolve_symbol): Make sure symstrdata->d_buf != NULL.
408
409 2014-12-13  Mark Wielaard  <mjw@redhat.com>
410
411         * dwfl_module_getdwarf.c (find_dynsym): elf_getdata_rawchunk takes
412         a size_t, make sure it doesn't overflow.
413
414 2014-12-13  Mark Wielaard  <mjw@redhat.com>
415
416         * cu.c (cudie_offset): Make sure Dwarf_Off difference doesn't
417         wrap around before returning as int.
418
419 2014-12-11  Josh Stone  <jistone@redhat.com>
420
421         * dwfl_module_getsrc.c (dwfl_module_getsrc): Return the *last* line
422         record <= addr, rather than returning immediately on matches.
423
424 2014-12-09  Mark Wielaard  <mjw@redhat.com>
425
426         * dwfl_segment_report_module.c (handle_file_note): Check count doesn't
427         overflow.
428
429 2014-12-07  Mark Wielaard  <mjw@redhat.com>
430
431         * relocate.c (relocate_section): Sanity check section overlap against
432         actually used ehsize, shentsize and phentsize.
433
434 2014-12-07  Mark Wielaard  <mjw@redhat.com>
435
436         * offline.c (dwfl_offline_section_address): Assert shndx is not zero.
437         * relocate.c (__libdwfl_relocate_value): Don't relocate against
438         section zero.
439
440 2014-11-29  Mark Wielaard  <mjw@redhat.com>
441
442         * relocate.c (relocate_section): Check relocation section and target
443         section data don't overlap any of the ELF headers.
444         (relocate): Check for offset + size overflow.
445
446 2014-11-22  Mark Wielaard  <mjw@redhat.com>
447
448         * link_map.c (consider_executable): Use elf_getphdrnum.
449         (dwfl_link_map_report): Likewise.
450
451 2014-11-18  Mark Wielaard  <mjw@redhat.com>
452
453         * dwfl_module_getdwarf.c (find_symtab): Sanity check the data buffer,
454         number of symbols and first_global before use.
455
456 2014-11-14  Mark Wielaard  <mjw@redhat.com>
457
458         * dwfl_module_getdwarf.c (load_symtab): Don't use tables which have
459         a zero sh_entsize.
460
461 2014-11-10  Mark Wielaard  <mjw@redhat.com>
462
463         * dwfl_module_getdwarf.c (find_dynsym): New inner function
464         translate_offs that takes an adjust argument. Try finding
465         the symbol table with and without adjusting to main_bias.
466
467 2014-09-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
468
469         Support NT_FILE for locating files.
470         * core-file.c (dwfl_core_file_report): New variables note_file and
471         note_file_size, set them and pass them to dwfl_segment_report_module.
472         * dwfl_segment_report_module.c: Include common.h and fcntl.h.
473         (buf_has_data, buf_read_ulong, handle_file_note): New functions.
474         (invalid_elf): New function from code of dwfl_segment_report_module.
475         (dwfl_segment_report_module): Add parameters note_file and
476         note_file_size.  New variables elf and fd, clean them up in finish.
477         Move some code to invalid_elf.  Call handle_file_note, if it found
478         a name verify the file by invalid_elf.  Protect elf and fd against
479         cleanup by finish if we found the file for new Dwfl_Module.
480         * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and
481         note_file_size.
482
483 2014-09-23  Mark Wielaard  <mjw@redhat.com>
484
485         * dwfl_segment_report_module.c (dwfl_segment_report_module):
486         Extract ei_class, ei_data and e_type early and use the result.
487
488 2014-09-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
489
490         * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Use IS_EXECUTABLE.
491         * dwfl_segment_report_module.c (dwfl_segment_report_module): Set
492         IS_EXECUTABLE.
493         * libdwflP.h (struct Dwfl_Module): New field is_executable.
494
495 2014-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
496
497         * dwfl_module_getdwarf.c (find_offsets): Add parameter main_bias, use
498         it.
499         (find_dynsym): Pass the new parameter main_bias.
500
501 2014-08-14  Mark Wielaard  <mjw@redhat.com>
502
503         * linux-kernel-modules.c (check-suffix): Also TRY .ko.xz.
504
505 2014-07-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
506
507         Fix report_r_debug for prelinked libraries.
508         * link_map.c (report_r_debug): Comment out variable l_addr.
509         Use instead new variable base recalculated from l_ld.
510
511 2014-06-24  Kurt Roeckx  <kurt@roeckx.be>
512
513         * linux-pid-attach.c: Make it build on non linux hosts.
514
515 2014-06-17  Mark Wielaard  <mjw@redhat.com>
516
517         * frame_unwind.c (handle_cfi): Use ebl_func_addr_mask.
518         * dwfl_module_getsym.c (__libdwfl_getsym): Likewise.
519
520 2014-06-15  Mark Wielaard  <mjw@redhat.com>
521
522         * linux-core-attach.c (core_memory_read): Use libdw/memory-access.h
523         macros read_4ubyte_unaligned_noncvt and read_8ubyte_unaligned_noncvt
524         to read possibly unaligned data.
525         (core_next_thread): Likewise.
526         (core_set_initial_registers): Likewise.
527         (dwfl_core_file_attach): Likewise.
528
529 2014-06-11  Mark Wielaard  <mjw@redhat.com>
530
531         * dwfl_frame.c (__libdwfl_process_free): Reset dwfl->attacherr.
532         (dwfl_attach_state): Set dwfl->attacherr.
533         (dwfl_pid): Check and return dwfl->attacherr if set.
534         (dwfl_getthreads): Likewise.
535         (getthread): Likewise.
536         * libdwflP.h: Add DWFL_E_NO_CORE_FILE.
537         (struct Dwfl): Add attacherr field.
538         * linux-core-attach.c (dwfl_core_file_attach): Set dwfl->attacherr.
539         Don't assert if ELF file is not ET_CORE, just return error.
540         * linux-pid-attach.c (dwfl_linux_proc_attach): Set dwfl->attacherr.
541
542 2014-06-10  Mark Wielaard  <mjw@redhat.com>
543
544         * argp-std.c (parse_opt): Ignore errors from dwfl_core_file_attach
545         or dwfl_linux_proc_attach.
546
547 2014-05-15  Mark Wielaard  <mjw@redhat.com>
548
549         * linux-proc-maps.c (grovel_auxv): Close fd on error.
550
551 2014-05-02  Mark Wielaard  <mjw@redhat.com>
552
553         * dwfl_module_getdwarf: Remove ENABLE_DWZ ifdefs so find_debug_altlink
554         is always called.
555
556 2014-05-01  Mark Wielaard  <mjw@redhat.com>
557
558         * libdwflP.h (struct Dwfl_Module): Add alt, alt_fd and alt_elf fields.
559         (__libdwfl_open_mod_by_build_id): Renamed __libdwfl_open_by_build_id.
560         (__libdwfl_open_by_build_id): New declaration that takes an explicit
561         build-id.
562         * dwfl_build_id_find_debuginfo.c (dwfl_build_id_find_debuginfo): If
563         we already have the Dwarf then look for the alt dwz multi file by
564         build-id.
565         * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Add the
566         build-id we are looking for as argument.
567         (__libdwfl_open_mod_by_build_id): New function, calls
568         __libdwfl_open_by_build_id.
569         (dwfl_build_id_find_elf): Call __libdwfl_open_mod_by_build_id.
570         * dwfl_module.c (__libdwfl_module_free): Release alt, alt_elf and
571         close alt_fd if necessary.
572         * dwfl_module_getdwarf.c (__check_build_id): Removed.
573         (try_debugaltlink): Removed.
574         (open_debugaltlink): Removed.
575         (open_elf_file): First half of open_elf that just opens the elf
576         file but doesn't setup the load address.
577         (open_elf): Call open_elf_file.
578         (find_debug_altlink): New function.
579         (load_dw): Remove loading of dwz multifile.
580         (find_dw): Call find_debug_altlink.
581         * find-debuginfo.c (validate): Handle alt debug case using
582         dwelf_dwarf_gnu_debugaltlink and mod->alt_elf.
583         (find_debuginfo_in_path): Handle alt debug files possibly in .dwz
584         subdirs.
585         * linux-kernel-modules.c (try_kernel_name): Use fakemod.debug.name
586         to store name to find by dwfl_standard_find_debuginfo instead of
587         allocating an extra variable on stack.
588
589 2014-04-30  Mark Wielaard  <mjw@redhat.com>
590
591         * dwfl_module_build_id.c (__libdwfl_find_elf_build_id): Moved to
592         dwelf_elf_gnu_build_id.c.
593         (__libdwfl_find_build_id): Add assert to make sure mod is never NULL.
594         * dwfl_segment_report_module.c (dwfl_segment_report_module): Call
595         dwelf_elf_gnu_build_id directly instead of __libdwfl_find_build_id.
596         * dwfl_module_getdwarf.c (__check_build_id): Implement using
597         dwelf_elf_gnu_build_id.
598
599 2014-04-15  Florian Weimer  <fweimer@redhat.com>
600
601         * dwfl_module_getdwarf.c (__check_build_id): Moved from libdw.
602         (try_debugaltlink): Likewise.
603         (open_debugaltlink): Likewise.
604         (load_dw): Locate alternate debug information using
605         dwelf_dwarf_gnu_debugaltlink and call open_debugaltlink.
606
607 2014-04-11  Mark Wielaard  <mjw@redhat.com>
608
609         * Makefile.am (AM_CPPFLAGS): Add libdwelf.
610         * libdwflP.h: Include libdwelfP.h.
611         * dwfl_module_getdwarf.c (find_debuglink): Moved to libdwelf.
612         (find_debuginfo): Use dwelf_elf_gnu_debuglink.
613
614 2014-04-22  Mark Wielaard  <mjw@redhat.com>
615
616         * frame_unwind.c (__libdwfl_frame_reg_get): Use uint64_t when
617         checking bits.
618         (__libdwfl_frame_reg_set): Likewise.
619
620 2014-04-22  Kurt Roeckx  <kurt@roeckx.be>
621
622         * linux-pid-attach.c: Make linux only.
623
624 2014-03-14  Mark Wielaard  <mjw@redhat.com>
625
626         * Makefile.am: Remove !MUDFLAP and MUDFLAP conditions.
627         Remove libelf and libdw definitions when MUDFLAP is defined.
628         * argp-std.c (__libdwfl_argp_mudflap_options): Removed.
629
630 2014-03-03  Mark Wielaard  <mjw@redhat.com>
631
632         * elf-from-memory.c (elf_from_remote_memory): Keep track of
633         segments_end_mem. Pass memsz to first handle_segment pass. Only
634         extend contents_size and use shdrs if only file bits are in
635         segment.
636
637 2014-03-11  Josh Stone  <jistone@redhat.com>
638
639         * dwfl_module_getdwarf.c (open_elf): Only explicitly set
640         mod->e_type when processing the main ELF file.
641
642 2014-03-04  Mark Wielaard  <mjw@redhat.com>
643
644         * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from
645         linux-pid-attach.c (struct pid_arg).
646         (__libdwfl_get_pid_arg): New internal function declaration.
647         (__libdwfl_ptrace_attach): Likewise.
648         (__libdwfl_ptrace_detach): Likewise.
649         * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the
650         special exception modules that cannot be checked at this point.
651         * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h
652         (ptrace_attach): Renamed to...
653         (__libdwfl_ptrace_attach): New internal function.
654         (__libdwfl_ptrace_detach): Likewise. Extracted from ...
655         (pid_thread_detach): Call __libdwfl_ptrace_detach now.
656         (__libdwfl_get_pid_arg): New internal function.
657         * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special
658         module name contains "(deleted)" and dwfl_pid gives an attached
659         pid. If pid is set and try to (re)use ptrace attach state of
660         process before reading memory.
661
662 2014-03-03  Mark Wielaard  <mjw@redhat.com>
663
664         * elf-from-memory.c (elf_from_remote_memory): Take pagesize as
665         argument. Free buffer when detecting bad elf. Check PT_LOAD
666         alignment requirements on first handle_segment pass. Calculate
667         loadbase, start and end of segment using pagesize, not p_align.
668         * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize
669         to elf_from_remote_memory.
670
671 2014-02-26  Mark Wielaard  <mjw@redhat.com>
672
673         * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
674
675 2014-02-26  Mark Wielaard  <mjw@redhat.com>
676
677         * elf-from-memory.c (elf_from_remote_memory): Check against p64
678         p_type in case ELFCLASS64, not against p32 p_type.
679
680 2014-01-17  Petr Machata  <pmachata@redhat.com>
681
682         * relocate.c (relocate_section): Use gelf_fsize instead of relying
683         on shdr->sh_entsize.
684
685 2014-01-05  Mark Wielaard  <mjw@redhat.com>
686
687         * frame_unwind.c (handle_cfi): Only skip resetting return register
688         if the regno is not the actual CIE return address register.
689
690 2014-01-02  Mark Wielaard  <mjw@redhat.com>
691
692         * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi.
693
694 2013-12-30  Mark Wielaard  <mjw@redhat.com>
695
696         * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and
697         dwfl_core_file_attach explicitly.
698         * core-file.c (dwfl_core_file_report): Don't call
699         __libdwfl_attach_state_for_core implicitly.
700         * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error.
701         * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not
702         process_attach_error.
703         (dwfl_getthreads): Likewise.
704         (getthread): Likewise.
705         * libdwfl.h (dwfl_core_file_report): Update documentation.
706         (dwfl_linux_proc_report): Likewise.
707         (dwfl_core_file_attach): New function declaration.
708         (dwfl_linux_proc_attach): Likewise.
709         * libdwflP.h (struct Dwfl): Remove process_attach_error.
710         (__libdwfl_attach_state_for_pid): Removed declaration.
711         (__libdwfl_attach_state_for_core): Likewise.
712         (dwfl_core_file_attach): New internal declaration.
713         (dwfl_linux_proc_attach): Likewise.
714         (attach_state_for_core): Renamed to...
715         (dwfl_core_file_attach): ...this. Change return type.
716         (__libdwfl_attach_state_for_core): Removed.
717         * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped.
718         (pid_set_initial_registers): Check assume_ptrace_stopped before
719         calling ptrace.
720         (pid_thread_detach): Likewise.
721         (__libdwfl_attach_state_for_pid): Renamed to...
722         (dwfl_linux_proc_attach): ...this. Adjust return type.
723         * linux-proc-maps.c (dwfl_linux_proc_report): Don't call
724         __libdwfl_attach_state_for_pid implicitly.
725
726 2013-12-28  Mark Wielaard  <mjw@redhat.com>
727
728         * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special
729         character device files, only regular files.
730
731 2013-12-24  Mark Wielaard  <mjw@redhat.com>
732
733         * linux-core-attach.c (core_next_thread): Check whether thread_argp
734         is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
735         in that case. Free thread_arg if there are no more threads.
736
737 2013-12-23  Mark Wielaard  <mjw@redhat.com>
738
739         * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
740         build_id before returning early.
741
742 2013-12-23  Mark Wielaard  <mjw@redhat.com>
743
744         * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
745         pid (thread group leader) to dwfl_attach_state.
746
747 2013-12-21  Mark Wielaard  <mjw@redhat.com>
748
749         * frame_unwind.c (handle_cfi): Track whether the return register
750         has been set and only allow it to be set once.
751
752 2013-12-20  Mark Wielaard  <mjw@redhat.com>
753
754         * dwfl_frame.c (one_arg): New struct.
755         (get_one_thread_cb): New function.
756         (dwfl_getthread): Likewise.
757         (one_thread): New struct.
758         (get_one_thread_frames_cb): New function.
759         (dwfl_getthread_frames): Likewise.
760         * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
761         (dwfl_getthread_frames): Likewise.
762         * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
763         * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
764         to NULL.
765         * linux-pid-attach.c (pid_getthread): New function.
766         (pid_thread_callbacks): Initialize get_thread to pid_getthread.
767
768 2013-12-20  Mark Wielaard  <mjw@redhat.com>
769
770         * linux-kernel-modules.c (report_kernel_archive): Correct nested
771         asprintf result check for debug.a.
772
773 2013-12-18  Mark Wielaard  <mjw@redhat.com>
774
775         * derelocate.c (__libdwfl_find_section_ndx): New internal function.
776         * dwfl_module_addrname.c (dwfl_module_addrname): Use
777         dwfl_module_addrinfo.
778         * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
779         (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
780         for comparisons, not st_value. Fill in off. Search for both value
781         and the (adjusted) sym.st_value when different.
782         (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
783         (dwfl_module_addrinfo): New function.
784         * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
785         (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
786         and possible. Adjust sym->st_value only when requested. Fill in addr
787         if available.
788         (dwfl_module_getsym_info): New function.
789         (dwfl_module_getsym): Use __libdwfl_getsym.
790         * libdwfl.h (dwfl_module_getsym_elf): Removed.
791         (dwfl_module_getsym_info): New function declaration.
792         (dwfl_module_addrinfo): Likewise.
793         (dwfl_module_addrsym): Add documentation describing differences
794         with addrinfo variants.
795         (dwfl_module_addrsym_elf): Removed.
796         * libdwflP.h (__libdwfl_getsym): New internal function declaration.
797         (__libdwfl_addrsym): Likewise.
798         (__libdwfl_find_section_ndx): Likewise.
799         (dwfl_module_addrinfo): New internal declaration.
800         (dwfl_module_getsym_info): Likewise.
801         (dwfl_module_addrsym_elf): Removed.
802         (dwfl_module_getsym_elf): Likewise.
803
804 2013-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
805
806         * argp-std.c (offline_find_elf): Remove.
807         (offline_callbacks): Use dwfl_build_id_find_elf instead.
808         * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
809         removed above.
810
811 2013-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
812
813         unwinder: s390 and s390x
814         * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
815         * frame_unwind.c (new_unwound): New function from ...
816         (handle_cfi): ... here.  Call it.
817         (setfunc, getfunc, readfunc): New functions.
818         (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
819         * linux-core-attach.c (core_set_initial_registers): Always iterate
820         through the Ebl_Register_Location loop.  Call
821         dwfl_thread_state_register_pc there.
822
823 2013-12-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
824
825         * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
826
827 2013-12-17  Mark Wielaard  <mjw@redhat.com>
828
829         * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
830         traversal.
831
832 2013-12-16  Mark Wielaard  <mjw@redhat.com>
833
834         * libdwfl.h (dwfl_module_getsymtab_first_global): New function
835         definition.
836         * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
837         function.
838         * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
839         function definition.
840         * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
841
842 2013-12-14  Mark Wielaard  <mjw@redhat.com>
843
844         * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
845         allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
846         * frame_unwind.c (handle_cfi): Free frame result from
847         dwarf_cfi_addrframe when done.
848
849 2013-12-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
850
851         unwinder: ppc and ppc64
852         * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
853         Call ebl_dwarf_to_regno.
854         * linux-core-attach.c (core_set_initial_registers): Implement
855         pc_register support.
856         * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
857         FIRSTREG -1.
858
859 2013-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
860
861         Introduce process_attach_error.
862         * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
863         * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
864         PROCESS is NULL.
865         * libdwflP.h (struct Dwfl): New field process_attach_error.
866         * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
867         (attach_state_for_core): ... here, make it static, change return type,
868         no longer use __libdwfl_seterrno.
869         (__libdwfl_attach_state_for_core): New wrapper for it.
870
871 2013-11-27  Mark Wielaard  <mjw@redhat.com>
872
873         * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
874         (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
875         keep track of symelf, addr_symelf, closest_elf and sizeless_elf
876         instead of tracking dwfl_files.
877         * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
878         (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
879         new elfp and biasp arguments. Track elf instead of file.
880         (dwfl_module_getsym): Call dwfl_module_getsym_elf.
881         dwfl_module_info.c (dwfl_module_info): Pass elf to
882         dwfl_adjusted_st_value.
883         * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
884         (dwfl_module_getsym_elf): New function declaration.
885         (dwfl_module_addrsym_elf): Likewise.
886         * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
887         (dwfl_module_getsym_elf): Likewise.
888         (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
889         (dwfl_deadjust_st_value): Likewise.
890         (__libdwfl_module_getsym): Removed.
891         * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
892
893 2013-11-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
894
895         Fix non-build-id core files on build-id system.
896         * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
897         be read from memory.
898
899 2013-11-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
900
901         * dwfl_segment_report_module.c (dwfl_segment_report_module): New
902         variable close_elf.  Call __libdwfl_find_elf_build_id and compare the
903         content, if possible.
904
905 2013-11-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
906
907         link_map: Use proper bias, not l_addr.
908         * core-file.c (dynamic_vaddr_get): Rename to ...
909         (__libdwfl_dynamic_vaddr_get): ... here, make it global,
910         internal_function.
911         (dwfl_core_file_report): Update name in the caller.
912         * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
913         * link_map.c (report_r_debug): New variable elf_dynamic_vaddr.  Call
914         __libdwfl_dynamic_vaddr_get for it.  Remove L_ADDR FIXME comment.
915         Use ELF_DYNAMIC_VADDR instead of L_ADDR.
916
917 2013-11-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
918
919         Compatibility with older kernels such as RHEL-6.
920         * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
921         (ptrace_attach): New parameter tid_was_stoppedp.  Set it.
922         (pid_set_initial_registers): Pass tid_was_stopped.
923         (pid_thread_detach): Use tid_was_stopped.
924
925 2013-11-18  Josh Stone  <jistone@redhat.com>
926
927         * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
928         (find_aux_sym): Use it.
929
930 2013-11-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
931
932         Code cleanup: Remove const in prototype
933         * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
934         firstreg.
935         * libdwfl.h (dwfl_thread_state_registers): Likewise.
936         * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
937
938 2013-11-14  Jan Kratochvil  <jan.kratochvil@redhat.com>
939
940         Fix dwfl_attach_state machine->elf.
941         * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
942         Call ebl_openbackend instead of ebl_openbackend_machine.
943         * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
944         Update the function description.
945         * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
946         dwfl_attach_state.
947         * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
948         dwfl_attach_state.
949
950 2013-11-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
951
952         Provide __libdwfl_module_getsym to get dwfl_file *.
953         * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
954         (dwfl_module_addrsym) (search_table): New variable file.  Use
955         __libdwfl_module_getsym.  Use file.
956         * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
957         (__libdwfl_module_getsym): ... here.  Add parameter filep.  Set it.
958         (dwfl_module_getsym): New wrapper.
959         * libdwflP.h (__libdwfl_module_getsym): New declaration.
960
961 2013-11-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
962
963         Fix dwfl_module_addrsym for minidebuginfo.
964         * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
965         addr_symfile.
966         (dwfl_module_addrsym) (same_section): Use it.
967         (dwfl_module_addrsym) (i_to_symfile): New function.
968         (dwfl_module_addrsym) (search_table): Use it.
969
970 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
971             Mark Wielaard  <mjw@redhat.com>
972
973         * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
974         dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
975         dwfl_frame_regs.c.
976         * core-file.c (dwfl_core_file_report): Call
977         __libdwfl_attach_state_for_core.
978         * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
979         * dwfl_frame.c: New file.
980         * frame_unwind.c: New file.
981         * dwfl_frame_pc.c: New file.
982         * linux-pid-attach.c: New file.
983         * linux-core-attach.c: New file.
984         * dwfl_frame_regs.c: New file.
985         * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
986         (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
987         (Dwfl_Thread_Callbacks): New definition.
988         (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
989         (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
990         (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
991         (dwfl_frame_pc): New declarations.
992         * libdwflP.h (Dwfl_Process): New typedef.
993         (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
994         (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
995         (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
996         (INVALID_ARGUMENT): New DWFL_ERROR entries.
997         (struct Dwfl): New entry process.
998         (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
999         (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
1000         (__libdwfl_process_free, __libdwfl_frame_unwind)
1001         (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
1002         (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
1003         (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
1004         (dwfl_frame_thread, dwfl_thread_state_registers)
1005         (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
1006         (dwfl_frame_pc): New INTDECL entries.
1007         * linux-proc-maps.c (dwfl_linux_proc_report): Call
1008         __libdwfl_attach_state_for_pid.
1009         * segment.c (segment_start): Rename to ...
1010         (__libdwfl_segment_start): ... here and make it internal_function.
1011         (segment_end): Rename to ...
1012         (__libdwfl_segment_end): ... here and make it internal_function.
1013         (reify_segments, dwfl_report_segment): Rename them at the callers.
1014
1015 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
1016
1017         * core-file.c (dwfl_core_file_report): Remove the use of MAX.
1018
1019 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
1020
1021         * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
1022         retval.  Fix one forgotten LISTED increase.
1023
1024 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
1025
1026         Fix core files for re-prelink-ed files.
1027         * core-file.c (dynamic_vaddr_get): New function.
1028         (dwfl_core_file_report): New variable file_dynamic_vaddr.  Call
1029         dynamic_vaddr_get instead of using L_ADDR.
1030         * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
1031         * link_map.c (report_r_debug): Do not initialize l_addr.
1032
1033 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
1034
1035         Code cleanup.
1036         * core-file.c (dwfl_core_file_report): Reindent block of code by
1037         continue keyword.
1038
1039 2013-10-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
1040
1041         * argp-std.c (parse_opt): Use executable parameter of
1042         dwfl_core_file_report.
1043         * core-file.c (dwfl_core_file_report): Add parameter executable.  Set
1044         it to DWFL.  Add NEW_VERSION for it.
1045         (_compat_without_executable_dwfl_core_file_report): New.  Twice.
1046         * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
1047         the function comment.
1048
1049 2013-10-15  Mark Wielaard  <mjw@redhat.com>
1050
1051         * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
1052         mappings.
1053         (dwfl_linux_proc_find_elf): Don't abort, just return failure.
1054
1055 2013-09-12  Mark Wielaard  <mjw@redhat.com>
1056
1057         * cu.c (intern_cu): If dwarf_offdie fails free cu.
1058
1059 2013-09-12  Mark Wielaard  <mjw@redhat.com>
1060
1061         * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
1062         bad_report.
1063
1064 2013-09-12  Mark Wielaard  <mjw@redhat.com>
1065
1066         * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
1067         aux_xndxscn, not xndxscn, for aux_symxndxdata.
1068
1069 2013-08-25  Mark Wielaard  <mjw@redhat.com>
1070
1071         * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
1072         to dwfl_report_elf.
1073
1074 2013-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
1075
1076         * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
1077         conflicts all the modules, not just the first one.  Compare L_LD if it
1078         is equal, not if it is in a module address range.
1079
1080 2013-07-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
1081
1082         * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
1083
1084 2013-07-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
1085
1086         * core-file.c (clear_r_debug_info): Close also ELF and FD.
1087         (dwfl_core_file_report): Call __libdwfl_report_elf for
1088         R_DEBUG_INFO.MODULE.
1089         * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
1090         code of ...
1091         (__libdwfl_report_elf): ... this function.  Call it.
1092         * dwfl_segment_report_module.c: Include unistd.h.
1093         (dwfl_segment_report_module): Use basename for MODULE->NAME.
1094         Clear MODULE if it has no build-id and we have segment with build-id.
1095         Ignore this segment only if MODULE still contains valid ELF.
1096         * libdwflP.h (__libdwfl_elf_address_range): New declaration.
1097         (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
1098         and disk_file_has_build_id.
1099         (dwfl_link_map_report): Extend the comment.
1100         * link_map.c (report_r_debug): Extend the comment.  Always fill in new
1101         r_debug_info_module.  Initialize also the new r_debug_info_module
1102         fields.  Remove one FIXME comment.  Call __libdwfl_elf_address_range
1103         instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
1104
1105 2013-07-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
1106
1107         * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
1108
1109 2013-07-02  Mark Wielaard  <mjw@redhat.com>
1110
1111         * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
1112
1113 2013-06-05  Mark Wielaard  <mjw@redhat.com>
1114
1115         * link_map.c (report_r_debug): Always call release_buffer after
1116         memory_callback succeeded reading build_id.
1117
1118 2013-05-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
1119
1120         * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
1121         executable_for_core before calling dwfl_core_file_report.
1122         * core-file.c (clear_r_debug_info): New function.
1123         (dwfl_core_file_report): Move raw segments reporting lower.  New
1124         variable r_debug_info, pass it to dwfl_segment_report_module.  Call
1125         clear_r_debug_info in the end.  Return sum of LISTED and SNIFFED.
1126         * dwfl_module_build_id.c (check_notes): Move into
1127         __libdwfl_find_elf_build_id.
1128         (__libdwfl_find_build_id): Rename to ...
1129         (__libdwfl_find_elf_build_id): ... here.  Add parameters build_id_bits,
1130         build_id_elfaddr and build_id_len.  Verify MOD vs. ELF.
1131         (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
1132         set, rename data_vaddr to data_elfaddr.  Do not call found_build_id.
1133         (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
1134         adjust its data_elfaddr parameter.
1135         (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
1136         * dwfl_segment_report_module.c (dwfl_segment_report_module): New
1137         parameter r_debug_info.  New variable name_is_final.  Adjust addresses
1138         according to R_DEBUG_INFO->MODULE.  Check conflicts against DWFL.
1139         Do not overwrite NAME by SONAME if NAME_IS_FINAL.
1140         * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
1141         (struct r_debug_info_module, struct r_debug_info): New definitions.
1142         (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
1143         r_debug_info.
1144         * link_map.c: Include fcntl.h.
1145         (report_r_debug): Add parameter r_debug_info, describe it in the
1146         function comment.  Delete dwfl_addrmodule call and its dependent code.
1147         Verify build-id before calling dwfl_report_elf, also supply
1148         executable_for_core to it.  Store r_debug_info->module info when
1149         appropriate.
1150         (dwfl_link_map_report): Add parameter r_debug_info.  New variable
1151         in_ok.  Try to read IN from EXECUTABLE_FOR_CORE.  Update report_r_debug
1152         caller parameters.
1153
1154 2013-04-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
1155
1156         * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
1157         Set it to true for ET_EXEC and ET_CORE.  Provide alternative
1158         setup of START and BIAS if !ADD_P_VADDR.  Set END from BIAS, not BASE.
1159         (dwfl_report_elf): Add parameter add_p_vaddr.  Pass it down.  Add
1160         NEW_VERSION.
1161         (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
1162         COMPAT_VERSION.
1163         * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr.  Describe it.
1164         * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
1165         * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
1166         * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
1167         dwfl_report_elf.
1168         * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
1169
1170 2013-04-27  Mark Wielaard  <mjw@redhat.com>
1171
1172         * link_map.c: #include system.h.
1173
1174 2013-04-26  Jan Kratochvil  <jan.kratochvil@redhat.com>
1175
1176         * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
1177         them to lib/system.h.
1178
1179 2013-04-24  Mark Wielaard  <mjw@redhat.com>
1180
1181         * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
1182
1183 2013-03-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1184
1185         * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
1186
1187 2013-03-12  Mark Wielaard  <mjw@redhat.com>
1188
1189         * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
1190
1191 2013-02-22  Mark Wielaard  <mjw@redhat.com>
1192
1193         * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
1194         as DWFL_E_BADELF when not used.
1195
1196 2013-02-10  Mark Wielaard  <mjw@redhat.com>
1197
1198         * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
1199         failure messages When handling ARGP_KEY_SUCCESS because arg will
1200         not have been set.
1201
1202 2013-01-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
1203
1204         * linux-proc-maps.c: Include system.h.
1205         (PROCEXEFMT, get_pid_class): New.
1206         (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
1207         get_pid_class.
1208
1209 2013-01-23  Mark Wielaard  <mjw@redhat.com>
1210
1211         * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
1212         from aux_syments by default.
1213         (find_symtab): Also succeed when only aux_symdata is found.
1214         When no symtab is found always try to load auxiliary table.
1215         (dwfl_module_getsymtab): Substract one from result when both
1216         tables have symbols.
1217         * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
1218         zero entry when both tables have symbols.
1219         * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
1220         one from first_global when both tables have symbols.
1221
1222 2013-01-16  Mark Wielaard  <mjw@redhat.com>
1223
1224         * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
1225         aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
1226         (dwfl_adjusted_aux_sym_addr): New function.
1227         (dwfl_deadjust_aux_sym_addr): Likewise.
1228         (dwfl_adjusted_st_value): Take and check symfile argument.
1229         (dwfl_deadjust_st_value): Likewise.
1230         * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
1231         use dwfl_file as argument to set address_sync.
1232         (find_debuginfo): Call find_prelink_address_sync with debug file.
1233         (find_aux_sym): New function.
1234         (find_symtab): Use find_aux_sym if all we have is the dynsym table
1235         and fill in aux DwflModule fields.
1236         (dwfl_module_getsymtab): Return syments plus aux_syments.
1237         (load_symtab): Always set first_global.
1238         * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
1239         when using same_section. Calculate first_global based on both
1240         mod->first_global and mod->aux_first_global.
1241         * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
1242         * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
1243         to retrieve symbol and name if necessary, making sure all locals
1244         from any table come before any globals.
1245         * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
1246         with symfile.
1247         * relocate.c (resolve_symbol): Likewise.
1248
1249 2013-01-07  Roland McGrath  <roland@hack.frob.com>
1250
1251         * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
1252         still assume the data is at least 32-bit aligned anyway.
1253         (dwfl_link_map_report): Handle unaligned auxv data.
1254
1255 2012-12-11  Mark Wielaard  <mjw@redhat.com>
1256
1257         * linux-kernel-modules.c (report_kernel): Only free fname if
1258         find_kernel_elf succeeds and allocates it.
1259         (report_kernel_archive): Fix brackets around unlikely expression.
1260
1261 2012-11-29  Jan Kratochvil  <jan.kratochvil@redhat.com>
1262
1263         * argp-std.c: Update Copyright year.
1264         (offline_find_elf): New function.
1265         (offline_callbacks): Use it for find_elf.
1266         (struct parse_opt): New.
1267         (parse_opt): New key ARGP_KEY_INIT.  In other make hook struct
1268         parse_opt pointer from former Dwfl pointer.  Delay 'e and OPT_COREFILE
1269         processing till ARGP_KEY_SUCCESS.  Initialize state->input already from
1270         ARGP_KEY_SUCCESS.  Modify the cleanup in ARGP_KEY_ERROR.  Make the
1271         final state->input initialization optional.
1272         * dwfl_end.c: Update Copyright year.
1273         (dwfl_end): Free executable_for_core.
1274         * libdwflP.h: Update Copyright year.
1275         (struct Dwfl): New field executable_for_core.
1276
1277 2012-11-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1278
1279         * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
1280         calculation.
1281
1282 2012-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
1283
1284         * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
1285         from ...
1286         (__libdwfl_getelf): ... here.  Call it.
1287
1288 2012-10-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
1289
1290         * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
1291
1292 2012-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1293
1294         * dwfl_segment_report_module.c (dwfl_segment_report_module):
1295         Initialize mod->MAIN_BIAS.
1296
1297 2012-10-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1298
1299         * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
1300         binding_value.  Use it for both zero and non-zero size symbols
1301         comparisons.
1302
1303 2012-10-01  Mark Wielaard  <mjw@redhat.com>
1304
1305         * cu.c (cudie_offset): Don't use type_sig8, it might not be
1306         initialized and these are always real CUs, never TUs.
1307
1308 2012-10-01  Mark Wielaard  <mjw@redhat.com>
1309
1310         * derelocate.c (find_section): Check next section exists before
1311         accessing it.
1312
1313 2012-08-01  Petr Machata  <pmachata@redhat.com>
1314
1315         * offline.c (process_archive_member): Ignore entry "/SYM64/".
1316
1317 2012-03-28  Roland McGrath  <roland@hack.frob.com>
1318
1319         * dwfl_segment_report_module.c
1320         (dwfl_segment_report_module: read_portion): Don't use existing buffer
1321         when FILESZ is zero (string mode) and available portion doesn't hold
1322         a terminated string.
1323
1324 2011-12-02  Roland McGrath  <roland@hack.frob.com>
1325
1326         * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
1327         to use elf64_xlatetom and PHDRS.p64.
1328         Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
1329
1330 2011-11-31  Mark Wielaard  <mjw@redhat.com>
1331
1332         * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
1333         global symbols. Then only when that doesn't provide a match search
1334         all local symbols too.
1335         * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
1336         and fill it in.
1337         (find_symtab): Initialize mod->first_global and pass it to load_symtab.
1338         * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
1339
1340 2011-11-31  Mark Wielaard  <mjw@redhat.com>
1341
1342         * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
1343         sizeless_sym if needed and closer to desired addr.
1344
1345 2011-10-20  Mark Wielaard  <mjw@redhat.com>
1346
1347         * derelocate.c (cache_sections): Intern mod->reloc_info check.
1348         (dwfl_module_relocations): Don't check mod->reloc_info.
1349         (dwfl_module_relocation_info): Likewise.
1350         (find_section): Likewise.
1351
1352 2011-07-09  Roland McGrath  <roland@hack.frob.com>
1353
1354         * image-header.c (LE32): Macro removed (now in lib/system.h).
1355
1356 2011-04-11  Mark Wielaard  <mjw@redhat.com>
1357
1358         * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
1359         by check for zlib, bzlib or lzma defines to check it isn't empty.
1360         (try_kernel_name): Use same guard for use of vmlinux_suffixes.
1361
1362 2011-03-08  Roland McGrath  <roland@redhat.com>
1363
1364         * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
1365         Reported by Kurt Roeckx <kurt@roeckx.be>.
1366
1367 2011-02-11  Roland McGrath  <roland@redhat.com>
1368
1369         * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
1370         suffixes if corresponding decompression support is enabled.
1371
1372 2011-02-01  Roland McGrath  <roland@redhat.com>
1373
1374         * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
1375         section-end address as the synchronization point, rather than sh_addr.
1376
1377         * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
1378         PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
1379
1380         * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
1381         last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
1382
1383 2011-01-11  Roland McGrath  <roland@redhat.com>
1384
1385         * dwfl_module_getdwarf.c (open_elf): Remove section-based
1386         address_sync fixup from here.
1387         (find_prelink_address_sync): New function.
1388         (find_debuginfo): Call it.
1389         * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
1390
1391 2011-01-04  Roland McGrath  <roland@redhat.com>
1392
1393         * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
1394         logic to consider section addresses, the better to survive all the
1395         possible prelink machinations.
1396         * libdwflP.h (struct dwfl_file): Comment change.
1397
1398 2010-11-30  Roland McGrath  <roland@redhat.com>
1399
1400         * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
1401
1402 2010-11-12  Roland McGrath  <roland@redhat.com>
1403
1404         * libdwflP.h (struct Dwfl_Module): New member main_bias.
1405         (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
1406         * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
1407
1408         * libdwflP.h (dwfl_deadjust_address): New function.
1409         (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
1410         * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
1411         * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
1412
1413 2010-11-11  Roland McGrath  <roland@redhat.com>
1414
1415         * libdwflP.h (struct dwfl_file): Remove bias member.
1416         Add vaddr and address_sync members instead.
1417         (dwfl_adjusted_address): Calculate using vaddr.
1418         (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
1419         (dwfl_adjusted_st_value): Use one of those calls.
1420         * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
1421         * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
1422         * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
1423         * link_map.c (consider_executable): Adjust only MOD->low_addr for
1424         detected PIE bias change.
1425
1426         * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
1427         * dwfl_module_info.c: Use it.
1428         * cu.c (addrarange): Likewise.
1429         * dwfl_dwarf_line.c: Likewise.
1430         * dwfl_module_dwarf_cfi.c: Likewise.
1431         * dwfl_lineinfo.c: Likewise.
1432         * dwfl_nextcu.c: Likewise.
1433         * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
1434
1435         * libdwflP.h (dwfl_adjusted_st_value): New function.
1436         * relocate.c (resolve_symbol): Use it.
1437         * dwfl_module_getsym.c: Likewise.
1438         * dwfl_module_addrsym.c: Likewise.
1439         * dwfl_module_info.c: Likewise.
1440
1441         * libdwflP.h (dwfl_adjusted_address): New function.
1442         * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
1443         * relocate.c (__libdwfl_relocate_value): Likewise.
1444         * derelocate.c (cache_sections): Likewise.
1445         (dwfl_module_address_section): Likewise.
1446         * dwfl_module_getelf.c: Likewise.
1447         * dwfl_module_eh_cfi.c: Likewise.
1448         * link_map.c (consider_executable): Likewise.
1449
1450 2010-08-24  Roland McGrath  <roland@redhat.com>
1451
1452         * dwfl_dwarf_line.c: New file.
1453         * Makefile.am (libdwfl_a_SOURCES): Add it.
1454
1455 2010-08-18  Roland McGrath  <roland@redhat.com>
1456
1457         * link_map.c (report_r_debug): Use found name if we have no name,
1458         even if we already have an Elf handle.
1459
1460 2010-06-30  Roland McGrath  <roland@redhat.com>
1461
1462         * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
1463         confused by -1 return from dwfl_build_id_find_elf after it opened
1464         the Elf handle.
1465         * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
1466         dwfl_build_id_find_debuginfo.
1467
1468 2010-06-16  Roland McGrath  <roland@redhat.com>
1469
1470         * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
1471
1472 2010-06-14  Roland McGrath  <roland@redhat.com>
1473
1474         * find-debuginfo.c (try_open): Take new arg MAIN_STAT.  Compare
1475         candidate file to that st_dev/st_ino and pretend it didn't exist
1476         if they match.
1477         (find_debuginfo_in_path): Update caller, pass main file's info.
1478
1479 2010-05-20  Roland McGrath  <roland@redhat.com>
1480
1481         * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
1482         (grovel_auxv): ... this.  Take DWFL argument.
1483         (dwfl_linux_proc_report): Update caller.
1484
1485         * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
1486         based on dwfl->segment_align or manifest alignment of MOD->low_addr.
1487
1488 2010-05-19  Roland McGrath  <roland@redhat.com>
1489
1490         * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
1491
1492 2010-05-06  Roland McGrath  <roland@redhat.com>
1493
1494         * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
1495
1496         * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
1497         * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
1498         ID but we didn't find a file.
1499         * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
1500         and refuse any fallback file-by-name if it lacks the matching ID.
1501
1502         * dwfl_error.c (dwfl_errno): Add INTDEF.
1503         * libdwflP.h: Add INTDECL.
1504
1505         * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
1506         failure cases.
1507
1508 2010-05-04  Roland McGrath  <roland@redhat.com>
1509
1510         * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
1511         ET_DYN that has a DT_DEBUG.
1512
1513         * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
1514
1515         * segment.c (insert): Fix moving of values following insertion.
1516         (reify_segments): Fix up MOD->segment backpointer indices after
1517         later insertions in the main loop invalidate them.
1518
1519         * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
1520         apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
1521
1522         * core-file.c (dwfl_core_file_report): Return any nonzero count of
1523         modules reported, even if link_map grovelling failed and only sniffing
1524         found anything.
1525
1526 2010-04-26  Roland McGrath  <roland@redhat.com>
1527
1528         * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
1529         Works around probably-wrong ld -r behavior for case of a DWARF address
1530         constant that refers to a discarded SHF_ALLOC section.
1531
1532 2010-04-14  Roland McGrath  <roland@redhat.com>
1533
1534         * link_map.c (report_r_debug): Limit iterations on the l_next chain to
1535         an upper bound on sane possible number of elements.
1536
1537 2010-03-11  Roland McGrath  <roland@redhat.com>
1538
1539         * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
1540         the second half for 32-bit matches.
1541
1542 2010-03-10  Roland McGrath  <roland@redhat.com>
1543
1544         * core-file.c (dwfl_core_file_report): Punt EHDR argument.
1545         * argp-std.c (parse_opt): Update caller.
1546         * libdwfl.h: Declare dwfl_core_file_report.
1547         * libdwflP.h: Don't.
1548
1549 2010-02-17  Roland McGrath  <roland@redhat.com>
1550
1551         * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
1552         If set, find the first index not below ADDR.
1553         (dwfl_segment_report_module): Update callers.
1554         Pass true when calculating return value.
1555
1556 2010-02-15  Roland McGrath  <roland@redhat.com>
1557
1558         * Makefile.am: Use config/eu.am for common stuff.
1559
1560         * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
1561         variable in failure path.
1562
1563 2010-02-02  Mark Wielaard  <mjw@redhat.com>
1564
1565         * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
1566         * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
1567
1568 2010-01-07  Roland McGrath  <roland@redhat.com>
1569
1570         * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
1571         * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1572         * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
1573         * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1574
1575 2010-01-06  Roland McGrath  <roland@redhat.com>
1576
1577         * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
1578         (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
1579
1580 2009-11-16  Roland McGrath  <roland@redhat.com>
1581
1582         * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
1583
1584 2009-11-12  Petr Machata  <pmachata@redhat.com>
1585
1586         * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
1587         the chunk is both offset-contiguous and vaddr-contiguous.
1588
1589 2009-11-05  Roland McGrath  <roland@redhat.com>
1590
1591         * link_map.c (report_r_debug): Skip entries with l_ld==0.
1592         Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
1593
1594 2009-09-04  Roland McGrath  <roland@redhat.com>
1595
1596         * image-header.c (__libdw_image_header): Fix tranposed comparison.
1597
1598 2009-08-27  Roland McGrath  <roland@redhat.com>
1599
1600         * image-header.c: New file.
1601         * Makefile.am (libdwfl_a_SOURCES): Add it.
1602         * libdwflP.h: Declare __libdw_image_header.
1603         * open.c (decompress): Don't consume ELF on failure.
1604         (what_kind): New function, broken out of ...
1605         (__libdw_open_file): ... here.  Call it.
1606         If it fails, try __libdw_image_header and then try what_kind again.
1607
1608         * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
1609         leave it behind for next decompressor.
1610         * open.c (decompress): Free BUFFER on failure.
1611
1612 2009-08-26  Roland McGrath  <roland@redhat.com>
1613
1614         * gzip.c (find_zImage_payload): New function, broken out of ...
1615         (mapped_zImage): ... here.  Call it.
1616         (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
1617         stupid method of just trying the decoder.
1618
1619         * open.c [USE_LZMA]: Try __libdw_unlzma.
1620         * libdwflP.h: Declare it.
1621         (DWFL_ERRORS): Add DWFL_E_LZMA.
1622         * gzip.c [LZMA]: Implement liblzma version for XZ file format.
1623         * lzma.c: New file.
1624         * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
1625
1626         * gzip.c (mapped_zImage): Limit scan to 32kb.
1627         Make this unconditional, support bzip2 kernel images too.
1628         (unzip): Use direct inflate method for non-mmap case too.
1629         Only zlib uses the stream method.
1630
1631 2009-08-09  Roland McGrath  <roland@redhat.com>
1632
1633         * dwfl_module_build_id.c: Use new macros for versioned definitions.
1634
1635 2009-07-08  Roland McGrath  <roland@redhat.com>
1636
1637         * dwfl_module_dwarf_cfi.c: New file.
1638         * dwfl_module_eh_cfi.c: New file.
1639         * Makefile.am (libdwfl_a_SOURCES): Add them.
1640         * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
1641         Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
1642
1643 2009-07-08  Roland McGrath  <roland@redhat.com>
1644
1645         * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
1646
1647 2009-06-18  Mark Wielaard  <mjw@redhat.com>
1648
1649         * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
1650
1651 2009-06-13  Ulrich Drepper  <drepper@redhat.com>
1652
1653         * derelocate.c: Don't use deprecated libelf functions.
1654         * dwfl_module_getdwarf.c: Likewise.
1655         * relocate.c: Likewise.
1656
1657 2009-04-23  Ulrich Drepper  <drepper@redhat.com>
1658
1659         * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
1660         defined.  Otherwise just define the latest version.
1661
1662 2009-04-22  Roland McGrath  <roland@redhat.com>
1663
1664         * relocate.c (resolve_symbol): Apply correct bias to st_value found in
1665         a non-ET_REL module.
1666
1667         * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
1668         adjust properly for non-ET_REL.
1669
1670 2009-04-21  Roland McGrath  <roland@redhat.com>
1671
1672         * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
1673
1674         * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
1675         * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
1676         for ET_REL.
1677         * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1678
1679 2009-04-20  Roland McGrath  <roland@redhat.com>
1680
1681         * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
1682
1683 2009-04-19  Roland McGrath  <roland@redhat.com>
1684
1685         * dwfl_module_getdwarf.c (find_file): Renamed to ...
1686         (__libdwfl_getelf): ... this.  Make it global.
1687         (find_symtab, find_dw): Update callers.
1688         (dwfl_module_getelf): Functions moved ...
1689         * dwfl_module_getelf.c: ... here, new file.
1690         * Makefile.am (libdwfl_a_SOURCES): Add it.
1691         * libdwflP.h: Declare __libdwfl_getelf.
1692
1693 2009-04-14  Roland McGrath  <roland@redhat.com>
1694
1695         * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
1696         absolute (already adjusted in place) or needing load bias adjustment.
1697
1698         * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
1699         gelf_getphdr failure.  Fix file size limit checks.
1700
1701         * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
1702
1703 2009-04-08  Roland McGrath  <roland@redhat.com>
1704
1705         * dwfl_module_getsym.c: Don't adjust for bias again after
1706         __libdwfl_relocate_value.
1707
1708         * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
1709         a non-SHF_ALLOC section.
1710         (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
1711         * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
1712
1713 2009-03-09  Roland McGrath  <roland@redhat.com>
1714
1715         * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
1716         variable to outer scope, so we cache it for the loop.
1717
1718         * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
1719
1720 2009-02-12  Roland McGrath  <roland@redhat.com>
1721
1722         * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
1723         __libdwfl_relocate_value to find correct sh_addr value.
1724
1725 2009-02-10  Roland McGrath  <roland@redhat.com>
1726
1727         * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
1728         If false, don't fail for NO_PHDR.
1729         (dwfl_report_elf): Update caller.
1730         * libdwflP.h: Update decl.
1731         * offline.c (process_elf): Call it with false, so we don't refuse
1732         dubiously-formed objects here.
1733
1734         * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1735         finds our module.  We shouldn't crash when we confuse some guesses.
1736
1737 2009-02-10  Ulrich Drepper  <drepper@redhat.com>
1738
1739         * open.c (decompress): Avoid crash with empty input file.
1740
1741 2009-01-27  Roland McGrath  <roland@redhat.com>
1742
1743         * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1744         with zero vaddr and memsz.
1745
1746 2009-01-22  Roland McGrath  <roland@redhat.com>
1747
1748         * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1749
1750         * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1751         after address-matching loop.
1752
1753         * segment.c (lookup): Fix fencepost in checking for HINT match.
1754
1755 2009-01-14  Roland McGrath  <roland@redhat.com>
1756
1757         * gzip.c [!BZLIB] (mapped_zImage): New function.
1758         (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1759
1760 2009-01-10  Ulrich Drepper  <drepper@redhat.com>
1761
1762         * dwfl_error.c: Always use __thread.  Remove all !USE_TLS code.
1763
1764 2009-01-08  Roland McGrath  <roland@redhat.com>
1765
1766         * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1767         Skip subdirectory named "source".
1768         (dwfl_linux_kernel_find_elf): Likewise.
1769
1770 2009-01-06  Roland McGrath  <roland@redhat.com>
1771
1772         * linux-kernel-modules.c (check_suffix): New function.
1773         Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1774         (dwfl_linux_kernel_report_offline): Use it.
1775         (dwfl_linux_kernel_find_elf): Likewise.
1776
1777 2009-01-05  Roland McGrath  <roland@redhat.com>
1778
1779         * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1780         * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1781         * dwfl_build_id_find_elf.c: Likewise.
1782         * dwfl_module_getdwarf.c (open_elf): Likewise.
1783         * dwfl_report_elf.c: Likewise.
1784         * find-debuginfo.c (validate): Likewise.
1785         * offline.c (__libdwfl_report_offline): Likewise.
1786
1787         * libdwflP.h: Declare __libdw_open_file.
1788         * open.c: New file.
1789         * Makefile.am (libdwfl_a_SOURCES): Add it.
1790
1791         * gzip.c: New file.
1792         * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1793         * bzip2.c: New file.
1794         * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1795         * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1796
1797 2008-12-16  Roland McGrath  <roland@redhat.com>
1798
1799         * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1800         symver magic to bind to ELFUTILS_0.138.
1801         (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1802         wrapper for ELFUTILS_0.130 version set.
1803
1804 2008-12-18  Roland McGrath  <roland@redhat.com>
1805
1806         * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1807         addresses are taken as relative to MOD->low_addr.
1808
1809 2008-12-15  Roland McGrath  <roland@redhat.com>
1810
1811         * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1812         debug.bias.
1813
1814 2008-12-11  Roland McGrath  <roland@redhat.com>
1815
1816         * offline.c (process_archive): Don't call elf_end and close if
1817         returning NULL.  Check first elf_begin call and set error code
1818         specially for empty archive.
1819         Fixes RHBZ#465878.
1820
1821 2008-12-02  Roland McGrath  <roland@redhat.com>
1822
1823         * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1824
1825 2008-11-26  Roland McGrath  <roland@redhat.com>
1826
1827         * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1828         return value, and interpret encoded OFFSET argument.
1829
1830 2008-10-07  Roland McGrath  <roland@redhat.com>
1831
1832         * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1833
1834 2008-09-29  Roland McGrath  <roland@redhat.com>
1835
1836         * segment.c (insert): Must realloc DWFL->lookup_module here too.
1837         (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1838
1839 2008-08-28  Roland McGrath  <roland@redhat.com>
1840
1841         * segment.c (reify_segments): Fix last change.
1842
1843 2008-08-27  Roland McGrath  <roland@redhat.com>
1844
1845         * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1846         failure from pread64.
1847
1848 2008-08-26  Roland McGrath  <roland@redhat.com>
1849
1850         * segment.c (reify_segments): Insert a trailing segment for a module
1851         end that is above the highest current segment.
1852
1853 2008-08-25  Roland McGrath  <roland@redhat.com>
1854
1855         * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1856         coded return value, not plain DWFL_E_LIBELF.  Return DWFL_E_BADELF
1857         if FILE->elf is not ELF_K_ELF.
1858
1859         * dwfl_segment_report_module.c: Add a cast.
1860
1861 2008-08-21  Denys Vlasenko  <dvlasenk@redhat.com>
1862
1863         * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1864         which decides which symbol is "closest" to a given address.
1865
1866 2008-08-15  Roland McGrath  <roland@redhat.com>
1867
1868         * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1869         (options, parse_opt): Handle --core.
1870
1871         * core-file.c: New file.
1872         * Makefile.am (libdwfl_a_SOURCES): Add it.
1873         * libdwflP.h (dwfl_core_file_report): Declare it.
1874
1875         * link_map.c: New file.
1876         * Makefile.am (libdwfl_a_SOURCES): Add it.
1877         * libdwflP.h (dwfl_link_map_report): Declare it.
1878
1879         * libdwflP.h (MIN, MAX): New macros.
1880         (Dwfl_Memory_Callback): New typedef.
1881         (Dwfl_Module_Callback): New typedef.
1882         (dwfl_segment_report_module): Declare it.
1883         * dwfl_segment_report_module.c: New file.
1884         * Makefile.am (libdwfl_a_SOURCES): Add it.
1885
1886         * derelocate.c (dwfl_module_address_section): Add INTDEF.
1887         * libdwflP.h: Add INTDECL.
1888
1889         * segment.c: New file.
1890         * Makefile.am (libdwfl_a_SOURCES): Add it.
1891         * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1892         * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1893         lookup_addr, lookup_module, lookup_segndx, replace removed members
1894         modules, nmodules.
1895         (struct Dwfl_Module): New member segment.
1896         * dwfl_end.c (dwfl_end): Free the new ones.  Iterate via modulelist
1897         to each free module.
1898         * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1899         (dwfl_report_begin): Don't call it.  Truncate the segment table instead.
1900         (dwfl_report_module): Don't touch DWFL->nmodules.
1901         (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1902         (compare_modules): Function removed.
1903         * dwfl_getmodules.c: Rewritten.
1904         Add INTDEF.
1905         * libdwflP.h: Add INTDECLs.
1906         * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1907         * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
1908
1909 2008-08-03  Roland McGrath  <roland@redhat.com>
1910
1911         * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1912
1913 2008-07-17  Roland McGrath  <roland@redhat.com>
1914
1915         * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1916         zero if the failure was only ENOENT.
1917
1918 2008-06-03  Roland McGrath  <roland@redhat.com>
1919
1920         * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1921         symbols.
1922
1923 2008-05-22  Petr Machata  <pmachata@redhat.com>
1924
1925         * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1926
1927 2008-05-06  Roland McGrath  <roland@frob.com>
1928
1929         * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1930         FTS_LOGICAL here too.
1931         (dwfl_linux_kernel_find_elf): Likewise.
1932
1933 2008-04-29  Roland McGrath  <roland@redhat.com>
1934
1935         * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1936         based on canonicalize_file_name if it differs from the supplied name.
1937
1938         * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1939         we accept symlinks.
1940
1941 2008-04-27  Roland McGrath  <roland@redhat.com>
1942
1943         * linux-kernel-modules.c (report_kernel): Fix crash when
1944         dwfl_report_elf fails.
1945
1946 2008-04-05  Roland McGrath  <roland@redhat.com>
1947
1948         * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1949
1950         * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1951         Clear it after freeing.
1952         * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1953
1954 2008-03-26  Roland McGrath  <roland@redhat.com>
1955
1956         * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1957         SHT_DYNSYM, just set *SYMSCN like the comment says.
1958
1959         * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1960
1961         * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1962
1963 2008-03-19  Roland McGrath  <roland@redhat.com>
1964
1965         * dwfl_module_getsrc.c: Adjust address for module bias before search.
1966
1967 2008-03-01  Roland McGrath  <roland@redhat.com>
1968
1969         * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1970         prototype to avoid older compiler's complaint about reuse of the name.
1971         (__libdwfl_canon_error): Likewise.
1972
1973 2008-02-19  Roland McGrath  <roland@redhat.com>
1974
1975         * relocate.c (relocate_section): Check for an unhandled relocation
1976         type before resolving a reloc's symbol.  Lift DWFL_E_BADRELTYPE ->
1977         DWFL_E_UNKNOWN_MACHINE check out of loops.
1978
1979         * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1980         DEBUGFILE->relocated is already set.
1981
1982 2008-01-26  Roland McGrath  <roland@redhat.com>
1983
1984         * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1985
1986         * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1987         incoming *FILE_NAME at the start.
1988
1989 2008-01-08  Roland McGrath  <roland@redhat.com>
1990
1991         * Makefile.am (euinclude): Variable removed.
1992         (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1993
1994 2007-10-23  Roland McGrath  <roland@redhat.com>
1995
1996         * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1997         module to appear first.
1998
1999 2007-10-20  Roland McGrath  <roland@redhat.com>
2000
2001         * offline.c (process_archive_member): Take FD argument, pass it down
2002         to process_file.  Return Elf_Cmd, not bool.
2003         Call elf_next here, always before elf_end.
2004         (process_archive): Update caller.  Don't close FD here unless there
2005         are no member refs.
2006
2007         * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
2008
2009         * libdwflP.h (struct dwfl_file): New bool member `relocated'.
2010         * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
2011         partial relocation to one or both files.
2012         (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
2013         relocations have been applied to the debug file if dwfl_module_getelf
2014         has been used before.
2015
2016         * relocate.c (resolve_symbol): New function.
2017         (relocate_section): Call it.
2018
2019         * relocate.c (relocate_getsym): Handle null MOD->symfile.
2020         (relocate_section): Take new bool arg, PARTIAL.  If true,
2021         no error for BADRELTYPE/RELUNDEF, instead just skip them
2022         and leave only those skipped relocs behind the reloc section.
2023         (__libdwfl_relocate_section): Take new arg, pass it down.
2024         (__libdwfl_relocate): Take new bool arg, DEBUG.  If false,
2025         do partial relocation on all sections.
2026         * dwfl_module_getdwarf.c (load_dw): Update caller.
2027         * libdwflP.h: Update decls.
2028         * derelocate.c (dwfl_module_address_section): Pass new argument
2029         to __libdwfl_relocate_section, true.
2030
2031         * derelocate.c (cache_sections): Don't cache reloc sections when
2032         section_address callback is null.
2033
2034 2007-10-19  Roland McGrath  <roland@redhat.com>
2035
2036         * relocate.c (relocate_section): Fix fencepost error in r_offset check.
2037
2038         * derelocate.c (struct dwfl_relocation): Add member `relocs'.
2039         (struct secref): Likewise.
2040         (cache_sections): Cache the relocation section referring to each
2041         section we cache, if any.
2042         (dwfl_module_address_section): Use __libdwfl_relocate_section as
2043         necessary.
2044
2045         * relocate.c (struct reloc_symtab_cache): New type.
2046         (relocate_getsym): Use it instead of four arguments.
2047         (__libdwfl_relocate): Update caller.
2048         (relocate_section): New function, broken out of ...
2049         (__libdwfl_relocate): ... here.
2050         (__libdwfl_relocate_section): New function.
2051         * libdwflP.h: Declare it.
2052
2053 2007-10-17  Roland McGrath  <roland@redhat.com>
2054
2055         * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
2056         to relocated st_value.
2057
2058         * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
2059         ET_REL to 0x100.
2060
2061 2007-10-16  Roland McGrath  <roland@redhat.com>
2062
2063         * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
2064         section has larger alignment requirements not met by the original BASE,
2065         rather than padding more between sections.
2066
2067         * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
2068
2069         * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
2070         to sh_addr value.
2071
2072         * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
2073         at zero in ET_REL case.  Adjust BASE to necessary alignment.
2074
2075         * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
2076         for DATA_VADDR.
2077         (__libdwfl_find_build_id): Update caller.
2078
2079         * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
2080         * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
2081         * offline.c (dwfl_offline_section_address): Bail early if there is
2082         separate debug file.
2083
2084         * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
2085
2086 2007-10-09  Roland McGrath  <roland@redhat.com>
2087
2088         * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
2089         caching SHDR->sh_addr = 0.
2090         * offline.c (dwfl_offline_section_address): Never called for sh_addr
2091         really at 0, don't check for it.  Use MOD->debug directly, not symfile.
2092
2093         * dwfl_module_getdwarf.c (load_symtab): Return success properly when
2094         we've found SHT_SYMTAB.
2095
2096         * relocate.c (relocate_getsym): New function.
2097         (__libdwfl_relocate): Use it.
2098         (__libdwfl_relocate_value): Take new Elf * argument.  Make SYMSHSTRNDX
2099         be a pointer instead of value; cache getshstrndx result there.
2100         * libdwflP.h: Update decl.
2101         * derelocate.c (cache_sections): Update caller.
2102         Always work on the main file, not the symfile.
2103         (dwfl_module_address_section): Likewise.
2104         * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
2105
2106 2007-10-07  Roland McGrath  <roland@redhat.com>
2107
2108         * offline.c (process_archive): Initialize MOD.
2109
2110         * linux-kernel-modules.c (get_release): New function, broken out of ...
2111         (report_kernel): ... here.  Call it.
2112         (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
2113         (find_kernel_elf): Update caller.
2114         (report_kernel_archive): New function.
2115         (dwfl_linux_kernel_report_offline): Call it.
2116
2117         * offline.c (process_file): Take new arg PREDICATE, pass it down.
2118         (process_archive): Likewise.
2119         (process_archive_member): Likewise.  When nonnull, let the predicate
2120         decide whether to use this member.
2121         (__libdwfl_report_offline): New function, broken out of ...
2122         (dwfl_report_offline): ... here.  Call it.
2123         * libdwflP.h: Declare it.
2124
2125         * offline.c (process_archive, process_archive_member): New functions.
2126         (process_elf, process_file): New functions, broken out of ...
2127         (dwfl_report_offline): ... here.  Call process_file, which recurses on
2128         ELF_K_AR files.
2129
2130         * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
2131         (dwfl_report_elf): ... here.  Call it.
2132         * libdwflP.h: Declare it.
2133
2134 2007-10-06  Roland McGrath  <roland@redhat.com>
2135
2136         * derelocate.c (dwfl_module_relocations): Don't call
2137         dwfl_module_getdwarf.
2138
2139         * derelocate.c (find_section): Use __libdwfl_seterrno, not
2140         __libdw_seterrno.
2141
2142         * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
2143         SHF_ALLOC, to cache sh_addr resolved to 0.
2144
2145         * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
2146         values nonzero already, just use its existing layout.
2147
2148         * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
2149         in-core shdr after applying it.
2150
2151 2007-10-04  Ulrich Drepper  <drepper@redhat.com>
2152
2153         * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
2154         initialization of notes variable.
2155
2156 2007-10-04  Roland McGrath  <roland@redhat.com>
2157
2158         * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
2159         fill in with vaddr of "__start_notes" symbol if found.
2160         (check_notes): New function.
2161         (check_kernel_notes): New function.
2162         (dwfl_linux_kernel_report_kernel): Call it.
2163         (check_module_notes): New function.
2164         (dwfl_linux_kernel_report_modules): Call it.
2165
2166         * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
2167         Try dwfl_build_id_find_elf first.
2168
2169         * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
2170         Set kernel module e_type to ET_DYN.
2171
2172 2007-10-03  Roland McGrath  <roland@redhat.com>
2173
2174         * find-debuginfo.c (validate): New function, broken out of ...
2175         (find_debuginfo_in_path): ... here.  New function, broken out of ...
2176         (dwfl_standard_find_debuginfo): ... here.  Call it, after trying
2177         dwfl_build_id_find_debuginfo first.
2178
2179         * dwfl_build_id_find_elf.c: New file.
2180         * dwfl_build_id_find_debuginfo.c: New file.
2181         * Makefile.am (libdwfl_a_SOURCES): Add them.
2182         * libdwfl.h: Declare them.
2183         * libdwflP.h: Add INTDECLs.
2184
2185         * dwfl_module_build_id.c: New file.
2186         * dwfl_module_report_build_id.c: New file.
2187         * Makefile.am (libdwfl_a_SOURCES): Add them.
2188         * libdwfl.h: Declare them.
2189         * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
2190         build_id_len, build_id_vaddr.  Declare __libdwfl_find_build_id.
2191         * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
2192
2193         * dwfl_module_getdwarf.c (find_offsets): New function.
2194         (find_dynsym): New function, calls that.
2195         (find_symtab): Call it.
2196
2197 2007-09-11  Roland McGrath  <roland@redhat.com>
2198
2199         * dwfl_module_addrsym.c: Prefer a later global symbol at the same
2200         address if its st_size is smaller.
2201
2202 2007-08-13  Roland McGrath  <roland@redhat.com>
2203
2204         * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
2205
2206 2007-08-12  Roland McGrath  <roland@redhat.com>
2207
2208         * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
2209         FTS_LOGICAL.
2210
2211         * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
2212         a second phdr if it happens to match EHDR_VMA exactly.
2213
2214 2007-08-08  Roland McGrath  <roland@redhat.com>
2215
2216         * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
2217         those with no names.  Rewrite best symbol algorithm not to assume a
2218         sorted table and to be smarter handling sizeless symbols.
2219
2220 2007-07-16  Roland McGrath  <roland@redhat.com>
2221
2222         * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
2223         reviving an existing module.
2224
2225 2007-06-08  Roland McGrath  <roland@redhat.com>
2226
2227         * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
2228
2229 2007-05-17  Roland McGrath  <roland@redhat.com>
2230
2231         * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
2232         whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
2233         (dwfl_linux_kernel_find_elf): Likewise.
2234
2235         * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2236         getline and sscanf instead of fscanf.
2237
2238 2007-05-08  Roland McGrath  <roland@redhat.com>
2239
2240         * offline.c (dwfl_offline_section_address): Don't assume section
2241         numbers match between stripped and debuginfo files.  Instead, assume
2242         only that the ordering among SHF_ALLOC sections matches.
2243
2244         * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
2245         pointer to string.
2246         (dwfl_linux_kernel_report_offline): Update caller.
2247         (dwfl_linux_kernel_report_kernel): Likewise.
2248
2249 2007-04-23  Roland McGrath  <roland@redhat.com>
2250
2251         * argp-std.c (options): Fix group title string.
2252
2253         * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
2254         Update via STATE->input every time we set STATE->hook, not only at
2255         ARGP_KEY_SUCCESS.
2256
2257         * dwfl_module.c (free_file): Free FILE->name.
2258
2259 2007-04-16  Roland McGrath  <roland@redhat.com>
2260
2261         * derelocate.c (cache_sections): Apply bias to sh_addr.
2262         (compare_secrefs): Fix address comparison to avoid signed overflow.
2263         (find_section): New function, broken out of ...
2264         (dwfl_module_relocate_address): ... here, call it.
2265         (check_module): New function, broken out of ...
2266         (dwfl_module_relocate_address): ... here, call it.
2267         (dwfl_module_address_section): New function.
2268         * libdwfl.h: Declare it.
2269
2270 2007-03-26  Roland McGrath  <roland@redhat.com>
2271
2272         * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
2273
2274 2007-03-18  Roland McGrath  <roland@redhat.com>
2275
2276         * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
2277         (find_debuginfo): ... here.  Call it.
2278         Don't return error for libelf errors finding .gnu_debuglink section.
2279
2280 2007-03-12  Roland McGrath  <roland@redhat.com>
2281
2282         * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
2283         (dwfl_report_begin): ... here.  Call it.
2284         * libdwfl.h: Declare it.
2285         * libdwflP.h: Add INTDECL.
2286
2287         * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2288
2289         * offline.c: Comment typo fix.
2290
2291 2007-03-04  Roland McGrath  <roland@redhat.com>
2292
2293         * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
2294         (find_kernel_elf): New function, broken out of ...
2295         (report_kernel): ... here.  Call it.
2296         (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
2297         (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
2298         virtual address bounds of kernel from symbols rounded to page size.
2299         (dwfl_linux_kernel_report_kernel): Use that if it works, before
2300         resorting to report_kernel.
2301
2302         * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
2303         ET_EXEC file with nonzero bias.
2304
2305         * dwfl_module_addrname.c (dwfl_module_addrname): Just call
2306         dwfl_module_addrsym.  Guts moved to ...
2307         * dwfl_module_addrsym.c: ... here; new file.
2308         * Makefile.am (libdwfl_a_SOURCES): Add it.
2309         * libdwfl.h: Declare dwfl_module_addrsym.
2310         * libdwflP.h: Add INTDECL.
2311
2312 2007-03-03  Roland McGrath  <roland@redhat.com>
2313
2314         * dwfl_module.c (free_file): New function, broken out of ...
2315         (__libdwfl_module_free): ... here.  In it, close fd after elf_end.
2316
2317         * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
2318         on libelf failure.
2319
2320 2007-03-02  Roland McGrath  <roland@redhat.com>
2321
2322         * linux-kernel-modules.c: Fix bogus error test for asprintf call.
2323
2324 2007-02-02  Roland McGrath  <roland@redhat.com>
2325
2326         * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
2327         address exactly if it's no other module's low boundary.
2328
2329         * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
2330         and size cover the address, select the closest symbol with st_size==0
2331         that lies in the same section.
2332
2333 2007-01-29  Roland McGrath  <roland@redhat.com>
2334
2335         * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
2336         not PACKAGE_STRING.
2337
2338 2007-01-20  Roland McGrath  <roland@redhat.com>
2339
2340         * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
2341         as omitted, not 0.
2342         * libdwfl.h (Dwfl_Callbacks): Update comment.
2343         * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
2344         * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2345         For ignored missing section, use -1 instead of 0.
2346         * offline.c (dwfl_offline_section_address): Expect a call for 0.
2347
2348 2007-01-19  Roland McGrath  <roland@redhat.com>
2349
2350         * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
2351         zero so a lone -e foo.so is shown without address bias.
2352
2353 2007-01-10  Roland McGrath  <roland@redhat.com>
2354
2355         * linux-kernel-modules.c (report_kernel): Check asprintf return value
2356         directly instead of via side effect, to silence warn_unused_result.
2357         (dwfl_linux_kernel_report_offline): Likewise.
2358         (dwfl_linux_kernel_find_elf): Likewise.
2359         (dwfl_linux_kernel_module_section_address): Likewise.
2360         * find-debuginfo.c (try_open): Likewise.
2361         * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
2362         (dwfl_linux_proc_report): Likewise.
2363
2364         * libdwfl.h (dwfl_begin): Require nonnull argument.
2365
2366 2006-12-27  Roland McGrath  <roland@redhat.com>
2367
2368         * dwfl_module.c (compare_modules): Fix address comparison to avoid
2369         signed overflow.  Patch by Frank Ch. Eigler <fche@redhat.com>.
2370
2371 2006-10-30  Roland McGrath  <roland@redhat.com>
2372
2373         * dwfl_module.c (dwfl_report_module): Comment typo fix.
2374
2375 2006-09-05  Roland McGrath  <roland@redhat.com>
2376
2377         * derelocate.c (cache_sections): Use alloca instead of variable-sized
2378         auto array, in function already using alloca.
2379
2380 2006-08-14  Roland McGrath  <roland@redhat.com>
2381
2382         * linux-kernel-modules.c (try_kernel_name): If the call to
2383         dwfl_standard_find_debuginfo produces no results, try it again
2384         with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
2385
2386         * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
2387         * libdwflP.h: ... to here.
2388         * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
2389         repeats the first thing dwfl_standard_find_debuginfo will try.
2390
2391         * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
2392         (dwfl_linux_kernel_module_section_address): If a /sys file is missing
2393         and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
2394         section name.
2395
2396 2006-07-12  Ulrich Drepper  <drepper@redhat.com>
2397
2398         * cu.c: Adjust for internal_function_def removal.
2399         * dwfl_error.c: Likewise.
2400         * dwfl_module.c: Likewise.
2401         * dwfl_module_getdwarf.c: Likewise.
2402         * lines.c: Likewise.
2403         * relocate.c: Likewise.
2404
2405 2006-07-11  Ulrich Drepper  <drepper@redhat.com>
2406
2407         * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
2408         it can overflow the return value type.
2409         Patch by Tim Moore <timoore@redhat.com>.
2410
2411 2006-06-28  Roland McGrath  <roland@redhat.com>
2412
2413         * libdwfl.h: Cosmetic changes.
2414
2415         * dwfl_line_comp_dir.c: New file.
2416         * Makefile.am (libdwfl_a_SOURCES): Add it.
2417         * libdwfl.h: Declare dwfl_line_comp_dir.
2418
2419         * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
2420
2421         * dwfl_linecu.c: New file.
2422         * Makefile.am (libdwfl_a_SOURCES): Add it.
2423         * libdwfl.h: Declare dwfl_linecu.
2424
2425         * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
2426         (dwfl_linecu): Define as macro.
2427
2428         * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
2429
2430         * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
2431         (dwfl_module_addrname): Function moved ...
2432         * dwfl_module_addrname.c: ... here, new file.
2433         * dwfl_module_getsym.c: New file.
2434         * Makefile.am (libdwfl_a_SOURCES): Add them.
2435         * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
2436         * libdwflP.h: Add INTDECLs.
2437
2438 2006-06-27  Roland McGrath  <roland@redhat.com>
2439
2440         * dwfl_module.c (dwfl_report_end): Whitespace fix.
2441
2442 2006-06-13  Roland McGrath  <roland@redhat.com>
2443
2444         * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2445         Use __libdwfl_seterrno for elf_memory failure.
2446
2447 2006-05-22  Roland McGrath  <roland@redhat.com>
2448
2449         * dwfl_module_return_value_location.c
2450         (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
2451
2452 2006-05-27  Ulrich Drepper  <drepper@redhat.com>
2453
2454         * libdwfl.h: Add extern "C".
2455
2456 2006-05-22  Ulrich Drepper  <drepper@redhat.com>
2457
2458         * cu.c (addrarange): Handle files without aranges information.
2459
2460 2006-05-16  Ulrich Drepper  <drepper@redhat.com>
2461
2462         * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
2463         ->modules is NULL.
2464
2465 2006-02-26  Roland McGrath  <roland@redhat.com>
2466
2467         * dwfl_version.c: New file.
2468         * Makefile.am (libdwfl_a_SOURCES): Add it.
2469         * libdwfl.h: Declare dwfl_version.
2470
2471         * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
2472         aligned up from DWFL->offline_next_address when checking for overlap.
2473
2474 2005-12-22  Roland McGrath  <roland@redhat.com>
2475
2476         * argp-std.c (parse_opt): Call dwfl_end in failure cases.
2477
2478         * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
2479         (dwfl_linux_proc_report): ... here.  Call it.
2480         (dwfl_linux_proc_maps_report): New function.
2481         * libdwfl.h: Declare it.
2482         * libdwflP.h: Add INTDECL.
2483         * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
2484
2485         * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
2486         failed with DWFL_E_NO_DWARF.
2487
2488 2005-11-26  Roland McGrath  <roland@redhat.com>
2489
2490         * dwfl_end.c (dwfl_end): Free the DWFL itself.
2491
2492 2005-11-25  Roland McGrath  <roland@redhat.com>
2493
2494         * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
2495         (load_dw): Use it.
2496         * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
2497         * libdwflP.h: Declare it.
2498
2499         * dwfl_module_register_names.c: New file.
2500         * Makefile.am (libdwfl_a_SOURCES): Add it.
2501         * libdwfl.h: Declare dwfl_module_register_names.
2502
2503 2005-11-21  Roland McGrath  <roland@redhat.com>
2504
2505         * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2506         Don't leak malloc'd file name.
2507         If a /sys/.../sections file is missing and starts with ".init",
2508         try the variant with "_init" too; catches PPC64 kernel braindamage.
2509
2510 2005-11-15  Roland McGrath  <roland@redhat.com>
2511
2512         * libdwfl.h: Comment fixes.
2513
2514         * dwfl_module_return_value_location.c: Add unlikely for error case.
2515
2516 2005-11-13  Roland McGrath  <roland@redhat.com>
2517
2518         * dwfl_return_value_location.c: New file.
2519         * Makefile.am (libdwfl_a_SOURCES): Add it.
2520         * libdwfl.h: Declare dwfl_module_return_value_location.
2521         * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
2522
2523 2005-10-20  Roland McGrath  <roland@redhat.com>
2524
2525         * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
2526         * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
2527         instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
2528
2529 2005-10-01  Roland McGrath  <roland@redhat.com>
2530
2531         * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
2532         with errno 0.
2533
2534 2005-09-19  Roland McGrath  <roland@redhat.com>
2535
2536         * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2537         PRIx64 instead of PRIi64, lest addresses with high bits set overflow
2538         the signed integer reading; they will just have to be in hexadecimal.
2539         (dwfl_linux_kernel_module_section_address): Likewise.
2540
2541 2005-08-28  Ulrich Drepper  <drepper@redhat.com>
2542
2543         * Makefile.am (%.os): Use COMPILE.os.
2544         (COMPILE.os): Filter out gconv options.
2545
2546 2005-08-25  Roland McGrath  <roland@redhat.com>
2547
2548         * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
2549         * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
2550
2551 2005-08-24  Roland McGrath  <roland@redhat.com>
2552
2553         * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
2554
2555         * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
2556         magic initializer to set -heur-stack-bound option.
2557
2558 2005-08-22  Roland McGrath  <roland@redhat.com>
2559
2560         * dwfl_validate_address.c: New file.
2561         * Makefile.am (libdwfl_a_SOURCES): Add it.
2562         * libdwfl.h: Declare dwfl_validate_address.
2563
2564         * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
2565         * libdwflP.h: Add INTDECL.
2566
2567         * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
2568         elf_rawdata for symbol-related sections.
2569
2570         * offline.c (dwfl_report_offline): Move offline_next_address outside
2571         module's range, in case it's an ET_EXEC using fixed segment locations.
2572         * libdwfl.h: Update comment.
2573
2574         * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
2575         required alignment.
2576
2577 2005-08-20  Roland McGrath  <roland@redhat.com>
2578
2579         * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
2580         function to choose whether to report.
2581         (dwfl_linux_kernel_report_offline): Likewise.
2582         * libdwfl.h: Update decl.
2583         * argp-std.c (parse_opt): Update caller.
2584
2585         * dwfl_getsrclines.c: New file.
2586         * dwfl_onesrcline.c: New file.
2587         * Makefile.am (libdwfl_a_SOURCES): Add them.
2588         * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
2589
2590         * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
2591         MODULESDIR[0].  Call fts_close on failure.
2592
2593         * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
2594         Close ET_REL file descriptors after relocation.
2595         (find_dw): Update caller.
2596         * offline.c (dwfl_report_offline): Get the file into memory and close
2597         the file descriptor.
2598
2599         * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
2600         MOD->debug.elf is already set.
2601
2602         * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
2603         (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
2604
2605         * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
2606         dwfl_linux_kernel_report_offline with offline_callbacks.
2607
2608         * linux-kernel-modules.c (report_kernel): New function, broken out of
2609         ...
2610         (dwfl_linux_kernel_report_kernel): ... here.  Use it.
2611         (dwfl_linux_kernel_report_offline): New function.
2612         * libdwfl.h: Declare it.
2613         * libdwflP.h: Add INTDECL.
2614
2615 2005-08-19  Roland McGrath  <roland@redhat.com>
2616
2617         Use standard debuginfo search path to look for vmlinux.
2618         * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
2619         passed zero.
2620         * linux-kernel-modules.c (try_kernel_name): New function, broken out
2621         of ...
2622         (dwfl_linux_kernel_report_kernel): ... here.  Use it.
2623
2624         * argp-std.c (offline_callbacks): New variable.
2625         (parse_opt): Use it for -e.  Allow multiple -e options.
2626
2627         * offline.c: New file.
2628         * Makefile.am (libdwfl_a_SOURCES): Add it.
2629         * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
2630         * libdwflP.h: Add INTDECLs.
2631         (OFFLINE_REDZONE): New macro.
2632         (struct Dwfl): New member `offline_next_address'.
2633         * dwfl_begin.c (dwfl_begin): Initialize it.
2634         * dwfl_module.c (dwfl_report_begin): Likewise.
2635
2636         * dwfl_report_elf.c (dwfl_report_elf): Accept all types.  When ET_REL,
2637         do a nominal absolute section layout starting at BASE.
2638         * libdwfl.h: Update comment.
2639
2640 2005-08-18  Roland McGrath  <roland@redhat.com>
2641
2642         * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
2643         dwfl_module_getdwarf if necessary.
2644
2645         * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
2646         * libdwfl.h: Update comment.
2647
2648         * derelocate.c: New file.
2649         * Makefile.am (libdwfl_a_SOURCES): Add it.
2650
2651         * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
2652         * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
2653         * dwfl_module_getdwarf.c (open_elf): Update initialization.
2654         (load_dw, dwfl_module_addrname): Update uses.
2655         * relocate.c (__libdwfl_relocate): Likewise.
2656
2657 2005-08-04  Roland McGrath  <roland@redhat.com>
2658
2659         * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
2660         arguments SHNDX, SHDR.
2661         (dwfl_linux_kernel_module_section_address): Update prototype.
2662         * relocate.c (__libdwfl_relocate_value): Update caller.
2663         * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2664         Take the new arguments.
2665
2666 2005-08-10  Roland McGrath  <roland@redhat.com>
2667
2668         * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
2669         use it instead of MOD->debug.file.
2670         * libdwflP.h: Update decl.
2671         * dwfl_module_getdwarf.c (load_dw): Update caller.
2672         Fixes bug #165598.
2673
2674 2005-08-09  Roland McGrath  <roland@redhat.com>
2675
2676         * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
2677         * cu.c: Use INTUSE on dwarf_* calls.
2678         * dwfl_error.c: Likewise.
2679         * dwfl_module.c: Likewise.
2680         * dwfl_module_getdwarf.c: Likewise.
2681         * dwfl_module_getsrc_file.c: Likewise.
2682         * lines.c: Likewise.
2683
2684 2005-08-07  Roland McGrath  <roland@redhat.com>
2685
2686         * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
2687         names contain '_' or '-', look for files named either "foo-bar.ko"
2688         or "foo_bar.ko".
2689
2690 2005-07-29  Roland McGrath  <roland@redhat.com>
2691
2692         * loc2c.c: File removed.
2693         * loc2c.h: File removed.
2694         * loc2c-runtime.h: File removed.
2695         * test2.c: File removed.
2696         * Makefile.am (EXTRA_DIST): Variable removed.
2697         (noinst_HEADERS): Remove loc2c.h from here.
2698
2699 2005-07-28  Ulrich Drepper  <drepper@redhat.com>
2700
2701         * libdwfl.h: Add a few missing extern for function prototypes.
2702
2703         * libdwfl_crc32.c: New file.
2704         * libdwfl_crc32_file.c: New file.
2705         * libdwflP.h: Declare the new functions.
2706         * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
2707         libdwfl_crc32_file.c.
2708         * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
2709         instead of crc32_file.
2710
2711 2005-07-28  Roland McGrath  <roland@redhat.com>
2712
2713         * ptest.c: Moved to ../tests/dwflmodtest.c.
2714
2715         * Makefile.am (noinst_PROGRAMS): Variable removed.
2716         (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
2717         (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
2718         (libdwfl): Don't use libdwfl.so any more.
2719         (libdwfl.so, install, uninstall): Targets removed.
2720         (test2_SOURCES): Define EXTRA_DIST instead of this.
2721         * libdwfl.map: File removed.
2722
2723         * libdwfl.h: Use "" for libdw.h #include.
2724
2725 2005-07-27  Roland McGrath  <roland@redhat.com>
2726
2727         * libdwfl.map: Add dwfl_getmodules.
2728
2729 2005-07-23  Ulrich Drepper  <drepper@redhat.com>
2730
2731         * Makefile.am: Fix rules to allow building with mudflap.
2732
2733 2005-07-21  Roland McGrath  <roland@redhat.com>
2734
2735         * Makefile.am (noinst_HEADERS): Add loc2c.c.
2736
2737         * test2.c (main): Check sscanf result to quiet warning.
2738
2739 2005-07-20  Roland McGrath  <roland@redhat.com>
2740
2741         * libdwfl-branch merged, creating this direcotry.