blob: b6a9161e9706ef4c4d754aeeeacd510e2b07c340 [file] [log] [blame]
Mark Wielaarddd64d4a2014-03-03 15:07:31 +010012014-03-03 Mark Wielaard <mjw@redhat.com>
2
3 * elf-from-memory.c (elf_from_remote_memory): Keep track of
4 segments_end_mem. Pass memsz to first handle_segment pass. Only
5 extend contents_size and use shdrs if only file bits are in
6 segment.
7
Josh Stone65cefbd2014-03-11 10:19:28 -070082014-03-11 Josh Stone <jistone@redhat.com>
9
10 * dwfl_module_getdwarf.c (open_elf): Only explicitly set
11 mod->e_type when processing the main ELF file.
12
Mark Wielaard4b9e1432014-03-04 11:27:15 +0100132014-03-04 Mark Wielaard <mjw@redhat.com>
14
15 * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from
16 linux-pid-attach.c (struct pid_arg).
17 (__libdwfl_get_pid_arg): New internal function declaration.
18 (__libdwfl_ptrace_attach): Likewise.
19 (__libdwfl_ptrace_detach): Likewise.
20 * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the
21 special exception modules that cannot be checked at this point.
22 * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h
23 (ptrace_attach): Renamed to...
24 (__libdwfl_ptrace_attach): New internal function.
25 (__libdwfl_ptrace_detach): Likewise. Extracted from ...
26 (pid_thread_detach): Call __libdwfl_ptrace_detach now.
27 (__libdwfl_get_pid_arg): New internal function.
28 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special
29 module name contains "(deleted)" and dwfl_pid gives an attached
30 pid. If pid is set and try to (re)use ptrace attach state of
31 process before reading memory.
32
Mark Wielaardf15bcda2014-03-03 11:43:43 +0100332014-03-03 Mark Wielaard <mjw@redhat.com>
34
35 * elf-from-memory.c (elf_from_remote_memory): Take pagesize as
36 argument. Free buffer when detecting bad elf. Check PT_LOAD
37 alignment requirements on first handle_segment pass. Calculate
38 loadbase, start and end of segment using pagesize, not p_align.
39 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize
40 to elf_from_remote_memory.
41
Mark Wielaard48827ec2014-02-26 17:17:07 +0100422014-02-26 Mark Wielaard <mjw@redhat.com>
43
Mark Wielaard8f4402f2014-02-26 17:00:39 +010044 * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
45
462014-02-26 Mark Wielaard <mjw@redhat.com>
47
Mark Wielaard48827ec2014-02-26 17:17:07 +010048 * elf-from-memory.c (elf_from_remote_memory): Check against p64
49 p_type in case ELFCLASS64, not against p32 p_type.
50
Petr Machataced66872014-01-17 17:00:12 +0100512014-01-17 Petr Machata <pmachata@redhat.com>
52
53 * relocate.c (relocate_section): Use gelf_fsize instead of relying
54 on shdr->sh_entsize.
55
Mark Wielaard27aae182014-01-05 20:37:30 +0100562014-01-05 Mark Wielaard <mjw@redhat.com>
57
58 * frame_unwind.c (handle_cfi): Only skip resetting return register
59 if the regno is not the actual CIE return address register.
60
Mark Wielaard68de4422014-01-02 21:17:18 +0100612014-01-02 Mark Wielaard <mjw@redhat.com>
62
63 * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi.
64
Mark Wielaard19108012013-12-30 22:00:57 +0100652013-12-30 Mark Wielaard <mjw@redhat.com>
66
67 * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and
68 dwfl_core_file_attach explicitly.
69 * core-file.c (dwfl_core_file_report): Don't call
70 __libdwfl_attach_state_for_core implicitly.
71 * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error.
72 * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not
73 process_attach_error.
74 (dwfl_getthreads): Likewise.
75 (getthread): Likewise.
76 * libdwfl.h (dwfl_core_file_report): Update documentation.
77 (dwfl_linux_proc_report): Likewise.
78 (dwfl_core_file_attach): New function declaration.
79 (dwfl_linux_proc_attach): Likewise.
80 * libdwflP.h (struct Dwfl): Remove process_attach_error.
81 (__libdwfl_attach_state_for_pid): Removed declaration.
82 (__libdwfl_attach_state_for_core): Likewise.
83 (dwfl_core_file_attach): New internal declaration.
84 (dwfl_linux_proc_attach): Likewise.
85 (attach_state_for_core): Renamed to...
86 (dwfl_core_file_attach): ...this. Change return type.
87 (__libdwfl_attach_state_for_core): Removed.
88 * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped.
89 (pid_set_initial_registers): Check assume_ptrace_stopped before
90 calling ptrace.
91 (pid_thread_detach): Likewise.
92 (__libdwfl_attach_state_for_pid): Renamed to...
93 (dwfl_linux_proc_attach): ...this. Adjust return type.
94 * linux-proc-maps.c (dwfl_linux_proc_report): Don't call
95 __libdwfl_attach_state_for_pid implicitly.
96
Mark Wielaardac652612013-12-28 12:58:10 +0100972013-12-28 Mark Wielaard <mjw@redhat.com>
98
99 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special
100 character device files, only regular files.
101
Mark Wielaard05a44122013-12-24 10:37:58 +01001022013-12-24 Mark Wielaard <mjw@redhat.com>
103
104 * linux-core-attach.c (core_next_thread): Check whether thread_argp
105 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
106 in that case. Free thread_arg if there are no more threads.
107
Mark Wielaard97bbf9b2013-12-23 14:20:06 +01001082013-12-23 Mark Wielaard <mjw@redhat.com>
109
Mark Wielaardb20ca0b2013-12-23 23:21:59 +0100110 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
111 build_id before returning early.
112
1132013-12-23 Mark Wielaard <mjw@redhat.com>
114
Mark Wielaard97bbf9b2013-12-23 14:20:06 +0100115 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
116 pid (thread group leader) to dwfl_attach_state.
117
Mark Wielaard3e98ab72013-12-21 21:56:35 +01001182013-12-21 Mark Wielaard <mjw@redhat.com>
119
120 * frame_unwind.c (handle_cfi): Track whether the return register
121 has been set and only allow it to be set once.
122
Mark Wielaard641a4f62013-12-21 00:04:21 +01001232013-12-20 Mark Wielaard <mjw@redhat.com>
124
Mark Wielaarde962ec32013-12-20 10:09:12 +0100125 * dwfl_frame.c (one_arg): New struct.
126 (get_one_thread_cb): New function.
127 (dwfl_getthread): Likewise.
128 (one_thread): New struct.
129 (get_one_thread_frames_cb): New function.
130 (dwfl_getthread_frames): Likewise.
131 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
132 (dwfl_getthread_frames): Likewise.
133 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
134 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
135 to NULL.
136 * linux-pid-attach.c (pid_getthread): New function.
137 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
138
1392013-12-20 Mark Wielaard <mjw@redhat.com>
140
Mark Wielaard641a4f62013-12-21 00:04:21 +0100141 * linux-kernel-modules.c (report_kernel_archive): Correct nested
142 asprintf result check for debug.a.
143
Mark Wielaard159ac522013-12-18 11:05:54 +01001442013-12-18 Mark Wielaard <mjw@redhat.com>
145
146 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
147 * dwfl_module_addrname.c (dwfl_module_addrname): Use
148 dwfl_module_addrinfo.
149 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
150 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
151 for comparisons, not st_value. Fill in off. Search for both value
152 and the (adjusted) sym.st_value when different.
153 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
154 (dwfl_module_addrinfo): New function.
155 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
156 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
157 and possible. Adjust sym->st_value only when requested. Fill in addr
158 if available.
159 (dwfl_module_getsym_info): New function.
160 (dwfl_module_getsym): Use __libdwfl_getsym.
161 * libdwfl.h (dwfl_module_getsym_elf): Removed.
162 (dwfl_module_getsym_info): New function declaration.
163 (dwfl_module_addrinfo): Likewise.
164 (dwfl_module_addrsym): Add documentation describing differences
165 with addrinfo variants.
166 (dwfl_module_addrsym_elf): Removed.
167 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
168 (__libdwfl_addrsym): Likewise.
169 (__libdwfl_find_section_ndx): Likewise.
170 (dwfl_module_addrinfo): New internal declaration.
171 (dwfl_module_getsym_info): Likewise.
172 (dwfl_module_addrsym_elf): Removed.
173 (dwfl_module_getsym_elf): Likewise.
174
Jan Kratochvilc6a41482013-12-17 18:49:54 +01001752013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
176
Jan Kratochvilc5309462013-12-18 15:02:19 +0100177 * argp-std.c (offline_find_elf): Remove.
178 (offline_callbacks): Use dwfl_build_id_find_elf instead.
179 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
180 removed above.
181
1822013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
183
Jan Kratochvilc6a41482013-12-17 18:49:54 +0100184 unwinder: s390 and s390x
185 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
186 * frame_unwind.c (new_unwound): New function from ...
187 (handle_cfi): ... here. Call it.
188 (setfunc, getfunc, readfunc): New functions.
189 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
190 * linux-core-attach.c (core_set_initial_registers): Always iterate
191 through the Ebl_Register_Location loop. Call
192 dwfl_thread_state_register_pc there.
193
Jan Kratochvil6cd283c2013-12-17 18:17:32 +01001942013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
195
196 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
197
Mark Wielaardc76b2ff2013-12-17 10:37:29 +01001982013-12-17 Mark Wielaard <mjw@redhat.com>
199
200 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
201 traversal.
202
Mark Wielaard14c2d9e2013-12-16 13:28:59 +01002032013-12-16 Mark Wielaard <mjw@redhat.com>
204
205 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
206 definition.
207 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
208 function.
209 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
210 function definition.
211 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
212
Mark Wielaarde6e6cc82013-12-14 15:02:56 +01002132013-12-14 Mark Wielaard <mjw@redhat.com>
214
215 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
216 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
217 * frame_unwind.c (handle_cfi): Free frame result from
218 dwarf_cfi_addrframe when done.
219
Jan Kratochvil5cbf42a2013-12-15 18:56:17 +01002202013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
221
222 unwinder: ppc and ppc64
223 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
224 Call ebl_dwarf_to_regno.
225 * linux-core-attach.c (core_set_initial_registers): Implement
226 pc_register support.
227 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
228 FIRSTREG -1.
229
Jan Kratochvil5ef96c92013-11-30 21:40:29 +01002302013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
231
232 Introduce process_attach_error.
233 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
234 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
235 PROCESS is NULL.
236 * libdwflP.h (struct Dwfl): New field process_attach_error.
237 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
238 (attach_state_for_core): ... here, make it static, change return type,
239 no longer use __libdwfl_seterrno.
240 (__libdwfl_attach_state_for_core): New wrapper for it.
241
Mark Wielaard819c3492013-11-27 16:45:44 +01002422013-11-27 Mark Wielaard <mjw@redhat.com>
243
244 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
245 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
246 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
247 instead of tracking dwfl_files.
248 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
249 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
250 new elfp and biasp arguments. Track elf instead of file.
251 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
252 dwfl_module_info.c (dwfl_module_info): Pass elf to
253 dwfl_adjusted_st_value.
254 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
255 (dwfl_module_getsym_elf): New function declaration.
256 (dwfl_module_addrsym_elf): Likewise.
257 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
258 (dwfl_module_getsym_elf): Likewise.
259 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
260 (dwfl_deadjust_st_value): Likewise.
261 (__libdwfl_module_getsym): Removed.
262 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
263
Jan Kratochvil463e9832013-11-21 15:28:02 +01002642013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
265
Jan Kratochvil99a29492013-11-21 15:33:22 +0100266 Fix non-build-id core files on build-id system.
267 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
268 be read from memory.
269
2702013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
271
Jan Kratochvilb301c2e2013-11-21 15:31:04 +0100272 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
273 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
274 content, if possible.
275
2762013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
277
Jan Kratochvil463e9832013-11-21 15:28:02 +0100278 link_map: Use proper bias, not l_addr.
279 * core-file.c (dynamic_vaddr_get): Rename to ...
280 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
281 internal_function.
282 (dwfl_core_file_report): Update name in the caller.
283 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
284 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
285 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
286 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
287
Jan Kratochvil10d7a392013-11-19 15:00:15 +01002882013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
289
290 Compatibility with older kernels such as RHEL-6.
291 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
292 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
293 (pid_set_initial_registers): Pass tid_was_stopped.
294 (pid_thread_detach): Use tid_was_stopped.
295
Josh Stonedb35c872013-11-18 14:29:35 -08002962013-11-18 Josh Stone <jistone@redhat.com>
297
298 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
299 (find_aux_sym): Use it.
300
Jan Kratochviled782372013-11-14 20:53:20 +01003012013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
302
Jan Kratochvil1c1a53b2013-11-14 20:55:41 +0100303 Code cleanup: Remove const in prototype
304 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
305 firstreg.
306 * libdwfl.h (dwfl_thread_state_registers): Likewise.
307 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
308
3092013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
310
Jan Kratochviled782372013-11-14 20:53:20 +0100311 Fix dwfl_attach_state machine->elf.
312 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
313 Call ebl_openbackend instead of ebl_openbackend_machine.
314 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
315 Update the function description.
316 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
317 dwfl_attach_state.
318 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
319 dwfl_attach_state.
320
Jan Kratochvil954a7b02013-11-13 20:00:56 +01003212013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
322
323 Provide __libdwfl_module_getsym to get dwfl_file *.
324 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
325 (dwfl_module_addrsym) (search_table): New variable file. Use
326 __libdwfl_module_getsym. Use file.
327 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
328 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
329 (dwfl_module_getsym): New wrapper.
330 * libdwflP.h (__libdwfl_module_getsym): New declaration.
331
Jan Kratochvil5dca2b62013-11-13 19:58:06 +01003322013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
333
334 Fix dwfl_module_addrsym for minidebuginfo.
335 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
336 addr_symfile.
337 (dwfl_module_addrsym) (same_section): Use it.
338 (dwfl_module_addrsym) (i_to_symfile): New function.
339 (dwfl_module_addrsym) (search_table): Use it.
340
Jan Kratochvil21783b52013-11-07 16:34:58 +01003412013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil0b867462013-05-30 14:37:38 +0200342 Mark Wielaard <mjw@redhat.com>
343
344 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
345 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
346 dwfl_frame_regs.c.
347 * core-file.c (dwfl_core_file_report): Call
348 __libdwfl_attach_state_for_core.
349 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
350 * dwfl_frame.c: New file.
351 * frame_unwind.c: New file.
352 * dwfl_frame_pc.c: New file.
353 * linux-pid-attach.c: New file.
354 * linux-core-attach.c: New file.
355 * dwfl_frame_regs.c: New file.
356 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
357 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
358 (Dwfl_Thread_Callbacks): New definition.
359 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
360 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
361 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
362 (dwfl_frame_pc): New declarations.
363 * libdwflP.h (Dwfl_Process): New typedef.
364 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
365 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
366 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
367 (INVALID_ARGUMENT): New DWFL_ERROR entries.
368 (struct Dwfl): New entry process.
369 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
370 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
371 (__libdwfl_process_free, __libdwfl_frame_unwind)
372 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
373 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
374 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
375 (dwfl_frame_thread, dwfl_thread_state_registers)
376 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
377 (dwfl_frame_pc): New INTDECL entries.
378 * linux-proc-maps.c (dwfl_linux_proc_report): Call
379 __libdwfl_attach_state_for_pid.
380 * segment.c (segment_start): Rename to ...
381 (__libdwfl_segment_start): ... here and make it internal_function.
382 (segment_end): Rename to ...
383 (__libdwfl_segment_end): ... here and make it internal_function.
384 (reify_segments, dwfl_report_segment): Rename them at the callers.
385
3862013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil21783b52013-11-07 16:34:58 +0100387
Jan Kratochvil22f867a2013-11-07 21:30:17 +0100388 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
389
3902013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
391
Jan Kratochvilb947ee12013-11-07 21:27:54 +0100392 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
393 retval. Fix one forgotten LISTED increase.
394
3952013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
396
Jan Kratochvil35d95f32013-11-07 16:47:19 +0100397 Fix core files for re-prelink-ed files.
398 * core-file.c (dynamic_vaddr_get): New function.
399 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
400 dynamic_vaddr_get instead of using L_ADDR.
401 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
402 * link_map.c (report_r_debug): Do not initialize l_addr.
403
4042013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
405
Jan Kratochvil21783b52013-11-07 16:34:58 +0100406 Code cleanup.
407 * core-file.c (dwfl_core_file_report): Reindent block of code by
408 continue keyword.
409
Jan Kratochvil3cf491e2013-10-30 10:48:20 +01004102013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
411
412 * argp-std.c (parse_opt): Use executable parameter of
413 dwfl_core_file_report.
414 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
415 it to DWFL. Add NEW_VERSION for it.
416 (_compat_without_executable_dwfl_core_file_report): New. Twice.
417 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
418 the function comment.
419
Mark Wielaardd1829742013-10-15 23:53:32 +02004202013-10-15 Mark Wielaard <mjw@redhat.com>
421
422 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
423 mappings.
424 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
425
Mark Wielaard2e73a8a2013-09-12 11:27:56 +02004262013-09-12 Mark Wielaard <mjw@redhat.com>
427
Mark Wielaardead7d192013-09-12 16:49:25 +0200428 * cu.c (intern_cu): If dwarf_offdie fails free cu.
429
4302013-09-12 Mark Wielaard <mjw@redhat.com>
431
Mark Wielaardcc392482013-09-12 15:16:13 +0200432 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
433 bad_report.
434
4352013-09-12 Mark Wielaard <mjw@redhat.com>
436
Mark Wielaard2e73a8a2013-09-12 11:27:56 +0200437 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
438 aux_xndxscn, not xndxscn, for aux_symxndxdata.
439
Mark Wielaard16fa4142013-08-22 13:45:16 +02004402013-08-25 Mark Wielaard <mjw@redhat.com>
441
442 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
443 to dwfl_report_elf.
444
Jan Kratochvil10edf472013-07-25 11:05:35 +02004452013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
446
447 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
448 conflicts all the modules, not just the first one. Compare L_LD if it
449 is equal, not if it is in a module address range.
450
Jan Kratochvil596d4302013-07-23 16:30:01 +02004512013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
452
Jan Kratochvil744fc6f2013-07-23 17:52:01 +0200453 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
454
4552013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
456
Jan Kratochvil596d4302013-07-23 16:30:01 +0200457 * core-file.c (clear_r_debug_info): Close also ELF and FD.
458 (dwfl_core_file_report): Call __libdwfl_report_elf for
459 R_DEBUG_INFO.MODULE.
460 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
461 code of ...
462 (__libdwfl_report_elf): ... this function. Call it.
463 * dwfl_segment_report_module.c: Include unistd.h.
464 (dwfl_segment_report_module): Use basename for MODULE->NAME.
465 Clear MODULE if it has no build-id and we have segment with build-id.
466 Ignore this segment only if MODULE still contains valid ELF.
467 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
468 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
469 and disk_file_has_build_id.
470 (dwfl_link_map_report): Extend the comment.
471 * link_map.c (report_r_debug): Extend the comment. Always fill in new
472 r_debug_info_module. Initialize also the new r_debug_info_module
473 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
474 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
475
Jan Kratochvil8af254a2013-07-19 21:41:31 +02004762013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
477
478 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
479
Mark Wielaard8e5393c2013-07-02 13:35:29 +02004802013-07-02 Mark Wielaard <mjw@redhat.com>
481
482 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
483
Mark Wielaard24b26ec2013-06-05 17:03:25 +02004842013-06-05 Mark Wielaard <mjw@redhat.com>
485
486 * link_map.c (report_r_debug): Always call release_buffer after
487 memory_callback succeeded reading build_id.
488
Jan Kratochvil8ff86292013-05-30 13:21:20 +02004892013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
490
491 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
492 executable_for_core before calling dwfl_core_file_report.
493 * core-file.c (clear_r_debug_info): New function.
494 (dwfl_core_file_report): Move raw segments reporting lower. New
495 variable r_debug_info, pass it to dwfl_segment_report_module. Call
496 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
497 * dwfl_module_build_id.c (check_notes): Move into
498 __libdwfl_find_elf_build_id.
499 (__libdwfl_find_build_id): Rename to ...
500 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
501 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
502 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
503 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
504 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
505 adjust its data_elfaddr parameter.
506 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
507 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
508 parameter r_debug_info. New variable name_is_final. Adjust addresses
509 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
510 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
511 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
512 (struct r_debug_info_module, struct r_debug_info): New definitions.
513 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
514 r_debug_info.
515 * link_map.c: Include fcntl.h.
516 (report_r_debug): Add parameter r_debug_info, describe it in the
517 function comment. Delete dwfl_addrmodule call and its dependent code.
518 Verify build-id before calling dwfl_report_elf, also supply
519 executable_for_core to it. Store r_debug_info->module info when
520 appropriate.
521 (dwfl_link_map_report): Add parameter r_debug_info. New variable
522 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
523 caller parameters.
524
Jan Kratochvil904aec22013-04-30 14:27:16 +02005252013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
526
527 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
528 Set it to true for ET_EXEC and ET_CORE. Provide alternative
529 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
530 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
531 NEW_VERSION.
532 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
533 COMPAT_VERSION.
534 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
535 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
536 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
537 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
538 dwfl_report_elf.
539 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
540
Mark Wielaard9efa9e62013-04-27 20:50:32 +02005412013-04-27 Mark Wielaard <mjw@redhat.com>
542
543 * link_map.c: #include system.h.
544
Jan Kratochvil1704baf2013-04-26 17:00:50 +02005452013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
546
547 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
548 them to lib/system.h.
549
Mark Wielaardcdaaf212013-04-25 16:50:11 -04005502013-04-24 Mark Wielaard <mjw@redhat.com>
551
552 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
553
Jan Kratochvila1d44822013-03-19 13:40:13 +01005542013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
555
556 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
557
Mark Wielaardf1b06b52013-03-12 12:02:51 +01005582013-03-12 Mark Wielaard <mjw@redhat.com>
559
560 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
561
Mark Wielaardf6185a72013-02-22 23:42:59 +01005622013-02-22 Mark Wielaard <mjw@redhat.com>
563
564 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
565 as DWFL_E_BADELF when not used.
566
Mark Wielaard40025812013-02-10 15:07:33 +01005672013-02-10 Mark Wielaard <mjw@redhat.com>
568
569 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
570 failure messages When handling ARGP_KEY_SUCCESS because arg will
571 not have been set.
572
Jan Kratochvil84476372012-10-10 20:42:30 +02005732013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
574
575 * linux-proc-maps.c: Include system.h.
576 (PROCEXEFMT, get_pid_class): New.
577 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
578 get_pid_class.
579
Mark Wielaard697bdca2013-01-23 17:39:19 +01005802013-01-23 Mark Wielaard <mjw@redhat.com>
581
582 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
583 from aux_syments by default.
584 (find_symtab): Also succeed when only aux_symdata is found.
585 When no symtab is found always try to load auxiliary table.
586 (dwfl_module_getsymtab): Substract one from result when both
587 tables have symbols.
588 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
589 zero entry when both tables have symbols.
590 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
591 one from first_global when both tables have symbols.
592
Mark Wielaard5083a702013-01-16 15:19:32 +01005932013-01-16 Mark Wielaard <mjw@redhat.com>
594
595 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
596 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
597 (dwfl_adjusted_aux_sym_addr): New function.
598 (dwfl_deadjust_aux_sym_addr): Likewise.
599 (dwfl_adjusted_st_value): Take and check symfile argument.
600 (dwfl_deadjust_st_value): Likewise.
601 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
602 use dwfl_file as argument to set address_sync.
603 (find_debuginfo): Call find_prelink_address_sync with debug file.
604 (find_aux_sym): New function.
605 (find_symtab): Use find_aux_sym if all we have is the dynsym table
606 and fill in aux DwflModule fields.
607 (dwfl_module_getsymtab): Return syments plus aux_syments.
608 (load_symtab): Always set first_global.
609 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
610 when using same_section. Calculate first_global based on both
611 mod->first_global and mod->aux_first_global.
612 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
613 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
614 to retrieve symbol and name if necessary, making sure all locals
615 from any table come before any globals.
616 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
617 with symfile.
618 * relocate.c (resolve_symbol): Likewise.
619
Roland McGrath3999ce12013-01-07 14:53:37 -08006202013-01-07 Roland McGrath <roland@hack.frob.com>
621
622 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
623 still assume the data is at least 32-bit aligned anyway.
624 (dwfl_link_map_report): Handle unaligned auxv data.
625
Mark Wielaard76c54592012-12-11 14:21:01 +01006262012-12-11 Mark Wielaard <mjw@redhat.com>
627
628 * linux-kernel-modules.c (report_kernel): Only free fname if
629 find_kernel_elf succeeds and allocates it.
630 (report_kernel_archive): Fix brackets around unlikely expression.
631
Jan Kratochvild5784af2012-10-18 00:11:30 +02006322012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
633
634 * argp-std.c: Update Copyright year.
635 (offline_find_elf): New function.
636 (offline_callbacks): Use it for find_elf.
637 (struct parse_opt): New.
638 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
639 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
640 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
641 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
642 final state->input initialization optional.
643 * dwfl_end.c: Update Copyright year.
644 (dwfl_end): Free executable_for_core.
645 * libdwflP.h: Update Copyright year.
646 (struct Dwfl): New field executable_for_core.
647
Jan Kratochvilae81c702012-10-27 20:45:27 +02006482012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
649
650 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
651 calculation.
652
Jan Kratochvil50f413e2012-10-17 22:04:24 +02006532012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
654
Jan Kratochvil3fdcdcb2012-10-17 21:49:10 +0200655 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
656 from ...
657 (__libdwfl_getelf): ... here. Call it.
658
6592012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
660
Jan Kratochvil50f413e2012-10-17 22:04:24 +0200661 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
662
Jan Kratochvil78dec222012-10-10 08:04:01 +02006632012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
664
Jan Kratochvil387654d2012-10-10 08:08:44 +0200665 * dwfl_segment_report_module.c (dwfl_segment_report_module):
666 Initialize mod->MAIN_BIAS.
667
6682012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
669
Jan Kratochvil78dec222012-10-10 08:04:01 +0200670 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
671 binding_value. Use it for both zero and non-zero size symbols
672 comparisons.
673
Mark Wielaard5b257822012-10-01 16:10:46 +02006742012-10-01 Mark Wielaard <mjw@redhat.com>
675
Mark Wielaardea45ac82012-10-01 16:12:10 +0200676 * cu.c (cudie_offset): Don't use type_sig8, it might not be
677 initialized and these are always real CUs, never TUs.
678
6792012-10-01 Mark Wielaard <mjw@redhat.com>
680
Mark Wielaard5b257822012-10-01 16:10:46 +0200681 * derelocate.c (find_section): Check next section exists before
682 accessing it.
683
Petr Machatae1873142012-08-01 21:37:52 +02006842012-08-01 Petr Machata <pmachata@redhat.com>
685
686 * offline.c (process_archive_member): Ignore entry "/SYM64/".
687
Roland McGrath210c2f02012-03-28 10:22:35 -07006882012-03-28 Roland McGrath <roland@hack.frob.com>
689
690 * dwfl_segment_report_module.c
691 (dwfl_segment_report_module: read_portion): Don't use existing buffer
692 when FILESZ is zero (string mode) and available portion doesn't hold
693 a terminated string.
694
Roland McGrath01fef9d2011-12-02 09:45:53 -08006952011-12-02 Roland McGrath <roland@hack.frob.com>
696
697 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
698 to use elf64_xlatetom and PHDRS.p64.
699 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
700
Mark Wielaard75ee33f2011-10-31 15:33:49 +01007012011-11-31 Mark Wielaard <mjw@redhat.com>
702
Mark Wielaardef431cd2011-10-31 23:17:06 +0100703 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
704 global symbols. Then only when that doesn't provide a match search
705 all local symbols too.
706 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
707 and fill it in.
708 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
709 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
710
7112011-11-31 Mark Wielaard <mjw@redhat.com>
712
Mark Wielaard75ee33f2011-10-31 15:33:49 +0100713 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
714 sizeless_sym if needed and closer to desired addr.
715
Mark Wielaardf43feb52011-10-20 16:53:54 +02007162011-10-20 Mark Wielaard <mjw@redhat.com>
717
718 * derelocate.c (cache_sections): Intern mod->reloc_info check.
719 (dwfl_module_relocations): Don't check mod->reloc_info.
720 (dwfl_module_relocation_info): Likewise.
721 (find_section): Likewise.
722
Roland McGrath32899ac2011-07-09 03:17:24 -07007232011-07-09 Roland McGrath <roland@hack.frob.com>
724
725 * image-header.c (LE32): Macro removed (now in lib/system.h).
726
Mark Wielaarddbb490f2011-04-11 17:24:16 +02007272011-04-11 Mark Wielaard <mjw@redhat.com>
728
729 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
730 by check for zlib, bzlib or lzma defines to check it isn't empty.
731 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
732
Roland McGrathe07da4f2011-03-08 16:26:02 -08007332011-03-08 Roland McGrath <roland@redhat.com>
734
735 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
736 Reported by Kurt Roeckx <kurt@roeckx.be>.
737
Roland McGrath6ecdead2011-02-11 12:29:45 -08007382011-02-11 Roland McGrath <roland@redhat.com>
739
740 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
741 suffixes if corresponding decompression support is enabled.
742
Roland McGrath9fdd4612011-02-01 16:09:43 -08007432011-02-01 Roland McGrath <roland@redhat.com>
744
Roland McGrath3a44c9a2011-02-01 19:06:21 -0800745 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
746 section-end address as the synchronization point, rather than sh_addr.
747
Roland McGrath0ef40202011-02-01 16:58:32 -0800748 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
749 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
750
Roland McGrath9fdd4612011-02-01 16:09:43 -0800751 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
752 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
753
Roland McGrath5ad466d2011-01-11 10:17:01 -08007542011-01-11 Roland McGrath <roland@redhat.com>
755
756 * dwfl_module_getdwarf.c (open_elf): Remove section-based
757 address_sync fixup from here.
758 (find_prelink_address_sync): New function.
759 (find_debuginfo): Call it.
760 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
761
Roland McGrath2c7d0dd2011-01-04 19:29:53 -08007622011-01-04 Roland McGrath <roland@redhat.com>
763
764 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
765 logic to consider section addresses, the better to survive all the
766 possible prelink machinations.
767 * libdwflP.h (struct dwfl_file): Comment change.
768
Roland McGrath33d305f2010-11-30 17:39:55 -08007692010-11-30 Roland McGrath <roland@redhat.com>
770
771 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
772
Roland McGrath1743d7f2010-11-12 16:46:47 -08007732010-11-12 Roland McGrath <roland@redhat.com>
774
775 * libdwflP.h (struct Dwfl_Module): New member main_bias.
776 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
777 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
778
779 * libdwflP.h (dwfl_deadjust_address): New function.
780 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
781 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
782 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
783
7842010-11-11 Roland McGrath <roland@redhat.com>
785
786 * libdwflP.h (struct dwfl_file): Remove bias member.
787 Add vaddr and address_sync members instead.
788 (dwfl_adjusted_address): Calculate using vaddr.
789 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
790 (dwfl_adjusted_st_value): Use one of those calls.
791 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
792 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
793 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
794 * link_map.c (consider_executable): Adjust only MOD->low_addr for
795 detected PIE bias change.
796
797 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
798 * dwfl_module_info.c: Use it.
799 * cu.c (addrarange): Likewise.
800 * dwfl_dwarf_line.c: Likewise.
801 * dwfl_module_dwarf_cfi.c: Likewise.
802 * dwfl_lineinfo.c: Likewise.
803 * dwfl_nextcu.c: Likewise.
804 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
805
806 * libdwflP.h (dwfl_adjusted_st_value): New function.
807 * relocate.c (resolve_symbol): Use it.
808 * dwfl_module_getsym.c: Likewise.
809 * dwfl_module_addrsym.c: Likewise.
810 * dwfl_module_info.c: Likewise.
811
812 * libdwflP.h (dwfl_adjusted_address): New function.
813 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
814 * relocate.c (__libdwfl_relocate_value): Likewise.
815 * derelocate.c (cache_sections): Likewise.
816 (dwfl_module_address_section): Likewise.
817 * dwfl_module_getelf.c: Likewise.
818 * dwfl_module_eh_cfi.c: Likewise.
819 * link_map.c (consider_executable): Likewise.
820
Roland McGrathde44f132010-08-24 15:38:42 -07008212010-08-24 Roland McGrath <roland@redhat.com>
822
823 * dwfl_dwarf_line.c: New file.
824 * Makefile.am (libdwfl_a_SOURCES): Add it.
825
Roland McGrath7503c892010-08-18 02:54:29 -07008262010-08-18 Roland McGrath <roland@redhat.com>
827
828 * link_map.c (report_r_debug): Use found name if we have no name,
829 even if we already have an Elf handle.
830
Roland McGrath81cfcca2010-06-30 00:45:58 -07008312010-06-30 Roland McGrath <roland@redhat.com>
832
833 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
834 confused by -1 return from dwfl_build_id_find_elf after it opened
835 the Elf handle.
Roland McGrath82a63362010-06-30 01:18:43 -0700836 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
837 dwfl_build_id_find_debuginfo.
Roland McGrath81cfcca2010-06-30 00:45:58 -0700838
Roland McGrath3e0f7d12010-06-15 23:10:35 -07008392010-06-16 Roland McGrath <roland@redhat.com>
840
841 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
842
Roland McGrathb9e85182010-06-14 12:45:25 -07008432010-06-14 Roland McGrath <roland@redhat.com>
844
845 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
846 candidate file to that st_dev/st_ino and pretend it didn't exist
847 if they match.
848 (find_debuginfo_in_path): Update caller, pass main file's info.
849
Roland McGratha0635db2010-05-20 00:04:59 -07008502010-05-20 Roland McGrath <roland@redhat.com>
851
852 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
853 (grovel_auxv): ... this. Take DWFL argument.
854 (dwfl_linux_proc_report): Update caller.
855
856 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
857 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
858
Roland McGrathbe9c4d72010-05-19 21:24:27 -07008592010-05-19 Roland McGrath <roland@redhat.com>
860
861 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
862
Roland McGrathed431dd2010-05-06 00:52:51 -07008632010-05-06 Roland McGrath <roland@redhat.com>
864
Roland McGrathaba26e02010-05-06 01:12:15 -0700865 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
866
Roland McGrathed431dd2010-05-06 00:52:51 -0700867 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
868 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
869 ID but we didn't find a file.
870 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
871 and refuse any fallback file-by-name if it lacks the matching ID.
872
873 * dwfl_error.c (dwfl_errno): Add INTDEF.
874 * libdwflP.h: Add INTDECL.
875
876 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
877 failure cases.
878
Roland McGrath77cda9d2010-05-04 16:31:43 -07008792010-05-04 Roland McGrath <roland@redhat.com>
880
Roland McGrathb4bb3012010-05-04 20:09:30 -0700881 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
882 ET_DYN that has a DT_DEBUG.
883
884 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
Roland McGrath89bb5d32010-05-04 18:03:42 -0700885
Roland McGrath4820a052010-05-04 19:46:56 -0700886 * segment.c (insert): Fix moving of values following insertion.
887 (reify_segments): Fix up MOD->segment backpointer indices after
888 later insertions in the main loop invalidate them.
889
Roland McGrathd05c5962010-05-04 18:05:22 -0700890 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
891 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
892
Roland McGrath77cda9d2010-05-04 16:31:43 -0700893 * core-file.c (dwfl_core_file_report): Return any nonzero count of
894 modules reported, even if link_map grovelling failed and only sniffing
895 found anything.
896
Roland McGrathd17f9de2010-04-26 13:09:33 -07008972010-04-26 Roland McGrath <roland@redhat.com>
898
899 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
900 Works around probably-wrong ld -r behavior for case of a DWARF address
901 constant that refers to a discarded SHF_ALLOC section.
902
Roland McGrathbe139302010-04-14 12:54:45 -07009032010-04-14 Roland McGrath <roland@redhat.com>
904
905 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
906 an upper bound on sane possible number of elements.
907
Roland McGrath5ea349b2010-04-06 00:04:49 -07009082010-03-11 Roland McGrath <roland@redhat.com>
909
910 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
911 the second half for 32-bit matches.
912
Roland McGrath8068e062010-03-10 23:49:13 -08009132010-03-10 Roland McGrath <roland@redhat.com>
914
915 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
916 * argp-std.c (parse_opt): Update caller.
917 * libdwfl.h: Declare dwfl_core_file_report.
918 * libdwflP.h: Don't.
919
Roland McGrathca84a552010-02-17 01:44:42 -08009202010-02-17 Roland McGrath <roland@redhat.com>
921
922 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
923 If set, find the first index not below ADDR.
924 (dwfl_segment_report_module): Update callers.
925 Pass true when calculating return value.
926
Roland McGrathbf963472010-02-15 15:16:44 -08009272010-02-15 Roland McGrath <roland@redhat.com>
928
Roland McGrath22359e22010-02-15 15:57:03 -0800929 * Makefile.am: Use config/eu.am for common stuff.
930
Roland McGrathbf963472010-02-15 15:16:44 -0800931 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
932 variable in failure path.
933
Mark Wielaardeacdcf32010-02-02 15:45:24 +01009342010-02-02 Mark Wielaard <mjw@redhat.com>
935
936 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
937 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
938
Roland McGrathf95760a2010-01-07 20:24:34 -08009392010-01-07 Roland McGrath <roland@redhat.com>
940
941 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
942 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
943 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
944 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
945
Roland McGrath1d7cbd12010-01-06 04:22:40 -08009462010-01-06 Roland McGrath <roland@redhat.com>
947
948 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
949 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
950
Roland McGrath15426bd2009-11-16 20:38:17 -08009512009-11-16 Roland McGrath <roland@redhat.com>
952
953 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
954
Petr Machata003dd322009-11-13 00:38:27 +01009552009-11-12 Petr Machata <pmachata@redhat.com>
956
957 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
958 the chunk is both offset-contiguous and vaddr-contiguous.
959
Roland McGrathcdb48e02009-11-05 11:34:08 -08009602009-11-05 Roland McGrath <roland@redhat.com>
961
962 * link_map.c (report_r_debug): Skip entries with l_ld==0.
Roland McGrath6229eb52009-11-05 11:43:38 -0800963 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
Roland McGrathcdb48e02009-11-05 11:34:08 -0800964
Roland McGrathde6730c2009-09-04 03:05:31 -07009652009-09-04 Roland McGrath <roland@redhat.com>
966
967 * image-header.c (__libdw_image_header): Fix tranposed comparison.
968
Roland McGrath6bb90712009-08-27 12:36:47 -07009692009-08-27 Roland McGrath <roland@redhat.com>
970
971 * image-header.c: New file.
972 * Makefile.am (libdwfl_a_SOURCES): Add it.
973 * libdwflP.h: Declare __libdw_image_header.
974 * open.c (decompress): Don't consume ELF on failure.
975 (what_kind): New function, broken out of ...
976 (__libdw_open_file): ... here. Call it.
977 If it fails, try __libdw_image_header and then try what_kind again.
978
979 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
980 leave it behind for next decompressor.
981 * open.c (decompress): Free BUFFER on failure.
982
Roland McGrathd6ccdc12009-08-26 00:23:01 -07009832009-08-26 Roland McGrath <roland@redhat.com>
984
Roland McGrathe5a1a812009-08-26 03:05:50 -0700985 * gzip.c (find_zImage_payload): New function, broken out of ...
986 (mapped_zImage): ... here. Call it.
987 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
988 stupid method of just trying the decoder.
989
Roland McGrath24169642009-08-26 02:26:34 -0700990 * open.c [USE_LZMA]: Try __libdw_unlzma.
991 * libdwflP.h: Declare it.
992 (DWFL_ERRORS): Add DWFL_E_LZMA.
993 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
994 * lzma.c: New file.
995 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
996
Roland McGrathd6ccdc12009-08-26 00:23:01 -0700997 * gzip.c (mapped_zImage): Limit scan to 32kb.
998 Make this unconditional, support bzip2 kernel images too.
Roland McGrathae1d7dc2009-08-26 01:27:59 -0700999 (unzip): Use direct inflate method for non-mmap case too.
1000 Only zlib uses the stream method.
Roland McGrathd6ccdc12009-08-26 00:23:01 -07001001
Roland McGrathebfb6482009-08-09 15:40:52 -070010022009-08-09 Roland McGrath <roland@redhat.com>
1003
1004 * dwfl_module_build_id.c: Use new macros for versioned definitions.
1005
Roland McGrathfe8b42e2009-07-08 14:54:16 -070010062009-07-08 Roland McGrath <roland@redhat.com>
1007
Roland McGrath3c84db32009-06-24 17:41:40 -07001008 * dwfl_module_dwarf_cfi.c: New file.
1009 * dwfl_module_eh_cfi.c: New file.
1010 * Makefile.am (libdwfl_a_SOURCES): Add them.
1011 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
1012 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
1013
10142009-07-08 Roland McGrath <roland@redhat.com>
1015
Roland McGrathfe8b42e2009-07-08 14:54:16 -07001016 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
1017
Mark Wielaard2256e362009-06-18 13:31:56 +020010182009-06-18 Mark Wielaard <mjw@redhat.com>
1019
1020 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
1021
Ulrich Drepperf1894932009-06-13 15:55:42 -070010222009-06-13 Ulrich Drepper <drepper@redhat.com>
1023
1024 * derelocate.c: Don't use deprecated libelf functions.
1025 * dwfl_module_getdwarf.c: Likewise.
1026 * relocate.c: Likewise.
1027
Ulrich Drepper4f515712009-04-23 07:54:53 -070010282009-04-23 Ulrich Drepper <drepper@redhat.com>
1029
1030 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
1031 defined. Otherwise just define the latest version.
1032
Roland McGrathcc480472009-04-22 11:32:20 -070010332009-04-22 Roland McGrath <roland@redhat.com>
1034
Roland McGrathc65558b2009-04-22 12:29:32 -07001035 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
1036 a non-ET_REL module.
1037
Roland McGrathcc480472009-04-22 11:32:20 -07001038 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
1039 adjust properly for non-ET_REL.
1040
Roland McGrath19a8e4d2009-04-21 15:44:07 -070010412009-04-21 Roland McGrath <roland@redhat.com>
1042
1043 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
1044
1045 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
1046 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
1047 for ET_REL.
1048 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1049
Roland McGrath10361572009-04-20 11:50:50 -070010502009-04-20 Roland McGrath <roland@redhat.com>
1051
1052 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
1053
Roland McGratha605a3c2009-04-19 18:27:01 -070010542009-04-19 Roland McGrath <roland@redhat.com>
1055
1056 * dwfl_module_getdwarf.c (find_file): Renamed to ...
1057 (__libdwfl_getelf): ... this. Make it global.
1058 (find_symtab, find_dw): Update callers.
1059 (dwfl_module_getelf): Functions moved ...
1060 * dwfl_module_getelf.c: ... here, new file.
1061 * Makefile.am (libdwfl_a_SOURCES): Add it.
1062 * libdwflP.h: Declare __libdwfl_getelf.
1063
Roland McGrathfa253262009-04-14 02:38:19 -070010642009-04-14 Roland McGrath <roland@redhat.com>
1065
1066 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
1067 absolute (already adjusted in place) or needing load bias adjustment.
1068
1069 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
1070 gelf_getphdr failure. Fix file size limit checks.
1071
1072 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
1073
Roland McGrath243fa262009-04-08 17:05:43 -070010742009-04-08 Roland McGrath <roland@redhat.com>
1075
Roland McGrath785dbb12009-04-08 17:15:01 -07001076 * dwfl_module_getsym.c: Don't adjust for bias again after
1077 __libdwfl_relocate_value.
1078
Roland McGrath243fa262009-04-08 17:05:43 -07001079 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
1080 a non-SHF_ALLOC section.
1081 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
1082 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
1083
Roland McGrath8651c5e2009-03-09 20:42:56 -070010842009-03-09 Roland McGrath <roland@redhat.com>
1085
Roland McGrath329ed9f2009-03-09 20:49:53 -07001086 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
1087 variable to outer scope, so we cache it for the loop.
1088
Roland McGrath8651c5e2009-03-09 20:42:56 -07001089 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
1090
Roland McGrath31fd6542009-02-12 17:26:39 -080010912009-02-12 Roland McGrath <roland@redhat.com>
1092
1093 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
1094 __libdwfl_relocate_value to find correct sh_addr value.
1095
Roland McGrath45c01cd2009-02-10 17:03:19 -080010962009-02-10 Roland McGrath <roland@redhat.com>
1097
Roland McGrath5453abf2009-02-10 17:33:49 -08001098 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
1099 If false, don't fail for NO_PHDR.
1100 (dwfl_report_elf): Update caller.
1101 * libdwflP.h: Update decl.
1102 * offline.c (process_elf): Call it with false, so we don't refuse
1103 dubiously-formed objects here.
1104
Roland McGrath45c01cd2009-02-10 17:03:19 -08001105 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1106 finds our module. We shouldn't crash when we confuse some guesses.
1107
Ulrich Dreppera9d51bf2009-02-10 12:55:07 -080011082009-02-10 Ulrich Drepper <drepper@redhat.com>
1109
1110 * open.c (decompress): Avoid crash with empty input file.
1111
Roland McGrathe738ad22009-01-27 16:41:54 -080011122009-01-27 Roland McGrath <roland@redhat.com>
1113
1114 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1115 with zero vaddr and memsz.
1116
Roland McGrath74afbee2009-01-22 04:52:56 -080011172009-01-22 Roland McGrath <roland@redhat.com>
1118
Roland McGrathe34a3f82009-01-22 12:59:23 -08001119 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1120
Roland McGrath74afbee2009-01-22 04:52:56 -08001121 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1122 after address-matching loop.
1123
1124 * segment.c (lookup): Fix fencepost in checking for HINT match.
1125
Roland McGrath8dc9f932009-01-14 12:56:53 -080011262009-01-14 Roland McGrath <roland@redhat.com>
1127
1128 * gzip.c [!BZLIB] (mapped_zImage): New function.
1129 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1130
Ulrich Drepper7e678fa2009-01-10 18:02:05 -080011312009-01-10 Ulrich Drepper <drepper@redhat.com>
1132
1133 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1134
Roland McGratha4b1a952009-01-08 20:53:26 -080011352009-01-08 Roland McGrath <roland@redhat.com>
1136
1137 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1138 Skip subdirectory named "source".
1139 (dwfl_linux_kernel_find_elf): Likewise.
1140
Roland McGrath60205c92009-01-06 00:10:23 -080011412009-01-06 Roland McGrath <roland@redhat.com>
1142
Roland McGrath705364b2009-01-06 02:04:51 -08001143 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -08001144 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1145 (dwfl_linux_kernel_report_offline): Use it.
1146 (dwfl_linux_kernel_find_elf): Likewise.
1147
Roland McGrathbca43152009-01-05 23:59:32 -080011482009-01-05 Roland McGrath <roland@redhat.com>
1149
1150 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1151 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1152 * dwfl_build_id_find_elf.c: Likewise.
1153 * dwfl_module_getdwarf.c (open_elf): Likewise.
1154 * dwfl_report_elf.c: Likewise.
1155 * find-debuginfo.c (validate): Likewise.
1156 * offline.c (__libdwfl_report_offline): Likewise.
1157
1158 * libdwflP.h: Declare __libdw_open_file.
1159 * open.c: New file.
1160 * Makefile.am (libdwfl_a_SOURCES): Add it.
1161
1162 * gzip.c: New file.
1163 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1164 * bzip2.c: New file.
1165 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1166 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1167
Roland McGrath45d7b292008-12-16 16:21:40 -080011682008-12-16 Roland McGrath <roland@redhat.com>
1169
1170 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1171 symver magic to bind to ELFUTILS_0.138.
1172 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1173 wrapper for ELFUTILS_0.130 version set.
1174
Roland McGrath7d9b8212008-12-18 15:08:09 -080011752008-12-18 Roland McGrath <roland@redhat.com>
1176
1177 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1178 addresses are taken as relative to MOD->low_addr.
1179
Roland McGrath74825c42008-12-15 19:33:33 -080011802008-12-15 Roland McGrath <roland@redhat.com>
1181
1182 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1183 debug.bias.
1184
Roland McGrathb28a8942008-12-11 02:09:28 -080011852008-12-11 Roland McGrath <roland@redhat.com>
1186
1187 * offline.c (process_archive): Don't call elf_end and close if
1188 returning NULL. Check first elf_begin call and set error code
1189 specially for empty archive.
1190 Fixes RHBZ#465878.
1191
Roland McGratha845f682008-12-03 03:41:58 +000011922008-12-02 Roland McGrath <roland@redhat.com>
1193
1194 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1195
11962008-11-26 Roland McGrath <roland@redhat.com>
1197
1198 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1199 return value, and interpret encoded OFFSET argument.
1200
12012008-10-07 Roland McGrath <roland@redhat.com>
1202
1203 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1204
Roland McGrath9cf28e42008-09-30 06:35:35 +000012052008-09-29 Roland McGrath <roland@redhat.com>
1206
1207 * segment.c (insert): Must realloc DWFL->lookup_module here too.
1208 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1209
12102008-08-28 Roland McGrath <roland@redhat.com>
1211
1212 * segment.c (reify_segments): Fix last change.
1213
12142008-08-27 Roland McGrath <roland@redhat.com>
1215
1216 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1217 failure from pread64.
1218
Roland McGrath122f3882008-08-26 07:20:29 +000012192008-08-26 Roland McGrath <roland@redhat.com>
1220
1221 * segment.c (reify_segments): Insert a trailing segment for a module
1222 end that is above the highest current segment.
1223
12242008-08-25 Roland McGrath <roland@redhat.com>
1225
1226 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1227 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
1228 if FILE->elf is not ELF_K_ELF.
1229
1230 * dwfl_segment_report_module.c: Add a cast.
1231
Roland McGrathb4d6f0f2008-08-25 22:55:17 +000012322008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001233
Roland McGrathb4d6f0f2008-08-25 22:55:17 +00001234 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1235 which decides which symbol is "closest" to a given address.
1236
12372008-08-15 Roland McGrath <roland@redhat.com>
1238
1239 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1240 (options, parse_opt): Handle --core.
1241
1242 * core-file.c: New file.
1243 * Makefile.am (libdwfl_a_SOURCES): Add it.
1244 * libdwflP.h (dwfl_core_file_report): Declare it.
1245
1246 * link_map.c: New file.
1247 * Makefile.am (libdwfl_a_SOURCES): Add it.
1248 * libdwflP.h (dwfl_link_map_report): Declare it.
1249
1250 * libdwflP.h (MIN, MAX): New macros.
1251 (Dwfl_Memory_Callback): New typedef.
1252 (Dwfl_Module_Callback): New typedef.
1253 (dwfl_segment_report_module): Declare it.
1254 * dwfl_segment_report_module.c: New file.
1255 * Makefile.am (libdwfl_a_SOURCES): Add it.
1256
1257 * derelocate.c (dwfl_module_address_section): Add INTDEF.
1258 * libdwflP.h: Add INTDECL.
1259
1260 * segment.c: New file.
1261 * Makefile.am (libdwfl_a_SOURCES): Add it.
1262 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1263 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1264 lookup_addr, lookup_module, lookup_segndx, replace removed members
1265 modules, nmodules.
1266 (struct Dwfl_Module): New member segment.
1267 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
1268 to each free module.
1269 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1270 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
1271 (dwfl_report_module): Don't touch DWFL->nmodules.
1272 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1273 (compare_modules): Function removed.
1274 * dwfl_getmodules.c: Rewritten.
1275 Add INTDEF.
1276 * libdwflP.h: Add INTDECLs.
1277 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1278 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001279
Roland McGrath1d8bb252008-08-07 08:39:41 +000012802008-08-03 Roland McGrath <roland@redhat.com>
1281
1282 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1283
12842008-07-17 Roland McGrath <roland@redhat.com>
1285
1286 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1287 zero if the failure was only ENOENT.
1288
12892008-06-03 Roland McGrath <roland@redhat.com>
1290
1291 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1292 symbols.
1293
Roland McGrath9d2f3ee2008-05-22 20:28:05 +000012942008-05-22 Petr Machata <pmachata@redhat.com>
1295
1296 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1297
Roland McGrath0fa20e82008-05-07 18:37:14 +000012982008-05-06 Roland McGrath <roland@frob.com>
1299
1300 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1301 FTS_LOGICAL here too.
1302 (dwfl_linux_kernel_find_elf): Likewise.
1303
13042008-04-29 Roland McGrath <roland@redhat.com>
1305
1306 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1307 based on canonicalize_file_name if it differs from the supplied name.
1308
1309 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1310 we accept symlinks.
1311
Roland McGrath9897d662008-04-29 01:49:50 +000013122008-04-27 Roland McGrath <roland@redhat.com>
1313
1314 * linux-kernel-modules.c (report_kernel): Fix crash when
1315 dwfl_report_elf fails.
1316
Roland McGrathbfc01702008-04-06 01:57:32 +000013172008-04-05 Roland McGrath <roland@redhat.com>
1318
1319 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1320
1321 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1322 Clear it after freeing.
1323 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1324
Roland McGrathd11f9cb2008-03-26 20:51:59 +000013252008-03-26 Roland McGrath <roland@redhat.com>
1326
1327 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1328 SHT_DYNSYM, just set *SYMSCN like the comment says.
1329
1330 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1331
1332 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1333
13342008-03-19 Roland McGrath <roland@redhat.com>
1335
1336 * dwfl_module_getsrc.c: Adjust address for module bias before search.
1337
13382008-03-01 Roland McGrath <roland@redhat.com>
1339
1340 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1341 prototype to avoid older compiler's complaint about reuse of the name.
1342 (__libdwfl_canon_error): Likewise.
1343
Roland McGrath059c83e2008-02-21 06:19:39 +000013442008-02-19 Roland McGrath <roland@redhat.com>
1345
1346 * relocate.c (relocate_section): Check for an unhandled relocation
1347 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
1348 DWFL_E_UNKNOWN_MACHINE check out of loops.
1349
1350 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1351 DEBUGFILE->relocated is already set.
1352
13532008-01-26 Roland McGrath <roland@redhat.com>
1354
1355 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1356
1357 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1358 incoming *FILE_NAME at the start.
1359
Ulrich Dreppere219f1c2008-01-09 05:49:49 +000013602008-01-08 Roland McGrath <roland@redhat.com>
1361
1362 * Makefile.am (euinclude): Variable removed.
1363 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1364
Roland McGrathe4c22ea2007-10-23 13:07:39 +000013652007-10-23 Roland McGrath <roland@redhat.com>
1366
1367 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1368 module to appear first.
1369
13702007-10-20 Roland McGrath <roland@redhat.com>
1371
1372 * offline.c (process_archive_member): Take FD argument, pass it down
1373 to process_file. Return Elf_Cmd, not bool.
1374 Call elf_next here, always before elf_end.
1375 (process_archive): Update caller. Don't close FD here unless there
1376 are no member refs.
1377
1378 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
1379
1380 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
1381 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
1382 partial relocation to one or both files.
1383 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
1384 relocations have been applied to the debug file if dwfl_module_getelf
1385 has been used before.
1386
1387 * relocate.c (resolve_symbol): New function.
1388 (relocate_section): Call it.
1389
1390 * relocate.c (relocate_getsym): Handle null MOD->symfile.
1391 (relocate_section): Take new bool arg, PARTIAL. If true,
1392 no error for BADRELTYPE/RELUNDEF, instead just skip them
1393 and leave only those skipped relocs behind the reloc section.
1394 (__libdwfl_relocate_section): Take new arg, pass it down.
1395 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
1396 do partial relocation on all sections.
1397 * dwfl_module_getdwarf.c (load_dw): Update caller.
1398 * libdwflP.h: Update decls.
1399 * derelocate.c (dwfl_module_address_section): Pass new argument
1400 to __libdwfl_relocate_section, true.
1401
1402 * derelocate.c (cache_sections): Don't cache reloc sections when
1403 section_address callback is null.
1404
14052007-10-19 Roland McGrath <roland@redhat.com>
1406
1407 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
1408
1409 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
1410 (struct secref): Likewise.
1411 (cache_sections): Cache the relocation section referring to each
1412 section we cache, if any.
1413 (dwfl_module_address_section): Use __libdwfl_relocate_section as
1414 necessary.
1415
1416 * relocate.c (struct reloc_symtab_cache): New type.
1417 (relocate_getsym): Use it instead of four arguments.
1418 (__libdwfl_relocate): Update caller.
1419 (relocate_section): New function, broken out of ...
1420 (__libdwfl_relocate): ... here.
1421 (__libdwfl_relocate_section): New function.
1422 * libdwflP.h: Declare it.
1423
14242007-10-17 Roland McGrath <roland@redhat.com>
1425
1426 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
1427 to relocated st_value.
1428
1429 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
1430 ET_REL to 0x100.
1431
14322007-10-16 Roland McGrath <roland@redhat.com>
1433
1434 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
1435 section has larger alignment requirements not met by the original BASE,
1436 rather than padding more between sections.
1437
1438 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
1439
1440 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
1441 to sh_addr value.
1442
1443 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
1444 at zero in ET_REL case. Adjust BASE to necessary alignment.
1445
1446 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
1447 for DATA_VADDR.
1448 (__libdwfl_find_build_id): Update caller.
1449
1450 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
1451 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1452 * offline.c (dwfl_offline_section_address): Bail early if there is
1453 separate debug file.
1454
1455 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
1456
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000014572007-10-09 Roland McGrath <roland@redhat.com>
1458
1459 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
1460 caching SHDR->sh_addr = 0.
1461 * offline.c (dwfl_offline_section_address): Never called for sh_addr
1462 really at 0, don't check for it. Use MOD->debug directly, not symfile.
1463
1464 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
1465 we've found SHT_SYMTAB.
1466
1467 * relocate.c (relocate_getsym): New function.
1468 (__libdwfl_relocate): Use it.
1469 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
1470 be a pointer instead of value; cache getshstrndx result there.
1471 * libdwflP.h: Update decl.
1472 * derelocate.c (cache_sections): Update caller.
1473 Always work on the main file, not the symfile.
1474 (dwfl_module_address_section): Likewise.
1475 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
1476
14772007-10-07 Roland McGrath <roland@redhat.com>
1478
1479 * offline.c (process_archive): Initialize MOD.
1480
1481 * linux-kernel-modules.c (get_release): New function, broken out of ...
1482 (report_kernel): ... here. Call it.
1483 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
1484 (find_kernel_elf): Update caller.
1485 (report_kernel_archive): New function.
1486 (dwfl_linux_kernel_report_offline): Call it.
1487
1488 * offline.c (process_file): Take new arg PREDICATE, pass it down.
1489 (process_archive): Likewise.
1490 (process_archive_member): Likewise. When nonnull, let the predicate
1491 decide whether to use this member.
1492 (__libdwfl_report_offline): New function, broken out of ...
1493 (dwfl_report_offline): ... here. Call it.
1494 * libdwflP.h: Declare it.
1495
1496 * offline.c (process_archive, process_archive_member): New functions.
1497 (process_elf, process_file): New functions, broken out of ...
1498 (dwfl_report_offline): ... here. Call process_file, which recurses on
1499 ELF_K_AR files.
1500
1501 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
1502 (dwfl_report_elf): ... here. Call it.
1503 * libdwflP.h: Declare it.
1504
15052007-10-06 Roland McGrath <roland@redhat.com>
1506
1507 * derelocate.c (dwfl_module_relocations): Don't call
1508 dwfl_module_getdwarf.
1509
1510 * derelocate.c (find_section): Use __libdwfl_seterrno, not
1511 __libdw_seterrno.
1512
1513 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
1514 SHF_ALLOC, to cache sh_addr resolved to 0.
1515
1516 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
1517 values nonzero already, just use its existing layout.
1518
1519 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
1520 in-core shdr after applying it.
1521
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +000015222007-10-04 Ulrich Drepper <drepper@redhat.com>
1523
1524 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
1525 initialization of notes variable.
1526
Roland McGrath59ea7f32007-10-04 08:50:09 +000015272007-10-04 Roland McGrath <roland@redhat.com>
1528
1529 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
1530 fill in with vaddr of "__start_notes" symbol if found.
1531 (check_notes): New function.
1532 (check_kernel_notes): New function.
1533 (dwfl_linux_kernel_report_kernel): Call it.
1534 (check_module_notes): New function.
1535 (dwfl_linux_kernel_report_modules): Call it.
1536
1537 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
1538 Try dwfl_build_id_find_elf first.
1539
1540 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
1541 Set kernel module e_type to ET_DYN.
1542
15432007-10-03 Roland McGrath <roland@redhat.com>
1544
1545 * find-debuginfo.c (validate): New function, broken out of ...
1546 (find_debuginfo_in_path): ... here. New function, broken out of ...
1547 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
1548 dwfl_build_id_find_debuginfo first.
1549
1550 * dwfl_build_id_find_elf.c: New file.
1551 * dwfl_build_id_find_debuginfo.c: New file.
1552 * Makefile.am (libdwfl_a_SOURCES): Add them.
1553 * libdwfl.h: Declare them.
1554 * libdwflP.h: Add INTDECLs.
1555
1556 * dwfl_module_build_id.c: New file.
1557 * dwfl_module_report_build_id.c: New file.
1558 * Makefile.am (libdwfl_a_SOURCES): Add them.
1559 * libdwfl.h: Declare them.
1560 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
1561 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
1562 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
1563
1564 * dwfl_module_getdwarf.c (find_offsets): New function.
1565 (find_dynsym): New function, calls that.
1566 (find_symtab): Call it.
1567
Roland McGrathc76f0b02007-09-27 07:31:33 +000015682007-09-11 Roland McGrath <roland@redhat.com>
1569
1570 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
1571 address if its st_size is smaller.
1572
Roland McGrath099dd522007-08-13 22:58:36 +000015732007-08-13 Roland McGrath <roland@redhat.com>
1574
1575 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
1576
15772007-08-12 Roland McGrath <roland@redhat.com>
1578
1579 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
1580 FTS_LOGICAL.
1581
1582 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
1583 a second phdr if it happens to match EHDR_VMA exactly.
1584
Roland McGrath42f68682007-08-09 07:54:22 +000015852007-08-08 Roland McGrath <roland@redhat.com>
1586
1587 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
1588 those with no names. Rewrite best symbol algorithm not to assume a
1589 sorted table and to be smarter handling sizeless symbols.
1590
Roland McGrath87d47802007-07-16 22:23:37 +000015912007-07-16 Roland McGrath <roland@redhat.com>
1592
1593 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
1594 reviving an existing module.
1595
15962007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +00001597
1598 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
1599
Roland McGrath9aa8ef72007-05-18 08:59:43 +000016002007-05-17 Roland McGrath <roland@redhat.com>
1601
1602 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
1603 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
1604 (dwfl_linux_kernel_find_elf): Likewise.
1605
1606 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1607 getline and sscanf instead of fscanf.
1608
16092007-05-08 Roland McGrath <roland@redhat.com>
1610
1611 * offline.c (dwfl_offline_section_address): Don't assume section
1612 numbers match between stripped and debuginfo files. Instead, assume
1613 only that the ordering among SHF_ALLOC sections matches.
1614
1615 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
1616 pointer to string.
1617 (dwfl_linux_kernel_report_offline): Update caller.
1618 (dwfl_linux_kernel_report_kernel): Likewise.
1619
Roland McGrath4be15242007-04-25 03:09:33 +000016202007-04-23 Roland McGrath <roland@redhat.com>
1621
1622 * argp-std.c (options): Fix group title string.
1623
1624 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
1625 Update via STATE->input every time we set STATE->hook, not only at
1626 ARGP_KEY_SUCCESS.
1627
1628 * dwfl_module.c (free_file): Free FILE->name.
1629
Roland McGrath43da9892007-04-16 23:13:37 +000016302007-04-16 Roland McGrath <roland@redhat.com>
1631
1632 * derelocate.c (cache_sections): Apply bias to sh_addr.
1633 (compare_secrefs): Fix address comparison to avoid signed overflow.
1634 (find_section): New function, broken out of ...
1635 (dwfl_module_relocate_address): ... here, call it.
1636 (check_module): New function, broken out of ...
1637 (dwfl_module_relocate_address): ... here, call it.
1638 (dwfl_module_address_section): New function.
1639 * libdwfl.h: Declare it.
1640
Ulrich Drepperc07fbb32007-03-30 19:14:59 +000016412007-03-26 Roland McGrath <roland@redhat.com>
1642
1643 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
1644
16452007-03-18 Roland McGrath <roland@redhat.com>
1646
1647 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
1648 (find_debuginfo): ... here. Call it.
1649 Don't return error for libelf errors finding .gnu_debuglink section.
1650
Ulrich Drepper6258e742007-03-13 06:22:40 +000016512007-03-12 Roland McGrath <roland@redhat.com>
1652
1653 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
1654 (dwfl_report_begin): ... here. Call it.
1655 * libdwfl.h: Declare it.
1656 * libdwflP.h: Add INTDECL.
1657
1658 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1659
1660 * offline.c: Comment typo fix.
1661
16622007-03-04 Roland McGrath <roland@redhat.com>
1663
1664 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
1665 (find_kernel_elf): New function, broken out of ...
1666 (report_kernel): ... here. Call it.
1667 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
1668 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
1669 virtual address bounds of kernel from symbols rounded to page size.
1670 (dwfl_linux_kernel_report_kernel): Use that if it works, before
1671 resorting to report_kernel.
1672
1673 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
1674 ET_EXEC file with nonzero bias.
1675
1676 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
1677 dwfl_module_addrsym. Guts moved to ...
1678 * dwfl_module_addrsym.c: ... here; new file.
1679 * Makefile.am (libdwfl_a_SOURCES): Add it.
1680 * libdwfl.h: Declare dwfl_module_addrsym.
1681 * libdwflP.h: Add INTDECL.
1682
16832007-03-03 Roland McGrath <roland@redhat.com>
1684
1685 * dwfl_module.c (free_file): New function, broken out of ...
1686 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
1687
1688 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
1689 on libelf failure.
1690
16912007-03-02 Roland McGrath <roland@redhat.com>
1692
1693 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
1694
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000016952007-02-02 Roland McGrath <roland@redhat.com>
1696
1697 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
1698 address exactly if it's no other module's low boundary.
1699
1700 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
1701 and size cover the address, select the closest symbol with st_size==0
1702 that lies in the same section.
1703
17042007-01-29 Roland McGrath <roland@redhat.com>
1705
1706 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
1707 not PACKAGE_STRING.
1708
17092007-01-20 Roland McGrath <roland@redhat.com>
1710
1711 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
1712 as omitted, not 0.
1713 * libdwfl.h (Dwfl_Callbacks): Update comment.
1714 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
1715 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1716 For ignored missing section, use -1 instead of 0.
1717 * offline.c (dwfl_offline_section_address): Expect a call for 0.
1718
17192007-01-19 Roland McGrath <roland@redhat.com>
1720
1721 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
1722 zero so a lone -e foo.so is shown without address bias.
1723
Roland McGrathba949b32007-01-10 20:44:29 +000017242007-01-10 Roland McGrath <roland@redhat.com>
1725
Roland McGrath44865b92007-01-11 05:06:16 +00001726 * linux-kernel-modules.c (report_kernel): Check asprintf return value
1727 directly instead of via side effect, to silence warn_unused_result.
1728 (dwfl_linux_kernel_report_offline): Likewise.
1729 (dwfl_linux_kernel_find_elf): Likewise.
1730 (dwfl_linux_kernel_module_section_address): Likewise.
1731 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +00001732 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
1733 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +00001734
Roland McGrathba949b32007-01-10 20:44:29 +00001735 * libdwfl.h (dwfl_begin): Require nonnull argument.
1736
Roland McGrath70008802006-12-29 20:44:16 +000017372006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001738
Roland McGrath70008802006-12-29 20:44:16 +00001739 * dwfl_module.c (compare_modules): Fix address comparison to avoid
1740 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001741
Roland McGrath8190db62006-12-17 23:56:51 +000017422006-10-30 Roland McGrath <roland@redhat.com>
1743
1744 * dwfl_module.c (dwfl_report_module): Comment typo fix.
1745
Roland McGrathc373d852006-10-10 00:25:21 +000017462006-09-05 Roland McGrath <roland@redhat.com>
1747
1748 * derelocate.c (cache_sections): Use alloca instead of variable-sized
Roland McGrath3c84db32009-06-24 17:41:40 -07001749 auto array, in function already using alloca.
Roland McGrathc373d852006-10-10 00:25:21 +00001750
Roland McGratha1cee072006-08-15 01:37:23 +000017512006-08-14 Roland McGrath <roland@redhat.com>
1752
1753 * linux-kernel-modules.c (try_kernel_name): If the call to
1754 dwfl_standard_find_debuginfo produces no results, try it again
1755 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
1756
1757 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
1758 * libdwflP.h: ... to here.
1759 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
1760 repeats the first thing dwfl_standard_find_debuginfo will try.
1761
1762 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
1763 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
1764 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
1765 section name.
1766
Ulrich Drepper077c65f2006-07-12 19:54:51 +000017672006-07-12 Ulrich Drepper <drepper@redhat.com>
1768
1769 * cu.c: Adjust for internal_function_def removal.
1770 * dwfl_error.c: Likewise.
1771 * dwfl_module.c: Likewise.
1772 * dwfl_module_getdwarf.c: Likewise.
1773 * lines.c: Likewise.
1774 * relocate.c: Likewise.
1775
Ulrich Drepperc87b6e72006-07-11 22:32:28 +000017762006-07-11 Ulrich Drepper <drepper@redhat.com>
1777
1778 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
1779 it can overflow the return value type.
1780 Patch by Tim Moore <timoore@redhat.com>.
1781
Ulrich Dreppere1812e12006-07-12 07:46:03 +000017822006-06-28 Roland McGrath <roland@redhat.com>
1783
1784 * libdwfl.h: Cosmetic changes.
1785
1786 * dwfl_line_comp_dir.c: New file.
1787 * Makefile.am (libdwfl_a_SOURCES): Add it.
1788 * libdwfl.h: Declare dwfl_line_comp_dir.
1789
1790 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
1791
1792 * dwfl_linecu.c: New file.
1793 * Makefile.am (libdwfl_a_SOURCES): Add it.
1794 * libdwfl.h: Declare dwfl_linecu.
1795
1796 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
1797 (dwfl_linecu): Define as macro.
1798
1799 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
1800
1801 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
1802 (dwfl_module_addrname): Function moved ...
1803 * dwfl_module_addrname.c: ... here, new file.
1804 * dwfl_module_getsym.c: New file.
1805 * Makefile.am (libdwfl_a_SOURCES): Add them.
1806 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
1807 * libdwflP.h: Add INTDECLs.
1808
18092006-06-27 Roland McGrath <roland@redhat.com>
1810
1811 * dwfl_module.c (dwfl_report_end): Whitespace fix.
1812
Ulrich Drepperd5a75192006-06-15 03:07:46 +000018132006-06-13 Roland McGrath <roland@redhat.com>
1814
1815 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1816 Use __libdwfl_seterrno for elf_memory failure.
1817
Ulrich Dreppere1812e12006-07-12 07:46:03 +000018182006-05-22 Roland McGrath <roland@redhat.com>
1819
1820 * dwfl_module_return_value_location.c
1821 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
1822
Ulrich Drepper41cbd762006-05-27 18:19:23 +000018232006-05-27 Ulrich Drepper <drepper@redhat.com>
1824
1825 * libdwfl.h: Add extern "C".
1826
Ulrich Dreppere7a73172006-05-22 18:16:45 +000018272006-05-22 Ulrich Drepper <drepper@redhat.com>
1828
1829 * cu.c (addrarange): Handle files without aranges information.
1830
Ulrich Dreppera1690682006-05-17 05:28:36 +000018312006-05-16 Ulrich Drepper <drepper@redhat.com>
1832
1833 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
1834 ->modules is NULL.
1835
Roland McGrath687d7e92006-02-27 04:53:00 +000018362006-02-26 Roland McGrath <roland@redhat.com>
1837
Roland McGrath08333122006-02-27 04:54:26 +00001838 * dwfl_version.c: New file.
1839 * Makefile.am (libdwfl_a_SOURCES): Add it.
1840 * libdwfl.h: Declare dwfl_version.
1841
Roland McGrath687d7e92006-02-27 04:53:00 +00001842 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
1843 aligned up from DWFL->offline_next_address when checking for overlap.
1844
Roland McGrathfceb7b42005-12-23 01:45:21 +000018452005-12-22 Roland McGrath <roland@redhat.com>
1846
Roland McGrath1656bc02005-12-23 01:49:50 +00001847 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
1848
1849 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
1850 (dwfl_linux_proc_report): ... here. Call it.
1851 (dwfl_linux_proc_maps_report): New function.
1852 * libdwfl.h: Declare it.
1853 * libdwflP.h: Add INTDECL.
1854 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
1855
Roland McGrathfceb7b42005-12-23 01:45:21 +00001856 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
1857 failed with DWFL_E_NO_DWARF.
1858
Roland McGrath994b4892005-12-05 22:46:21 +000018592005-11-26 Roland McGrath <roland@redhat.com>
1860
1861 * dwfl_end.c (dwfl_end): Free the DWFL itself.
1862
18632005-11-25 Roland McGrath <roland@redhat.com>
1864
1865 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
1866 (load_dw): Use it.
1867 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
1868 * libdwflP.h: Declare it.
1869
1870 * dwfl_module_register_names.c: New file.
1871 * Makefile.am (libdwfl_a_SOURCES): Add it.
1872 * libdwfl.h: Declare dwfl_module_register_names.
1873
Roland McGratha5640892005-11-26 00:38:14 +000018742005-11-21 Roland McGrath <roland@redhat.com>
1875
1876 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1877 Don't leak malloc'd file name.
1878 If a /sys/.../sections file is missing and starts with ".init",
1879 try the variant with "_init" too; catches PPC64 kernel braindamage.
1880
Roland McGrathe47ab762005-11-17 03:16:00 +000018812005-11-15 Roland McGrath <roland@redhat.com>
1882
1883 * libdwfl.h: Comment fixes.
1884
1885 * dwfl_module_return_value_location.c: Add unlikely for error case.
1886
18872005-11-13 Roland McGrath <roland@redhat.com>
1888
1889 * dwfl_return_value_location.c: New file.
1890 * Makefile.am (libdwfl_a_SOURCES): Add it.
1891 * libdwfl.h: Declare dwfl_module_return_value_location.
1892 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
1893
Roland McGrath07d4f2f2005-10-28 06:56:24 +000018942005-10-20 Roland McGrath <roland@redhat.com>
1895
1896 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
1897 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
1898 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
1899
19002005-10-01 Roland McGrath <roland@redhat.com>
1901
1902 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
1903 with errno 0.
1904
19052005-09-19 Roland McGrath <roland@redhat.com>
1906
1907 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1908 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
1909 the signed integer reading; they will just have to be in hexadecimal.
1910 (dwfl_linux_kernel_module_section_address): Likewise.
1911
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000019122005-08-28 Ulrich Drepper <drepper@redhat.com>
1913
1914 * Makefile.am (%.os): Use COMPILE.os.
1915 (COMPILE.os): Filter out gconv options.
1916
Roland McGrath995f92d2005-08-26 05:55:04 +000019172005-08-25 Roland McGrath <roland@redhat.com>
1918
1919 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
1920 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
1921
Roland McGrath80e43a72005-08-24 21:12:15 +000019222005-08-24 Roland McGrath <roland@redhat.com>
1923
Roland McGrathefb5caa2005-08-25 01:49:53 +00001924 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
1925
Roland McGrath80e43a72005-08-24 21:12:15 +00001926 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
1927 magic initializer to set -heur-stack-bound option.
1928
Roland McGrath3712b282005-08-23 05:58:42 +000019292005-08-22 Roland McGrath <roland@redhat.com>
1930
Roland McGrathd17fac72005-08-23 08:20:21 +00001931 * dwfl_validate_address.c: New file.
1932 * Makefile.am (libdwfl_a_SOURCES): Add it.
1933 * libdwfl.h: Declare dwfl_validate_address.
1934
1935 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
1936 * libdwflP.h: Add INTDECL.
1937
Roland McGrath3712b282005-08-23 05:58:42 +00001938 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
1939 elf_rawdata for symbol-related sections.
1940
Roland McGrathd17fac72005-08-23 08:20:21 +00001941 * offline.c (dwfl_report_offline): Move offline_next_address outside
1942 module's range, in case it's an ET_EXEC using fixed segment locations.
1943 * libdwfl.h: Update comment.
1944
1945 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
1946 required alignment.
1947
19482005-08-20 Roland McGrath <roland@redhat.com>
1949
1950 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
1951 function to choose whether to report.
1952 (dwfl_linux_kernel_report_offline): Likewise.
1953 * libdwfl.h: Update decl.
1954 * argp-std.c (parse_opt): Update caller.
1955
1956 * dwfl_getsrclines.c: New file.
1957 * dwfl_onesrcline.c: New file.
1958 * Makefile.am (libdwfl_a_SOURCES): Add them.
1959 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
1960
1961 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
1962 MODULESDIR[0]. Call fts_close on failure.
1963
1964 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
1965 Close ET_REL file descriptors after relocation.
1966 (find_dw): Update caller.
1967 * offline.c (dwfl_report_offline): Get the file into memory and close
1968 the file descriptor.
1969
1970 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1971 MOD->debug.elf is already set.
1972
1973 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1974 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1975
1976 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1977 dwfl_linux_kernel_report_offline with offline_callbacks.
1978
1979 * linux-kernel-modules.c (report_kernel): New function, broken out of
1980 ...
1981 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1982 (dwfl_linux_kernel_report_offline): New function.
1983 * libdwfl.h: Declare it.
1984 * libdwflP.h: Add INTDECL.
1985
19862005-08-19 Roland McGrath <roland@redhat.com>
1987
1988 Use standard debuginfo search path to look for vmlinux.
1989 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1990 passed zero.
1991 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1992 of ...
1993 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1994
1995 * argp-std.c (offline_callbacks): New variable.
1996 (parse_opt): Use it for -e. Allow multiple -e options.
1997
1998 * offline.c: New file.
1999 * Makefile.am (libdwfl_a_SOURCES): Add it.
2000 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
2001 * libdwflP.h: Add INTDECLs.
2002 (OFFLINE_REDZONE): New macro.
2003 (struct Dwfl): New member `offline_next_address'.
2004 * dwfl_begin.c (dwfl_begin): Initialize it.
2005 * dwfl_module.c (dwfl_report_begin): Likewise.
2006
2007 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
2008 do a nominal absolute section layout starting at BASE.
2009 * libdwfl.h: Update comment.
2010
20112005-08-18 Roland McGrath <roland@redhat.com>
2012
2013 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
2014 dwfl_module_getdwarf if necessary.
2015
2016 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
2017 * libdwfl.h: Update comment.
2018
2019 * derelocate.c: New file.
2020 * Makefile.am (libdwfl_a_SOURCES): Add it.
2021
2022 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
2023 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
2024 * dwfl_module_getdwarf.c (open_elf): Update initialization.
2025 (load_dw, dwfl_module_addrname): Update uses.
2026 * relocate.c (__libdwfl_relocate): Likewise.
2027
20282005-08-04 Roland McGrath <roland@redhat.com>
2029
2030 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
2031 arguments SHNDX, SHDR.
2032 (dwfl_linux_kernel_module_section_address): Update prototype.
2033 * relocate.c (__libdwfl_relocate_value): Update caller.
2034 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2035 Take the new arguments.
2036
Roland McGrathd2c59962005-08-10 22:13:57 +000020372005-08-10 Roland McGrath <roland@redhat.com>
2038
2039 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
2040 use it instead of MOD->debug.file.
2041 * libdwflP.h: Update decl.
2042 * dwfl_module_getdwarf.c (load_dw): Update caller.
2043 Fixes bug #165598.
2044
Roland McGrath4959bf82005-08-09 10:31:08 +000020452005-08-09 Roland McGrath <roland@redhat.com>
2046
2047 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
2048 * cu.c: Use INTUSE on dwarf_* calls.
2049 * dwfl_error.c: Likewise.
2050 * dwfl_module.c: Likewise.
2051 * dwfl_module_getdwarf.c: Likewise.
2052 * dwfl_module_getsrc_file.c: Likewise.
2053 * lines.c: Likewise.
2054
Roland McGrath5678f872005-08-07 21:42:56 +000020552005-08-07 Roland McGrath <roland@redhat.com>
2056
2057 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
2058 names contain '_' or '-', look for files named either "foo-bar.ko"
2059 or "foo_bar.ko".
2060
Roland McGrath83fcb482005-08-02 00:58:33 +000020612005-07-29 Roland McGrath <roland@redhat.com>
2062
2063 * loc2c.c: File removed.
2064 * loc2c.h: File removed.
2065 * loc2c-runtime.h: File removed.
2066 * test2.c: File removed.
2067 * Makefile.am (EXTRA_DIST): Variable removed.
2068 (noinst_HEADERS): Remove loc2c.h from here.
2069
Ulrich Drepper18618fd2005-07-28 21:29:22 +000020702005-07-28 Ulrich Drepper <drepper@redhat.com>
2071
Ulrich Drepper4d527362005-07-28 22:32:58 +00002072 * libdwfl.h: Add a few missing extern for function prototypes.
2073
Ulrich Drepper18618fd2005-07-28 21:29:22 +00002074 * libdwfl_crc32.c: New file.
2075 * libdwfl_crc32_file.c: New file.
2076 * libdwflP.h: Declare the new functions.
2077 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
2078 libdwfl_crc32_file.c.
2079 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
2080 instead of crc32_file.
2081
Roland McGrathd89bbe42005-07-28 07:08:01 +000020822005-07-28 Roland McGrath <roland@redhat.com>
2083
Roland McGrath244501f2005-07-28 09:15:47 +00002084 * ptest.c: Moved to ../tests/dwflmodtest.c.
2085
Roland McGrath18385902005-07-28 07:12:38 +00002086 * Makefile.am (noinst_PROGRAMS): Variable removed.
2087 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
2088 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
2089 (libdwfl): Don't use libdwfl.so any more.
2090 (libdwfl.so, install, uninstall): Targets removed.
2091 (test2_SOURCES): Define EXTRA_DIST instead of this.
2092 * libdwfl.map: File removed.
2093
Roland McGrathd89bbe42005-07-28 07:08:01 +00002094 * libdwfl.h: Use "" for libdw.h #include.
2095
Roland McGrath5bab2442005-07-28 00:44:29 +000020962005-07-27 Roland McGrath <roland@redhat.com>
2097
2098 * libdwfl.map: Add dwfl_getmodules.
2099
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000021002005-07-23 Ulrich Drepper <drepper@redhat.com>
2101
2102 * Makefile.am: Fix rules to allow building with mudflap.
2103
21042005-07-21 Roland McGrath <roland@redhat.com>
2105
2106 * Makefile.am (noinst_HEADERS): Add loc2c.c.
2107
2108 * test2.c (main): Check sscanf result to quiet warning.
2109
21102005-07-20 Roland McGrath <roland@redhat.com>
2111
2112 * libdwfl-branch merged, creating this direcotry.