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