blob: d8ca9eb367a45f5bf9fd641bd83a0e8607acef6a [file] [log] [blame]
Mark Wielaard641a4f62013-12-21 00:04:21 +010012013-12-20 Mark Wielaard <mjw@redhat.com>
2
Mark Wielaarde962ec32013-12-20 10:09:12 +01003 * dwfl_frame.c (one_arg): New struct.
4 (get_one_thread_cb): New function.
5 (dwfl_getthread): Likewise.
6 (one_thread): New struct.
7 (get_one_thread_frames_cb): New function.
8 (dwfl_getthread_frames): Likewise.
9 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
10 (dwfl_getthread_frames): Likewise.
11 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
12 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
13 to NULL.
14 * linux-pid-attach.c (pid_getthread): New function.
15 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
16
172013-12-20 Mark Wielaard <mjw@redhat.com>
18
Mark Wielaard641a4f62013-12-21 00:04:21 +010019 * linux-kernel-modules.c (report_kernel_archive): Correct nested
20 asprintf result check for debug.a.
21
Mark Wielaard159ac522013-12-18 11:05:54 +0100222013-12-18 Mark Wielaard <mjw@redhat.com>
23
24 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
25 * dwfl_module_addrname.c (dwfl_module_addrname): Use
26 dwfl_module_addrinfo.
27 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
28 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
29 for comparisons, not st_value. Fill in off. Search for both value
30 and the (adjusted) sym.st_value when different.
31 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
32 (dwfl_module_addrinfo): New function.
33 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
34 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
35 and possible. Adjust sym->st_value only when requested. Fill in addr
36 if available.
37 (dwfl_module_getsym_info): New function.
38 (dwfl_module_getsym): Use __libdwfl_getsym.
39 * libdwfl.h (dwfl_module_getsym_elf): Removed.
40 (dwfl_module_getsym_info): New function declaration.
41 (dwfl_module_addrinfo): Likewise.
42 (dwfl_module_addrsym): Add documentation describing differences
43 with addrinfo variants.
44 (dwfl_module_addrsym_elf): Removed.
45 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
46 (__libdwfl_addrsym): Likewise.
47 (__libdwfl_find_section_ndx): Likewise.
48 (dwfl_module_addrinfo): New internal declaration.
49 (dwfl_module_getsym_info): Likewise.
50 (dwfl_module_addrsym_elf): Removed.
51 (dwfl_module_getsym_elf): Likewise.
52
Jan Kratochvilc6a41482013-12-17 18:49:54 +0100532013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
54
Jan Kratochvilc5309462013-12-18 15:02:19 +010055 * argp-std.c (offline_find_elf): Remove.
56 (offline_callbacks): Use dwfl_build_id_find_elf instead.
57 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
58 removed above.
59
602013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
61
Jan Kratochvilc6a41482013-12-17 18:49:54 +010062 unwinder: s390 and s390x
63 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
64 * frame_unwind.c (new_unwound): New function from ...
65 (handle_cfi): ... here. Call it.
66 (setfunc, getfunc, readfunc): New functions.
67 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
68 * linux-core-attach.c (core_set_initial_registers): Always iterate
69 through the Ebl_Register_Location loop. Call
70 dwfl_thread_state_register_pc there.
71
Jan Kratochvil6cd283c2013-12-17 18:17:32 +0100722013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
73
74 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
75
Mark Wielaardc76b2ff2013-12-17 10:37:29 +0100762013-12-17 Mark Wielaard <mjw@redhat.com>
77
78 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
79 traversal.
80
Mark Wielaard14c2d9e2013-12-16 13:28:59 +0100812013-12-16 Mark Wielaard <mjw@redhat.com>
82
83 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
84 definition.
85 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
86 function.
87 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
88 function definition.
89 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
90
Mark Wielaarde6e6cc82013-12-14 15:02:56 +0100912013-12-14 Mark Wielaard <mjw@redhat.com>
92
93 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
94 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
95 * frame_unwind.c (handle_cfi): Free frame result from
96 dwarf_cfi_addrframe when done.
97
Jan Kratochvil5cbf42a2013-12-15 18:56:17 +0100982013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
99
100 unwinder: ppc and ppc64
101 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
102 Call ebl_dwarf_to_regno.
103 * linux-core-attach.c (core_set_initial_registers): Implement
104 pc_register support.
105 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
106 FIRSTREG -1.
107
Jan Kratochvil5ef96c92013-11-30 21:40:29 +01001082013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
109
110 Introduce process_attach_error.
111 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
112 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
113 PROCESS is NULL.
114 * libdwflP.h (struct Dwfl): New field process_attach_error.
115 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
116 (attach_state_for_core): ... here, make it static, change return type,
117 no longer use __libdwfl_seterrno.
118 (__libdwfl_attach_state_for_core): New wrapper for it.
119
Mark Wielaard819c3492013-11-27 16:45:44 +01001202013-11-27 Mark Wielaard <mjw@redhat.com>
121
122 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
123 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
124 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
125 instead of tracking dwfl_files.
126 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
127 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
128 new elfp and biasp arguments. Track elf instead of file.
129 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
130 dwfl_module_info.c (dwfl_module_info): Pass elf to
131 dwfl_adjusted_st_value.
132 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
133 (dwfl_module_getsym_elf): New function declaration.
134 (dwfl_module_addrsym_elf): Likewise.
135 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
136 (dwfl_module_getsym_elf): Likewise.
137 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
138 (dwfl_deadjust_st_value): Likewise.
139 (__libdwfl_module_getsym): Removed.
140 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
141
Jan Kratochvil463e9832013-11-21 15:28:02 +01001422013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
143
Jan Kratochvil99a29492013-11-21 15:33:22 +0100144 Fix non-build-id core files on build-id system.
145 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
146 be read from memory.
147
1482013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
149
Jan Kratochvilb301c2e2013-11-21 15:31:04 +0100150 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
151 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
152 content, if possible.
153
1542013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
155
Jan Kratochvil463e9832013-11-21 15:28:02 +0100156 link_map: Use proper bias, not l_addr.
157 * core-file.c (dynamic_vaddr_get): Rename to ...
158 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
159 internal_function.
160 (dwfl_core_file_report): Update name in the caller.
161 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
162 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
163 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
164 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
165
Jan Kratochvil10d7a392013-11-19 15:00:15 +01001662013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
167
168 Compatibility with older kernels such as RHEL-6.
169 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
170 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
171 (pid_set_initial_registers): Pass tid_was_stopped.
172 (pid_thread_detach): Use tid_was_stopped.
173
Josh Stonedb35c872013-11-18 14:29:35 -08001742013-11-18 Josh Stone <jistone@redhat.com>
175
176 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
177 (find_aux_sym): Use it.
178
Jan Kratochviled782372013-11-14 20:53:20 +01001792013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
180
Jan Kratochvil1c1a53b2013-11-14 20:55:41 +0100181 Code cleanup: Remove const in prototype
182 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
183 firstreg.
184 * libdwfl.h (dwfl_thread_state_registers): Likewise.
185 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
186
1872013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
188
Jan Kratochviled782372013-11-14 20:53:20 +0100189 Fix dwfl_attach_state machine->elf.
190 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
191 Call ebl_openbackend instead of ebl_openbackend_machine.
192 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
193 Update the function description.
194 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
195 dwfl_attach_state.
196 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
197 dwfl_attach_state.
198
Jan Kratochvil954a7b02013-11-13 20:00:56 +01001992013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
200
201 Provide __libdwfl_module_getsym to get dwfl_file *.
202 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
203 (dwfl_module_addrsym) (search_table): New variable file. Use
204 __libdwfl_module_getsym. Use file.
205 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
206 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
207 (dwfl_module_getsym): New wrapper.
208 * libdwflP.h (__libdwfl_module_getsym): New declaration.
209
Jan Kratochvil5dca2b62013-11-13 19:58:06 +01002102013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
211
212 Fix dwfl_module_addrsym for minidebuginfo.
213 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
214 addr_symfile.
215 (dwfl_module_addrsym) (same_section): Use it.
216 (dwfl_module_addrsym) (i_to_symfile): New function.
217 (dwfl_module_addrsym) (search_table): Use it.
218
Jan Kratochvil21783b52013-11-07 16:34:58 +01002192013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil0b867462013-05-30 14:37:38 +0200220 Mark Wielaard <mjw@redhat.com>
221
222 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
223 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
224 dwfl_frame_regs.c.
225 * core-file.c (dwfl_core_file_report): Call
226 __libdwfl_attach_state_for_core.
227 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
228 * dwfl_frame.c: New file.
229 * frame_unwind.c: New file.
230 * dwfl_frame_pc.c: New file.
231 * linux-pid-attach.c: New file.
232 * linux-core-attach.c: New file.
233 * dwfl_frame_regs.c: New file.
234 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
235 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
236 (Dwfl_Thread_Callbacks): New definition.
237 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
238 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
239 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
240 (dwfl_frame_pc): New declarations.
241 * libdwflP.h (Dwfl_Process): New typedef.
242 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
243 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
244 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
245 (INVALID_ARGUMENT): New DWFL_ERROR entries.
246 (struct Dwfl): New entry process.
247 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
248 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
249 (__libdwfl_process_free, __libdwfl_frame_unwind)
250 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
251 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
252 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
253 (dwfl_frame_thread, dwfl_thread_state_registers)
254 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
255 (dwfl_frame_pc): New INTDECL entries.
256 * linux-proc-maps.c (dwfl_linux_proc_report): Call
257 __libdwfl_attach_state_for_pid.
258 * segment.c (segment_start): Rename to ...
259 (__libdwfl_segment_start): ... here and make it internal_function.
260 (segment_end): Rename to ...
261 (__libdwfl_segment_end): ... here and make it internal_function.
262 (reify_segments, dwfl_report_segment): Rename them at the callers.
263
2642013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil21783b52013-11-07 16:34:58 +0100265
Jan Kratochvil22f867a2013-11-07 21:30:17 +0100266 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
267
2682013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
269
Jan Kratochvilb947ee12013-11-07 21:27:54 +0100270 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
271 retval. Fix one forgotten LISTED increase.
272
2732013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
274
Jan Kratochvil35d95f32013-11-07 16:47:19 +0100275 Fix core files for re-prelink-ed files.
276 * core-file.c (dynamic_vaddr_get): New function.
277 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
278 dynamic_vaddr_get instead of using L_ADDR.
279 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
280 * link_map.c (report_r_debug): Do not initialize l_addr.
281
2822013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
283
Jan Kratochvil21783b52013-11-07 16:34:58 +0100284 Code cleanup.
285 * core-file.c (dwfl_core_file_report): Reindent block of code by
286 continue keyword.
287
Jan Kratochvil3cf491e2013-10-30 10:48:20 +01002882013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
289
290 * argp-std.c (parse_opt): Use executable parameter of
291 dwfl_core_file_report.
292 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
293 it to DWFL. Add NEW_VERSION for it.
294 (_compat_without_executable_dwfl_core_file_report): New. Twice.
295 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
296 the function comment.
297
Mark Wielaardd1829742013-10-15 23:53:32 +02002982013-10-15 Mark Wielaard <mjw@redhat.com>
299
300 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
301 mappings.
302 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
303
Mark Wielaard2e73a8a2013-09-12 11:27:56 +02003042013-09-12 Mark Wielaard <mjw@redhat.com>
305
Mark Wielaardead7d192013-09-12 16:49:25 +0200306 * cu.c (intern_cu): If dwarf_offdie fails free cu.
307
3082013-09-12 Mark Wielaard <mjw@redhat.com>
309
Mark Wielaardcc392482013-09-12 15:16:13 +0200310 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
311 bad_report.
312
3132013-09-12 Mark Wielaard <mjw@redhat.com>
314
Mark Wielaard2e73a8a2013-09-12 11:27:56 +0200315 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
316 aux_xndxscn, not xndxscn, for aux_symxndxdata.
317
Mark Wielaard16fa4142013-08-22 13:45:16 +02003182013-08-25 Mark Wielaard <mjw@redhat.com>
319
320 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
321 to dwfl_report_elf.
322
Jan Kratochvil10edf472013-07-25 11:05:35 +02003232013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
324
325 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
326 conflicts all the modules, not just the first one. Compare L_LD if it
327 is equal, not if it is in a module address range.
328
Jan Kratochvil596d4302013-07-23 16:30:01 +02003292013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
330
Jan Kratochvil744fc6f2013-07-23 17:52:01 +0200331 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
332
3332013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
334
Jan Kratochvil596d4302013-07-23 16:30:01 +0200335 * core-file.c (clear_r_debug_info): Close also ELF and FD.
336 (dwfl_core_file_report): Call __libdwfl_report_elf for
337 R_DEBUG_INFO.MODULE.
338 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
339 code of ...
340 (__libdwfl_report_elf): ... this function. Call it.
341 * dwfl_segment_report_module.c: Include unistd.h.
342 (dwfl_segment_report_module): Use basename for MODULE->NAME.
343 Clear MODULE if it has no build-id and we have segment with build-id.
344 Ignore this segment only if MODULE still contains valid ELF.
345 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
346 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
347 and disk_file_has_build_id.
348 (dwfl_link_map_report): Extend the comment.
349 * link_map.c (report_r_debug): Extend the comment. Always fill in new
350 r_debug_info_module. Initialize also the new r_debug_info_module
351 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
352 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
353
Jan Kratochvil8af254a2013-07-19 21:41:31 +02003542013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
355
356 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
357
Mark Wielaard8e5393c2013-07-02 13:35:29 +02003582013-07-02 Mark Wielaard <mjw@redhat.com>
359
360 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
361
Mark Wielaard24b26ec2013-06-05 17:03:25 +02003622013-06-05 Mark Wielaard <mjw@redhat.com>
363
364 * link_map.c (report_r_debug): Always call release_buffer after
365 memory_callback succeeded reading build_id.
366
Jan Kratochvil8ff86292013-05-30 13:21:20 +02003672013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
368
369 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
370 executable_for_core before calling dwfl_core_file_report.
371 * core-file.c (clear_r_debug_info): New function.
372 (dwfl_core_file_report): Move raw segments reporting lower. New
373 variable r_debug_info, pass it to dwfl_segment_report_module. Call
374 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
375 * dwfl_module_build_id.c (check_notes): Move into
376 __libdwfl_find_elf_build_id.
377 (__libdwfl_find_build_id): Rename to ...
378 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
379 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
380 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
381 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
382 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
383 adjust its data_elfaddr parameter.
384 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
385 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
386 parameter r_debug_info. New variable name_is_final. Adjust addresses
387 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
388 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
389 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
390 (struct r_debug_info_module, struct r_debug_info): New definitions.
391 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
392 r_debug_info.
393 * link_map.c: Include fcntl.h.
394 (report_r_debug): Add parameter r_debug_info, describe it in the
395 function comment. Delete dwfl_addrmodule call and its dependent code.
396 Verify build-id before calling dwfl_report_elf, also supply
397 executable_for_core to it. Store r_debug_info->module info when
398 appropriate.
399 (dwfl_link_map_report): Add parameter r_debug_info. New variable
400 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
401 caller parameters.
402
Jan Kratochvil904aec22013-04-30 14:27:16 +02004032013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
404
405 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
406 Set it to true for ET_EXEC and ET_CORE. Provide alternative
407 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
408 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
409 NEW_VERSION.
410 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
411 COMPAT_VERSION.
412 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
413 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
414 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
415 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
416 dwfl_report_elf.
417 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
418
Mark Wielaard9efa9e62013-04-27 20:50:32 +02004192013-04-27 Mark Wielaard <mjw@redhat.com>
420
421 * link_map.c: #include system.h.
422
Jan Kratochvil1704baf2013-04-26 17:00:50 +02004232013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
424
425 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
426 them to lib/system.h.
427
Mark Wielaardcdaaf212013-04-25 16:50:11 -04004282013-04-24 Mark Wielaard <mjw@redhat.com>
429
430 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
431
Jan Kratochvila1d44822013-03-19 13:40:13 +01004322013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
433
434 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
435
Mark Wielaardf1b06b52013-03-12 12:02:51 +01004362013-03-12 Mark Wielaard <mjw@redhat.com>
437
438 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
439
Mark Wielaardf6185a72013-02-22 23:42:59 +01004402013-02-22 Mark Wielaard <mjw@redhat.com>
441
442 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
443 as DWFL_E_BADELF when not used.
444
Mark Wielaard40025812013-02-10 15:07:33 +01004452013-02-10 Mark Wielaard <mjw@redhat.com>
446
447 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
448 failure messages When handling ARGP_KEY_SUCCESS because arg will
449 not have been set.
450
Jan Kratochvil84476372012-10-10 20:42:30 +02004512013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
452
453 * linux-proc-maps.c: Include system.h.
454 (PROCEXEFMT, get_pid_class): New.
455 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
456 get_pid_class.
457
Mark Wielaard697bdca2013-01-23 17:39:19 +01004582013-01-23 Mark Wielaard <mjw@redhat.com>
459
460 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
461 from aux_syments by default.
462 (find_symtab): Also succeed when only aux_symdata is found.
463 When no symtab is found always try to load auxiliary table.
464 (dwfl_module_getsymtab): Substract one from result when both
465 tables have symbols.
466 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
467 zero entry when both tables have symbols.
468 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
469 one from first_global when both tables have symbols.
470
Mark Wielaard5083a702013-01-16 15:19:32 +01004712013-01-16 Mark Wielaard <mjw@redhat.com>
472
473 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
474 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
475 (dwfl_adjusted_aux_sym_addr): New function.
476 (dwfl_deadjust_aux_sym_addr): Likewise.
477 (dwfl_adjusted_st_value): Take and check symfile argument.
478 (dwfl_deadjust_st_value): Likewise.
479 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
480 use dwfl_file as argument to set address_sync.
481 (find_debuginfo): Call find_prelink_address_sync with debug file.
482 (find_aux_sym): New function.
483 (find_symtab): Use find_aux_sym if all we have is the dynsym table
484 and fill in aux DwflModule fields.
485 (dwfl_module_getsymtab): Return syments plus aux_syments.
486 (load_symtab): Always set first_global.
487 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
488 when using same_section. Calculate first_global based on both
489 mod->first_global and mod->aux_first_global.
490 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
491 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
492 to retrieve symbol and name if necessary, making sure all locals
493 from any table come before any globals.
494 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
495 with symfile.
496 * relocate.c (resolve_symbol): Likewise.
497
Roland McGrath3999ce12013-01-07 14:53:37 -08004982013-01-07 Roland McGrath <roland@hack.frob.com>
499
500 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
501 still assume the data is at least 32-bit aligned anyway.
502 (dwfl_link_map_report): Handle unaligned auxv data.
503
Mark Wielaard76c54592012-12-11 14:21:01 +01005042012-12-11 Mark Wielaard <mjw@redhat.com>
505
506 * linux-kernel-modules.c (report_kernel): Only free fname if
507 find_kernel_elf succeeds and allocates it.
508 (report_kernel_archive): Fix brackets around unlikely expression.
509
Jan Kratochvild5784af2012-10-18 00:11:30 +02005102012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
511
512 * argp-std.c: Update Copyright year.
513 (offline_find_elf): New function.
514 (offline_callbacks): Use it for find_elf.
515 (struct parse_opt): New.
516 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
517 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
518 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
519 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
520 final state->input initialization optional.
521 * dwfl_end.c: Update Copyright year.
522 (dwfl_end): Free executable_for_core.
523 * libdwflP.h: Update Copyright year.
524 (struct Dwfl): New field executable_for_core.
525
Jan Kratochvilae81c702012-10-27 20:45:27 +02005262012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
527
528 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
529 calculation.
530
Jan Kratochvil50f413e2012-10-17 22:04:24 +02005312012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
532
Jan Kratochvil3fdcdcb2012-10-17 21:49:10 +0200533 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
534 from ...
535 (__libdwfl_getelf): ... here. Call it.
536
5372012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
538
Jan Kratochvil50f413e2012-10-17 22:04:24 +0200539 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
540
Jan Kratochvil78dec222012-10-10 08:04:01 +02005412012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
542
Jan Kratochvil387654d2012-10-10 08:08:44 +0200543 * dwfl_segment_report_module.c (dwfl_segment_report_module):
544 Initialize mod->MAIN_BIAS.
545
5462012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
547
Jan Kratochvil78dec222012-10-10 08:04:01 +0200548 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
549 binding_value. Use it for both zero and non-zero size symbols
550 comparisons.
551
Mark Wielaard5b257822012-10-01 16:10:46 +02005522012-10-01 Mark Wielaard <mjw@redhat.com>
553
Mark Wielaardea45ac82012-10-01 16:12:10 +0200554 * cu.c (cudie_offset): Don't use type_sig8, it might not be
555 initialized and these are always real CUs, never TUs.
556
5572012-10-01 Mark Wielaard <mjw@redhat.com>
558
Mark Wielaard5b257822012-10-01 16:10:46 +0200559 * derelocate.c (find_section): Check next section exists before
560 accessing it.
561
Petr Machatae1873142012-08-01 21:37:52 +02005622012-08-01 Petr Machata <pmachata@redhat.com>
563
564 * offline.c (process_archive_member): Ignore entry "/SYM64/".
565
Roland McGrath210c2f02012-03-28 10:22:35 -07005662012-03-28 Roland McGrath <roland@hack.frob.com>
567
568 * dwfl_segment_report_module.c
569 (dwfl_segment_report_module: read_portion): Don't use existing buffer
570 when FILESZ is zero (string mode) and available portion doesn't hold
571 a terminated string.
572
Roland McGrath01fef9d2011-12-02 09:45:53 -08005732011-12-02 Roland McGrath <roland@hack.frob.com>
574
575 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
576 to use elf64_xlatetom and PHDRS.p64.
577 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
578
Mark Wielaard75ee33f2011-10-31 15:33:49 +01005792011-11-31 Mark Wielaard <mjw@redhat.com>
580
Mark Wielaardef431cd2011-10-31 23:17:06 +0100581 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
582 global symbols. Then only when that doesn't provide a match search
583 all local symbols too.
584 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
585 and fill it in.
586 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
587 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
588
5892011-11-31 Mark Wielaard <mjw@redhat.com>
590
Mark Wielaard75ee33f2011-10-31 15:33:49 +0100591 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
592 sizeless_sym if needed and closer to desired addr.
593
Mark Wielaardf43feb52011-10-20 16:53:54 +02005942011-10-20 Mark Wielaard <mjw@redhat.com>
595
596 * derelocate.c (cache_sections): Intern mod->reloc_info check.
597 (dwfl_module_relocations): Don't check mod->reloc_info.
598 (dwfl_module_relocation_info): Likewise.
599 (find_section): Likewise.
600
Roland McGrath32899ac2011-07-09 03:17:24 -07006012011-07-09 Roland McGrath <roland@hack.frob.com>
602
603 * image-header.c (LE32): Macro removed (now in lib/system.h).
604
Mark Wielaarddbb490f2011-04-11 17:24:16 +02006052011-04-11 Mark Wielaard <mjw@redhat.com>
606
607 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
608 by check for zlib, bzlib or lzma defines to check it isn't empty.
609 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
610
Roland McGrathe07da4f2011-03-08 16:26:02 -08006112011-03-08 Roland McGrath <roland@redhat.com>
612
613 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
614 Reported by Kurt Roeckx <kurt@roeckx.be>.
615
Roland McGrath6ecdead2011-02-11 12:29:45 -08006162011-02-11 Roland McGrath <roland@redhat.com>
617
618 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
619 suffixes if corresponding decompression support is enabled.
620
Roland McGrath9fdd4612011-02-01 16:09:43 -08006212011-02-01 Roland McGrath <roland@redhat.com>
622
Roland McGrath3a44c9a2011-02-01 19:06:21 -0800623 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
624 section-end address as the synchronization point, rather than sh_addr.
625
Roland McGrath0ef40202011-02-01 16:58:32 -0800626 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
627 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
628
Roland McGrath9fdd4612011-02-01 16:09:43 -0800629 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
630 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
631
Roland McGrath5ad466d2011-01-11 10:17:01 -08006322011-01-11 Roland McGrath <roland@redhat.com>
633
634 * dwfl_module_getdwarf.c (open_elf): Remove section-based
635 address_sync fixup from here.
636 (find_prelink_address_sync): New function.
637 (find_debuginfo): Call it.
638 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
639
Roland McGrath2c7d0dd2011-01-04 19:29:53 -08006402011-01-04 Roland McGrath <roland@redhat.com>
641
642 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
643 logic to consider section addresses, the better to survive all the
644 possible prelink machinations.
645 * libdwflP.h (struct dwfl_file): Comment change.
646
Roland McGrath33d305f2010-11-30 17:39:55 -08006472010-11-30 Roland McGrath <roland@redhat.com>
648
649 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
650
Roland McGrath1743d7f2010-11-12 16:46:47 -08006512010-11-12 Roland McGrath <roland@redhat.com>
652
653 * libdwflP.h (struct Dwfl_Module): New member main_bias.
654 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
655 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
656
657 * libdwflP.h (dwfl_deadjust_address): New function.
658 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
659 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
660 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
661
6622010-11-11 Roland McGrath <roland@redhat.com>
663
664 * libdwflP.h (struct dwfl_file): Remove bias member.
665 Add vaddr and address_sync members instead.
666 (dwfl_adjusted_address): Calculate using vaddr.
667 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
668 (dwfl_adjusted_st_value): Use one of those calls.
669 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
670 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
671 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
672 * link_map.c (consider_executable): Adjust only MOD->low_addr for
673 detected PIE bias change.
674
675 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
676 * dwfl_module_info.c: Use it.
677 * cu.c (addrarange): Likewise.
678 * dwfl_dwarf_line.c: Likewise.
679 * dwfl_module_dwarf_cfi.c: Likewise.
680 * dwfl_lineinfo.c: Likewise.
681 * dwfl_nextcu.c: Likewise.
682 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
683
684 * libdwflP.h (dwfl_adjusted_st_value): New function.
685 * relocate.c (resolve_symbol): Use it.
686 * dwfl_module_getsym.c: Likewise.
687 * dwfl_module_addrsym.c: Likewise.
688 * dwfl_module_info.c: Likewise.
689
690 * libdwflP.h (dwfl_adjusted_address): New function.
691 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
692 * relocate.c (__libdwfl_relocate_value): Likewise.
693 * derelocate.c (cache_sections): Likewise.
694 (dwfl_module_address_section): Likewise.
695 * dwfl_module_getelf.c: Likewise.
696 * dwfl_module_eh_cfi.c: Likewise.
697 * link_map.c (consider_executable): Likewise.
698
Roland McGrathde44f132010-08-24 15:38:42 -07006992010-08-24 Roland McGrath <roland@redhat.com>
700
701 * dwfl_dwarf_line.c: New file.
702 * Makefile.am (libdwfl_a_SOURCES): Add it.
703
Roland McGrath7503c892010-08-18 02:54:29 -07007042010-08-18 Roland McGrath <roland@redhat.com>
705
706 * link_map.c (report_r_debug): Use found name if we have no name,
707 even if we already have an Elf handle.
708
Roland McGrath81cfcca2010-06-30 00:45:58 -07007092010-06-30 Roland McGrath <roland@redhat.com>
710
711 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
712 confused by -1 return from dwfl_build_id_find_elf after it opened
713 the Elf handle.
Roland McGrath82a63362010-06-30 01:18:43 -0700714 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
715 dwfl_build_id_find_debuginfo.
Roland McGrath81cfcca2010-06-30 00:45:58 -0700716
Roland McGrath3e0f7d12010-06-15 23:10:35 -07007172010-06-16 Roland McGrath <roland@redhat.com>
718
719 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
720
Roland McGrathb9e85182010-06-14 12:45:25 -07007212010-06-14 Roland McGrath <roland@redhat.com>
722
723 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
724 candidate file to that st_dev/st_ino and pretend it didn't exist
725 if they match.
726 (find_debuginfo_in_path): Update caller, pass main file's info.
727
Roland McGratha0635db2010-05-20 00:04:59 -07007282010-05-20 Roland McGrath <roland@redhat.com>
729
730 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
731 (grovel_auxv): ... this. Take DWFL argument.
732 (dwfl_linux_proc_report): Update caller.
733
734 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
735 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
736
Roland McGrathbe9c4d72010-05-19 21:24:27 -07007372010-05-19 Roland McGrath <roland@redhat.com>
738
739 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
740
Roland McGrathed431dd2010-05-06 00:52:51 -07007412010-05-06 Roland McGrath <roland@redhat.com>
742
Roland McGrathaba26e02010-05-06 01:12:15 -0700743 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
744
Roland McGrathed431dd2010-05-06 00:52:51 -0700745 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
746 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
747 ID but we didn't find a file.
748 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
749 and refuse any fallback file-by-name if it lacks the matching ID.
750
751 * dwfl_error.c (dwfl_errno): Add INTDEF.
752 * libdwflP.h: Add INTDECL.
753
754 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
755 failure cases.
756
Roland McGrath77cda9d2010-05-04 16:31:43 -07007572010-05-04 Roland McGrath <roland@redhat.com>
758
Roland McGrathb4bb3012010-05-04 20:09:30 -0700759 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
760 ET_DYN that has a DT_DEBUG.
761
762 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
Roland McGrath89bb5d32010-05-04 18:03:42 -0700763
Roland McGrath4820a052010-05-04 19:46:56 -0700764 * segment.c (insert): Fix moving of values following insertion.
765 (reify_segments): Fix up MOD->segment backpointer indices after
766 later insertions in the main loop invalidate them.
767
Roland McGrathd05c5962010-05-04 18:05:22 -0700768 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
769 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
770
Roland McGrath77cda9d2010-05-04 16:31:43 -0700771 * core-file.c (dwfl_core_file_report): Return any nonzero count of
772 modules reported, even if link_map grovelling failed and only sniffing
773 found anything.
774
Roland McGrathd17f9de2010-04-26 13:09:33 -07007752010-04-26 Roland McGrath <roland@redhat.com>
776
777 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
778 Works around probably-wrong ld -r behavior for case of a DWARF address
779 constant that refers to a discarded SHF_ALLOC section.
780
Roland McGrathbe139302010-04-14 12:54:45 -07007812010-04-14 Roland McGrath <roland@redhat.com>
782
783 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
784 an upper bound on sane possible number of elements.
785
Roland McGrath5ea349b2010-04-06 00:04:49 -07007862010-03-11 Roland McGrath <roland@redhat.com>
787
788 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
789 the second half for 32-bit matches.
790
Roland McGrath8068e062010-03-10 23:49:13 -08007912010-03-10 Roland McGrath <roland@redhat.com>
792
793 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
794 * argp-std.c (parse_opt): Update caller.
795 * libdwfl.h: Declare dwfl_core_file_report.
796 * libdwflP.h: Don't.
797
Roland McGrathca84a552010-02-17 01:44:42 -08007982010-02-17 Roland McGrath <roland@redhat.com>
799
800 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
801 If set, find the first index not below ADDR.
802 (dwfl_segment_report_module): Update callers.
803 Pass true when calculating return value.
804
Roland McGrathbf963472010-02-15 15:16:44 -08008052010-02-15 Roland McGrath <roland@redhat.com>
806
Roland McGrath22359e22010-02-15 15:57:03 -0800807 * Makefile.am: Use config/eu.am for common stuff.
808
Roland McGrathbf963472010-02-15 15:16:44 -0800809 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
810 variable in failure path.
811
Mark Wielaardeacdcf32010-02-02 15:45:24 +01008122010-02-02 Mark Wielaard <mjw@redhat.com>
813
814 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
815 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
816
Roland McGrathf95760a2010-01-07 20:24:34 -08008172010-01-07 Roland McGrath <roland@redhat.com>
818
819 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
820 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
821 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
822 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
823
Roland McGrath1d7cbd12010-01-06 04:22:40 -08008242010-01-06 Roland McGrath <roland@redhat.com>
825
826 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
827 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
828
Roland McGrath15426bd2009-11-16 20:38:17 -08008292009-11-16 Roland McGrath <roland@redhat.com>
830
831 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
832
Petr Machata003dd322009-11-13 00:38:27 +01008332009-11-12 Petr Machata <pmachata@redhat.com>
834
835 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
836 the chunk is both offset-contiguous and vaddr-contiguous.
837
Roland McGrathcdb48e02009-11-05 11:34:08 -08008382009-11-05 Roland McGrath <roland@redhat.com>
839
840 * link_map.c (report_r_debug): Skip entries with l_ld==0.
Roland McGrath6229eb52009-11-05 11:43:38 -0800841 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
Roland McGrathcdb48e02009-11-05 11:34:08 -0800842
Roland McGrathde6730c2009-09-04 03:05:31 -07008432009-09-04 Roland McGrath <roland@redhat.com>
844
845 * image-header.c (__libdw_image_header): Fix tranposed comparison.
846
Roland McGrath6bb90712009-08-27 12:36:47 -07008472009-08-27 Roland McGrath <roland@redhat.com>
848
849 * image-header.c: New file.
850 * Makefile.am (libdwfl_a_SOURCES): Add it.
851 * libdwflP.h: Declare __libdw_image_header.
852 * open.c (decompress): Don't consume ELF on failure.
853 (what_kind): New function, broken out of ...
854 (__libdw_open_file): ... here. Call it.
855 If it fails, try __libdw_image_header and then try what_kind again.
856
857 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
858 leave it behind for next decompressor.
859 * open.c (decompress): Free BUFFER on failure.
860
Roland McGrathd6ccdc12009-08-26 00:23:01 -07008612009-08-26 Roland McGrath <roland@redhat.com>
862
Roland McGrathe5a1a812009-08-26 03:05:50 -0700863 * gzip.c (find_zImage_payload): New function, broken out of ...
864 (mapped_zImage): ... here. Call it.
865 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
866 stupid method of just trying the decoder.
867
Roland McGrath24169642009-08-26 02:26:34 -0700868 * open.c [USE_LZMA]: Try __libdw_unlzma.
869 * libdwflP.h: Declare it.
870 (DWFL_ERRORS): Add DWFL_E_LZMA.
871 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
872 * lzma.c: New file.
873 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
874
Roland McGrathd6ccdc12009-08-26 00:23:01 -0700875 * gzip.c (mapped_zImage): Limit scan to 32kb.
876 Make this unconditional, support bzip2 kernel images too.
Roland McGrathae1d7dc2009-08-26 01:27:59 -0700877 (unzip): Use direct inflate method for non-mmap case too.
878 Only zlib uses the stream method.
Roland McGrathd6ccdc12009-08-26 00:23:01 -0700879
Roland McGrathebfb6482009-08-09 15:40:52 -07008802009-08-09 Roland McGrath <roland@redhat.com>
881
882 * dwfl_module_build_id.c: Use new macros for versioned definitions.
883
Roland McGrathfe8b42e2009-07-08 14:54:16 -07008842009-07-08 Roland McGrath <roland@redhat.com>
885
Roland McGrath3c84db32009-06-24 17:41:40 -0700886 * dwfl_module_dwarf_cfi.c: New file.
887 * dwfl_module_eh_cfi.c: New file.
888 * Makefile.am (libdwfl_a_SOURCES): Add them.
889 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
890 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
891
8922009-07-08 Roland McGrath <roland@redhat.com>
893
Roland McGrathfe8b42e2009-07-08 14:54:16 -0700894 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
895
Mark Wielaard2256e362009-06-18 13:31:56 +02008962009-06-18 Mark Wielaard <mjw@redhat.com>
897
898 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
899
Ulrich Drepperf1894932009-06-13 15:55:42 -07009002009-06-13 Ulrich Drepper <drepper@redhat.com>
901
902 * derelocate.c: Don't use deprecated libelf functions.
903 * dwfl_module_getdwarf.c: Likewise.
904 * relocate.c: Likewise.
905
Ulrich Drepper4f515712009-04-23 07:54:53 -07009062009-04-23 Ulrich Drepper <drepper@redhat.com>
907
908 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
909 defined. Otherwise just define the latest version.
910
Roland McGrathcc480472009-04-22 11:32:20 -07009112009-04-22 Roland McGrath <roland@redhat.com>
912
Roland McGrathc65558b2009-04-22 12:29:32 -0700913 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
914 a non-ET_REL module.
915
Roland McGrathcc480472009-04-22 11:32:20 -0700916 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
917 adjust properly for non-ET_REL.
918
Roland McGrath19a8e4d2009-04-21 15:44:07 -07009192009-04-21 Roland McGrath <roland@redhat.com>
920
921 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
922
923 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
924 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
925 for ET_REL.
926 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
927
Roland McGrath10361572009-04-20 11:50:50 -07009282009-04-20 Roland McGrath <roland@redhat.com>
929
930 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
931
Roland McGratha605a3c2009-04-19 18:27:01 -07009322009-04-19 Roland McGrath <roland@redhat.com>
933
934 * dwfl_module_getdwarf.c (find_file): Renamed to ...
935 (__libdwfl_getelf): ... this. Make it global.
936 (find_symtab, find_dw): Update callers.
937 (dwfl_module_getelf): Functions moved ...
938 * dwfl_module_getelf.c: ... here, new file.
939 * Makefile.am (libdwfl_a_SOURCES): Add it.
940 * libdwflP.h: Declare __libdwfl_getelf.
941
Roland McGrathfa253262009-04-14 02:38:19 -07009422009-04-14 Roland McGrath <roland@redhat.com>
943
944 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
945 absolute (already adjusted in place) or needing load bias adjustment.
946
947 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
948 gelf_getphdr failure. Fix file size limit checks.
949
950 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
951
Roland McGrath243fa262009-04-08 17:05:43 -07009522009-04-08 Roland McGrath <roland@redhat.com>
953
Roland McGrath785dbb12009-04-08 17:15:01 -0700954 * dwfl_module_getsym.c: Don't adjust for bias again after
955 __libdwfl_relocate_value.
956
Roland McGrath243fa262009-04-08 17:05:43 -0700957 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
958 a non-SHF_ALLOC section.
959 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
960 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
961
Roland McGrath8651c5e2009-03-09 20:42:56 -07009622009-03-09 Roland McGrath <roland@redhat.com>
963
Roland McGrath329ed9f2009-03-09 20:49:53 -0700964 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
965 variable to outer scope, so we cache it for the loop.
966
Roland McGrath8651c5e2009-03-09 20:42:56 -0700967 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
968
Roland McGrath31fd6542009-02-12 17:26:39 -08009692009-02-12 Roland McGrath <roland@redhat.com>
970
971 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
972 __libdwfl_relocate_value to find correct sh_addr value.
973
Roland McGrath45c01cd2009-02-10 17:03:19 -08009742009-02-10 Roland McGrath <roland@redhat.com>
975
Roland McGrath5453abf2009-02-10 17:33:49 -0800976 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
977 If false, don't fail for NO_PHDR.
978 (dwfl_report_elf): Update caller.
979 * libdwflP.h: Update decl.
980 * offline.c (process_elf): Call it with false, so we don't refuse
981 dubiously-formed objects here.
982
Roland McGrath45c01cd2009-02-10 17:03:19 -0800983 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
984 finds our module. We shouldn't crash when we confuse some guesses.
985
Ulrich Dreppera9d51bf2009-02-10 12:55:07 -08009862009-02-10 Ulrich Drepper <drepper@redhat.com>
987
988 * open.c (decompress): Avoid crash with empty input file.
989
Roland McGrathe738ad22009-01-27 16:41:54 -08009902009-01-27 Roland McGrath <roland@redhat.com>
991
992 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
993 with zero vaddr and memsz.
994
Roland McGrath74afbee2009-01-22 04:52:56 -08009952009-01-22 Roland McGrath <roland@redhat.com>
996
Roland McGrathe34a3f82009-01-22 12:59:23 -0800997 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
998
Roland McGrath74afbee2009-01-22 04:52:56 -0800999 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1000 after address-matching loop.
1001
1002 * segment.c (lookup): Fix fencepost in checking for HINT match.
1003
Roland McGrath8dc9f932009-01-14 12:56:53 -080010042009-01-14 Roland McGrath <roland@redhat.com>
1005
1006 * gzip.c [!BZLIB] (mapped_zImage): New function.
1007 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1008
Ulrich Drepper7e678fa2009-01-10 18:02:05 -080010092009-01-10 Ulrich Drepper <drepper@redhat.com>
1010
1011 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1012
Roland McGratha4b1a952009-01-08 20:53:26 -080010132009-01-08 Roland McGrath <roland@redhat.com>
1014
1015 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1016 Skip subdirectory named "source".
1017 (dwfl_linux_kernel_find_elf): Likewise.
1018
Roland McGrath60205c92009-01-06 00:10:23 -080010192009-01-06 Roland McGrath <roland@redhat.com>
1020
Roland McGrath705364b2009-01-06 02:04:51 -08001021 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -08001022 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1023 (dwfl_linux_kernel_report_offline): Use it.
1024 (dwfl_linux_kernel_find_elf): Likewise.
1025
Roland McGrathbca43152009-01-05 23:59:32 -080010262009-01-05 Roland McGrath <roland@redhat.com>
1027
1028 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1029 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1030 * dwfl_build_id_find_elf.c: Likewise.
1031 * dwfl_module_getdwarf.c (open_elf): Likewise.
1032 * dwfl_report_elf.c: Likewise.
1033 * find-debuginfo.c (validate): Likewise.
1034 * offline.c (__libdwfl_report_offline): Likewise.
1035
1036 * libdwflP.h: Declare __libdw_open_file.
1037 * open.c: New file.
1038 * Makefile.am (libdwfl_a_SOURCES): Add it.
1039
1040 * gzip.c: New file.
1041 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1042 * bzip2.c: New file.
1043 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1044 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1045
Roland McGrath45d7b292008-12-16 16:21:40 -080010462008-12-16 Roland McGrath <roland@redhat.com>
1047
1048 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1049 symver magic to bind to ELFUTILS_0.138.
1050 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1051 wrapper for ELFUTILS_0.130 version set.
1052
Roland McGrath7d9b8212008-12-18 15:08:09 -080010532008-12-18 Roland McGrath <roland@redhat.com>
1054
1055 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1056 addresses are taken as relative to MOD->low_addr.
1057
Roland McGrath74825c42008-12-15 19:33:33 -080010582008-12-15 Roland McGrath <roland@redhat.com>
1059
1060 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1061 debug.bias.
1062
Roland McGrathb28a8942008-12-11 02:09:28 -080010632008-12-11 Roland McGrath <roland@redhat.com>
1064
1065 * offline.c (process_archive): Don't call elf_end and close if
1066 returning NULL. Check first elf_begin call and set error code
1067 specially for empty archive.
1068 Fixes RHBZ#465878.
1069
Roland McGratha845f682008-12-03 03:41:58 +000010702008-12-02 Roland McGrath <roland@redhat.com>
1071
1072 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1073
10742008-11-26 Roland McGrath <roland@redhat.com>
1075
1076 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1077 return value, and interpret encoded OFFSET argument.
1078
10792008-10-07 Roland McGrath <roland@redhat.com>
1080
1081 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1082
Roland McGrath9cf28e42008-09-30 06:35:35 +000010832008-09-29 Roland McGrath <roland@redhat.com>
1084
1085 * segment.c (insert): Must realloc DWFL->lookup_module here too.
1086 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1087
10882008-08-28 Roland McGrath <roland@redhat.com>
1089
1090 * segment.c (reify_segments): Fix last change.
1091
10922008-08-27 Roland McGrath <roland@redhat.com>
1093
1094 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1095 failure from pread64.
1096
Roland McGrath122f3882008-08-26 07:20:29 +000010972008-08-26 Roland McGrath <roland@redhat.com>
1098
1099 * segment.c (reify_segments): Insert a trailing segment for a module
1100 end that is above the highest current segment.
1101
11022008-08-25 Roland McGrath <roland@redhat.com>
1103
1104 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1105 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
1106 if FILE->elf is not ELF_K_ELF.
1107
1108 * dwfl_segment_report_module.c: Add a cast.
1109
Roland McGrathb4d6f0f2008-08-25 22:55:17 +000011102008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001111
Roland McGrathb4d6f0f2008-08-25 22:55:17 +00001112 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1113 which decides which symbol is "closest" to a given address.
1114
11152008-08-15 Roland McGrath <roland@redhat.com>
1116
1117 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1118 (options, parse_opt): Handle --core.
1119
1120 * core-file.c: New file.
1121 * Makefile.am (libdwfl_a_SOURCES): Add it.
1122 * libdwflP.h (dwfl_core_file_report): Declare it.
1123
1124 * link_map.c: New file.
1125 * Makefile.am (libdwfl_a_SOURCES): Add it.
1126 * libdwflP.h (dwfl_link_map_report): Declare it.
1127
1128 * libdwflP.h (MIN, MAX): New macros.
1129 (Dwfl_Memory_Callback): New typedef.
1130 (Dwfl_Module_Callback): New typedef.
1131 (dwfl_segment_report_module): Declare it.
1132 * dwfl_segment_report_module.c: New file.
1133 * Makefile.am (libdwfl_a_SOURCES): Add it.
1134
1135 * derelocate.c (dwfl_module_address_section): Add INTDEF.
1136 * libdwflP.h: Add INTDECL.
1137
1138 * segment.c: New file.
1139 * Makefile.am (libdwfl_a_SOURCES): Add it.
1140 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1141 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1142 lookup_addr, lookup_module, lookup_segndx, replace removed members
1143 modules, nmodules.
1144 (struct Dwfl_Module): New member segment.
1145 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
1146 to each free module.
1147 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1148 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
1149 (dwfl_report_module): Don't touch DWFL->nmodules.
1150 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1151 (compare_modules): Function removed.
1152 * dwfl_getmodules.c: Rewritten.
1153 Add INTDEF.
1154 * libdwflP.h: Add INTDECLs.
1155 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1156 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001157
Roland McGrath1d8bb252008-08-07 08:39:41 +000011582008-08-03 Roland McGrath <roland@redhat.com>
1159
1160 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1161
11622008-07-17 Roland McGrath <roland@redhat.com>
1163
1164 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1165 zero if the failure was only ENOENT.
1166
11672008-06-03 Roland McGrath <roland@redhat.com>
1168
1169 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1170 symbols.
1171
Roland McGrath9d2f3ee2008-05-22 20:28:05 +000011722008-05-22 Petr Machata <pmachata@redhat.com>
1173
1174 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1175
Roland McGrath0fa20e82008-05-07 18:37:14 +000011762008-05-06 Roland McGrath <roland@frob.com>
1177
1178 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1179 FTS_LOGICAL here too.
1180 (dwfl_linux_kernel_find_elf): Likewise.
1181
11822008-04-29 Roland McGrath <roland@redhat.com>
1183
1184 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1185 based on canonicalize_file_name if it differs from the supplied name.
1186
1187 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1188 we accept symlinks.
1189
Roland McGrath9897d662008-04-29 01:49:50 +000011902008-04-27 Roland McGrath <roland@redhat.com>
1191
1192 * linux-kernel-modules.c (report_kernel): Fix crash when
1193 dwfl_report_elf fails.
1194
Roland McGrathbfc01702008-04-06 01:57:32 +000011952008-04-05 Roland McGrath <roland@redhat.com>
1196
1197 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1198
1199 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1200 Clear it after freeing.
1201 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1202
Roland McGrathd11f9cb2008-03-26 20:51:59 +000012032008-03-26 Roland McGrath <roland@redhat.com>
1204
1205 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1206 SHT_DYNSYM, just set *SYMSCN like the comment says.
1207
1208 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1209
1210 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1211
12122008-03-19 Roland McGrath <roland@redhat.com>
1213
1214 * dwfl_module_getsrc.c: Adjust address for module bias before search.
1215
12162008-03-01 Roland McGrath <roland@redhat.com>
1217
1218 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1219 prototype to avoid older compiler's complaint about reuse of the name.
1220 (__libdwfl_canon_error): Likewise.
1221
Roland McGrath059c83e2008-02-21 06:19:39 +000012222008-02-19 Roland McGrath <roland@redhat.com>
1223
1224 * relocate.c (relocate_section): Check for an unhandled relocation
1225 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
1226 DWFL_E_UNKNOWN_MACHINE check out of loops.
1227
1228 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1229 DEBUGFILE->relocated is already set.
1230
12312008-01-26 Roland McGrath <roland@redhat.com>
1232
1233 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1234
1235 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1236 incoming *FILE_NAME at the start.
1237
Ulrich Dreppere219f1c2008-01-09 05:49:49 +000012382008-01-08 Roland McGrath <roland@redhat.com>
1239
1240 * Makefile.am (euinclude): Variable removed.
1241 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1242
Roland McGrathe4c22ea2007-10-23 13:07:39 +000012432007-10-23 Roland McGrath <roland@redhat.com>
1244
1245 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1246 module to appear first.
1247
12482007-10-20 Roland McGrath <roland@redhat.com>
1249
1250 * offline.c (process_archive_member): Take FD argument, pass it down
1251 to process_file. Return Elf_Cmd, not bool.
1252 Call elf_next here, always before elf_end.
1253 (process_archive): Update caller. Don't close FD here unless there
1254 are no member refs.
1255
1256 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
1257
1258 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
1259 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
1260 partial relocation to one or both files.
1261 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
1262 relocations have been applied to the debug file if dwfl_module_getelf
1263 has been used before.
1264
1265 * relocate.c (resolve_symbol): New function.
1266 (relocate_section): Call it.
1267
1268 * relocate.c (relocate_getsym): Handle null MOD->symfile.
1269 (relocate_section): Take new bool arg, PARTIAL. If true,
1270 no error for BADRELTYPE/RELUNDEF, instead just skip them
1271 and leave only those skipped relocs behind the reloc section.
1272 (__libdwfl_relocate_section): Take new arg, pass it down.
1273 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
1274 do partial relocation on all sections.
1275 * dwfl_module_getdwarf.c (load_dw): Update caller.
1276 * libdwflP.h: Update decls.
1277 * derelocate.c (dwfl_module_address_section): Pass new argument
1278 to __libdwfl_relocate_section, true.
1279
1280 * derelocate.c (cache_sections): Don't cache reloc sections when
1281 section_address callback is null.
1282
12832007-10-19 Roland McGrath <roland@redhat.com>
1284
1285 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
1286
1287 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
1288 (struct secref): Likewise.
1289 (cache_sections): Cache the relocation section referring to each
1290 section we cache, if any.
1291 (dwfl_module_address_section): Use __libdwfl_relocate_section as
1292 necessary.
1293
1294 * relocate.c (struct reloc_symtab_cache): New type.
1295 (relocate_getsym): Use it instead of four arguments.
1296 (__libdwfl_relocate): Update caller.
1297 (relocate_section): New function, broken out of ...
1298 (__libdwfl_relocate): ... here.
1299 (__libdwfl_relocate_section): New function.
1300 * libdwflP.h: Declare it.
1301
13022007-10-17 Roland McGrath <roland@redhat.com>
1303
1304 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
1305 to relocated st_value.
1306
1307 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
1308 ET_REL to 0x100.
1309
13102007-10-16 Roland McGrath <roland@redhat.com>
1311
1312 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
1313 section has larger alignment requirements not met by the original BASE,
1314 rather than padding more between sections.
1315
1316 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
1317
1318 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
1319 to sh_addr value.
1320
1321 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
1322 at zero in ET_REL case. Adjust BASE to necessary alignment.
1323
1324 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
1325 for DATA_VADDR.
1326 (__libdwfl_find_build_id): Update caller.
1327
1328 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
1329 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1330 * offline.c (dwfl_offline_section_address): Bail early if there is
1331 separate debug file.
1332
1333 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
1334
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000013352007-10-09 Roland McGrath <roland@redhat.com>
1336
1337 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
1338 caching SHDR->sh_addr = 0.
1339 * offline.c (dwfl_offline_section_address): Never called for sh_addr
1340 really at 0, don't check for it. Use MOD->debug directly, not symfile.
1341
1342 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
1343 we've found SHT_SYMTAB.
1344
1345 * relocate.c (relocate_getsym): New function.
1346 (__libdwfl_relocate): Use it.
1347 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
1348 be a pointer instead of value; cache getshstrndx result there.
1349 * libdwflP.h: Update decl.
1350 * derelocate.c (cache_sections): Update caller.
1351 Always work on the main file, not the symfile.
1352 (dwfl_module_address_section): Likewise.
1353 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
1354
13552007-10-07 Roland McGrath <roland@redhat.com>
1356
1357 * offline.c (process_archive): Initialize MOD.
1358
1359 * linux-kernel-modules.c (get_release): New function, broken out of ...
1360 (report_kernel): ... here. Call it.
1361 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
1362 (find_kernel_elf): Update caller.
1363 (report_kernel_archive): New function.
1364 (dwfl_linux_kernel_report_offline): Call it.
1365
1366 * offline.c (process_file): Take new arg PREDICATE, pass it down.
1367 (process_archive): Likewise.
1368 (process_archive_member): Likewise. When nonnull, let the predicate
1369 decide whether to use this member.
1370 (__libdwfl_report_offline): New function, broken out of ...
1371 (dwfl_report_offline): ... here. Call it.
1372 * libdwflP.h: Declare it.
1373
1374 * offline.c (process_archive, process_archive_member): New functions.
1375 (process_elf, process_file): New functions, broken out of ...
1376 (dwfl_report_offline): ... here. Call process_file, which recurses on
1377 ELF_K_AR files.
1378
1379 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
1380 (dwfl_report_elf): ... here. Call it.
1381 * libdwflP.h: Declare it.
1382
13832007-10-06 Roland McGrath <roland@redhat.com>
1384
1385 * derelocate.c (dwfl_module_relocations): Don't call
1386 dwfl_module_getdwarf.
1387
1388 * derelocate.c (find_section): Use __libdwfl_seterrno, not
1389 __libdw_seterrno.
1390
1391 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
1392 SHF_ALLOC, to cache sh_addr resolved to 0.
1393
1394 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
1395 values nonzero already, just use its existing layout.
1396
1397 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
1398 in-core shdr after applying it.
1399
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +000014002007-10-04 Ulrich Drepper <drepper@redhat.com>
1401
1402 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
1403 initialization of notes variable.
1404
Roland McGrath59ea7f32007-10-04 08:50:09 +000014052007-10-04 Roland McGrath <roland@redhat.com>
1406
1407 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
1408 fill in with vaddr of "__start_notes" symbol if found.
1409 (check_notes): New function.
1410 (check_kernel_notes): New function.
1411 (dwfl_linux_kernel_report_kernel): Call it.
1412 (check_module_notes): New function.
1413 (dwfl_linux_kernel_report_modules): Call it.
1414
1415 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
1416 Try dwfl_build_id_find_elf first.
1417
1418 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
1419 Set kernel module e_type to ET_DYN.
1420
14212007-10-03 Roland McGrath <roland@redhat.com>
1422
1423 * find-debuginfo.c (validate): New function, broken out of ...
1424 (find_debuginfo_in_path): ... here. New function, broken out of ...
1425 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
1426 dwfl_build_id_find_debuginfo first.
1427
1428 * dwfl_build_id_find_elf.c: New file.
1429 * dwfl_build_id_find_debuginfo.c: New file.
1430 * Makefile.am (libdwfl_a_SOURCES): Add them.
1431 * libdwfl.h: Declare them.
1432 * libdwflP.h: Add INTDECLs.
1433
1434 * dwfl_module_build_id.c: New file.
1435 * dwfl_module_report_build_id.c: New file.
1436 * Makefile.am (libdwfl_a_SOURCES): Add them.
1437 * libdwfl.h: Declare them.
1438 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
1439 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
1440 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
1441
1442 * dwfl_module_getdwarf.c (find_offsets): New function.
1443 (find_dynsym): New function, calls that.
1444 (find_symtab): Call it.
1445
Roland McGrathc76f0b02007-09-27 07:31:33 +000014462007-09-11 Roland McGrath <roland@redhat.com>
1447
1448 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
1449 address if its st_size is smaller.
1450
Roland McGrath099dd522007-08-13 22:58:36 +000014512007-08-13 Roland McGrath <roland@redhat.com>
1452
1453 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
1454
14552007-08-12 Roland McGrath <roland@redhat.com>
1456
1457 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
1458 FTS_LOGICAL.
1459
1460 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
1461 a second phdr if it happens to match EHDR_VMA exactly.
1462
Roland McGrath42f68682007-08-09 07:54:22 +000014632007-08-08 Roland McGrath <roland@redhat.com>
1464
1465 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
1466 those with no names. Rewrite best symbol algorithm not to assume a
1467 sorted table and to be smarter handling sizeless symbols.
1468
Roland McGrath87d47802007-07-16 22:23:37 +000014692007-07-16 Roland McGrath <roland@redhat.com>
1470
1471 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
1472 reviving an existing module.
1473
14742007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +00001475
1476 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
1477
Roland McGrath9aa8ef72007-05-18 08:59:43 +000014782007-05-17 Roland McGrath <roland@redhat.com>
1479
1480 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
1481 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
1482 (dwfl_linux_kernel_find_elf): Likewise.
1483
1484 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1485 getline and sscanf instead of fscanf.
1486
14872007-05-08 Roland McGrath <roland@redhat.com>
1488
1489 * offline.c (dwfl_offline_section_address): Don't assume section
1490 numbers match between stripped and debuginfo files. Instead, assume
1491 only that the ordering among SHF_ALLOC sections matches.
1492
1493 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
1494 pointer to string.
1495 (dwfl_linux_kernel_report_offline): Update caller.
1496 (dwfl_linux_kernel_report_kernel): Likewise.
1497
Roland McGrath4be15242007-04-25 03:09:33 +000014982007-04-23 Roland McGrath <roland@redhat.com>
1499
1500 * argp-std.c (options): Fix group title string.
1501
1502 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
1503 Update via STATE->input every time we set STATE->hook, not only at
1504 ARGP_KEY_SUCCESS.
1505
1506 * dwfl_module.c (free_file): Free FILE->name.
1507
Roland McGrath43da9892007-04-16 23:13:37 +000015082007-04-16 Roland McGrath <roland@redhat.com>
1509
1510 * derelocate.c (cache_sections): Apply bias to sh_addr.
1511 (compare_secrefs): Fix address comparison to avoid signed overflow.
1512 (find_section): New function, broken out of ...
1513 (dwfl_module_relocate_address): ... here, call it.
1514 (check_module): New function, broken out of ...
1515 (dwfl_module_relocate_address): ... here, call it.
1516 (dwfl_module_address_section): New function.
1517 * libdwfl.h: Declare it.
1518
Ulrich Drepperc07fbb32007-03-30 19:14:59 +000015192007-03-26 Roland McGrath <roland@redhat.com>
1520
1521 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
1522
15232007-03-18 Roland McGrath <roland@redhat.com>
1524
1525 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
1526 (find_debuginfo): ... here. Call it.
1527 Don't return error for libelf errors finding .gnu_debuglink section.
1528
Ulrich Drepper6258e742007-03-13 06:22:40 +000015292007-03-12 Roland McGrath <roland@redhat.com>
1530
1531 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
1532 (dwfl_report_begin): ... here. Call it.
1533 * libdwfl.h: Declare it.
1534 * libdwflP.h: Add INTDECL.
1535
1536 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1537
1538 * offline.c: Comment typo fix.
1539
15402007-03-04 Roland McGrath <roland@redhat.com>
1541
1542 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
1543 (find_kernel_elf): New function, broken out of ...
1544 (report_kernel): ... here. Call it.
1545 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
1546 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
1547 virtual address bounds of kernel from symbols rounded to page size.
1548 (dwfl_linux_kernel_report_kernel): Use that if it works, before
1549 resorting to report_kernel.
1550
1551 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
1552 ET_EXEC file with nonzero bias.
1553
1554 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
1555 dwfl_module_addrsym. Guts moved to ...
1556 * dwfl_module_addrsym.c: ... here; new file.
1557 * Makefile.am (libdwfl_a_SOURCES): Add it.
1558 * libdwfl.h: Declare dwfl_module_addrsym.
1559 * libdwflP.h: Add INTDECL.
1560
15612007-03-03 Roland McGrath <roland@redhat.com>
1562
1563 * dwfl_module.c (free_file): New function, broken out of ...
1564 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
1565
1566 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
1567 on libelf failure.
1568
15692007-03-02 Roland McGrath <roland@redhat.com>
1570
1571 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
1572
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000015732007-02-02 Roland McGrath <roland@redhat.com>
1574
1575 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
1576 address exactly if it's no other module's low boundary.
1577
1578 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
1579 and size cover the address, select the closest symbol with st_size==0
1580 that lies in the same section.
1581
15822007-01-29 Roland McGrath <roland@redhat.com>
1583
1584 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
1585 not PACKAGE_STRING.
1586
15872007-01-20 Roland McGrath <roland@redhat.com>
1588
1589 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
1590 as omitted, not 0.
1591 * libdwfl.h (Dwfl_Callbacks): Update comment.
1592 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
1593 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1594 For ignored missing section, use -1 instead of 0.
1595 * offline.c (dwfl_offline_section_address): Expect a call for 0.
1596
15972007-01-19 Roland McGrath <roland@redhat.com>
1598
1599 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
1600 zero so a lone -e foo.so is shown without address bias.
1601
Roland McGrathba949b32007-01-10 20:44:29 +000016022007-01-10 Roland McGrath <roland@redhat.com>
1603
Roland McGrath44865b92007-01-11 05:06:16 +00001604 * linux-kernel-modules.c (report_kernel): Check asprintf return value
1605 directly instead of via side effect, to silence warn_unused_result.
1606 (dwfl_linux_kernel_report_offline): Likewise.
1607 (dwfl_linux_kernel_find_elf): Likewise.
1608 (dwfl_linux_kernel_module_section_address): Likewise.
1609 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +00001610 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
1611 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +00001612
Roland McGrathba949b32007-01-10 20:44:29 +00001613 * libdwfl.h (dwfl_begin): Require nonnull argument.
1614
Roland McGrath70008802006-12-29 20:44:16 +000016152006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001616
Roland McGrath70008802006-12-29 20:44:16 +00001617 * dwfl_module.c (compare_modules): Fix address comparison to avoid
1618 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001619
Roland McGrath8190db62006-12-17 23:56:51 +000016202006-10-30 Roland McGrath <roland@redhat.com>
1621
1622 * dwfl_module.c (dwfl_report_module): Comment typo fix.
1623
Roland McGrathc373d852006-10-10 00:25:21 +000016242006-09-05 Roland McGrath <roland@redhat.com>
1625
1626 * derelocate.c (cache_sections): Use alloca instead of variable-sized
Roland McGrath3c84db32009-06-24 17:41:40 -07001627 auto array, in function already using alloca.
Roland McGrathc373d852006-10-10 00:25:21 +00001628
Roland McGratha1cee072006-08-15 01:37:23 +000016292006-08-14 Roland McGrath <roland@redhat.com>
1630
1631 * linux-kernel-modules.c (try_kernel_name): If the call to
1632 dwfl_standard_find_debuginfo produces no results, try it again
1633 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
1634
1635 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
1636 * libdwflP.h: ... to here.
1637 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
1638 repeats the first thing dwfl_standard_find_debuginfo will try.
1639
1640 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
1641 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
1642 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
1643 section name.
1644
Ulrich Drepper077c65f2006-07-12 19:54:51 +000016452006-07-12 Ulrich Drepper <drepper@redhat.com>
1646
1647 * cu.c: Adjust for internal_function_def removal.
1648 * dwfl_error.c: Likewise.
1649 * dwfl_module.c: Likewise.
1650 * dwfl_module_getdwarf.c: Likewise.
1651 * lines.c: Likewise.
1652 * relocate.c: Likewise.
1653
Ulrich Drepperc87b6e72006-07-11 22:32:28 +000016542006-07-11 Ulrich Drepper <drepper@redhat.com>
1655
1656 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
1657 it can overflow the return value type.
1658 Patch by Tim Moore <timoore@redhat.com>.
1659
Ulrich Dreppere1812e12006-07-12 07:46:03 +000016602006-06-28 Roland McGrath <roland@redhat.com>
1661
1662 * libdwfl.h: Cosmetic changes.
1663
1664 * dwfl_line_comp_dir.c: New file.
1665 * Makefile.am (libdwfl_a_SOURCES): Add it.
1666 * libdwfl.h: Declare dwfl_line_comp_dir.
1667
1668 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
1669
1670 * dwfl_linecu.c: New file.
1671 * Makefile.am (libdwfl_a_SOURCES): Add it.
1672 * libdwfl.h: Declare dwfl_linecu.
1673
1674 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
1675 (dwfl_linecu): Define as macro.
1676
1677 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
1678
1679 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
1680 (dwfl_module_addrname): Function moved ...
1681 * dwfl_module_addrname.c: ... here, new file.
1682 * dwfl_module_getsym.c: New file.
1683 * Makefile.am (libdwfl_a_SOURCES): Add them.
1684 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
1685 * libdwflP.h: Add INTDECLs.
1686
16872006-06-27 Roland McGrath <roland@redhat.com>
1688
1689 * dwfl_module.c (dwfl_report_end): Whitespace fix.
1690
Ulrich Drepperd5a75192006-06-15 03:07:46 +000016912006-06-13 Roland McGrath <roland@redhat.com>
1692
1693 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1694 Use __libdwfl_seterrno for elf_memory failure.
1695
Ulrich Dreppere1812e12006-07-12 07:46:03 +000016962006-05-22 Roland McGrath <roland@redhat.com>
1697
1698 * dwfl_module_return_value_location.c
1699 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
1700
Ulrich Drepper41cbd762006-05-27 18:19:23 +000017012006-05-27 Ulrich Drepper <drepper@redhat.com>
1702
1703 * libdwfl.h: Add extern "C".
1704
Ulrich Dreppere7a73172006-05-22 18:16:45 +000017052006-05-22 Ulrich Drepper <drepper@redhat.com>
1706
1707 * cu.c (addrarange): Handle files without aranges information.
1708
Ulrich Dreppera1690682006-05-17 05:28:36 +000017092006-05-16 Ulrich Drepper <drepper@redhat.com>
1710
1711 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
1712 ->modules is NULL.
1713
Roland McGrath687d7e92006-02-27 04:53:00 +000017142006-02-26 Roland McGrath <roland@redhat.com>
1715
Roland McGrath08333122006-02-27 04:54:26 +00001716 * dwfl_version.c: New file.
1717 * Makefile.am (libdwfl_a_SOURCES): Add it.
1718 * libdwfl.h: Declare dwfl_version.
1719
Roland McGrath687d7e92006-02-27 04:53:00 +00001720 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
1721 aligned up from DWFL->offline_next_address when checking for overlap.
1722
Roland McGrathfceb7b42005-12-23 01:45:21 +000017232005-12-22 Roland McGrath <roland@redhat.com>
1724
Roland McGrath1656bc02005-12-23 01:49:50 +00001725 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
1726
1727 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
1728 (dwfl_linux_proc_report): ... here. Call it.
1729 (dwfl_linux_proc_maps_report): New function.
1730 * libdwfl.h: Declare it.
1731 * libdwflP.h: Add INTDECL.
1732 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
1733
Roland McGrathfceb7b42005-12-23 01:45:21 +00001734 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
1735 failed with DWFL_E_NO_DWARF.
1736
Roland McGrath994b4892005-12-05 22:46:21 +000017372005-11-26 Roland McGrath <roland@redhat.com>
1738
1739 * dwfl_end.c (dwfl_end): Free the DWFL itself.
1740
17412005-11-25 Roland McGrath <roland@redhat.com>
1742
1743 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
1744 (load_dw): Use it.
1745 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
1746 * libdwflP.h: Declare it.
1747
1748 * dwfl_module_register_names.c: New file.
1749 * Makefile.am (libdwfl_a_SOURCES): Add it.
1750 * libdwfl.h: Declare dwfl_module_register_names.
1751
Roland McGratha5640892005-11-26 00:38:14 +000017522005-11-21 Roland McGrath <roland@redhat.com>
1753
1754 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1755 Don't leak malloc'd file name.
1756 If a /sys/.../sections file is missing and starts with ".init",
1757 try the variant with "_init" too; catches PPC64 kernel braindamage.
1758
Roland McGrathe47ab762005-11-17 03:16:00 +000017592005-11-15 Roland McGrath <roland@redhat.com>
1760
1761 * libdwfl.h: Comment fixes.
1762
1763 * dwfl_module_return_value_location.c: Add unlikely for error case.
1764
17652005-11-13 Roland McGrath <roland@redhat.com>
1766
1767 * dwfl_return_value_location.c: New file.
1768 * Makefile.am (libdwfl_a_SOURCES): Add it.
1769 * libdwfl.h: Declare dwfl_module_return_value_location.
1770 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
1771
Roland McGrath07d4f2f2005-10-28 06:56:24 +000017722005-10-20 Roland McGrath <roland@redhat.com>
1773
1774 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
1775 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
1776 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
1777
17782005-10-01 Roland McGrath <roland@redhat.com>
1779
1780 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
1781 with errno 0.
1782
17832005-09-19 Roland McGrath <roland@redhat.com>
1784
1785 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1786 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
1787 the signed integer reading; they will just have to be in hexadecimal.
1788 (dwfl_linux_kernel_module_section_address): Likewise.
1789
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000017902005-08-28 Ulrich Drepper <drepper@redhat.com>
1791
1792 * Makefile.am (%.os): Use COMPILE.os.
1793 (COMPILE.os): Filter out gconv options.
1794
Roland McGrath995f92d2005-08-26 05:55:04 +000017952005-08-25 Roland McGrath <roland@redhat.com>
1796
1797 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
1798 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
1799
Roland McGrath80e43a72005-08-24 21:12:15 +000018002005-08-24 Roland McGrath <roland@redhat.com>
1801
Roland McGrathefb5caa2005-08-25 01:49:53 +00001802 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
1803
Roland McGrath80e43a72005-08-24 21:12:15 +00001804 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
1805 magic initializer to set -heur-stack-bound option.
1806
Roland McGrath3712b282005-08-23 05:58:42 +000018072005-08-22 Roland McGrath <roland@redhat.com>
1808
Roland McGrathd17fac72005-08-23 08:20:21 +00001809 * dwfl_validate_address.c: New file.
1810 * Makefile.am (libdwfl_a_SOURCES): Add it.
1811 * libdwfl.h: Declare dwfl_validate_address.
1812
1813 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
1814 * libdwflP.h: Add INTDECL.
1815
Roland McGrath3712b282005-08-23 05:58:42 +00001816 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
1817 elf_rawdata for symbol-related sections.
1818
Roland McGrathd17fac72005-08-23 08:20:21 +00001819 * offline.c (dwfl_report_offline): Move offline_next_address outside
1820 module's range, in case it's an ET_EXEC using fixed segment locations.
1821 * libdwfl.h: Update comment.
1822
1823 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
1824 required alignment.
1825
18262005-08-20 Roland McGrath <roland@redhat.com>
1827
1828 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
1829 function to choose whether to report.
1830 (dwfl_linux_kernel_report_offline): Likewise.
1831 * libdwfl.h: Update decl.
1832 * argp-std.c (parse_opt): Update caller.
1833
1834 * dwfl_getsrclines.c: New file.
1835 * dwfl_onesrcline.c: New file.
1836 * Makefile.am (libdwfl_a_SOURCES): Add them.
1837 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
1838
1839 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
1840 MODULESDIR[0]. Call fts_close on failure.
1841
1842 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
1843 Close ET_REL file descriptors after relocation.
1844 (find_dw): Update caller.
1845 * offline.c (dwfl_report_offline): Get the file into memory and close
1846 the file descriptor.
1847
1848 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1849 MOD->debug.elf is already set.
1850
1851 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1852 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1853
1854 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1855 dwfl_linux_kernel_report_offline with offline_callbacks.
1856
1857 * linux-kernel-modules.c (report_kernel): New function, broken out of
1858 ...
1859 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1860 (dwfl_linux_kernel_report_offline): New function.
1861 * libdwfl.h: Declare it.
1862 * libdwflP.h: Add INTDECL.
1863
18642005-08-19 Roland McGrath <roland@redhat.com>
1865
1866 Use standard debuginfo search path to look for vmlinux.
1867 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1868 passed zero.
1869 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1870 of ...
1871 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1872
1873 * argp-std.c (offline_callbacks): New variable.
1874 (parse_opt): Use it for -e. Allow multiple -e options.
1875
1876 * offline.c: New file.
1877 * Makefile.am (libdwfl_a_SOURCES): Add it.
1878 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
1879 * libdwflP.h: Add INTDECLs.
1880 (OFFLINE_REDZONE): New macro.
1881 (struct Dwfl): New member `offline_next_address'.
1882 * dwfl_begin.c (dwfl_begin): Initialize it.
1883 * dwfl_module.c (dwfl_report_begin): Likewise.
1884
1885 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
1886 do a nominal absolute section layout starting at BASE.
1887 * libdwfl.h: Update comment.
1888
18892005-08-18 Roland McGrath <roland@redhat.com>
1890
1891 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
1892 dwfl_module_getdwarf if necessary.
1893
1894 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
1895 * libdwfl.h: Update comment.
1896
1897 * derelocate.c: New file.
1898 * Makefile.am (libdwfl_a_SOURCES): Add it.
1899
1900 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
1901 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
1902 * dwfl_module_getdwarf.c (open_elf): Update initialization.
1903 (load_dw, dwfl_module_addrname): Update uses.
1904 * relocate.c (__libdwfl_relocate): Likewise.
1905
19062005-08-04 Roland McGrath <roland@redhat.com>
1907
1908 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
1909 arguments SHNDX, SHDR.
1910 (dwfl_linux_kernel_module_section_address): Update prototype.
1911 * relocate.c (__libdwfl_relocate_value): Update caller.
1912 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1913 Take the new arguments.
1914
Roland McGrathd2c59962005-08-10 22:13:57 +000019152005-08-10 Roland McGrath <roland@redhat.com>
1916
1917 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
1918 use it instead of MOD->debug.file.
1919 * libdwflP.h: Update decl.
1920 * dwfl_module_getdwarf.c (load_dw): Update caller.
1921 Fixes bug #165598.
1922
Roland McGrath4959bf82005-08-09 10:31:08 +000019232005-08-09 Roland McGrath <roland@redhat.com>
1924
1925 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
1926 * cu.c: Use INTUSE on dwarf_* calls.
1927 * dwfl_error.c: Likewise.
1928 * dwfl_module.c: Likewise.
1929 * dwfl_module_getdwarf.c: Likewise.
1930 * dwfl_module_getsrc_file.c: Likewise.
1931 * lines.c: Likewise.
1932
Roland McGrath5678f872005-08-07 21:42:56 +000019332005-08-07 Roland McGrath <roland@redhat.com>
1934
1935 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
1936 names contain '_' or '-', look for files named either "foo-bar.ko"
1937 or "foo_bar.ko".
1938
Roland McGrath83fcb482005-08-02 00:58:33 +000019392005-07-29 Roland McGrath <roland@redhat.com>
1940
1941 * loc2c.c: File removed.
1942 * loc2c.h: File removed.
1943 * loc2c-runtime.h: File removed.
1944 * test2.c: File removed.
1945 * Makefile.am (EXTRA_DIST): Variable removed.
1946 (noinst_HEADERS): Remove loc2c.h from here.
1947
Ulrich Drepper18618fd2005-07-28 21:29:22 +000019482005-07-28 Ulrich Drepper <drepper@redhat.com>
1949
Ulrich Drepper4d527362005-07-28 22:32:58 +00001950 * libdwfl.h: Add a few missing extern for function prototypes.
1951
Ulrich Drepper18618fd2005-07-28 21:29:22 +00001952 * libdwfl_crc32.c: New file.
1953 * libdwfl_crc32_file.c: New file.
1954 * libdwflP.h: Declare the new functions.
1955 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
1956 libdwfl_crc32_file.c.
1957 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
1958 instead of crc32_file.
1959
Roland McGrathd89bbe42005-07-28 07:08:01 +000019602005-07-28 Roland McGrath <roland@redhat.com>
1961
Roland McGrath244501f2005-07-28 09:15:47 +00001962 * ptest.c: Moved to ../tests/dwflmodtest.c.
1963
Roland McGrath18385902005-07-28 07:12:38 +00001964 * Makefile.am (noinst_PROGRAMS): Variable removed.
1965 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
1966 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
1967 (libdwfl): Don't use libdwfl.so any more.
1968 (libdwfl.so, install, uninstall): Targets removed.
1969 (test2_SOURCES): Define EXTRA_DIST instead of this.
1970 * libdwfl.map: File removed.
1971
Roland McGrathd89bbe42005-07-28 07:08:01 +00001972 * libdwfl.h: Use "" for libdw.h #include.
1973
Roland McGrath5bab2442005-07-28 00:44:29 +000019742005-07-27 Roland McGrath <roland@redhat.com>
1975
1976 * libdwfl.map: Add dwfl_getmodules.
1977
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000019782005-07-23 Ulrich Drepper <drepper@redhat.com>
1979
1980 * Makefile.am: Fix rules to allow building with mudflap.
1981
19822005-07-21 Roland McGrath <roland@redhat.com>
1983
1984 * Makefile.am (noinst_HEADERS): Add loc2c.c.
1985
1986 * test2.c (main): Check sscanf result to quiet warning.
1987
19882005-07-20 Roland McGrath <roland@redhat.com>
1989
1990 * libdwfl-branch merged, creating this direcotry.