blob: 9e76838fd5115234be534d19a66c11462ab0d71e [file] [log] [blame]
Roland McGrathcdb48e02009-11-05 11:34:08 -080012009-11-05 Roland McGrath <roland@redhat.com>
2
3 * link_map.c (report_r_debug): Skip entries with l_ld==0.
Roland McGrath6229eb52009-11-05 11:43:38 -08004 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
Roland McGrathcdb48e02009-11-05 11:34:08 -08005
Roland McGrathde6730c2009-09-04 03:05:31 -070062009-09-04 Roland McGrath <roland@redhat.com>
7
8 * image-header.c (__libdw_image_header): Fix tranposed comparison.
9
Roland McGrath6bb90712009-08-27 12:36:47 -0700102009-08-27 Roland McGrath <roland@redhat.com>
11
12 * image-header.c: New file.
13 * Makefile.am (libdwfl_a_SOURCES): Add it.
14 * libdwflP.h: Declare __libdw_image_header.
15 * open.c (decompress): Don't consume ELF on failure.
16 (what_kind): New function, broken out of ...
17 (__libdw_open_file): ... here. Call it.
18 If it fails, try __libdw_image_header and then try what_kind again.
19
20 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
21 leave it behind for next decompressor.
22 * open.c (decompress): Free BUFFER on failure.
23
Roland McGrathd6ccdc12009-08-26 00:23:01 -0700242009-08-26 Roland McGrath <roland@redhat.com>
25
Roland McGrathe5a1a812009-08-26 03:05:50 -070026 * gzip.c (find_zImage_payload): New function, broken out of ...
27 (mapped_zImage): ... here. Call it.
28 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
29 stupid method of just trying the decoder.
30
Roland McGrath24169642009-08-26 02:26:34 -070031 * open.c [USE_LZMA]: Try __libdw_unlzma.
32 * libdwflP.h: Declare it.
33 (DWFL_ERRORS): Add DWFL_E_LZMA.
34 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
35 * lzma.c: New file.
36 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
37
Roland McGrathd6ccdc12009-08-26 00:23:01 -070038 * gzip.c (mapped_zImage): Limit scan to 32kb.
39 Make this unconditional, support bzip2 kernel images too.
Roland McGrathae1d7dc2009-08-26 01:27:59 -070040 (unzip): Use direct inflate method for non-mmap case too.
41 Only zlib uses the stream method.
Roland McGrathd6ccdc12009-08-26 00:23:01 -070042
Roland McGrathebfb6482009-08-09 15:40:52 -0700432009-08-09 Roland McGrath <roland@redhat.com>
44
45 * dwfl_module_build_id.c: Use new macros for versioned definitions.
46
Roland McGrathfe8b42e2009-07-08 14:54:16 -0700472009-07-08 Roland McGrath <roland@redhat.com>
48
Roland McGrath3c84db32009-06-24 17:41:40 -070049 * dwfl_module_dwarf_cfi.c: New file.
50 * dwfl_module_eh_cfi.c: New file.
51 * Makefile.am (libdwfl_a_SOURCES): Add them.
52 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
53 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
54
552009-07-08 Roland McGrath <roland@redhat.com>
56
Roland McGrathfe8b42e2009-07-08 14:54:16 -070057 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
58
Mark Wielaard2256e362009-06-18 13:31:56 +0200592009-06-18 Mark Wielaard <mjw@redhat.com>
60
61 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
62
Ulrich Drepperf1894932009-06-13 15:55:42 -0700632009-06-13 Ulrich Drepper <drepper@redhat.com>
64
65 * derelocate.c: Don't use deprecated libelf functions.
66 * dwfl_module_getdwarf.c: Likewise.
67 * relocate.c: Likewise.
68
Ulrich Drepper4f515712009-04-23 07:54:53 -0700692009-04-23 Ulrich Drepper <drepper@redhat.com>
70
71 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
72 defined. Otherwise just define the latest version.
73
Roland McGrathcc480472009-04-22 11:32:20 -0700742009-04-22 Roland McGrath <roland@redhat.com>
75
Roland McGrathc65558b2009-04-22 12:29:32 -070076 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
77 a non-ET_REL module.
78
Roland McGrathcc480472009-04-22 11:32:20 -070079 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
80 adjust properly for non-ET_REL.
81
Roland McGrath19a8e4d2009-04-21 15:44:07 -0700822009-04-21 Roland McGrath <roland@redhat.com>
83
84 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
85
86 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
87 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
88 for ET_REL.
89 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
90
Roland McGrath10361572009-04-20 11:50:50 -0700912009-04-20 Roland McGrath <roland@redhat.com>
92
93 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
94
Roland McGratha605a3c2009-04-19 18:27:01 -0700952009-04-19 Roland McGrath <roland@redhat.com>
96
97 * dwfl_module_getdwarf.c (find_file): Renamed to ...
98 (__libdwfl_getelf): ... this. Make it global.
99 (find_symtab, find_dw): Update callers.
100 (dwfl_module_getelf): Functions moved ...
101 * dwfl_module_getelf.c: ... here, new file.
102 * Makefile.am (libdwfl_a_SOURCES): Add it.
103 * libdwflP.h: Declare __libdwfl_getelf.
104
Roland McGrathfa253262009-04-14 02:38:19 -07001052009-04-14 Roland McGrath <roland@redhat.com>
106
107 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
108 absolute (already adjusted in place) or needing load bias adjustment.
109
110 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
111 gelf_getphdr failure. Fix file size limit checks.
112
113 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
114
Roland McGrath243fa262009-04-08 17:05:43 -07001152009-04-08 Roland McGrath <roland@redhat.com>
116
Roland McGrath785dbb12009-04-08 17:15:01 -0700117 * dwfl_module_getsym.c: Don't adjust for bias again after
118 __libdwfl_relocate_value.
119
Roland McGrath243fa262009-04-08 17:05:43 -0700120 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
121 a non-SHF_ALLOC section.
122 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
123 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
124
Roland McGrath8651c5e2009-03-09 20:42:56 -07001252009-03-09 Roland McGrath <roland@redhat.com>
126
Roland McGrath329ed9f2009-03-09 20:49:53 -0700127 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
128 variable to outer scope, so we cache it for the loop.
129
Roland McGrath8651c5e2009-03-09 20:42:56 -0700130 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
131
Roland McGrath31fd6542009-02-12 17:26:39 -08001322009-02-12 Roland McGrath <roland@redhat.com>
133
134 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
135 __libdwfl_relocate_value to find correct sh_addr value.
136
Roland McGrath45c01cd2009-02-10 17:03:19 -08001372009-02-10 Roland McGrath <roland@redhat.com>
138
Roland McGrath5453abf2009-02-10 17:33:49 -0800139 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
140 If false, don't fail for NO_PHDR.
141 (dwfl_report_elf): Update caller.
142 * libdwflP.h: Update decl.
143 * offline.c (process_elf): Call it with false, so we don't refuse
144 dubiously-formed objects here.
145
Roland McGrath45c01cd2009-02-10 17:03:19 -0800146 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
147 finds our module. We shouldn't crash when we confuse some guesses.
148
Ulrich Dreppera9d51bf2009-02-10 12:55:07 -08001492009-02-10 Ulrich Drepper <drepper@redhat.com>
150
151 * open.c (decompress): Avoid crash with empty input file.
152
Roland McGrathe738ad22009-01-27 16:41:54 -08001532009-01-27 Roland McGrath <roland@redhat.com>
154
155 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
156 with zero vaddr and memsz.
157
Roland McGrath74afbee2009-01-22 04:52:56 -08001582009-01-22 Roland McGrath <roland@redhat.com>
159
Roland McGrathe34a3f82009-01-22 12:59:23 -0800160 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
161
Roland McGrath74afbee2009-01-22 04:52:56 -0800162 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
163 after address-matching loop.
164
165 * segment.c (lookup): Fix fencepost in checking for HINT match.
166
Roland McGrath8dc9f932009-01-14 12:56:53 -08001672009-01-14 Roland McGrath <roland@redhat.com>
168
169 * gzip.c [!BZLIB] (mapped_zImage): New function.
170 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
171
Ulrich Drepper7e678fa2009-01-10 18:02:05 -08001722009-01-10 Ulrich Drepper <drepper@redhat.com>
173
174 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
175
Roland McGratha4b1a952009-01-08 20:53:26 -08001762009-01-08 Roland McGrath <roland@redhat.com>
177
178 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
179 Skip subdirectory named "source".
180 (dwfl_linux_kernel_find_elf): Likewise.
181
Roland McGrath60205c92009-01-06 00:10:23 -08001822009-01-06 Roland McGrath <roland@redhat.com>
183
Roland McGrath705364b2009-01-06 02:04:51 -0800184 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -0800185 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
186 (dwfl_linux_kernel_report_offline): Use it.
187 (dwfl_linux_kernel_find_elf): Likewise.
188
Roland McGrathbca43152009-01-05 23:59:32 -08001892009-01-05 Roland McGrath <roland@redhat.com>
190
191 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
192 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
193 * dwfl_build_id_find_elf.c: Likewise.
194 * dwfl_module_getdwarf.c (open_elf): Likewise.
195 * dwfl_report_elf.c: Likewise.
196 * find-debuginfo.c (validate): Likewise.
197 * offline.c (__libdwfl_report_offline): Likewise.
198
199 * libdwflP.h: Declare __libdw_open_file.
200 * open.c: New file.
201 * Makefile.am (libdwfl_a_SOURCES): Add it.
202
203 * gzip.c: New file.
204 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
205 * bzip2.c: New file.
206 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
207 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
208
Roland McGrath45d7b292008-12-16 16:21:40 -08002092008-12-16 Roland McGrath <roland@redhat.com>
210
211 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
212 symver magic to bind to ELFUTILS_0.138.
213 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
214 wrapper for ELFUTILS_0.130 version set.
215
Roland McGrath7d9b8212008-12-18 15:08:09 -08002162008-12-18 Roland McGrath <roland@redhat.com>
217
218 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
219 addresses are taken as relative to MOD->low_addr.
220
Roland McGrath74825c42008-12-15 19:33:33 -08002212008-12-15 Roland McGrath <roland@redhat.com>
222
223 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
224 debug.bias.
225
Roland McGrathb28a8942008-12-11 02:09:28 -08002262008-12-11 Roland McGrath <roland@redhat.com>
227
228 * offline.c (process_archive): Don't call elf_end and close if
229 returning NULL. Check first elf_begin call and set error code
230 specially for empty archive.
231 Fixes RHBZ#465878.
232
Roland McGratha845f682008-12-03 03:41:58 +00002332008-12-02 Roland McGrath <roland@redhat.com>
234
235 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
236
2372008-11-26 Roland McGrath <roland@redhat.com>
238
239 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
240 return value, and interpret encoded OFFSET argument.
241
2422008-10-07 Roland McGrath <roland@redhat.com>
243
244 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
245
Roland McGrath9cf28e42008-09-30 06:35:35 +00002462008-09-29 Roland McGrath <roland@redhat.com>
247
248 * segment.c (insert): Must realloc DWFL->lookup_module here too.
249 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
250
2512008-08-28 Roland McGrath <roland@redhat.com>
252
253 * segment.c (reify_segments): Fix last change.
254
2552008-08-27 Roland McGrath <roland@redhat.com>
256
257 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
258 failure from pread64.
259
Roland McGrath122f3882008-08-26 07:20:29 +00002602008-08-26 Roland McGrath <roland@redhat.com>
261
262 * segment.c (reify_segments): Insert a trailing segment for a module
263 end that is above the highest current segment.
264
2652008-08-25 Roland McGrath <roland@redhat.com>
266
267 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
268 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
269 if FILE->elf is not ELF_K_ELF.
270
271 * dwfl_segment_report_module.c: Add a cast.
272
Roland McGrathb4d6f0f2008-08-25 22:55:17 +00002732008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +0000274
Roland McGrathb4d6f0f2008-08-25 22:55:17 +0000275 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
276 which decides which symbol is "closest" to a given address.
277
2782008-08-15 Roland McGrath <roland@redhat.com>
279
280 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
281 (options, parse_opt): Handle --core.
282
283 * core-file.c: New file.
284 * Makefile.am (libdwfl_a_SOURCES): Add it.
285 * libdwflP.h (dwfl_core_file_report): Declare it.
286
287 * link_map.c: New file.
288 * Makefile.am (libdwfl_a_SOURCES): Add it.
289 * libdwflP.h (dwfl_link_map_report): Declare it.
290
291 * libdwflP.h (MIN, MAX): New macros.
292 (Dwfl_Memory_Callback): New typedef.
293 (Dwfl_Module_Callback): New typedef.
294 (dwfl_segment_report_module): Declare it.
295 * dwfl_segment_report_module.c: New file.
296 * Makefile.am (libdwfl_a_SOURCES): Add it.
297
298 * derelocate.c (dwfl_module_address_section): Add INTDEF.
299 * libdwflP.h: Add INTDECL.
300
301 * segment.c: New file.
302 * Makefile.am (libdwfl_a_SOURCES): Add it.
303 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
304 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
305 lookup_addr, lookup_module, lookup_segndx, replace removed members
306 modules, nmodules.
307 (struct Dwfl_Module): New member segment.
308 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
309 to each free module.
310 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
311 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
312 (dwfl_report_module): Don't touch DWFL->nmodules.
313 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
314 (compare_modules): Function removed.
315 * dwfl_getmodules.c: Rewritten.
316 Add INTDEF.
317 * libdwflP.h: Add INTDECLs.
318 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
319 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +0000320
Roland McGrath1d8bb252008-08-07 08:39:41 +00003212008-08-03 Roland McGrath <roland@redhat.com>
322
323 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
324
3252008-07-17 Roland McGrath <roland@redhat.com>
326
327 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
328 zero if the failure was only ENOENT.
329
3302008-06-03 Roland McGrath <roland@redhat.com>
331
332 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
333 symbols.
334
Roland McGrath9d2f3ee2008-05-22 20:28:05 +00003352008-05-22 Petr Machata <pmachata@redhat.com>
336
337 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
338
Roland McGrath0fa20e82008-05-07 18:37:14 +00003392008-05-06 Roland McGrath <roland@frob.com>
340
341 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
342 FTS_LOGICAL here too.
343 (dwfl_linux_kernel_find_elf): Likewise.
344
3452008-04-29 Roland McGrath <roland@redhat.com>
346
347 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
348 based on canonicalize_file_name if it differs from the supplied name.
349
350 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
351 we accept symlinks.
352
Roland McGrath9897d662008-04-29 01:49:50 +00003532008-04-27 Roland McGrath <roland@redhat.com>
354
355 * linux-kernel-modules.c (report_kernel): Fix crash when
356 dwfl_report_elf fails.
357
Roland McGrathbfc01702008-04-06 01:57:32 +00003582008-04-05 Roland McGrath <roland@redhat.com>
359
360 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
361
362 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
363 Clear it after freeing.
364 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
365
Roland McGrathd11f9cb2008-03-26 20:51:59 +00003662008-03-26 Roland McGrath <roland@redhat.com>
367
368 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
369 SHT_DYNSYM, just set *SYMSCN like the comment says.
370
371 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
372
373 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
374
3752008-03-19 Roland McGrath <roland@redhat.com>
376
377 * dwfl_module_getsrc.c: Adjust address for module bias before search.
378
3792008-03-01 Roland McGrath <roland@redhat.com>
380
381 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
382 prototype to avoid older compiler's complaint about reuse of the name.
383 (__libdwfl_canon_error): Likewise.
384
Roland McGrath059c83e2008-02-21 06:19:39 +00003852008-02-19 Roland McGrath <roland@redhat.com>
386
387 * relocate.c (relocate_section): Check for an unhandled relocation
388 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
389 DWFL_E_UNKNOWN_MACHINE check out of loops.
390
391 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
392 DEBUGFILE->relocated is already set.
393
3942008-01-26 Roland McGrath <roland@redhat.com>
395
396 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
397
398 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
399 incoming *FILE_NAME at the start.
400
Ulrich Dreppere219f1c2008-01-09 05:49:49 +00004012008-01-08 Roland McGrath <roland@redhat.com>
402
403 * Makefile.am (euinclude): Variable removed.
404 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
405
Roland McGrathe4c22ea2007-10-23 13:07:39 +00004062007-10-23 Roland McGrath <roland@redhat.com>
407
408 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
409 module to appear first.
410
4112007-10-20 Roland McGrath <roland@redhat.com>
412
413 * offline.c (process_archive_member): Take FD argument, pass it down
414 to process_file. Return Elf_Cmd, not bool.
415 Call elf_next here, always before elf_end.
416 (process_archive): Update caller. Don't close FD here unless there
417 are no member refs.
418
419 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
420
421 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
422 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
423 partial relocation to one or both files.
424 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
425 relocations have been applied to the debug file if dwfl_module_getelf
426 has been used before.
427
428 * relocate.c (resolve_symbol): New function.
429 (relocate_section): Call it.
430
431 * relocate.c (relocate_getsym): Handle null MOD->symfile.
432 (relocate_section): Take new bool arg, PARTIAL. If true,
433 no error for BADRELTYPE/RELUNDEF, instead just skip them
434 and leave only those skipped relocs behind the reloc section.
435 (__libdwfl_relocate_section): Take new arg, pass it down.
436 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
437 do partial relocation on all sections.
438 * dwfl_module_getdwarf.c (load_dw): Update caller.
439 * libdwflP.h: Update decls.
440 * derelocate.c (dwfl_module_address_section): Pass new argument
441 to __libdwfl_relocate_section, true.
442
443 * derelocate.c (cache_sections): Don't cache reloc sections when
444 section_address callback is null.
445
4462007-10-19 Roland McGrath <roland@redhat.com>
447
448 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
449
450 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
451 (struct secref): Likewise.
452 (cache_sections): Cache the relocation section referring to each
453 section we cache, if any.
454 (dwfl_module_address_section): Use __libdwfl_relocate_section as
455 necessary.
456
457 * relocate.c (struct reloc_symtab_cache): New type.
458 (relocate_getsym): Use it instead of four arguments.
459 (__libdwfl_relocate): Update caller.
460 (relocate_section): New function, broken out of ...
461 (__libdwfl_relocate): ... here.
462 (__libdwfl_relocate_section): New function.
463 * libdwflP.h: Declare it.
464
4652007-10-17 Roland McGrath <roland@redhat.com>
466
467 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
468 to relocated st_value.
469
470 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
471 ET_REL to 0x100.
472
4732007-10-16 Roland McGrath <roland@redhat.com>
474
475 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
476 section has larger alignment requirements not met by the original BASE,
477 rather than padding more between sections.
478
479 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
480
481 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
482 to sh_addr value.
483
484 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
485 at zero in ET_REL case. Adjust BASE to necessary alignment.
486
487 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
488 for DATA_VADDR.
489 (__libdwfl_find_build_id): Update caller.
490
491 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
492 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
493 * offline.c (dwfl_offline_section_address): Bail early if there is
494 separate debug file.
495
496 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
497
Ulrich Drepperb597dfa2007-10-16 05:21:27 +00004982007-10-09 Roland McGrath <roland@redhat.com>
499
500 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
501 caching SHDR->sh_addr = 0.
502 * offline.c (dwfl_offline_section_address): Never called for sh_addr
503 really at 0, don't check for it. Use MOD->debug directly, not symfile.
504
505 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
506 we've found SHT_SYMTAB.
507
508 * relocate.c (relocate_getsym): New function.
509 (__libdwfl_relocate): Use it.
510 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
511 be a pointer instead of value; cache getshstrndx result there.
512 * libdwflP.h: Update decl.
513 * derelocate.c (cache_sections): Update caller.
514 Always work on the main file, not the symfile.
515 (dwfl_module_address_section): Likewise.
516 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
517
5182007-10-07 Roland McGrath <roland@redhat.com>
519
520 * offline.c (process_archive): Initialize MOD.
521
522 * linux-kernel-modules.c (get_release): New function, broken out of ...
523 (report_kernel): ... here. Call it.
524 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
525 (find_kernel_elf): Update caller.
526 (report_kernel_archive): New function.
527 (dwfl_linux_kernel_report_offline): Call it.
528
529 * offline.c (process_file): Take new arg PREDICATE, pass it down.
530 (process_archive): Likewise.
531 (process_archive_member): Likewise. When nonnull, let the predicate
532 decide whether to use this member.
533 (__libdwfl_report_offline): New function, broken out of ...
534 (dwfl_report_offline): ... here. Call it.
535 * libdwflP.h: Declare it.
536
537 * offline.c (process_archive, process_archive_member): New functions.
538 (process_elf, process_file): New functions, broken out of ...
539 (dwfl_report_offline): ... here. Call process_file, which recurses on
540 ELF_K_AR files.
541
542 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
543 (dwfl_report_elf): ... here. Call it.
544 * libdwflP.h: Declare it.
545
5462007-10-06 Roland McGrath <roland@redhat.com>
547
548 * derelocate.c (dwfl_module_relocations): Don't call
549 dwfl_module_getdwarf.
550
551 * derelocate.c (find_section): Use __libdwfl_seterrno, not
552 __libdw_seterrno.
553
554 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
555 SHF_ALLOC, to cache sh_addr resolved to 0.
556
557 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
558 values nonzero already, just use its existing layout.
559
560 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
561 in-core shdr after applying it.
562
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +00005632007-10-04 Ulrich Drepper <drepper@redhat.com>
564
565 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
566 initialization of notes variable.
567
Roland McGrath59ea7f32007-10-04 08:50:09 +00005682007-10-04 Roland McGrath <roland@redhat.com>
569
570 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
571 fill in with vaddr of "__start_notes" symbol if found.
572 (check_notes): New function.
573 (check_kernel_notes): New function.
574 (dwfl_linux_kernel_report_kernel): Call it.
575 (check_module_notes): New function.
576 (dwfl_linux_kernel_report_modules): Call it.
577
578 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
579 Try dwfl_build_id_find_elf first.
580
581 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
582 Set kernel module e_type to ET_DYN.
583
5842007-10-03 Roland McGrath <roland@redhat.com>
585
586 * find-debuginfo.c (validate): New function, broken out of ...
587 (find_debuginfo_in_path): ... here. New function, broken out of ...
588 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
589 dwfl_build_id_find_debuginfo first.
590
591 * dwfl_build_id_find_elf.c: New file.
592 * dwfl_build_id_find_debuginfo.c: New file.
593 * Makefile.am (libdwfl_a_SOURCES): Add them.
594 * libdwfl.h: Declare them.
595 * libdwflP.h: Add INTDECLs.
596
597 * dwfl_module_build_id.c: New file.
598 * dwfl_module_report_build_id.c: New file.
599 * Makefile.am (libdwfl_a_SOURCES): Add them.
600 * libdwfl.h: Declare them.
601 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
602 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
603 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
604
605 * dwfl_module_getdwarf.c (find_offsets): New function.
606 (find_dynsym): New function, calls that.
607 (find_symtab): Call it.
608
Roland McGrathc76f0b02007-09-27 07:31:33 +00006092007-09-11 Roland McGrath <roland@redhat.com>
610
611 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
612 address if its st_size is smaller.
613
Roland McGrath099dd522007-08-13 22:58:36 +00006142007-08-13 Roland McGrath <roland@redhat.com>
615
616 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
617
6182007-08-12 Roland McGrath <roland@redhat.com>
619
620 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
621 FTS_LOGICAL.
622
623 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
624 a second phdr if it happens to match EHDR_VMA exactly.
625
Roland McGrath42f68682007-08-09 07:54:22 +00006262007-08-08 Roland McGrath <roland@redhat.com>
627
628 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
629 those with no names. Rewrite best symbol algorithm not to assume a
630 sorted table and to be smarter handling sizeless symbols.
631
Roland McGrath87d47802007-07-16 22:23:37 +00006322007-07-16 Roland McGrath <roland@redhat.com>
633
634 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
635 reviving an existing module.
636
6372007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +0000638
639 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
640
Roland McGrath9aa8ef72007-05-18 08:59:43 +00006412007-05-17 Roland McGrath <roland@redhat.com>
642
643 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
644 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
645 (dwfl_linux_kernel_find_elf): Likewise.
646
647 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
648 getline and sscanf instead of fscanf.
649
6502007-05-08 Roland McGrath <roland@redhat.com>
651
652 * offline.c (dwfl_offline_section_address): Don't assume section
653 numbers match between stripped and debuginfo files. Instead, assume
654 only that the ordering among SHF_ALLOC sections matches.
655
656 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
657 pointer to string.
658 (dwfl_linux_kernel_report_offline): Update caller.
659 (dwfl_linux_kernel_report_kernel): Likewise.
660
Roland McGrath4be15242007-04-25 03:09:33 +00006612007-04-23 Roland McGrath <roland@redhat.com>
662
663 * argp-std.c (options): Fix group title string.
664
665 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
666 Update via STATE->input every time we set STATE->hook, not only at
667 ARGP_KEY_SUCCESS.
668
669 * dwfl_module.c (free_file): Free FILE->name.
670
Roland McGrath43da9892007-04-16 23:13:37 +00006712007-04-16 Roland McGrath <roland@redhat.com>
672
673 * derelocate.c (cache_sections): Apply bias to sh_addr.
674 (compare_secrefs): Fix address comparison to avoid signed overflow.
675 (find_section): New function, broken out of ...
676 (dwfl_module_relocate_address): ... here, call it.
677 (check_module): New function, broken out of ...
678 (dwfl_module_relocate_address): ... here, call it.
679 (dwfl_module_address_section): New function.
680 * libdwfl.h: Declare it.
681
Ulrich Drepperc07fbb32007-03-30 19:14:59 +00006822007-03-26 Roland McGrath <roland@redhat.com>
683
684 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
685
6862007-03-18 Roland McGrath <roland@redhat.com>
687
688 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
689 (find_debuginfo): ... here. Call it.
690 Don't return error for libelf errors finding .gnu_debuglink section.
691
Ulrich Drepper6258e742007-03-13 06:22:40 +00006922007-03-12 Roland McGrath <roland@redhat.com>
693
694 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
695 (dwfl_report_begin): ... here. Call it.
696 * libdwfl.h: Declare it.
697 * libdwflP.h: Add INTDECL.
698
699 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
700
701 * offline.c: Comment typo fix.
702
7032007-03-04 Roland McGrath <roland@redhat.com>
704
705 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
706 (find_kernel_elf): New function, broken out of ...
707 (report_kernel): ... here. Call it.
708 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
709 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
710 virtual address bounds of kernel from symbols rounded to page size.
711 (dwfl_linux_kernel_report_kernel): Use that if it works, before
712 resorting to report_kernel.
713
714 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
715 ET_EXEC file with nonzero bias.
716
717 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
718 dwfl_module_addrsym. Guts moved to ...
719 * dwfl_module_addrsym.c: ... here; new file.
720 * Makefile.am (libdwfl_a_SOURCES): Add it.
721 * libdwfl.h: Declare dwfl_module_addrsym.
722 * libdwflP.h: Add INTDECL.
723
7242007-03-03 Roland McGrath <roland@redhat.com>
725
726 * dwfl_module.c (free_file): New function, broken out of ...
727 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
728
729 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
730 on libelf failure.
731
7322007-03-02 Roland McGrath <roland@redhat.com>
733
734 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
735
Ulrich Drepperaa915fd2007-02-05 07:25:33 +00007362007-02-02 Roland McGrath <roland@redhat.com>
737
738 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
739 address exactly if it's no other module's low boundary.
740
741 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
742 and size cover the address, select the closest symbol with st_size==0
743 that lies in the same section.
744
7452007-01-29 Roland McGrath <roland@redhat.com>
746
747 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
748 not PACKAGE_STRING.
749
7502007-01-20 Roland McGrath <roland@redhat.com>
751
752 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
753 as omitted, not 0.
754 * libdwfl.h (Dwfl_Callbacks): Update comment.
755 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
756 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
757 For ignored missing section, use -1 instead of 0.
758 * offline.c (dwfl_offline_section_address): Expect a call for 0.
759
7602007-01-19 Roland McGrath <roland@redhat.com>
761
762 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
763 zero so a lone -e foo.so is shown without address bias.
764
Roland McGrathba949b32007-01-10 20:44:29 +00007652007-01-10 Roland McGrath <roland@redhat.com>
766
Roland McGrath44865b92007-01-11 05:06:16 +0000767 * linux-kernel-modules.c (report_kernel): Check asprintf return value
768 directly instead of via side effect, to silence warn_unused_result.
769 (dwfl_linux_kernel_report_offline): Likewise.
770 (dwfl_linux_kernel_find_elf): Likewise.
771 (dwfl_linux_kernel_module_section_address): Likewise.
772 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +0000773 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
774 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +0000775
Roland McGrathba949b32007-01-10 20:44:29 +0000776 * libdwfl.h (dwfl_begin): Require nonnull argument.
777
Roland McGrath70008802006-12-29 20:44:16 +00007782006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +0000779
Roland McGrath70008802006-12-29 20:44:16 +0000780 * dwfl_module.c (compare_modules): Fix address comparison to avoid
781 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +0000782
Roland McGrath8190db62006-12-17 23:56:51 +00007832006-10-30 Roland McGrath <roland@redhat.com>
784
785 * dwfl_module.c (dwfl_report_module): Comment typo fix.
786
Roland McGrathc373d852006-10-10 00:25:21 +00007872006-09-05 Roland McGrath <roland@redhat.com>
788
789 * derelocate.c (cache_sections): Use alloca instead of variable-sized
Roland McGrath3c84db32009-06-24 17:41:40 -0700790 auto array, in function already using alloca.
Roland McGrathc373d852006-10-10 00:25:21 +0000791
Roland McGratha1cee072006-08-15 01:37:23 +00007922006-08-14 Roland McGrath <roland@redhat.com>
793
794 * linux-kernel-modules.c (try_kernel_name): If the call to
795 dwfl_standard_find_debuginfo produces no results, try it again
796 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
797
798 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
799 * libdwflP.h: ... to here.
800 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
801 repeats the first thing dwfl_standard_find_debuginfo will try.
802
803 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
804 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
805 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
806 section name.
807
Ulrich Drepper077c65f2006-07-12 19:54:51 +00008082006-07-12 Ulrich Drepper <drepper@redhat.com>
809
810 * cu.c: Adjust for internal_function_def removal.
811 * dwfl_error.c: Likewise.
812 * dwfl_module.c: Likewise.
813 * dwfl_module_getdwarf.c: Likewise.
814 * lines.c: Likewise.
815 * relocate.c: Likewise.
816
Ulrich Drepperc87b6e72006-07-11 22:32:28 +00008172006-07-11 Ulrich Drepper <drepper@redhat.com>
818
819 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
820 it can overflow the return value type.
821 Patch by Tim Moore <timoore@redhat.com>.
822
Ulrich Dreppere1812e12006-07-12 07:46:03 +00008232006-06-28 Roland McGrath <roland@redhat.com>
824
825 * libdwfl.h: Cosmetic changes.
826
827 * dwfl_line_comp_dir.c: New file.
828 * Makefile.am (libdwfl_a_SOURCES): Add it.
829 * libdwfl.h: Declare dwfl_line_comp_dir.
830
831 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
832
833 * dwfl_linecu.c: New file.
834 * Makefile.am (libdwfl_a_SOURCES): Add it.
835 * libdwfl.h: Declare dwfl_linecu.
836
837 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
838 (dwfl_linecu): Define as macro.
839
840 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
841
842 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
843 (dwfl_module_addrname): Function moved ...
844 * dwfl_module_addrname.c: ... here, new file.
845 * dwfl_module_getsym.c: New file.
846 * Makefile.am (libdwfl_a_SOURCES): Add them.
847 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
848 * libdwflP.h: Add INTDECLs.
849
8502006-06-27 Roland McGrath <roland@redhat.com>
851
852 * dwfl_module.c (dwfl_report_end): Whitespace fix.
853
Ulrich Drepperd5a75192006-06-15 03:07:46 +00008542006-06-13 Roland McGrath <roland@redhat.com>
855
856 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
857 Use __libdwfl_seterrno for elf_memory failure.
858
Ulrich Dreppere1812e12006-07-12 07:46:03 +00008592006-05-22 Roland McGrath <roland@redhat.com>
860
861 * dwfl_module_return_value_location.c
862 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
863
Ulrich Drepper41cbd762006-05-27 18:19:23 +00008642006-05-27 Ulrich Drepper <drepper@redhat.com>
865
866 * libdwfl.h: Add extern "C".
867
Ulrich Dreppere7a73172006-05-22 18:16:45 +00008682006-05-22 Ulrich Drepper <drepper@redhat.com>
869
870 * cu.c (addrarange): Handle files without aranges information.
871
Ulrich Dreppera1690682006-05-17 05:28:36 +00008722006-05-16 Ulrich Drepper <drepper@redhat.com>
873
874 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
875 ->modules is NULL.
876
Roland McGrath687d7e92006-02-27 04:53:00 +00008772006-02-26 Roland McGrath <roland@redhat.com>
878
Roland McGrath08333122006-02-27 04:54:26 +0000879 * dwfl_version.c: New file.
880 * Makefile.am (libdwfl_a_SOURCES): Add it.
881 * libdwfl.h: Declare dwfl_version.
882
Roland McGrath687d7e92006-02-27 04:53:00 +0000883 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
884 aligned up from DWFL->offline_next_address when checking for overlap.
885
Roland McGrathfceb7b42005-12-23 01:45:21 +00008862005-12-22 Roland McGrath <roland@redhat.com>
887
Roland McGrath1656bc02005-12-23 01:49:50 +0000888 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
889
890 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
891 (dwfl_linux_proc_report): ... here. Call it.
892 (dwfl_linux_proc_maps_report): New function.
893 * libdwfl.h: Declare it.
894 * libdwflP.h: Add INTDECL.
895 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
896
Roland McGrathfceb7b42005-12-23 01:45:21 +0000897 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
898 failed with DWFL_E_NO_DWARF.
899
Roland McGrath994b4892005-12-05 22:46:21 +00009002005-11-26 Roland McGrath <roland@redhat.com>
901
902 * dwfl_end.c (dwfl_end): Free the DWFL itself.
903
9042005-11-25 Roland McGrath <roland@redhat.com>
905
906 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
907 (load_dw): Use it.
908 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
909 * libdwflP.h: Declare it.
910
911 * dwfl_module_register_names.c: New file.
912 * Makefile.am (libdwfl_a_SOURCES): Add it.
913 * libdwfl.h: Declare dwfl_module_register_names.
914
Roland McGratha5640892005-11-26 00:38:14 +00009152005-11-21 Roland McGrath <roland@redhat.com>
916
917 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
918 Don't leak malloc'd file name.
919 If a /sys/.../sections file is missing and starts with ".init",
920 try the variant with "_init" too; catches PPC64 kernel braindamage.
921
Roland McGrathe47ab762005-11-17 03:16:00 +00009222005-11-15 Roland McGrath <roland@redhat.com>
923
924 * libdwfl.h: Comment fixes.
925
926 * dwfl_module_return_value_location.c: Add unlikely for error case.
927
9282005-11-13 Roland McGrath <roland@redhat.com>
929
930 * dwfl_return_value_location.c: New file.
931 * Makefile.am (libdwfl_a_SOURCES): Add it.
932 * libdwfl.h: Declare dwfl_module_return_value_location.
933 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
934
Roland McGrath07d4f2f2005-10-28 06:56:24 +00009352005-10-20 Roland McGrath <roland@redhat.com>
936
937 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
938 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
939 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
940
9412005-10-01 Roland McGrath <roland@redhat.com>
942
943 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
944 with errno 0.
945
9462005-09-19 Roland McGrath <roland@redhat.com>
947
948 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
949 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
950 the signed integer reading; they will just have to be in hexadecimal.
951 (dwfl_linux_kernel_module_section_address): Likewise.
952
Ulrich Drepperfbe998a2005-08-29 16:27:10 +00009532005-08-28 Ulrich Drepper <drepper@redhat.com>
954
955 * Makefile.am (%.os): Use COMPILE.os.
956 (COMPILE.os): Filter out gconv options.
957
Roland McGrath995f92d2005-08-26 05:55:04 +00009582005-08-25 Roland McGrath <roland@redhat.com>
959
960 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
961 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
962
Roland McGrath80e43a72005-08-24 21:12:15 +00009632005-08-24 Roland McGrath <roland@redhat.com>
964
Roland McGrathefb5caa2005-08-25 01:49:53 +0000965 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
966
Roland McGrath80e43a72005-08-24 21:12:15 +0000967 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
968 magic initializer to set -heur-stack-bound option.
969
Roland McGrath3712b282005-08-23 05:58:42 +00009702005-08-22 Roland McGrath <roland@redhat.com>
971
Roland McGrathd17fac72005-08-23 08:20:21 +0000972 * dwfl_validate_address.c: New file.
973 * Makefile.am (libdwfl_a_SOURCES): Add it.
974 * libdwfl.h: Declare dwfl_validate_address.
975
976 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
977 * libdwflP.h: Add INTDECL.
978
Roland McGrath3712b282005-08-23 05:58:42 +0000979 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
980 elf_rawdata for symbol-related sections.
981
Roland McGrathd17fac72005-08-23 08:20:21 +0000982 * offline.c (dwfl_report_offline): Move offline_next_address outside
983 module's range, in case it's an ET_EXEC using fixed segment locations.
984 * libdwfl.h: Update comment.
985
986 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
987 required alignment.
988
9892005-08-20 Roland McGrath <roland@redhat.com>
990
991 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
992 function to choose whether to report.
993 (dwfl_linux_kernel_report_offline): Likewise.
994 * libdwfl.h: Update decl.
995 * argp-std.c (parse_opt): Update caller.
996
997 * dwfl_getsrclines.c: New file.
998 * dwfl_onesrcline.c: New file.
999 * Makefile.am (libdwfl_a_SOURCES): Add them.
1000 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
1001
1002 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
1003 MODULESDIR[0]. Call fts_close on failure.
1004
1005 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
1006 Close ET_REL file descriptors after relocation.
1007 (find_dw): Update caller.
1008 * offline.c (dwfl_report_offline): Get the file into memory and close
1009 the file descriptor.
1010
1011 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1012 MOD->debug.elf is already set.
1013
1014 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1015 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1016
1017 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1018 dwfl_linux_kernel_report_offline with offline_callbacks.
1019
1020 * linux-kernel-modules.c (report_kernel): New function, broken out of
1021 ...
1022 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1023 (dwfl_linux_kernel_report_offline): New function.
1024 * libdwfl.h: Declare it.
1025 * libdwflP.h: Add INTDECL.
1026
10272005-08-19 Roland McGrath <roland@redhat.com>
1028
1029 Use standard debuginfo search path to look for vmlinux.
1030 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1031 passed zero.
1032 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1033 of ...
1034 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1035
1036 * argp-std.c (offline_callbacks): New variable.
1037 (parse_opt): Use it for -e. Allow multiple -e options.
1038
1039 * offline.c: New file.
1040 * Makefile.am (libdwfl_a_SOURCES): Add it.
1041 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
1042 * libdwflP.h: Add INTDECLs.
1043 (OFFLINE_REDZONE): New macro.
1044 (struct Dwfl): New member `offline_next_address'.
1045 * dwfl_begin.c (dwfl_begin): Initialize it.
1046 * dwfl_module.c (dwfl_report_begin): Likewise.
1047
1048 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
1049 do a nominal absolute section layout starting at BASE.
1050 * libdwfl.h: Update comment.
1051
10522005-08-18 Roland McGrath <roland@redhat.com>
1053
1054 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
1055 dwfl_module_getdwarf if necessary.
1056
1057 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
1058 * libdwfl.h: Update comment.
1059
1060 * derelocate.c: New file.
1061 * Makefile.am (libdwfl_a_SOURCES): Add it.
1062
1063 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
1064 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
1065 * dwfl_module_getdwarf.c (open_elf): Update initialization.
1066 (load_dw, dwfl_module_addrname): Update uses.
1067 * relocate.c (__libdwfl_relocate): Likewise.
1068
10692005-08-04 Roland McGrath <roland@redhat.com>
1070
1071 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
1072 arguments SHNDX, SHDR.
1073 (dwfl_linux_kernel_module_section_address): Update prototype.
1074 * relocate.c (__libdwfl_relocate_value): Update caller.
1075 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1076 Take the new arguments.
1077
Roland McGrathd2c59962005-08-10 22:13:57 +000010782005-08-10 Roland McGrath <roland@redhat.com>
1079
1080 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
1081 use it instead of MOD->debug.file.
1082 * libdwflP.h: Update decl.
1083 * dwfl_module_getdwarf.c (load_dw): Update caller.
1084 Fixes bug #165598.
1085
Roland McGrath4959bf82005-08-09 10:31:08 +000010862005-08-09 Roland McGrath <roland@redhat.com>
1087
1088 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
1089 * cu.c: Use INTUSE on dwarf_* calls.
1090 * dwfl_error.c: Likewise.
1091 * dwfl_module.c: Likewise.
1092 * dwfl_module_getdwarf.c: Likewise.
1093 * dwfl_module_getsrc_file.c: Likewise.
1094 * lines.c: Likewise.
1095
Roland McGrath5678f872005-08-07 21:42:56 +000010962005-08-07 Roland McGrath <roland@redhat.com>
1097
1098 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
1099 names contain '_' or '-', look for files named either "foo-bar.ko"
1100 or "foo_bar.ko".
1101
Roland McGrath83fcb482005-08-02 00:58:33 +000011022005-07-29 Roland McGrath <roland@redhat.com>
1103
1104 * loc2c.c: File removed.
1105 * loc2c.h: File removed.
1106 * loc2c-runtime.h: File removed.
1107 * test2.c: File removed.
1108 * Makefile.am (EXTRA_DIST): Variable removed.
1109 (noinst_HEADERS): Remove loc2c.h from here.
1110
Ulrich Drepper18618fd2005-07-28 21:29:22 +000011112005-07-28 Ulrich Drepper <drepper@redhat.com>
1112
Ulrich Drepper4d527362005-07-28 22:32:58 +00001113 * libdwfl.h: Add a few missing extern for function prototypes.
1114
Ulrich Drepper18618fd2005-07-28 21:29:22 +00001115 * libdwfl_crc32.c: New file.
1116 * libdwfl_crc32_file.c: New file.
1117 * libdwflP.h: Declare the new functions.
1118 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
1119 libdwfl_crc32_file.c.
1120 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
1121 instead of crc32_file.
1122
Roland McGrathd89bbe42005-07-28 07:08:01 +000011232005-07-28 Roland McGrath <roland@redhat.com>
1124
Roland McGrath244501f2005-07-28 09:15:47 +00001125 * ptest.c: Moved to ../tests/dwflmodtest.c.
1126
Roland McGrath18385902005-07-28 07:12:38 +00001127 * Makefile.am (noinst_PROGRAMS): Variable removed.
1128 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
1129 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
1130 (libdwfl): Don't use libdwfl.so any more.
1131 (libdwfl.so, install, uninstall): Targets removed.
1132 (test2_SOURCES): Define EXTRA_DIST instead of this.
1133 * libdwfl.map: File removed.
1134
Roland McGrathd89bbe42005-07-28 07:08:01 +00001135 * libdwfl.h: Use "" for libdw.h #include.
1136
Roland McGrath5bab2442005-07-28 00:44:29 +000011372005-07-27 Roland McGrath <roland@redhat.com>
1138
1139 * libdwfl.map: Add dwfl_getmodules.
1140
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000011412005-07-23 Ulrich Drepper <drepper@redhat.com>
1142
1143 * Makefile.am: Fix rules to allow building with mudflap.
1144
11452005-07-21 Roland McGrath <roland@redhat.com>
1146
1147 * Makefile.am (noinst_HEADERS): Add loc2c.c.
1148
1149 * test2.c (main): Check sscanf result to quiet warning.
1150
11512005-07-20 Roland McGrath <roland@redhat.com>
1152
1153 * libdwfl-branch merged, creating this direcotry.