blob: 0e3768628f74532ba88524c34e8735bfc9c036ab [file] [log] [blame]
Roland McGrath60205c92009-01-06 00:10:23 -080012009-01-06 Roland McGrath <roland@redhat.com>
2
Roland McGrath705364b2009-01-06 02:04:51 -08003 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -08004 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
5 (dwfl_linux_kernel_report_offline): Use it.
6 (dwfl_linux_kernel_find_elf): Likewise.
7
Roland McGrathbca43152009-01-05 23:59:32 -080082009-01-05 Roland McGrath <roland@redhat.com>
9
10 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
11 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
12 * dwfl_build_id_find_elf.c: Likewise.
13 * dwfl_module_getdwarf.c (open_elf): Likewise.
14 * dwfl_report_elf.c: Likewise.
15 * find-debuginfo.c (validate): Likewise.
16 * offline.c (__libdwfl_report_offline): Likewise.
17
18 * libdwflP.h: Declare __libdw_open_file.
19 * open.c: New file.
20 * Makefile.am (libdwfl_a_SOURCES): Add it.
21
22 * gzip.c: New file.
23 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
24 * bzip2.c: New file.
25 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
26 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
27
Roland McGrath45d7b292008-12-16 16:21:40 -0800282008-12-16 Roland McGrath <roland@redhat.com>
29
30 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
31 symver magic to bind to ELFUTILS_0.138.
32 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
33 wrapper for ELFUTILS_0.130 version set.
34
Roland McGrath7d9b8212008-12-18 15:08:09 -0800352008-12-18 Roland McGrath <roland@redhat.com>
36
37 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
38 addresses are taken as relative to MOD->low_addr.
39
Roland McGrath74825c42008-12-15 19:33:33 -0800402008-12-15 Roland McGrath <roland@redhat.com>
41
42 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
43 debug.bias.
44
Roland McGrathb28a8942008-12-11 02:09:28 -0800452008-12-11 Roland McGrath <roland@redhat.com>
46
47 * offline.c (process_archive): Don't call elf_end and close if
48 returning NULL. Check first elf_begin call and set error code
49 specially for empty archive.
50 Fixes RHBZ#465878.
51
Roland McGratha845f682008-12-03 03:41:58 +0000522008-12-02 Roland McGrath <roland@redhat.com>
53
54 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
55
562008-11-26 Roland McGrath <roland@redhat.com>
57
58 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
59 return value, and interpret encoded OFFSET argument.
60
612008-10-07 Roland McGrath <roland@redhat.com>
62
63 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
64
Roland McGrath9cf28e42008-09-30 06:35:35 +0000652008-09-29 Roland McGrath <roland@redhat.com>
66
67 * segment.c (insert): Must realloc DWFL->lookup_module here too.
68 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
69
702008-08-28 Roland McGrath <roland@redhat.com>
71
72 * segment.c (reify_segments): Fix last change.
73
742008-08-27 Roland McGrath <roland@redhat.com>
75
76 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
77 failure from pread64.
78
Roland McGrath122f3882008-08-26 07:20:29 +0000792008-08-26 Roland McGrath <roland@redhat.com>
80
81 * segment.c (reify_segments): Insert a trailing segment for a module
82 end that is above the highest current segment.
83
842008-08-25 Roland McGrath <roland@redhat.com>
85
86 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
87 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
88 if FILE->elf is not ELF_K_ELF.
89
90 * dwfl_segment_report_module.c: Add a cast.
91
Roland McGrathb4d6f0f2008-08-25 22:55:17 +0000922008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +000093
Roland McGrathb4d6f0f2008-08-25 22:55:17 +000094 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
95 which decides which symbol is "closest" to a given address.
96
972008-08-15 Roland McGrath <roland@redhat.com>
98
99 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
100 (options, parse_opt): Handle --core.
101
102 * core-file.c: New file.
103 * Makefile.am (libdwfl_a_SOURCES): Add it.
104 * libdwflP.h (dwfl_core_file_report): Declare it.
105
106 * link_map.c: New file.
107 * Makefile.am (libdwfl_a_SOURCES): Add it.
108 * libdwflP.h (dwfl_link_map_report): Declare it.
109
110 * libdwflP.h (MIN, MAX): New macros.
111 (Dwfl_Memory_Callback): New typedef.
112 (Dwfl_Module_Callback): New typedef.
113 (dwfl_segment_report_module): Declare it.
114 * dwfl_segment_report_module.c: New file.
115 * Makefile.am (libdwfl_a_SOURCES): Add it.
116
117 * derelocate.c (dwfl_module_address_section): Add INTDEF.
118 * libdwflP.h: Add INTDECL.
119
120 * segment.c: New file.
121 * Makefile.am (libdwfl_a_SOURCES): Add it.
122 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
123 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
124 lookup_addr, lookup_module, lookup_segndx, replace removed members
125 modules, nmodules.
126 (struct Dwfl_Module): New member segment.
127 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
128 to each free module.
129 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
130 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
131 (dwfl_report_module): Don't touch DWFL->nmodules.
132 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
133 (compare_modules): Function removed.
134 * dwfl_getmodules.c: Rewritten.
135 Add INTDEF.
136 * libdwflP.h: Add INTDECLs.
137 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
138 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +0000139
Roland McGrath1d8bb252008-08-07 08:39:41 +00001402008-08-03 Roland McGrath <roland@redhat.com>
141
142 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
143
1442008-07-17 Roland McGrath <roland@redhat.com>
145
146 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
147 zero if the failure was only ENOENT.
148
1492008-06-03 Roland McGrath <roland@redhat.com>
150
151 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
152 symbols.
153
Roland McGrath9d2f3ee2008-05-22 20:28:05 +00001542008-05-22 Petr Machata <pmachata@redhat.com>
155
156 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
157
Roland McGrath0fa20e82008-05-07 18:37:14 +00001582008-05-06 Roland McGrath <roland@frob.com>
159
160 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
161 FTS_LOGICAL here too.
162 (dwfl_linux_kernel_find_elf): Likewise.
163
1642008-04-29 Roland McGrath <roland@redhat.com>
165
166 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
167 based on canonicalize_file_name if it differs from the supplied name.
168
169 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
170 we accept symlinks.
171
Roland McGrath9897d662008-04-29 01:49:50 +00001722008-04-27 Roland McGrath <roland@redhat.com>
173
174 * linux-kernel-modules.c (report_kernel): Fix crash when
175 dwfl_report_elf fails.
176
Roland McGrathbfc01702008-04-06 01:57:32 +00001772008-04-05 Roland McGrath <roland@redhat.com>
178
179 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
180
181 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
182 Clear it after freeing.
183 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
184
Roland McGrathd11f9cb2008-03-26 20:51:59 +00001852008-03-26 Roland McGrath <roland@redhat.com>
186
187 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
188 SHT_DYNSYM, just set *SYMSCN like the comment says.
189
190 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
191
192 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
193
1942008-03-19 Roland McGrath <roland@redhat.com>
195
196 * dwfl_module_getsrc.c: Adjust address for module bias before search.
197
1982008-03-01 Roland McGrath <roland@redhat.com>
199
200 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
201 prototype to avoid older compiler's complaint about reuse of the name.
202 (__libdwfl_canon_error): Likewise.
203
Roland McGrath059c83e2008-02-21 06:19:39 +00002042008-02-19 Roland McGrath <roland@redhat.com>
205
206 * relocate.c (relocate_section): Check for an unhandled relocation
207 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
208 DWFL_E_UNKNOWN_MACHINE check out of loops.
209
210 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
211 DEBUGFILE->relocated is already set.
212
2132008-01-26 Roland McGrath <roland@redhat.com>
214
215 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
216
217 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
218 incoming *FILE_NAME at the start.
219
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00002202008-01-08 Roland McGrath <roland@redhat.com>
221
222 * Makefile.am (euinclude): Variable removed.
223 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
224
Roland McGrathe4c22ea2007-10-23 13:07:39 +00002252007-10-23 Roland McGrath <roland@redhat.com>
226
227 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
228 module to appear first.
229
2302007-10-20 Roland McGrath <roland@redhat.com>
231
232 * offline.c (process_archive_member): Take FD argument, pass it down
233 to process_file. Return Elf_Cmd, not bool.
234 Call elf_next here, always before elf_end.
235 (process_archive): Update caller. Don't close FD here unless there
236 are no member refs.
237
238 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
239
240 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
241 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
242 partial relocation to one or both files.
243 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
244 relocations have been applied to the debug file if dwfl_module_getelf
245 has been used before.
246
247 * relocate.c (resolve_symbol): New function.
248 (relocate_section): Call it.
249
250 * relocate.c (relocate_getsym): Handle null MOD->symfile.
251 (relocate_section): Take new bool arg, PARTIAL. If true,
252 no error for BADRELTYPE/RELUNDEF, instead just skip them
253 and leave only those skipped relocs behind the reloc section.
254 (__libdwfl_relocate_section): Take new arg, pass it down.
255 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
256 do partial relocation on all sections.
257 * dwfl_module_getdwarf.c (load_dw): Update caller.
258 * libdwflP.h: Update decls.
259 * derelocate.c (dwfl_module_address_section): Pass new argument
260 to __libdwfl_relocate_section, true.
261
262 * derelocate.c (cache_sections): Don't cache reloc sections when
263 section_address callback is null.
264
2652007-10-19 Roland McGrath <roland@redhat.com>
266
267 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
268
269 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
270 (struct secref): Likewise.
271 (cache_sections): Cache the relocation section referring to each
272 section we cache, if any.
273 (dwfl_module_address_section): Use __libdwfl_relocate_section as
274 necessary.
275
276 * relocate.c (struct reloc_symtab_cache): New type.
277 (relocate_getsym): Use it instead of four arguments.
278 (__libdwfl_relocate): Update caller.
279 (relocate_section): New function, broken out of ...
280 (__libdwfl_relocate): ... here.
281 (__libdwfl_relocate_section): New function.
282 * libdwflP.h: Declare it.
283
2842007-10-17 Roland McGrath <roland@redhat.com>
285
286 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
287 to relocated st_value.
288
289 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
290 ET_REL to 0x100.
291
2922007-10-16 Roland McGrath <roland@redhat.com>
293
294 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
295 section has larger alignment requirements not met by the original BASE,
296 rather than padding more between sections.
297
298 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
299
300 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
301 to sh_addr value.
302
303 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
304 at zero in ET_REL case. Adjust BASE to necessary alignment.
305
306 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
307 for DATA_VADDR.
308 (__libdwfl_find_build_id): Update caller.
309
310 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
311 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
312 * offline.c (dwfl_offline_section_address): Bail early if there is
313 separate debug file.
314
315 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
316
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00003172007-10-09 Roland McGrath <roland@redhat.com>
318
319 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
320 caching SHDR->sh_addr = 0.
321 * offline.c (dwfl_offline_section_address): Never called for sh_addr
322 really at 0, don't check for it. Use MOD->debug directly, not symfile.
323
324 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
325 we've found SHT_SYMTAB.
326
327 * relocate.c (relocate_getsym): New function.
328 (__libdwfl_relocate): Use it.
329 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
330 be a pointer instead of value; cache getshstrndx result there.
331 * libdwflP.h: Update decl.
332 * derelocate.c (cache_sections): Update caller.
333 Always work on the main file, not the symfile.
334 (dwfl_module_address_section): Likewise.
335 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
336
3372007-10-07 Roland McGrath <roland@redhat.com>
338
339 * offline.c (process_archive): Initialize MOD.
340
341 * linux-kernel-modules.c (get_release): New function, broken out of ...
342 (report_kernel): ... here. Call it.
343 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
344 (find_kernel_elf): Update caller.
345 (report_kernel_archive): New function.
346 (dwfl_linux_kernel_report_offline): Call it.
347
348 * offline.c (process_file): Take new arg PREDICATE, pass it down.
349 (process_archive): Likewise.
350 (process_archive_member): Likewise. When nonnull, let the predicate
351 decide whether to use this member.
352 (__libdwfl_report_offline): New function, broken out of ...
353 (dwfl_report_offline): ... here. Call it.
354 * libdwflP.h: Declare it.
355
356 * offline.c (process_archive, process_archive_member): New functions.
357 (process_elf, process_file): New functions, broken out of ...
358 (dwfl_report_offline): ... here. Call process_file, which recurses on
359 ELF_K_AR files.
360
361 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
362 (dwfl_report_elf): ... here. Call it.
363 * libdwflP.h: Declare it.
364
3652007-10-06 Roland McGrath <roland@redhat.com>
366
367 * derelocate.c (dwfl_module_relocations): Don't call
368 dwfl_module_getdwarf.
369
370 * derelocate.c (find_section): Use __libdwfl_seterrno, not
371 __libdw_seterrno.
372
373 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
374 SHF_ALLOC, to cache sh_addr resolved to 0.
375
376 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
377 values nonzero already, just use its existing layout.
378
379 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
380 in-core shdr after applying it.
381
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00003822007-10-04 Ulrich Drepper <drepper@redhat.com>
383
384 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
385 initialization of notes variable.
386
Roland McGrath59ea7f32007-10-04 08:50:09 +00003872007-10-04 Roland McGrath <roland@redhat.com>
388
389 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
390 fill in with vaddr of "__start_notes" symbol if found.
391 (check_notes): New function.
392 (check_kernel_notes): New function.
393 (dwfl_linux_kernel_report_kernel): Call it.
394 (check_module_notes): New function.
395 (dwfl_linux_kernel_report_modules): Call it.
396
397 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
398 Try dwfl_build_id_find_elf first.
399
400 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
401 Set kernel module e_type to ET_DYN.
402
4032007-10-03 Roland McGrath <roland@redhat.com>
404
405 * find-debuginfo.c (validate): New function, broken out of ...
406 (find_debuginfo_in_path): ... here. New function, broken out of ...
407 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
408 dwfl_build_id_find_debuginfo first.
409
410 * dwfl_build_id_find_elf.c: New file.
411 * dwfl_build_id_find_debuginfo.c: New file.
412 * Makefile.am (libdwfl_a_SOURCES): Add them.
413 * libdwfl.h: Declare them.
414 * libdwflP.h: Add INTDECLs.
415
416 * dwfl_module_build_id.c: New file.
417 * dwfl_module_report_build_id.c: New file.
418 * Makefile.am (libdwfl_a_SOURCES): Add them.
419 * libdwfl.h: Declare them.
420 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
421 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
422 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
423
424 * dwfl_module_getdwarf.c (find_offsets): New function.
425 (find_dynsym): New function, calls that.
426 (find_symtab): Call it.
427
Roland McGrathc76f0b02007-09-27 07:31:33 +00004282007-09-11 Roland McGrath <roland@redhat.com>
429
430 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
431 address if its st_size is smaller.
432
Roland McGrath099dd522007-08-13 22:58:36 +00004332007-08-13 Roland McGrath <roland@redhat.com>
434
435 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
436
4372007-08-12 Roland McGrath <roland@redhat.com>
438
439 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
440 FTS_LOGICAL.
441
442 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
443 a second phdr if it happens to match EHDR_VMA exactly.
444
Roland McGrath42f68682007-08-09 07:54:22 +00004452007-08-08 Roland McGrath <roland@redhat.com>
446
447 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
448 those with no names. Rewrite best symbol algorithm not to assume a
449 sorted table and to be smarter handling sizeless symbols.
450
Roland McGrath87d47802007-07-16 22:23:37 +00004512007-07-16 Roland McGrath <roland@redhat.com>
452
453 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
454 reviving an existing module.
455
4562007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +0000457
458 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
459
Roland McGrath9aa8ef72007-05-18 08:59:43 +00004602007-05-17 Roland McGrath <roland@redhat.com>
461
462 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
463 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
464 (dwfl_linux_kernel_find_elf): Likewise.
465
466 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
467 getline and sscanf instead of fscanf.
468
4692007-05-08 Roland McGrath <roland@redhat.com>
470
471 * offline.c (dwfl_offline_section_address): Don't assume section
472 numbers match between stripped and debuginfo files. Instead, assume
473 only that the ordering among SHF_ALLOC sections matches.
474
475 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
476 pointer to string.
477 (dwfl_linux_kernel_report_offline): Update caller.
478 (dwfl_linux_kernel_report_kernel): Likewise.
479
Roland McGrath4be15242007-04-25 03:09:33 +00004802007-04-23 Roland McGrath <roland@redhat.com>
481
482 * argp-std.c (options): Fix group title string.
483
484 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
485 Update via STATE->input every time we set STATE->hook, not only at
486 ARGP_KEY_SUCCESS.
487
488 * dwfl_module.c (free_file): Free FILE->name.
489
Roland McGrath43da9892007-04-16 23:13:37 +00004902007-04-16 Roland McGrath <roland@redhat.com>
491
492 * derelocate.c (cache_sections): Apply bias to sh_addr.
493 (compare_secrefs): Fix address comparison to avoid signed overflow.
494 (find_section): New function, broken out of ...
495 (dwfl_module_relocate_address): ... here, call it.
496 (check_module): New function, broken out of ...
497 (dwfl_module_relocate_address): ... here, call it.
498 (dwfl_module_address_section): New function.
499 * libdwfl.h: Declare it.
500
Ulrich Drepperc07fbb32007-03-30 19:14:59 +00005012007-03-26 Roland McGrath <roland@redhat.com>
502
503 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
504
5052007-03-18 Roland McGrath <roland@redhat.com>
506
507 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
508 (find_debuginfo): ... here. Call it.
509 Don't return error for libelf errors finding .gnu_debuglink section.
510
Ulrich Drepper6258e742007-03-13 06:22:40 +00005112007-03-12 Roland McGrath <roland@redhat.com>
512
513 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
514 (dwfl_report_begin): ... here. Call it.
515 * libdwfl.h: Declare it.
516 * libdwflP.h: Add INTDECL.
517
518 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
519
520 * offline.c: Comment typo fix.
521
5222007-03-04 Roland McGrath <roland@redhat.com>
523
524 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
525 (find_kernel_elf): New function, broken out of ...
526 (report_kernel): ... here. Call it.
527 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
528 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
529 virtual address bounds of kernel from symbols rounded to page size.
530 (dwfl_linux_kernel_report_kernel): Use that if it works, before
531 resorting to report_kernel.
532
533 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
534 ET_EXEC file with nonzero bias.
535
536 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
537 dwfl_module_addrsym. Guts moved to ...
538 * dwfl_module_addrsym.c: ... here; new file.
539 * Makefile.am (libdwfl_a_SOURCES): Add it.
540 * libdwfl.h: Declare dwfl_module_addrsym.
541 * libdwflP.h: Add INTDECL.
542
5432007-03-03 Roland McGrath <roland@redhat.com>
544
545 * dwfl_module.c (free_file): New function, broken out of ...
546 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
547
548 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
549 on libelf failure.
550
5512007-03-02 Roland McGrath <roland@redhat.com>
552
553 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
554
Ulrich Drepperaa915fd2007-02-05 07:25:33 +00005552007-02-02 Roland McGrath <roland@redhat.com>
556
557 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
558 address exactly if it's no other module's low boundary.
559
560 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
561 and size cover the address, select the closest symbol with st_size==0
562 that lies in the same section.
563
5642007-01-29 Roland McGrath <roland@redhat.com>
565
566 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
567 not PACKAGE_STRING.
568
5692007-01-20 Roland McGrath <roland@redhat.com>
570
571 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
572 as omitted, not 0.
573 * libdwfl.h (Dwfl_Callbacks): Update comment.
574 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
575 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
576 For ignored missing section, use -1 instead of 0.
577 * offline.c (dwfl_offline_section_address): Expect a call for 0.
578
5792007-01-19 Roland McGrath <roland@redhat.com>
580
581 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
582 zero so a lone -e foo.so is shown without address bias.
583
Roland McGrathba949b32007-01-10 20:44:29 +00005842007-01-10 Roland McGrath <roland@redhat.com>
585
Roland McGrath44865b92007-01-11 05:06:16 +0000586 * linux-kernel-modules.c (report_kernel): Check asprintf return value
587 directly instead of via side effect, to silence warn_unused_result.
588 (dwfl_linux_kernel_report_offline): Likewise.
589 (dwfl_linux_kernel_find_elf): Likewise.
590 (dwfl_linux_kernel_module_section_address): Likewise.
591 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +0000592 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
593 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +0000594
Roland McGrathba949b32007-01-10 20:44:29 +0000595 * libdwfl.h (dwfl_begin): Require nonnull argument.
596
Roland McGrath70008802006-12-29 20:44:16 +00005972006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +0000598
Roland McGrath70008802006-12-29 20:44:16 +0000599 * dwfl_module.c (compare_modules): Fix address comparison to avoid
600 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +0000601
Roland McGrath8190db62006-12-17 23:56:51 +00006022006-10-30 Roland McGrath <roland@redhat.com>
603
604 * dwfl_module.c (dwfl_report_module): Comment typo fix.
605
Roland McGrathc373d852006-10-10 00:25:21 +00006062006-09-05 Roland McGrath <roland@redhat.com>
607
608 * derelocate.c (cache_sections): Use alloca instead of variable-sized
609 auto array, in function already alloca.
610
Roland McGratha1cee072006-08-15 01:37:23 +00006112006-08-14 Roland McGrath <roland@redhat.com>
612
613 * linux-kernel-modules.c (try_kernel_name): If the call to
614 dwfl_standard_find_debuginfo produces no results, try it again
615 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
616
617 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
618 * libdwflP.h: ... to here.
619 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
620 repeats the first thing dwfl_standard_find_debuginfo will try.
621
622 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
623 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
624 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
625 section name.
626
Ulrich Drepper077c65f2006-07-12 19:54:51 +00006272006-07-12 Ulrich Drepper <drepper@redhat.com>
628
629 * cu.c: Adjust for internal_function_def removal.
630 * dwfl_error.c: Likewise.
631 * dwfl_module.c: Likewise.
632 * dwfl_module_getdwarf.c: Likewise.
633 * lines.c: Likewise.
634 * relocate.c: Likewise.
635
Ulrich Drepperc87b6e72006-07-11 22:32:28 +00006362006-07-11 Ulrich Drepper <drepper@redhat.com>
637
638 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
639 it can overflow the return value type.
640 Patch by Tim Moore <timoore@redhat.com>.
641
Ulrich Dreppere1812e12006-07-12 07:46:03 +00006422006-06-28 Roland McGrath <roland@redhat.com>
643
644 * libdwfl.h: Cosmetic changes.
645
646 * dwfl_line_comp_dir.c: New file.
647 * Makefile.am (libdwfl_a_SOURCES): Add it.
648 * libdwfl.h: Declare dwfl_line_comp_dir.
649
650 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
651
652 * dwfl_linecu.c: New file.
653 * Makefile.am (libdwfl_a_SOURCES): Add it.
654 * libdwfl.h: Declare dwfl_linecu.
655
656 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
657 (dwfl_linecu): Define as macro.
658
659 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
660
661 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
662 (dwfl_module_addrname): Function moved ...
663 * dwfl_module_addrname.c: ... here, new file.
664 * dwfl_module_getsym.c: New file.
665 * Makefile.am (libdwfl_a_SOURCES): Add them.
666 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
667 * libdwflP.h: Add INTDECLs.
668
6692006-06-27 Roland McGrath <roland@redhat.com>
670
671 * dwfl_module.c (dwfl_report_end): Whitespace fix.
672
Ulrich Drepperd5a75192006-06-15 03:07:46 +00006732006-06-13 Roland McGrath <roland@redhat.com>
674
675 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
676 Use __libdwfl_seterrno for elf_memory failure.
677
Ulrich Dreppere1812e12006-07-12 07:46:03 +00006782006-05-22 Roland McGrath <roland@redhat.com>
679
680 * dwfl_module_return_value_location.c
681 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
682
Ulrich Drepper41cbd762006-05-27 18:19:23 +00006832006-05-27 Ulrich Drepper <drepper@redhat.com>
684
685 * libdwfl.h: Add extern "C".
686
Ulrich Dreppere7a73172006-05-22 18:16:45 +00006872006-05-22 Ulrich Drepper <drepper@redhat.com>
688
689 * cu.c (addrarange): Handle files without aranges information.
690
Ulrich Dreppera1690682006-05-17 05:28:36 +00006912006-05-16 Ulrich Drepper <drepper@redhat.com>
692
693 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
694 ->modules is NULL.
695
Roland McGrath687d7e92006-02-27 04:53:00 +00006962006-02-26 Roland McGrath <roland@redhat.com>
697
Roland McGrath08333122006-02-27 04:54:26 +0000698 * dwfl_version.c: New file.
699 * Makefile.am (libdwfl_a_SOURCES): Add it.
700 * libdwfl.h: Declare dwfl_version.
701
Roland McGrath687d7e92006-02-27 04:53:00 +0000702 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
703 aligned up from DWFL->offline_next_address when checking for overlap.
704
Roland McGrathfceb7b42005-12-23 01:45:21 +00007052005-12-22 Roland McGrath <roland@redhat.com>
706
Roland McGrath1656bc02005-12-23 01:49:50 +0000707 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
708
709 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
710 (dwfl_linux_proc_report): ... here. Call it.
711 (dwfl_linux_proc_maps_report): New function.
712 * libdwfl.h: Declare it.
713 * libdwflP.h: Add INTDECL.
714 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
715
Roland McGrathfceb7b42005-12-23 01:45:21 +0000716 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
717 failed with DWFL_E_NO_DWARF.
718
Roland McGrath994b4892005-12-05 22:46:21 +00007192005-11-26 Roland McGrath <roland@redhat.com>
720
721 * dwfl_end.c (dwfl_end): Free the DWFL itself.
722
7232005-11-25 Roland McGrath <roland@redhat.com>
724
725 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
726 (load_dw): Use it.
727 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
728 * libdwflP.h: Declare it.
729
730 * dwfl_module_register_names.c: New file.
731 * Makefile.am (libdwfl_a_SOURCES): Add it.
732 * libdwfl.h: Declare dwfl_module_register_names.
733
Roland McGratha5640892005-11-26 00:38:14 +00007342005-11-21 Roland McGrath <roland@redhat.com>
735
736 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
737 Don't leak malloc'd file name.
738 If a /sys/.../sections file is missing and starts with ".init",
739 try the variant with "_init" too; catches PPC64 kernel braindamage.
740
Roland McGrathe47ab762005-11-17 03:16:00 +00007412005-11-15 Roland McGrath <roland@redhat.com>
742
743 * libdwfl.h: Comment fixes.
744
745 * dwfl_module_return_value_location.c: Add unlikely for error case.
746
7472005-11-13 Roland McGrath <roland@redhat.com>
748
749 * dwfl_return_value_location.c: New file.
750 * Makefile.am (libdwfl_a_SOURCES): Add it.
751 * libdwfl.h: Declare dwfl_module_return_value_location.
752 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
753
Roland McGrath07d4f2f2005-10-28 06:56:24 +00007542005-10-20 Roland McGrath <roland@redhat.com>
755
756 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
757 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
758 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
759
7602005-10-01 Roland McGrath <roland@redhat.com>
761
762 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
763 with errno 0.
764
7652005-09-19 Roland McGrath <roland@redhat.com>
766
767 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
768 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
769 the signed integer reading; they will just have to be in hexadecimal.
770 (dwfl_linux_kernel_module_section_address): Likewise.
771
Ulrich Drepperfbe998a2005-08-29 16:27:10 +00007722005-08-28 Ulrich Drepper <drepper@redhat.com>
773
774 * Makefile.am (%.os): Use COMPILE.os.
775 (COMPILE.os): Filter out gconv options.
776
Roland McGrath995f92d2005-08-26 05:55:04 +00007772005-08-25 Roland McGrath <roland@redhat.com>
778
779 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
780 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
781
Roland McGrath80e43a72005-08-24 21:12:15 +00007822005-08-24 Roland McGrath <roland@redhat.com>
783
Roland McGrathefb5caa2005-08-25 01:49:53 +0000784 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
785
Roland McGrath80e43a72005-08-24 21:12:15 +0000786 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
787 magic initializer to set -heur-stack-bound option.
788
Roland McGrath3712b282005-08-23 05:58:42 +00007892005-08-22 Roland McGrath <roland@redhat.com>
790
Roland McGrathd17fac72005-08-23 08:20:21 +0000791 * dwfl_validate_address.c: New file.
792 * Makefile.am (libdwfl_a_SOURCES): Add it.
793 * libdwfl.h: Declare dwfl_validate_address.
794
795 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
796 * libdwflP.h: Add INTDECL.
797
Roland McGrath3712b282005-08-23 05:58:42 +0000798 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
799 elf_rawdata for symbol-related sections.
800
Roland McGrathd17fac72005-08-23 08:20:21 +0000801 * offline.c (dwfl_report_offline): Move offline_next_address outside
802 module's range, in case it's an ET_EXEC using fixed segment locations.
803 * libdwfl.h: Update comment.
804
805 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
806 required alignment.
807
8082005-08-20 Roland McGrath <roland@redhat.com>
809
810 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
811 function to choose whether to report.
812 (dwfl_linux_kernel_report_offline): Likewise.
813 * libdwfl.h: Update decl.
814 * argp-std.c (parse_opt): Update caller.
815
816 * dwfl_getsrclines.c: New file.
817 * dwfl_onesrcline.c: New file.
818 * Makefile.am (libdwfl_a_SOURCES): Add them.
819 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
820
821 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
822 MODULESDIR[0]. Call fts_close on failure.
823
824 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
825 Close ET_REL file descriptors after relocation.
826 (find_dw): Update caller.
827 * offline.c (dwfl_report_offline): Get the file into memory and close
828 the file descriptor.
829
830 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
831 MOD->debug.elf is already set.
832
833 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
834 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
835
836 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
837 dwfl_linux_kernel_report_offline with offline_callbacks.
838
839 * linux-kernel-modules.c (report_kernel): New function, broken out of
840 ...
841 (dwfl_linux_kernel_report_kernel): ... here. Use it.
842 (dwfl_linux_kernel_report_offline): New function.
843 * libdwfl.h: Declare it.
844 * libdwflP.h: Add INTDECL.
845
8462005-08-19 Roland McGrath <roland@redhat.com>
847
848 Use standard debuginfo search path to look for vmlinux.
849 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
850 passed zero.
851 * linux-kernel-modules.c (try_kernel_name): New function, broken out
852 of ...
853 (dwfl_linux_kernel_report_kernel): ... here. Use it.
854
855 * argp-std.c (offline_callbacks): New variable.
856 (parse_opt): Use it for -e. Allow multiple -e options.
857
858 * offline.c: New file.
859 * Makefile.am (libdwfl_a_SOURCES): Add it.
860 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
861 * libdwflP.h: Add INTDECLs.
862 (OFFLINE_REDZONE): New macro.
863 (struct Dwfl): New member `offline_next_address'.
864 * dwfl_begin.c (dwfl_begin): Initialize it.
865 * dwfl_module.c (dwfl_report_begin): Likewise.
866
867 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
868 do a nominal absolute section layout starting at BASE.
869 * libdwfl.h: Update comment.
870
8712005-08-18 Roland McGrath <roland@redhat.com>
872
873 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
874 dwfl_module_getdwarf if necessary.
875
876 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
877 * libdwfl.h: Update comment.
878
879 * derelocate.c: New file.
880 * Makefile.am (libdwfl_a_SOURCES): Add it.
881
882 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
883 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
884 * dwfl_module_getdwarf.c (open_elf): Update initialization.
885 (load_dw, dwfl_module_addrname): Update uses.
886 * relocate.c (__libdwfl_relocate): Likewise.
887
8882005-08-04 Roland McGrath <roland@redhat.com>
889
890 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
891 arguments SHNDX, SHDR.
892 (dwfl_linux_kernel_module_section_address): Update prototype.
893 * relocate.c (__libdwfl_relocate_value): Update caller.
894 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
895 Take the new arguments.
896
Roland McGrathd2c59962005-08-10 22:13:57 +00008972005-08-10 Roland McGrath <roland@redhat.com>
898
899 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
900 use it instead of MOD->debug.file.
901 * libdwflP.h: Update decl.
902 * dwfl_module_getdwarf.c (load_dw): Update caller.
903 Fixes bug #165598.
904
Roland McGrath4959bf82005-08-09 10:31:08 +00009052005-08-09 Roland McGrath <roland@redhat.com>
906
907 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
908 * cu.c: Use INTUSE on dwarf_* calls.
909 * dwfl_error.c: Likewise.
910 * dwfl_module.c: Likewise.
911 * dwfl_module_getdwarf.c: Likewise.
912 * dwfl_module_getsrc_file.c: Likewise.
913 * lines.c: Likewise.
914
Roland McGrath5678f872005-08-07 21:42:56 +00009152005-08-07 Roland McGrath <roland@redhat.com>
916
917 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
918 names contain '_' or '-', look for files named either "foo-bar.ko"
919 or "foo_bar.ko".
920
Roland McGrath83fcb482005-08-02 00:58:33 +00009212005-07-29 Roland McGrath <roland@redhat.com>
922
923 * loc2c.c: File removed.
924 * loc2c.h: File removed.
925 * loc2c-runtime.h: File removed.
926 * test2.c: File removed.
927 * Makefile.am (EXTRA_DIST): Variable removed.
928 (noinst_HEADERS): Remove loc2c.h from here.
929
Ulrich Drepper18618fd2005-07-28 21:29:22 +00009302005-07-28 Ulrich Drepper <drepper@redhat.com>
931
Ulrich Drepper4d527362005-07-28 22:32:58 +0000932 * libdwfl.h: Add a few missing extern for function prototypes.
933
Ulrich Drepper18618fd2005-07-28 21:29:22 +0000934 * libdwfl_crc32.c: New file.
935 * libdwfl_crc32_file.c: New file.
936 * libdwflP.h: Declare the new functions.
937 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
938 libdwfl_crc32_file.c.
939 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
940 instead of crc32_file.
941
Roland McGrathd89bbe42005-07-28 07:08:01 +00009422005-07-28 Roland McGrath <roland@redhat.com>
943
Roland McGrath244501f2005-07-28 09:15:47 +0000944 * ptest.c: Moved to ../tests/dwflmodtest.c.
945
Roland McGrath18385902005-07-28 07:12:38 +0000946 * Makefile.am (noinst_PROGRAMS): Variable removed.
947 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
948 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
949 (libdwfl): Don't use libdwfl.so any more.
950 (libdwfl.so, install, uninstall): Targets removed.
951 (test2_SOURCES): Define EXTRA_DIST instead of this.
952 * libdwfl.map: File removed.
953
Roland McGrathd89bbe42005-07-28 07:08:01 +0000954 * libdwfl.h: Use "" for libdw.h #include.
955
Roland McGrath5bab2442005-07-28 00:44:29 +00009562005-07-27 Roland McGrath <roland@redhat.com>
957
958 * libdwfl.map: Add dwfl_getmodules.
959
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00009602005-07-23 Ulrich Drepper <drepper@redhat.com>
961
962 * Makefile.am: Fix rules to allow building with mudflap.
963
9642005-07-21 Roland McGrath <roland@redhat.com>
965
966 * Makefile.am (noinst_HEADERS): Add loc2c.c.
967
968 * test2.c (main): Check sscanf result to quiet warning.
969
9702005-07-20 Roland McGrath <roland@redhat.com>
971
972 * libdwfl-branch merged, creating this direcotry.