blob: e93d50c0d43f82075693a2372e7b5c741556ccee [file] [log] [blame]
Mark Wielaard32324792014-04-13 17:39:57 +020012014-03-14 Mark Wielaard <mjw@redhat.com>
2
3 * Makefile.am: Remove !MUDFLAP and MUDFLAP conditions.
4 Remove libelf and libdw definitions when MUDFLAP is defined.
5 * argp-std.c (__libdwfl_argp_mudflap_options): Removed.
6
Mark Wielaarddd64d4a2014-03-03 15:07:31 +010072014-03-03 Mark Wielaard <mjw@redhat.com>
8
9 * elf-from-memory.c (elf_from_remote_memory): Keep track of
10 segments_end_mem. Pass memsz to first handle_segment pass. Only
11 extend contents_size and use shdrs if only file bits are in
12 segment.
13
Josh Stone65cefbd2014-03-11 10:19:28 -0700142014-03-11 Josh Stone <jistone@redhat.com>
15
16 * dwfl_module_getdwarf.c (open_elf): Only explicitly set
17 mod->e_type when processing the main ELF file.
18
Mark Wielaard4b9e1432014-03-04 11:27:15 +0100192014-03-04 Mark Wielaard <mjw@redhat.com>
20
21 * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from
22 linux-pid-attach.c (struct pid_arg).
23 (__libdwfl_get_pid_arg): New internal function declaration.
24 (__libdwfl_ptrace_attach): Likewise.
25 (__libdwfl_ptrace_detach): Likewise.
26 * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the
27 special exception modules that cannot be checked at this point.
28 * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h
29 (ptrace_attach): Renamed to...
30 (__libdwfl_ptrace_attach): New internal function.
31 (__libdwfl_ptrace_detach): Likewise. Extracted from ...
32 (pid_thread_detach): Call __libdwfl_ptrace_detach now.
33 (__libdwfl_get_pid_arg): New internal function.
34 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special
35 module name contains "(deleted)" and dwfl_pid gives an attached
36 pid. If pid is set and try to (re)use ptrace attach state of
37 process before reading memory.
38
Mark Wielaardf15bcda2014-03-03 11:43:43 +0100392014-03-03 Mark Wielaard <mjw@redhat.com>
40
41 * elf-from-memory.c (elf_from_remote_memory): Take pagesize as
42 argument. Free buffer when detecting bad elf. Check PT_LOAD
43 alignment requirements on first handle_segment pass. Calculate
44 loadbase, start and end of segment using pagesize, not p_align.
45 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize
46 to elf_from_remote_memory.
47
Mark Wielaard48827ec2014-02-26 17:17:07 +0100482014-02-26 Mark Wielaard <mjw@redhat.com>
49
Mark Wielaard8f4402f2014-02-26 17:00:39 +010050 * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
51
522014-02-26 Mark Wielaard <mjw@redhat.com>
53
Mark Wielaard48827ec2014-02-26 17:17:07 +010054 * elf-from-memory.c (elf_from_remote_memory): Check against p64
55 p_type in case ELFCLASS64, not against p32 p_type.
56
Petr Machataced66872014-01-17 17:00:12 +0100572014-01-17 Petr Machata <pmachata@redhat.com>
58
59 * relocate.c (relocate_section): Use gelf_fsize instead of relying
60 on shdr->sh_entsize.
61
Mark Wielaard27aae182014-01-05 20:37:30 +0100622014-01-05 Mark Wielaard <mjw@redhat.com>
63
64 * frame_unwind.c (handle_cfi): Only skip resetting return register
65 if the regno is not the actual CIE return address register.
66
Mark Wielaard68de4422014-01-02 21:17:18 +0100672014-01-02 Mark Wielaard <mjw@redhat.com>
68
69 * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi.
70
Mark Wielaard19108012013-12-30 22:00:57 +0100712013-12-30 Mark Wielaard <mjw@redhat.com>
72
73 * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and
74 dwfl_core_file_attach explicitly.
75 * core-file.c (dwfl_core_file_report): Don't call
76 __libdwfl_attach_state_for_core implicitly.
77 * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error.
78 * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not
79 process_attach_error.
80 (dwfl_getthreads): Likewise.
81 (getthread): Likewise.
82 * libdwfl.h (dwfl_core_file_report): Update documentation.
83 (dwfl_linux_proc_report): Likewise.
84 (dwfl_core_file_attach): New function declaration.
85 (dwfl_linux_proc_attach): Likewise.
86 * libdwflP.h (struct Dwfl): Remove process_attach_error.
87 (__libdwfl_attach_state_for_pid): Removed declaration.
88 (__libdwfl_attach_state_for_core): Likewise.
89 (dwfl_core_file_attach): New internal declaration.
90 (dwfl_linux_proc_attach): Likewise.
91 (attach_state_for_core): Renamed to...
92 (dwfl_core_file_attach): ...this. Change return type.
93 (__libdwfl_attach_state_for_core): Removed.
94 * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped.
95 (pid_set_initial_registers): Check assume_ptrace_stopped before
96 calling ptrace.
97 (pid_thread_detach): Likewise.
98 (__libdwfl_attach_state_for_pid): Renamed to...
99 (dwfl_linux_proc_attach): ...this. Adjust return type.
100 * linux-proc-maps.c (dwfl_linux_proc_report): Don't call
101 __libdwfl_attach_state_for_pid implicitly.
102
Mark Wielaardac652612013-12-28 12:58:10 +01001032013-12-28 Mark Wielaard <mjw@redhat.com>
104
105 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special
106 character device files, only regular files.
107
Mark Wielaard05a44122013-12-24 10:37:58 +01001082013-12-24 Mark Wielaard <mjw@redhat.com>
109
110 * linux-core-attach.c (core_next_thread): Check whether thread_argp
111 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
112 in that case. Free thread_arg if there are no more threads.
113
Mark Wielaard97bbf9b2013-12-23 14:20:06 +01001142013-12-23 Mark Wielaard <mjw@redhat.com>
115
Mark Wielaardb20ca0b2013-12-23 23:21:59 +0100116 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
117 build_id before returning early.
118
1192013-12-23 Mark Wielaard <mjw@redhat.com>
120
Mark Wielaard97bbf9b2013-12-23 14:20:06 +0100121 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
122 pid (thread group leader) to dwfl_attach_state.
123
Mark Wielaard3e98ab72013-12-21 21:56:35 +01001242013-12-21 Mark Wielaard <mjw@redhat.com>
125
126 * frame_unwind.c (handle_cfi): Track whether the return register
127 has been set and only allow it to be set once.
128
Mark Wielaard641a4f62013-12-21 00:04:21 +01001292013-12-20 Mark Wielaard <mjw@redhat.com>
130
Mark Wielaarde962ec32013-12-20 10:09:12 +0100131 * dwfl_frame.c (one_arg): New struct.
132 (get_one_thread_cb): New function.
133 (dwfl_getthread): Likewise.
134 (one_thread): New struct.
135 (get_one_thread_frames_cb): New function.
136 (dwfl_getthread_frames): Likewise.
137 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
138 (dwfl_getthread_frames): Likewise.
139 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
140 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
141 to NULL.
142 * linux-pid-attach.c (pid_getthread): New function.
143 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
144
1452013-12-20 Mark Wielaard <mjw@redhat.com>
146
Mark Wielaard641a4f62013-12-21 00:04:21 +0100147 * linux-kernel-modules.c (report_kernel_archive): Correct nested
148 asprintf result check for debug.a.
149
Mark Wielaard159ac522013-12-18 11:05:54 +01001502013-12-18 Mark Wielaard <mjw@redhat.com>
151
152 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
153 * dwfl_module_addrname.c (dwfl_module_addrname): Use
154 dwfl_module_addrinfo.
155 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
156 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
157 for comparisons, not st_value. Fill in off. Search for both value
158 and the (adjusted) sym.st_value when different.
159 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
160 (dwfl_module_addrinfo): New function.
161 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
162 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
163 and possible. Adjust sym->st_value only when requested. Fill in addr
164 if available.
165 (dwfl_module_getsym_info): New function.
166 (dwfl_module_getsym): Use __libdwfl_getsym.
167 * libdwfl.h (dwfl_module_getsym_elf): Removed.
168 (dwfl_module_getsym_info): New function declaration.
169 (dwfl_module_addrinfo): Likewise.
170 (dwfl_module_addrsym): Add documentation describing differences
171 with addrinfo variants.
172 (dwfl_module_addrsym_elf): Removed.
173 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
174 (__libdwfl_addrsym): Likewise.
175 (__libdwfl_find_section_ndx): Likewise.
176 (dwfl_module_addrinfo): New internal declaration.
177 (dwfl_module_getsym_info): Likewise.
178 (dwfl_module_addrsym_elf): Removed.
179 (dwfl_module_getsym_elf): Likewise.
180
Jan Kratochvilc6a41482013-12-17 18:49:54 +01001812013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
182
Jan Kratochvilc5309462013-12-18 15:02:19 +0100183 * argp-std.c (offline_find_elf): Remove.
184 (offline_callbacks): Use dwfl_build_id_find_elf instead.
185 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
186 removed above.
187
1882013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
189
Jan Kratochvilc6a41482013-12-17 18:49:54 +0100190 unwinder: s390 and s390x
191 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
192 * frame_unwind.c (new_unwound): New function from ...
193 (handle_cfi): ... here. Call it.
194 (setfunc, getfunc, readfunc): New functions.
195 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
196 * linux-core-attach.c (core_set_initial_registers): Always iterate
197 through the Ebl_Register_Location loop. Call
198 dwfl_thread_state_register_pc there.
199
Jan Kratochvil6cd283c2013-12-17 18:17:32 +01002002013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
201
202 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
203
Mark Wielaardc76b2ff2013-12-17 10:37:29 +01002042013-12-17 Mark Wielaard <mjw@redhat.com>
205
206 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
207 traversal.
208
Mark Wielaard14c2d9e2013-12-16 13:28:59 +01002092013-12-16 Mark Wielaard <mjw@redhat.com>
210
211 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
212 definition.
213 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
214 function.
215 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
216 function definition.
217 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
218
Mark Wielaarde6e6cc82013-12-14 15:02:56 +01002192013-12-14 Mark Wielaard <mjw@redhat.com>
220
221 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
222 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
223 * frame_unwind.c (handle_cfi): Free frame result from
224 dwarf_cfi_addrframe when done.
225
Jan Kratochvil5cbf42a2013-12-15 18:56:17 +01002262013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
227
228 unwinder: ppc and ppc64
229 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
230 Call ebl_dwarf_to_regno.
231 * linux-core-attach.c (core_set_initial_registers): Implement
232 pc_register support.
233 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
234 FIRSTREG -1.
235
Jan Kratochvil5ef96c92013-11-30 21:40:29 +01002362013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
237
238 Introduce process_attach_error.
239 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
240 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
241 PROCESS is NULL.
242 * libdwflP.h (struct Dwfl): New field process_attach_error.
243 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
244 (attach_state_for_core): ... here, make it static, change return type,
245 no longer use __libdwfl_seterrno.
246 (__libdwfl_attach_state_for_core): New wrapper for it.
247
Mark Wielaard819c3492013-11-27 16:45:44 +01002482013-11-27 Mark Wielaard <mjw@redhat.com>
249
250 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
251 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
252 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
253 instead of tracking dwfl_files.
254 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
255 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
256 new elfp and biasp arguments. Track elf instead of file.
257 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
258 dwfl_module_info.c (dwfl_module_info): Pass elf to
259 dwfl_adjusted_st_value.
260 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
261 (dwfl_module_getsym_elf): New function declaration.
262 (dwfl_module_addrsym_elf): Likewise.
263 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
264 (dwfl_module_getsym_elf): Likewise.
265 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
266 (dwfl_deadjust_st_value): Likewise.
267 (__libdwfl_module_getsym): Removed.
268 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
269
Jan Kratochvil463e9832013-11-21 15:28:02 +01002702013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
271
Jan Kratochvil99a29492013-11-21 15:33:22 +0100272 Fix non-build-id core files on build-id system.
273 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
274 be read from memory.
275
2762013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
277
Jan Kratochvilb301c2e2013-11-21 15:31:04 +0100278 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
279 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
280 content, if possible.
281
2822013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
283
Jan Kratochvil463e9832013-11-21 15:28:02 +0100284 link_map: Use proper bias, not l_addr.
285 * core-file.c (dynamic_vaddr_get): Rename to ...
286 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
287 internal_function.
288 (dwfl_core_file_report): Update name in the caller.
289 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
290 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
291 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
292 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
293
Jan Kratochvil10d7a392013-11-19 15:00:15 +01002942013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
295
296 Compatibility with older kernels such as RHEL-6.
297 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
298 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
299 (pid_set_initial_registers): Pass tid_was_stopped.
300 (pid_thread_detach): Use tid_was_stopped.
301
Josh Stonedb35c872013-11-18 14:29:35 -08003022013-11-18 Josh Stone <jistone@redhat.com>
303
304 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
305 (find_aux_sym): Use it.
306
Jan Kratochviled782372013-11-14 20:53:20 +01003072013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
308
Jan Kratochvil1c1a53b2013-11-14 20:55:41 +0100309 Code cleanup: Remove const in prototype
310 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
311 firstreg.
312 * libdwfl.h (dwfl_thread_state_registers): Likewise.
313 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
314
3152013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
316
Jan Kratochviled782372013-11-14 20:53:20 +0100317 Fix dwfl_attach_state machine->elf.
318 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
319 Call ebl_openbackend instead of ebl_openbackend_machine.
320 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
321 Update the function description.
322 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
323 dwfl_attach_state.
324 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
325 dwfl_attach_state.
326
Jan Kratochvil954a7b02013-11-13 20:00:56 +01003272013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
328
329 Provide __libdwfl_module_getsym to get dwfl_file *.
330 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
331 (dwfl_module_addrsym) (search_table): New variable file. Use
332 __libdwfl_module_getsym. Use file.
333 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
334 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
335 (dwfl_module_getsym): New wrapper.
336 * libdwflP.h (__libdwfl_module_getsym): New declaration.
337
Jan Kratochvil5dca2b62013-11-13 19:58:06 +01003382013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
339
340 Fix dwfl_module_addrsym for minidebuginfo.
341 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
342 addr_symfile.
343 (dwfl_module_addrsym) (same_section): Use it.
344 (dwfl_module_addrsym) (i_to_symfile): New function.
345 (dwfl_module_addrsym) (search_table): Use it.
346
Jan Kratochvil21783b52013-11-07 16:34:58 +01003472013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil0b867462013-05-30 14:37:38 +0200348 Mark Wielaard <mjw@redhat.com>
349
350 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
351 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
352 dwfl_frame_regs.c.
353 * core-file.c (dwfl_core_file_report): Call
354 __libdwfl_attach_state_for_core.
355 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
356 * dwfl_frame.c: New file.
357 * frame_unwind.c: New file.
358 * dwfl_frame_pc.c: New file.
359 * linux-pid-attach.c: New file.
360 * linux-core-attach.c: New file.
361 * dwfl_frame_regs.c: New file.
362 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
363 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
364 (Dwfl_Thread_Callbacks): New definition.
365 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
366 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
367 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
368 (dwfl_frame_pc): New declarations.
369 * libdwflP.h (Dwfl_Process): New typedef.
370 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
371 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
372 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
373 (INVALID_ARGUMENT): New DWFL_ERROR entries.
374 (struct Dwfl): New entry process.
375 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
376 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
377 (__libdwfl_process_free, __libdwfl_frame_unwind)
378 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
379 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
380 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
381 (dwfl_frame_thread, dwfl_thread_state_registers)
382 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
383 (dwfl_frame_pc): New INTDECL entries.
384 * linux-proc-maps.c (dwfl_linux_proc_report): Call
385 __libdwfl_attach_state_for_pid.
386 * segment.c (segment_start): Rename to ...
387 (__libdwfl_segment_start): ... here and make it internal_function.
388 (segment_end): Rename to ...
389 (__libdwfl_segment_end): ... here and make it internal_function.
390 (reify_segments, dwfl_report_segment): Rename them at the callers.
391
3922013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil21783b52013-11-07 16:34:58 +0100393
Jan Kratochvil22f867a2013-11-07 21:30:17 +0100394 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
395
3962013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
397
Jan Kratochvilb947ee12013-11-07 21:27:54 +0100398 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
399 retval. Fix one forgotten LISTED increase.
400
4012013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
402
Jan Kratochvil35d95f32013-11-07 16:47:19 +0100403 Fix core files for re-prelink-ed files.
404 * core-file.c (dynamic_vaddr_get): New function.
405 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
406 dynamic_vaddr_get instead of using L_ADDR.
407 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
408 * link_map.c (report_r_debug): Do not initialize l_addr.
409
4102013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
411
Jan Kratochvil21783b52013-11-07 16:34:58 +0100412 Code cleanup.
413 * core-file.c (dwfl_core_file_report): Reindent block of code by
414 continue keyword.
415
Jan Kratochvil3cf491e2013-10-30 10:48:20 +01004162013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
417
418 * argp-std.c (parse_opt): Use executable parameter of
419 dwfl_core_file_report.
420 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
421 it to DWFL. Add NEW_VERSION for it.
422 (_compat_without_executable_dwfl_core_file_report): New. Twice.
423 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
424 the function comment.
425
Mark Wielaardd1829742013-10-15 23:53:32 +02004262013-10-15 Mark Wielaard <mjw@redhat.com>
427
428 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
429 mappings.
430 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
431
Mark Wielaard2e73a8a2013-09-12 11:27:56 +02004322013-09-12 Mark Wielaard <mjw@redhat.com>
433
Mark Wielaardead7d192013-09-12 16:49:25 +0200434 * cu.c (intern_cu): If dwarf_offdie fails free cu.
435
4362013-09-12 Mark Wielaard <mjw@redhat.com>
437
Mark Wielaardcc392482013-09-12 15:16:13 +0200438 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
439 bad_report.
440
4412013-09-12 Mark Wielaard <mjw@redhat.com>
442
Mark Wielaard2e73a8a2013-09-12 11:27:56 +0200443 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
444 aux_xndxscn, not xndxscn, for aux_symxndxdata.
445
Mark Wielaard16fa4142013-08-22 13:45:16 +02004462013-08-25 Mark Wielaard <mjw@redhat.com>
447
448 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
449 to dwfl_report_elf.
450
Jan Kratochvil10edf472013-07-25 11:05:35 +02004512013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
452
453 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
454 conflicts all the modules, not just the first one. Compare L_LD if it
455 is equal, not if it is in a module address range.
456
Jan Kratochvil596d4302013-07-23 16:30:01 +02004572013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
458
Jan Kratochvil744fc6f2013-07-23 17:52:01 +0200459 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
460
4612013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
462
Jan Kratochvil596d4302013-07-23 16:30:01 +0200463 * core-file.c (clear_r_debug_info): Close also ELF and FD.
464 (dwfl_core_file_report): Call __libdwfl_report_elf for
465 R_DEBUG_INFO.MODULE.
466 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
467 code of ...
468 (__libdwfl_report_elf): ... this function. Call it.
469 * dwfl_segment_report_module.c: Include unistd.h.
470 (dwfl_segment_report_module): Use basename for MODULE->NAME.
471 Clear MODULE if it has no build-id and we have segment with build-id.
472 Ignore this segment only if MODULE still contains valid ELF.
473 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
474 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
475 and disk_file_has_build_id.
476 (dwfl_link_map_report): Extend the comment.
477 * link_map.c (report_r_debug): Extend the comment. Always fill in new
478 r_debug_info_module. Initialize also the new r_debug_info_module
479 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
480 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
481
Jan Kratochvil8af254a2013-07-19 21:41:31 +02004822013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
483
484 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
485
Mark Wielaard8e5393c2013-07-02 13:35:29 +02004862013-07-02 Mark Wielaard <mjw@redhat.com>
487
488 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
489
Mark Wielaard24b26ec2013-06-05 17:03:25 +02004902013-06-05 Mark Wielaard <mjw@redhat.com>
491
492 * link_map.c (report_r_debug): Always call release_buffer after
493 memory_callback succeeded reading build_id.
494
Jan Kratochvil8ff86292013-05-30 13:21:20 +02004952013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
496
497 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
498 executable_for_core before calling dwfl_core_file_report.
499 * core-file.c (clear_r_debug_info): New function.
500 (dwfl_core_file_report): Move raw segments reporting lower. New
501 variable r_debug_info, pass it to dwfl_segment_report_module. Call
502 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
503 * dwfl_module_build_id.c (check_notes): Move into
504 __libdwfl_find_elf_build_id.
505 (__libdwfl_find_build_id): Rename to ...
506 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
507 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
508 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
509 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
510 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
511 adjust its data_elfaddr parameter.
512 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
513 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
514 parameter r_debug_info. New variable name_is_final. Adjust addresses
515 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
516 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
517 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
518 (struct r_debug_info_module, struct r_debug_info): New definitions.
519 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
520 r_debug_info.
521 * link_map.c: Include fcntl.h.
522 (report_r_debug): Add parameter r_debug_info, describe it in the
523 function comment. Delete dwfl_addrmodule call and its dependent code.
524 Verify build-id before calling dwfl_report_elf, also supply
525 executable_for_core to it. Store r_debug_info->module info when
526 appropriate.
527 (dwfl_link_map_report): Add parameter r_debug_info. New variable
528 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
529 caller parameters.
530
Jan Kratochvil904aec22013-04-30 14:27:16 +02005312013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
532
533 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
534 Set it to true for ET_EXEC and ET_CORE. Provide alternative
535 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
536 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
537 NEW_VERSION.
538 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
539 COMPAT_VERSION.
540 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
541 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
542 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
543 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
544 dwfl_report_elf.
545 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
546
Mark Wielaard9efa9e62013-04-27 20:50:32 +02005472013-04-27 Mark Wielaard <mjw@redhat.com>
548
549 * link_map.c: #include system.h.
550
Jan Kratochvil1704baf2013-04-26 17:00:50 +02005512013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
552
553 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
554 them to lib/system.h.
555
Mark Wielaardcdaaf212013-04-25 16:50:11 -04005562013-04-24 Mark Wielaard <mjw@redhat.com>
557
558 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
559
Jan Kratochvila1d44822013-03-19 13:40:13 +01005602013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
561
562 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
563
Mark Wielaardf1b06b52013-03-12 12:02:51 +01005642013-03-12 Mark Wielaard <mjw@redhat.com>
565
566 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
567
Mark Wielaardf6185a72013-02-22 23:42:59 +01005682013-02-22 Mark Wielaard <mjw@redhat.com>
569
570 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
571 as DWFL_E_BADELF when not used.
572
Mark Wielaard40025812013-02-10 15:07:33 +01005732013-02-10 Mark Wielaard <mjw@redhat.com>
574
575 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
576 failure messages When handling ARGP_KEY_SUCCESS because arg will
577 not have been set.
578
Jan Kratochvil84476372012-10-10 20:42:30 +02005792013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
580
581 * linux-proc-maps.c: Include system.h.
582 (PROCEXEFMT, get_pid_class): New.
583 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
584 get_pid_class.
585
Mark Wielaard697bdca2013-01-23 17:39:19 +01005862013-01-23 Mark Wielaard <mjw@redhat.com>
587
588 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
589 from aux_syments by default.
590 (find_symtab): Also succeed when only aux_symdata is found.
591 When no symtab is found always try to load auxiliary table.
592 (dwfl_module_getsymtab): Substract one from result when both
593 tables have symbols.
594 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
595 zero entry when both tables have symbols.
596 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
597 one from first_global when both tables have symbols.
598
Mark Wielaard5083a702013-01-16 15:19:32 +01005992013-01-16 Mark Wielaard <mjw@redhat.com>
600
601 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
602 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
603 (dwfl_adjusted_aux_sym_addr): New function.
604 (dwfl_deadjust_aux_sym_addr): Likewise.
605 (dwfl_adjusted_st_value): Take and check symfile argument.
606 (dwfl_deadjust_st_value): Likewise.
607 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
608 use dwfl_file as argument to set address_sync.
609 (find_debuginfo): Call find_prelink_address_sync with debug file.
610 (find_aux_sym): New function.
611 (find_symtab): Use find_aux_sym if all we have is the dynsym table
612 and fill in aux DwflModule fields.
613 (dwfl_module_getsymtab): Return syments plus aux_syments.
614 (load_symtab): Always set first_global.
615 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
616 when using same_section. Calculate first_global based on both
617 mod->first_global and mod->aux_first_global.
618 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
619 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
620 to retrieve symbol and name if necessary, making sure all locals
621 from any table come before any globals.
622 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
623 with symfile.
624 * relocate.c (resolve_symbol): Likewise.
625
Roland McGrath3999ce12013-01-07 14:53:37 -08006262013-01-07 Roland McGrath <roland@hack.frob.com>
627
628 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
629 still assume the data is at least 32-bit aligned anyway.
630 (dwfl_link_map_report): Handle unaligned auxv data.
631
Mark Wielaard76c54592012-12-11 14:21:01 +01006322012-12-11 Mark Wielaard <mjw@redhat.com>
633
634 * linux-kernel-modules.c (report_kernel): Only free fname if
635 find_kernel_elf succeeds and allocates it.
636 (report_kernel_archive): Fix brackets around unlikely expression.
637
Jan Kratochvild5784af2012-10-18 00:11:30 +02006382012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
639
640 * argp-std.c: Update Copyright year.
641 (offline_find_elf): New function.
642 (offline_callbacks): Use it for find_elf.
643 (struct parse_opt): New.
644 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
645 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
646 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
647 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
648 final state->input initialization optional.
649 * dwfl_end.c: Update Copyright year.
650 (dwfl_end): Free executable_for_core.
651 * libdwflP.h: Update Copyright year.
652 (struct Dwfl): New field executable_for_core.
653
Jan Kratochvilae81c702012-10-27 20:45:27 +02006542012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
655
656 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
657 calculation.
658
Jan Kratochvil50f413e2012-10-17 22:04:24 +02006592012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
660
Jan Kratochvil3fdcdcb2012-10-17 21:49:10 +0200661 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
662 from ...
663 (__libdwfl_getelf): ... here. Call it.
664
6652012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
666
Jan Kratochvil50f413e2012-10-17 22:04:24 +0200667 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
668
Jan Kratochvil78dec222012-10-10 08:04:01 +02006692012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
670
Jan Kratochvil387654d2012-10-10 08:08:44 +0200671 * dwfl_segment_report_module.c (dwfl_segment_report_module):
672 Initialize mod->MAIN_BIAS.
673
6742012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
675
Jan Kratochvil78dec222012-10-10 08:04:01 +0200676 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
677 binding_value. Use it for both zero and non-zero size symbols
678 comparisons.
679
Mark Wielaard5b257822012-10-01 16:10:46 +02006802012-10-01 Mark Wielaard <mjw@redhat.com>
681
Mark Wielaardea45ac82012-10-01 16:12:10 +0200682 * cu.c (cudie_offset): Don't use type_sig8, it might not be
683 initialized and these are always real CUs, never TUs.
684
6852012-10-01 Mark Wielaard <mjw@redhat.com>
686
Mark Wielaard5b257822012-10-01 16:10:46 +0200687 * derelocate.c (find_section): Check next section exists before
688 accessing it.
689
Petr Machatae1873142012-08-01 21:37:52 +02006902012-08-01 Petr Machata <pmachata@redhat.com>
691
692 * offline.c (process_archive_member): Ignore entry "/SYM64/".
693
Roland McGrath210c2f02012-03-28 10:22:35 -07006942012-03-28 Roland McGrath <roland@hack.frob.com>
695
696 * dwfl_segment_report_module.c
697 (dwfl_segment_report_module: read_portion): Don't use existing buffer
698 when FILESZ is zero (string mode) and available portion doesn't hold
699 a terminated string.
700
Roland McGrath01fef9d2011-12-02 09:45:53 -08007012011-12-02 Roland McGrath <roland@hack.frob.com>
702
703 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
704 to use elf64_xlatetom and PHDRS.p64.
705 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
706
Mark Wielaard75ee33f2011-10-31 15:33:49 +01007072011-11-31 Mark Wielaard <mjw@redhat.com>
708
Mark Wielaardef431cd2011-10-31 23:17:06 +0100709 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
710 global symbols. Then only when that doesn't provide a match search
711 all local symbols too.
712 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
713 and fill it in.
714 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
715 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
716
7172011-11-31 Mark Wielaard <mjw@redhat.com>
718
Mark Wielaard75ee33f2011-10-31 15:33:49 +0100719 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
720 sizeless_sym if needed and closer to desired addr.
721
Mark Wielaardf43feb52011-10-20 16:53:54 +02007222011-10-20 Mark Wielaard <mjw@redhat.com>
723
724 * derelocate.c (cache_sections): Intern mod->reloc_info check.
725 (dwfl_module_relocations): Don't check mod->reloc_info.
726 (dwfl_module_relocation_info): Likewise.
727 (find_section): Likewise.
728
Roland McGrath32899ac2011-07-09 03:17:24 -07007292011-07-09 Roland McGrath <roland@hack.frob.com>
730
731 * image-header.c (LE32): Macro removed (now in lib/system.h).
732
Mark Wielaarddbb490f2011-04-11 17:24:16 +02007332011-04-11 Mark Wielaard <mjw@redhat.com>
734
735 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
736 by check for zlib, bzlib or lzma defines to check it isn't empty.
737 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
738
Roland McGrathe07da4f2011-03-08 16:26:02 -08007392011-03-08 Roland McGrath <roland@redhat.com>
740
741 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
742 Reported by Kurt Roeckx <kurt@roeckx.be>.
743
Roland McGrath6ecdead2011-02-11 12:29:45 -08007442011-02-11 Roland McGrath <roland@redhat.com>
745
746 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
747 suffixes if corresponding decompression support is enabled.
748
Roland McGrath9fdd4612011-02-01 16:09:43 -08007492011-02-01 Roland McGrath <roland@redhat.com>
750
Roland McGrath3a44c9a2011-02-01 19:06:21 -0800751 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
752 section-end address as the synchronization point, rather than sh_addr.
753
Roland McGrath0ef40202011-02-01 16:58:32 -0800754 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
755 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
756
Roland McGrath9fdd4612011-02-01 16:09:43 -0800757 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
758 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
759
Roland McGrath5ad466d2011-01-11 10:17:01 -08007602011-01-11 Roland McGrath <roland@redhat.com>
761
762 * dwfl_module_getdwarf.c (open_elf): Remove section-based
763 address_sync fixup from here.
764 (find_prelink_address_sync): New function.
765 (find_debuginfo): Call it.
766 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
767
Roland McGrath2c7d0dd2011-01-04 19:29:53 -08007682011-01-04 Roland McGrath <roland@redhat.com>
769
770 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
771 logic to consider section addresses, the better to survive all the
772 possible prelink machinations.
773 * libdwflP.h (struct dwfl_file): Comment change.
774
Roland McGrath33d305f2010-11-30 17:39:55 -08007752010-11-30 Roland McGrath <roland@redhat.com>
776
777 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
778
Roland McGrath1743d7f2010-11-12 16:46:47 -08007792010-11-12 Roland McGrath <roland@redhat.com>
780
781 * libdwflP.h (struct Dwfl_Module): New member main_bias.
782 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
783 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
784
785 * libdwflP.h (dwfl_deadjust_address): New function.
786 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
787 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
788 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
789
7902010-11-11 Roland McGrath <roland@redhat.com>
791
792 * libdwflP.h (struct dwfl_file): Remove bias member.
793 Add vaddr and address_sync members instead.
794 (dwfl_adjusted_address): Calculate using vaddr.
795 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
796 (dwfl_adjusted_st_value): Use one of those calls.
797 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
798 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
799 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
800 * link_map.c (consider_executable): Adjust only MOD->low_addr for
801 detected PIE bias change.
802
803 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
804 * dwfl_module_info.c: Use it.
805 * cu.c (addrarange): Likewise.
806 * dwfl_dwarf_line.c: Likewise.
807 * dwfl_module_dwarf_cfi.c: Likewise.
808 * dwfl_lineinfo.c: Likewise.
809 * dwfl_nextcu.c: Likewise.
810 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
811
812 * libdwflP.h (dwfl_adjusted_st_value): New function.
813 * relocate.c (resolve_symbol): Use it.
814 * dwfl_module_getsym.c: Likewise.
815 * dwfl_module_addrsym.c: Likewise.
816 * dwfl_module_info.c: Likewise.
817
818 * libdwflP.h (dwfl_adjusted_address): New function.
819 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
820 * relocate.c (__libdwfl_relocate_value): Likewise.
821 * derelocate.c (cache_sections): Likewise.
822 (dwfl_module_address_section): Likewise.
823 * dwfl_module_getelf.c: Likewise.
824 * dwfl_module_eh_cfi.c: Likewise.
825 * link_map.c (consider_executable): Likewise.
826
Roland McGrathde44f132010-08-24 15:38:42 -07008272010-08-24 Roland McGrath <roland@redhat.com>
828
829 * dwfl_dwarf_line.c: New file.
830 * Makefile.am (libdwfl_a_SOURCES): Add it.
831
Roland McGrath7503c892010-08-18 02:54:29 -07008322010-08-18 Roland McGrath <roland@redhat.com>
833
834 * link_map.c (report_r_debug): Use found name if we have no name,
835 even if we already have an Elf handle.
836
Roland McGrath81cfcca2010-06-30 00:45:58 -07008372010-06-30 Roland McGrath <roland@redhat.com>
838
839 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
840 confused by -1 return from dwfl_build_id_find_elf after it opened
841 the Elf handle.
Roland McGrath82a63362010-06-30 01:18:43 -0700842 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
843 dwfl_build_id_find_debuginfo.
Roland McGrath81cfcca2010-06-30 00:45:58 -0700844
Roland McGrath3e0f7d12010-06-15 23:10:35 -07008452010-06-16 Roland McGrath <roland@redhat.com>
846
847 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
848
Roland McGrathb9e85182010-06-14 12:45:25 -07008492010-06-14 Roland McGrath <roland@redhat.com>
850
851 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
852 candidate file to that st_dev/st_ino and pretend it didn't exist
853 if they match.
854 (find_debuginfo_in_path): Update caller, pass main file's info.
855
Roland McGratha0635db2010-05-20 00:04:59 -07008562010-05-20 Roland McGrath <roland@redhat.com>
857
858 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
859 (grovel_auxv): ... this. Take DWFL argument.
860 (dwfl_linux_proc_report): Update caller.
861
862 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
863 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
864
Roland McGrathbe9c4d72010-05-19 21:24:27 -07008652010-05-19 Roland McGrath <roland@redhat.com>
866
867 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
868
Roland McGrathed431dd2010-05-06 00:52:51 -07008692010-05-06 Roland McGrath <roland@redhat.com>
870
Roland McGrathaba26e02010-05-06 01:12:15 -0700871 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
872
Roland McGrathed431dd2010-05-06 00:52:51 -0700873 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
874 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
875 ID but we didn't find a file.
876 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
877 and refuse any fallback file-by-name if it lacks the matching ID.
878
879 * dwfl_error.c (dwfl_errno): Add INTDEF.
880 * libdwflP.h: Add INTDECL.
881
882 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
883 failure cases.
884
Roland McGrath77cda9d2010-05-04 16:31:43 -07008852010-05-04 Roland McGrath <roland@redhat.com>
886
Roland McGrathb4bb3012010-05-04 20:09:30 -0700887 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
888 ET_DYN that has a DT_DEBUG.
889
890 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
Roland McGrath89bb5d32010-05-04 18:03:42 -0700891
Roland McGrath4820a052010-05-04 19:46:56 -0700892 * segment.c (insert): Fix moving of values following insertion.
893 (reify_segments): Fix up MOD->segment backpointer indices after
894 later insertions in the main loop invalidate them.
895
Roland McGrathd05c5962010-05-04 18:05:22 -0700896 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
897 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
898
Roland McGrath77cda9d2010-05-04 16:31:43 -0700899 * core-file.c (dwfl_core_file_report): Return any nonzero count of
900 modules reported, even if link_map grovelling failed and only sniffing
901 found anything.
902
Roland McGrathd17f9de2010-04-26 13:09:33 -07009032010-04-26 Roland McGrath <roland@redhat.com>
904
905 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
906 Works around probably-wrong ld -r behavior for case of a DWARF address
907 constant that refers to a discarded SHF_ALLOC section.
908
Roland McGrathbe139302010-04-14 12:54:45 -07009092010-04-14 Roland McGrath <roland@redhat.com>
910
911 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
912 an upper bound on sane possible number of elements.
913
Roland McGrath5ea349b2010-04-06 00:04:49 -07009142010-03-11 Roland McGrath <roland@redhat.com>
915
916 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
917 the second half for 32-bit matches.
918
Roland McGrath8068e062010-03-10 23:49:13 -08009192010-03-10 Roland McGrath <roland@redhat.com>
920
921 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
922 * argp-std.c (parse_opt): Update caller.
923 * libdwfl.h: Declare dwfl_core_file_report.
924 * libdwflP.h: Don't.
925
Roland McGrathca84a552010-02-17 01:44:42 -08009262010-02-17 Roland McGrath <roland@redhat.com>
927
928 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
929 If set, find the first index not below ADDR.
930 (dwfl_segment_report_module): Update callers.
931 Pass true when calculating return value.
932
Roland McGrathbf963472010-02-15 15:16:44 -08009332010-02-15 Roland McGrath <roland@redhat.com>
934
Roland McGrath22359e22010-02-15 15:57:03 -0800935 * Makefile.am: Use config/eu.am for common stuff.
936
Roland McGrathbf963472010-02-15 15:16:44 -0800937 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
938 variable in failure path.
939
Mark Wielaardeacdcf32010-02-02 15:45:24 +01009402010-02-02 Mark Wielaard <mjw@redhat.com>
941
942 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
943 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
944
Roland McGrathf95760a2010-01-07 20:24:34 -08009452010-01-07 Roland McGrath <roland@redhat.com>
946
947 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
948 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
949 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
950 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
951
Roland McGrath1d7cbd12010-01-06 04:22:40 -08009522010-01-06 Roland McGrath <roland@redhat.com>
953
954 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
955 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
956
Roland McGrath15426bd2009-11-16 20:38:17 -08009572009-11-16 Roland McGrath <roland@redhat.com>
958
959 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
960
Petr Machata003dd322009-11-13 00:38:27 +01009612009-11-12 Petr Machata <pmachata@redhat.com>
962
963 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
964 the chunk is both offset-contiguous and vaddr-contiguous.
965
Roland McGrathcdb48e02009-11-05 11:34:08 -08009662009-11-05 Roland McGrath <roland@redhat.com>
967
968 * link_map.c (report_r_debug): Skip entries with l_ld==0.
Roland McGrath6229eb52009-11-05 11:43:38 -0800969 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
Roland McGrathcdb48e02009-11-05 11:34:08 -0800970
Roland McGrathde6730c2009-09-04 03:05:31 -07009712009-09-04 Roland McGrath <roland@redhat.com>
972
973 * image-header.c (__libdw_image_header): Fix tranposed comparison.
974
Roland McGrath6bb90712009-08-27 12:36:47 -07009752009-08-27 Roland McGrath <roland@redhat.com>
976
977 * image-header.c: New file.
978 * Makefile.am (libdwfl_a_SOURCES): Add it.
979 * libdwflP.h: Declare __libdw_image_header.
980 * open.c (decompress): Don't consume ELF on failure.
981 (what_kind): New function, broken out of ...
982 (__libdw_open_file): ... here. Call it.
983 If it fails, try __libdw_image_header and then try what_kind again.
984
985 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
986 leave it behind for next decompressor.
987 * open.c (decompress): Free BUFFER on failure.
988
Roland McGrathd6ccdc12009-08-26 00:23:01 -07009892009-08-26 Roland McGrath <roland@redhat.com>
990
Roland McGrathe5a1a812009-08-26 03:05:50 -0700991 * gzip.c (find_zImage_payload): New function, broken out of ...
992 (mapped_zImage): ... here. Call it.
993 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
994 stupid method of just trying the decoder.
995
Roland McGrath24169642009-08-26 02:26:34 -0700996 * open.c [USE_LZMA]: Try __libdw_unlzma.
997 * libdwflP.h: Declare it.
998 (DWFL_ERRORS): Add DWFL_E_LZMA.
999 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
1000 * lzma.c: New file.
1001 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
1002
Roland McGrathd6ccdc12009-08-26 00:23:01 -07001003 * gzip.c (mapped_zImage): Limit scan to 32kb.
1004 Make this unconditional, support bzip2 kernel images too.
Roland McGrathae1d7dc2009-08-26 01:27:59 -07001005 (unzip): Use direct inflate method for non-mmap case too.
1006 Only zlib uses the stream method.
Roland McGrathd6ccdc12009-08-26 00:23:01 -07001007
Roland McGrathebfb6482009-08-09 15:40:52 -070010082009-08-09 Roland McGrath <roland@redhat.com>
1009
1010 * dwfl_module_build_id.c: Use new macros for versioned definitions.
1011
Roland McGrathfe8b42e2009-07-08 14:54:16 -070010122009-07-08 Roland McGrath <roland@redhat.com>
1013
Roland McGrath3c84db32009-06-24 17:41:40 -07001014 * dwfl_module_dwarf_cfi.c: New file.
1015 * dwfl_module_eh_cfi.c: New file.
1016 * Makefile.am (libdwfl_a_SOURCES): Add them.
1017 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
1018 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
1019
10202009-07-08 Roland McGrath <roland@redhat.com>
1021
Roland McGrathfe8b42e2009-07-08 14:54:16 -07001022 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
1023
Mark Wielaard2256e362009-06-18 13:31:56 +020010242009-06-18 Mark Wielaard <mjw@redhat.com>
1025
1026 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
1027
Ulrich Drepperf1894932009-06-13 15:55:42 -070010282009-06-13 Ulrich Drepper <drepper@redhat.com>
1029
1030 * derelocate.c: Don't use deprecated libelf functions.
1031 * dwfl_module_getdwarf.c: Likewise.
1032 * relocate.c: Likewise.
1033
Ulrich Drepper4f515712009-04-23 07:54:53 -070010342009-04-23 Ulrich Drepper <drepper@redhat.com>
1035
1036 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
1037 defined. Otherwise just define the latest version.
1038
Roland McGrathcc480472009-04-22 11:32:20 -070010392009-04-22 Roland McGrath <roland@redhat.com>
1040
Roland McGrathc65558b2009-04-22 12:29:32 -07001041 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
1042 a non-ET_REL module.
1043
Roland McGrathcc480472009-04-22 11:32:20 -07001044 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
1045 adjust properly for non-ET_REL.
1046
Roland McGrath19a8e4d2009-04-21 15:44:07 -070010472009-04-21 Roland McGrath <roland@redhat.com>
1048
1049 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
1050
1051 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
1052 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
1053 for ET_REL.
1054 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1055
Roland McGrath10361572009-04-20 11:50:50 -070010562009-04-20 Roland McGrath <roland@redhat.com>
1057
1058 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
1059
Roland McGratha605a3c2009-04-19 18:27:01 -070010602009-04-19 Roland McGrath <roland@redhat.com>
1061
1062 * dwfl_module_getdwarf.c (find_file): Renamed to ...
1063 (__libdwfl_getelf): ... this. Make it global.
1064 (find_symtab, find_dw): Update callers.
1065 (dwfl_module_getelf): Functions moved ...
1066 * dwfl_module_getelf.c: ... here, new file.
1067 * Makefile.am (libdwfl_a_SOURCES): Add it.
1068 * libdwflP.h: Declare __libdwfl_getelf.
1069
Roland McGrathfa253262009-04-14 02:38:19 -070010702009-04-14 Roland McGrath <roland@redhat.com>
1071
1072 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
1073 absolute (already adjusted in place) or needing load bias adjustment.
1074
1075 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
1076 gelf_getphdr failure. Fix file size limit checks.
1077
1078 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
1079
Roland McGrath243fa262009-04-08 17:05:43 -070010802009-04-08 Roland McGrath <roland@redhat.com>
1081
Roland McGrath785dbb12009-04-08 17:15:01 -07001082 * dwfl_module_getsym.c: Don't adjust for bias again after
1083 __libdwfl_relocate_value.
1084
Roland McGrath243fa262009-04-08 17:05:43 -07001085 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
1086 a non-SHF_ALLOC section.
1087 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
1088 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
1089
Roland McGrath8651c5e2009-03-09 20:42:56 -070010902009-03-09 Roland McGrath <roland@redhat.com>
1091
Roland McGrath329ed9f2009-03-09 20:49:53 -07001092 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
1093 variable to outer scope, so we cache it for the loop.
1094
Roland McGrath8651c5e2009-03-09 20:42:56 -07001095 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
1096
Roland McGrath31fd6542009-02-12 17:26:39 -080010972009-02-12 Roland McGrath <roland@redhat.com>
1098
1099 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
1100 __libdwfl_relocate_value to find correct sh_addr value.
1101
Roland McGrath45c01cd2009-02-10 17:03:19 -080011022009-02-10 Roland McGrath <roland@redhat.com>
1103
Roland McGrath5453abf2009-02-10 17:33:49 -08001104 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
1105 If false, don't fail for NO_PHDR.
1106 (dwfl_report_elf): Update caller.
1107 * libdwflP.h: Update decl.
1108 * offline.c (process_elf): Call it with false, so we don't refuse
1109 dubiously-formed objects here.
1110
Roland McGrath45c01cd2009-02-10 17:03:19 -08001111 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1112 finds our module. We shouldn't crash when we confuse some guesses.
1113
Ulrich Dreppera9d51bf2009-02-10 12:55:07 -080011142009-02-10 Ulrich Drepper <drepper@redhat.com>
1115
1116 * open.c (decompress): Avoid crash with empty input file.
1117
Roland McGrathe738ad22009-01-27 16:41:54 -080011182009-01-27 Roland McGrath <roland@redhat.com>
1119
1120 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1121 with zero vaddr and memsz.
1122
Roland McGrath74afbee2009-01-22 04:52:56 -080011232009-01-22 Roland McGrath <roland@redhat.com>
1124
Roland McGrathe34a3f82009-01-22 12:59:23 -08001125 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1126
Roland McGrath74afbee2009-01-22 04:52:56 -08001127 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1128 after address-matching loop.
1129
1130 * segment.c (lookup): Fix fencepost in checking for HINT match.
1131
Roland McGrath8dc9f932009-01-14 12:56:53 -080011322009-01-14 Roland McGrath <roland@redhat.com>
1133
1134 * gzip.c [!BZLIB] (mapped_zImage): New function.
1135 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1136
Ulrich Drepper7e678fa2009-01-10 18:02:05 -080011372009-01-10 Ulrich Drepper <drepper@redhat.com>
1138
1139 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1140
Roland McGratha4b1a952009-01-08 20:53:26 -080011412009-01-08 Roland McGrath <roland@redhat.com>
1142
1143 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1144 Skip subdirectory named "source".
1145 (dwfl_linux_kernel_find_elf): Likewise.
1146
Roland McGrath60205c92009-01-06 00:10:23 -080011472009-01-06 Roland McGrath <roland@redhat.com>
1148
Roland McGrath705364b2009-01-06 02:04:51 -08001149 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -08001150 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1151 (dwfl_linux_kernel_report_offline): Use it.
1152 (dwfl_linux_kernel_find_elf): Likewise.
1153
Roland McGrathbca43152009-01-05 23:59:32 -080011542009-01-05 Roland McGrath <roland@redhat.com>
1155
1156 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1157 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1158 * dwfl_build_id_find_elf.c: Likewise.
1159 * dwfl_module_getdwarf.c (open_elf): Likewise.
1160 * dwfl_report_elf.c: Likewise.
1161 * find-debuginfo.c (validate): Likewise.
1162 * offline.c (__libdwfl_report_offline): Likewise.
1163
1164 * libdwflP.h: Declare __libdw_open_file.
1165 * open.c: New file.
1166 * Makefile.am (libdwfl_a_SOURCES): Add it.
1167
1168 * gzip.c: New file.
1169 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1170 * bzip2.c: New file.
1171 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1172 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1173
Roland McGrath45d7b292008-12-16 16:21:40 -080011742008-12-16 Roland McGrath <roland@redhat.com>
1175
1176 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1177 symver magic to bind to ELFUTILS_0.138.
1178 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1179 wrapper for ELFUTILS_0.130 version set.
1180
Roland McGrath7d9b8212008-12-18 15:08:09 -080011812008-12-18 Roland McGrath <roland@redhat.com>
1182
1183 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1184 addresses are taken as relative to MOD->low_addr.
1185
Roland McGrath74825c42008-12-15 19:33:33 -080011862008-12-15 Roland McGrath <roland@redhat.com>
1187
1188 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1189 debug.bias.
1190
Roland McGrathb28a8942008-12-11 02:09:28 -080011912008-12-11 Roland McGrath <roland@redhat.com>
1192
1193 * offline.c (process_archive): Don't call elf_end and close if
1194 returning NULL. Check first elf_begin call and set error code
1195 specially for empty archive.
1196 Fixes RHBZ#465878.
1197
Roland McGratha845f682008-12-03 03:41:58 +000011982008-12-02 Roland McGrath <roland@redhat.com>
1199
1200 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1201
12022008-11-26 Roland McGrath <roland@redhat.com>
1203
1204 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1205 return value, and interpret encoded OFFSET argument.
1206
12072008-10-07 Roland McGrath <roland@redhat.com>
1208
1209 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1210
Roland McGrath9cf28e42008-09-30 06:35:35 +000012112008-09-29 Roland McGrath <roland@redhat.com>
1212
1213 * segment.c (insert): Must realloc DWFL->lookup_module here too.
1214 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1215
12162008-08-28 Roland McGrath <roland@redhat.com>
1217
1218 * segment.c (reify_segments): Fix last change.
1219
12202008-08-27 Roland McGrath <roland@redhat.com>
1221
1222 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1223 failure from pread64.
1224
Roland McGrath122f3882008-08-26 07:20:29 +000012252008-08-26 Roland McGrath <roland@redhat.com>
1226
1227 * segment.c (reify_segments): Insert a trailing segment for a module
1228 end that is above the highest current segment.
1229
12302008-08-25 Roland McGrath <roland@redhat.com>
1231
1232 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1233 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
1234 if FILE->elf is not ELF_K_ELF.
1235
1236 * dwfl_segment_report_module.c: Add a cast.
1237
Roland McGrathb4d6f0f2008-08-25 22:55:17 +000012382008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001239
Roland McGrathb4d6f0f2008-08-25 22:55:17 +00001240 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1241 which decides which symbol is "closest" to a given address.
1242
12432008-08-15 Roland McGrath <roland@redhat.com>
1244
1245 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1246 (options, parse_opt): Handle --core.
1247
1248 * core-file.c: New file.
1249 * Makefile.am (libdwfl_a_SOURCES): Add it.
1250 * libdwflP.h (dwfl_core_file_report): Declare it.
1251
1252 * link_map.c: New file.
1253 * Makefile.am (libdwfl_a_SOURCES): Add it.
1254 * libdwflP.h (dwfl_link_map_report): Declare it.
1255
1256 * libdwflP.h (MIN, MAX): New macros.
1257 (Dwfl_Memory_Callback): New typedef.
1258 (Dwfl_Module_Callback): New typedef.
1259 (dwfl_segment_report_module): Declare it.
1260 * dwfl_segment_report_module.c: New file.
1261 * Makefile.am (libdwfl_a_SOURCES): Add it.
1262
1263 * derelocate.c (dwfl_module_address_section): Add INTDEF.
1264 * libdwflP.h: Add INTDECL.
1265
1266 * segment.c: New file.
1267 * Makefile.am (libdwfl_a_SOURCES): Add it.
1268 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1269 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1270 lookup_addr, lookup_module, lookup_segndx, replace removed members
1271 modules, nmodules.
1272 (struct Dwfl_Module): New member segment.
1273 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
1274 to each free module.
1275 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1276 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
1277 (dwfl_report_module): Don't touch DWFL->nmodules.
1278 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1279 (compare_modules): Function removed.
1280 * dwfl_getmodules.c: Rewritten.
1281 Add INTDEF.
1282 * libdwflP.h: Add INTDECLs.
1283 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1284 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001285
Roland McGrath1d8bb252008-08-07 08:39:41 +000012862008-08-03 Roland McGrath <roland@redhat.com>
1287
1288 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1289
12902008-07-17 Roland McGrath <roland@redhat.com>
1291
1292 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1293 zero if the failure was only ENOENT.
1294
12952008-06-03 Roland McGrath <roland@redhat.com>
1296
1297 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1298 symbols.
1299
Roland McGrath9d2f3ee2008-05-22 20:28:05 +000013002008-05-22 Petr Machata <pmachata@redhat.com>
1301
1302 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1303
Roland McGrath0fa20e82008-05-07 18:37:14 +000013042008-05-06 Roland McGrath <roland@frob.com>
1305
1306 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1307 FTS_LOGICAL here too.
1308 (dwfl_linux_kernel_find_elf): Likewise.
1309
13102008-04-29 Roland McGrath <roland@redhat.com>
1311
1312 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1313 based on canonicalize_file_name if it differs from the supplied name.
1314
1315 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1316 we accept symlinks.
1317
Roland McGrath9897d662008-04-29 01:49:50 +000013182008-04-27 Roland McGrath <roland@redhat.com>
1319
1320 * linux-kernel-modules.c (report_kernel): Fix crash when
1321 dwfl_report_elf fails.
1322
Roland McGrathbfc01702008-04-06 01:57:32 +000013232008-04-05 Roland McGrath <roland@redhat.com>
1324
1325 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1326
1327 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1328 Clear it after freeing.
1329 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1330
Roland McGrathd11f9cb2008-03-26 20:51:59 +000013312008-03-26 Roland McGrath <roland@redhat.com>
1332
1333 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1334 SHT_DYNSYM, just set *SYMSCN like the comment says.
1335
1336 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1337
1338 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1339
13402008-03-19 Roland McGrath <roland@redhat.com>
1341
1342 * dwfl_module_getsrc.c: Adjust address for module bias before search.
1343
13442008-03-01 Roland McGrath <roland@redhat.com>
1345
1346 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1347 prototype to avoid older compiler's complaint about reuse of the name.
1348 (__libdwfl_canon_error): Likewise.
1349
Roland McGrath059c83e2008-02-21 06:19:39 +000013502008-02-19 Roland McGrath <roland@redhat.com>
1351
1352 * relocate.c (relocate_section): Check for an unhandled relocation
1353 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
1354 DWFL_E_UNKNOWN_MACHINE check out of loops.
1355
1356 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1357 DEBUGFILE->relocated is already set.
1358
13592008-01-26 Roland McGrath <roland@redhat.com>
1360
1361 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1362
1363 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1364 incoming *FILE_NAME at the start.
1365
Ulrich Dreppere219f1c2008-01-09 05:49:49 +000013662008-01-08 Roland McGrath <roland@redhat.com>
1367
1368 * Makefile.am (euinclude): Variable removed.
1369 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1370
Roland McGrathe4c22ea2007-10-23 13:07:39 +000013712007-10-23 Roland McGrath <roland@redhat.com>
1372
1373 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1374 module to appear first.
1375
13762007-10-20 Roland McGrath <roland@redhat.com>
1377
1378 * offline.c (process_archive_member): Take FD argument, pass it down
1379 to process_file. Return Elf_Cmd, not bool.
1380 Call elf_next here, always before elf_end.
1381 (process_archive): Update caller. Don't close FD here unless there
1382 are no member refs.
1383
1384 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
1385
1386 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
1387 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
1388 partial relocation to one or both files.
1389 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
1390 relocations have been applied to the debug file if dwfl_module_getelf
1391 has been used before.
1392
1393 * relocate.c (resolve_symbol): New function.
1394 (relocate_section): Call it.
1395
1396 * relocate.c (relocate_getsym): Handle null MOD->symfile.
1397 (relocate_section): Take new bool arg, PARTIAL. If true,
1398 no error for BADRELTYPE/RELUNDEF, instead just skip them
1399 and leave only those skipped relocs behind the reloc section.
1400 (__libdwfl_relocate_section): Take new arg, pass it down.
1401 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
1402 do partial relocation on all sections.
1403 * dwfl_module_getdwarf.c (load_dw): Update caller.
1404 * libdwflP.h: Update decls.
1405 * derelocate.c (dwfl_module_address_section): Pass new argument
1406 to __libdwfl_relocate_section, true.
1407
1408 * derelocate.c (cache_sections): Don't cache reloc sections when
1409 section_address callback is null.
1410
14112007-10-19 Roland McGrath <roland@redhat.com>
1412
1413 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
1414
1415 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
1416 (struct secref): Likewise.
1417 (cache_sections): Cache the relocation section referring to each
1418 section we cache, if any.
1419 (dwfl_module_address_section): Use __libdwfl_relocate_section as
1420 necessary.
1421
1422 * relocate.c (struct reloc_symtab_cache): New type.
1423 (relocate_getsym): Use it instead of four arguments.
1424 (__libdwfl_relocate): Update caller.
1425 (relocate_section): New function, broken out of ...
1426 (__libdwfl_relocate): ... here.
1427 (__libdwfl_relocate_section): New function.
1428 * libdwflP.h: Declare it.
1429
14302007-10-17 Roland McGrath <roland@redhat.com>
1431
1432 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
1433 to relocated st_value.
1434
1435 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
1436 ET_REL to 0x100.
1437
14382007-10-16 Roland McGrath <roland@redhat.com>
1439
1440 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
1441 section has larger alignment requirements not met by the original BASE,
1442 rather than padding more between sections.
1443
1444 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
1445
1446 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
1447 to sh_addr value.
1448
1449 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
1450 at zero in ET_REL case. Adjust BASE to necessary alignment.
1451
1452 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
1453 for DATA_VADDR.
1454 (__libdwfl_find_build_id): Update caller.
1455
1456 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
1457 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1458 * offline.c (dwfl_offline_section_address): Bail early if there is
1459 separate debug file.
1460
1461 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
1462
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000014632007-10-09 Roland McGrath <roland@redhat.com>
1464
1465 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
1466 caching SHDR->sh_addr = 0.
1467 * offline.c (dwfl_offline_section_address): Never called for sh_addr
1468 really at 0, don't check for it. Use MOD->debug directly, not symfile.
1469
1470 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
1471 we've found SHT_SYMTAB.
1472
1473 * relocate.c (relocate_getsym): New function.
1474 (__libdwfl_relocate): Use it.
1475 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
1476 be a pointer instead of value; cache getshstrndx result there.
1477 * libdwflP.h: Update decl.
1478 * derelocate.c (cache_sections): Update caller.
1479 Always work on the main file, not the symfile.
1480 (dwfl_module_address_section): Likewise.
1481 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
1482
14832007-10-07 Roland McGrath <roland@redhat.com>
1484
1485 * offline.c (process_archive): Initialize MOD.
1486
1487 * linux-kernel-modules.c (get_release): New function, broken out of ...
1488 (report_kernel): ... here. Call it.
1489 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
1490 (find_kernel_elf): Update caller.
1491 (report_kernel_archive): New function.
1492 (dwfl_linux_kernel_report_offline): Call it.
1493
1494 * offline.c (process_file): Take new arg PREDICATE, pass it down.
1495 (process_archive): Likewise.
1496 (process_archive_member): Likewise. When nonnull, let the predicate
1497 decide whether to use this member.
1498 (__libdwfl_report_offline): New function, broken out of ...
1499 (dwfl_report_offline): ... here. Call it.
1500 * libdwflP.h: Declare it.
1501
1502 * offline.c (process_archive, process_archive_member): New functions.
1503 (process_elf, process_file): New functions, broken out of ...
1504 (dwfl_report_offline): ... here. Call process_file, which recurses on
1505 ELF_K_AR files.
1506
1507 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
1508 (dwfl_report_elf): ... here. Call it.
1509 * libdwflP.h: Declare it.
1510
15112007-10-06 Roland McGrath <roland@redhat.com>
1512
1513 * derelocate.c (dwfl_module_relocations): Don't call
1514 dwfl_module_getdwarf.
1515
1516 * derelocate.c (find_section): Use __libdwfl_seterrno, not
1517 __libdw_seterrno.
1518
1519 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
1520 SHF_ALLOC, to cache sh_addr resolved to 0.
1521
1522 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
1523 values nonzero already, just use its existing layout.
1524
1525 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
1526 in-core shdr after applying it.
1527
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +000015282007-10-04 Ulrich Drepper <drepper@redhat.com>
1529
1530 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
1531 initialization of notes variable.
1532
Roland McGrath59ea7f32007-10-04 08:50:09 +000015332007-10-04 Roland McGrath <roland@redhat.com>
1534
1535 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
1536 fill in with vaddr of "__start_notes" symbol if found.
1537 (check_notes): New function.
1538 (check_kernel_notes): New function.
1539 (dwfl_linux_kernel_report_kernel): Call it.
1540 (check_module_notes): New function.
1541 (dwfl_linux_kernel_report_modules): Call it.
1542
1543 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
1544 Try dwfl_build_id_find_elf first.
1545
1546 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
1547 Set kernel module e_type to ET_DYN.
1548
15492007-10-03 Roland McGrath <roland@redhat.com>
1550
1551 * find-debuginfo.c (validate): New function, broken out of ...
1552 (find_debuginfo_in_path): ... here. New function, broken out of ...
1553 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
1554 dwfl_build_id_find_debuginfo first.
1555
1556 * dwfl_build_id_find_elf.c: New file.
1557 * dwfl_build_id_find_debuginfo.c: New file.
1558 * Makefile.am (libdwfl_a_SOURCES): Add them.
1559 * libdwfl.h: Declare them.
1560 * libdwflP.h: Add INTDECLs.
1561
1562 * dwfl_module_build_id.c: New file.
1563 * dwfl_module_report_build_id.c: New file.
1564 * Makefile.am (libdwfl_a_SOURCES): Add them.
1565 * libdwfl.h: Declare them.
1566 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
1567 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
1568 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
1569
1570 * dwfl_module_getdwarf.c (find_offsets): New function.
1571 (find_dynsym): New function, calls that.
1572 (find_symtab): Call it.
1573
Roland McGrathc76f0b02007-09-27 07:31:33 +000015742007-09-11 Roland McGrath <roland@redhat.com>
1575
1576 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
1577 address if its st_size is smaller.
1578
Roland McGrath099dd522007-08-13 22:58:36 +000015792007-08-13 Roland McGrath <roland@redhat.com>
1580
1581 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
1582
15832007-08-12 Roland McGrath <roland@redhat.com>
1584
1585 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
1586 FTS_LOGICAL.
1587
1588 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
1589 a second phdr if it happens to match EHDR_VMA exactly.
1590
Roland McGrath42f68682007-08-09 07:54:22 +000015912007-08-08 Roland McGrath <roland@redhat.com>
1592
1593 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
1594 those with no names. Rewrite best symbol algorithm not to assume a
1595 sorted table and to be smarter handling sizeless symbols.
1596
Roland McGrath87d47802007-07-16 22:23:37 +000015972007-07-16 Roland McGrath <roland@redhat.com>
1598
1599 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
1600 reviving an existing module.
1601
16022007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +00001603
1604 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
1605
Roland McGrath9aa8ef72007-05-18 08:59:43 +000016062007-05-17 Roland McGrath <roland@redhat.com>
1607
1608 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
1609 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
1610 (dwfl_linux_kernel_find_elf): Likewise.
1611
1612 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1613 getline and sscanf instead of fscanf.
1614
16152007-05-08 Roland McGrath <roland@redhat.com>
1616
1617 * offline.c (dwfl_offline_section_address): Don't assume section
1618 numbers match between stripped and debuginfo files. Instead, assume
1619 only that the ordering among SHF_ALLOC sections matches.
1620
1621 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
1622 pointer to string.
1623 (dwfl_linux_kernel_report_offline): Update caller.
1624 (dwfl_linux_kernel_report_kernel): Likewise.
1625
Roland McGrath4be15242007-04-25 03:09:33 +000016262007-04-23 Roland McGrath <roland@redhat.com>
1627
1628 * argp-std.c (options): Fix group title string.
1629
1630 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
1631 Update via STATE->input every time we set STATE->hook, not only at
1632 ARGP_KEY_SUCCESS.
1633
1634 * dwfl_module.c (free_file): Free FILE->name.
1635
Roland McGrath43da9892007-04-16 23:13:37 +000016362007-04-16 Roland McGrath <roland@redhat.com>
1637
1638 * derelocate.c (cache_sections): Apply bias to sh_addr.
1639 (compare_secrefs): Fix address comparison to avoid signed overflow.
1640 (find_section): New function, broken out of ...
1641 (dwfl_module_relocate_address): ... here, call it.
1642 (check_module): New function, broken out of ...
1643 (dwfl_module_relocate_address): ... here, call it.
1644 (dwfl_module_address_section): New function.
1645 * libdwfl.h: Declare it.
1646
Ulrich Drepperc07fbb32007-03-30 19:14:59 +000016472007-03-26 Roland McGrath <roland@redhat.com>
1648
1649 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
1650
16512007-03-18 Roland McGrath <roland@redhat.com>
1652
1653 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
1654 (find_debuginfo): ... here. Call it.
1655 Don't return error for libelf errors finding .gnu_debuglink section.
1656
Ulrich Drepper6258e742007-03-13 06:22:40 +000016572007-03-12 Roland McGrath <roland@redhat.com>
1658
1659 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
1660 (dwfl_report_begin): ... here. Call it.
1661 * libdwfl.h: Declare it.
1662 * libdwflP.h: Add INTDECL.
1663
1664 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1665
1666 * offline.c: Comment typo fix.
1667
16682007-03-04 Roland McGrath <roland@redhat.com>
1669
1670 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
1671 (find_kernel_elf): New function, broken out of ...
1672 (report_kernel): ... here. Call it.
1673 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
1674 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
1675 virtual address bounds of kernel from symbols rounded to page size.
1676 (dwfl_linux_kernel_report_kernel): Use that if it works, before
1677 resorting to report_kernel.
1678
1679 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
1680 ET_EXEC file with nonzero bias.
1681
1682 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
1683 dwfl_module_addrsym. Guts moved to ...
1684 * dwfl_module_addrsym.c: ... here; new file.
1685 * Makefile.am (libdwfl_a_SOURCES): Add it.
1686 * libdwfl.h: Declare dwfl_module_addrsym.
1687 * libdwflP.h: Add INTDECL.
1688
16892007-03-03 Roland McGrath <roland@redhat.com>
1690
1691 * dwfl_module.c (free_file): New function, broken out of ...
1692 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
1693
1694 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
1695 on libelf failure.
1696
16972007-03-02 Roland McGrath <roland@redhat.com>
1698
1699 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
1700
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000017012007-02-02 Roland McGrath <roland@redhat.com>
1702
1703 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
1704 address exactly if it's no other module's low boundary.
1705
1706 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
1707 and size cover the address, select the closest symbol with st_size==0
1708 that lies in the same section.
1709
17102007-01-29 Roland McGrath <roland@redhat.com>
1711
1712 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
1713 not PACKAGE_STRING.
1714
17152007-01-20 Roland McGrath <roland@redhat.com>
1716
1717 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
1718 as omitted, not 0.
1719 * libdwfl.h (Dwfl_Callbacks): Update comment.
1720 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
1721 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1722 For ignored missing section, use -1 instead of 0.
1723 * offline.c (dwfl_offline_section_address): Expect a call for 0.
1724
17252007-01-19 Roland McGrath <roland@redhat.com>
1726
1727 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
1728 zero so a lone -e foo.so is shown without address bias.
1729
Roland McGrathba949b32007-01-10 20:44:29 +000017302007-01-10 Roland McGrath <roland@redhat.com>
1731
Roland McGrath44865b92007-01-11 05:06:16 +00001732 * linux-kernel-modules.c (report_kernel): Check asprintf return value
1733 directly instead of via side effect, to silence warn_unused_result.
1734 (dwfl_linux_kernel_report_offline): Likewise.
1735 (dwfl_linux_kernel_find_elf): Likewise.
1736 (dwfl_linux_kernel_module_section_address): Likewise.
1737 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +00001738 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
1739 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +00001740
Roland McGrathba949b32007-01-10 20:44:29 +00001741 * libdwfl.h (dwfl_begin): Require nonnull argument.
1742
Roland McGrath70008802006-12-29 20:44:16 +000017432006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001744
Roland McGrath70008802006-12-29 20:44:16 +00001745 * dwfl_module.c (compare_modules): Fix address comparison to avoid
1746 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001747
Roland McGrath8190db62006-12-17 23:56:51 +000017482006-10-30 Roland McGrath <roland@redhat.com>
1749
1750 * dwfl_module.c (dwfl_report_module): Comment typo fix.
1751
Roland McGrathc373d852006-10-10 00:25:21 +000017522006-09-05 Roland McGrath <roland@redhat.com>
1753
1754 * derelocate.c (cache_sections): Use alloca instead of variable-sized
Roland McGrath3c84db32009-06-24 17:41:40 -07001755 auto array, in function already using alloca.
Roland McGrathc373d852006-10-10 00:25:21 +00001756
Roland McGratha1cee072006-08-15 01:37:23 +000017572006-08-14 Roland McGrath <roland@redhat.com>
1758
1759 * linux-kernel-modules.c (try_kernel_name): If the call to
1760 dwfl_standard_find_debuginfo produces no results, try it again
1761 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
1762
1763 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
1764 * libdwflP.h: ... to here.
1765 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
1766 repeats the first thing dwfl_standard_find_debuginfo will try.
1767
1768 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
1769 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
1770 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
1771 section name.
1772
Ulrich Drepper077c65f2006-07-12 19:54:51 +000017732006-07-12 Ulrich Drepper <drepper@redhat.com>
1774
1775 * cu.c: Adjust for internal_function_def removal.
1776 * dwfl_error.c: Likewise.
1777 * dwfl_module.c: Likewise.
1778 * dwfl_module_getdwarf.c: Likewise.
1779 * lines.c: Likewise.
1780 * relocate.c: Likewise.
1781
Ulrich Drepperc87b6e72006-07-11 22:32:28 +000017822006-07-11 Ulrich Drepper <drepper@redhat.com>
1783
1784 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
1785 it can overflow the return value type.
1786 Patch by Tim Moore <timoore@redhat.com>.
1787
Ulrich Dreppere1812e12006-07-12 07:46:03 +000017882006-06-28 Roland McGrath <roland@redhat.com>
1789
1790 * libdwfl.h: Cosmetic changes.
1791
1792 * dwfl_line_comp_dir.c: New file.
1793 * Makefile.am (libdwfl_a_SOURCES): Add it.
1794 * libdwfl.h: Declare dwfl_line_comp_dir.
1795
1796 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
1797
1798 * dwfl_linecu.c: New file.
1799 * Makefile.am (libdwfl_a_SOURCES): Add it.
1800 * libdwfl.h: Declare dwfl_linecu.
1801
1802 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
1803 (dwfl_linecu): Define as macro.
1804
1805 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
1806
1807 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
1808 (dwfl_module_addrname): Function moved ...
1809 * dwfl_module_addrname.c: ... here, new file.
1810 * dwfl_module_getsym.c: New file.
1811 * Makefile.am (libdwfl_a_SOURCES): Add them.
1812 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
1813 * libdwflP.h: Add INTDECLs.
1814
18152006-06-27 Roland McGrath <roland@redhat.com>
1816
1817 * dwfl_module.c (dwfl_report_end): Whitespace fix.
1818
Ulrich Drepperd5a75192006-06-15 03:07:46 +000018192006-06-13 Roland McGrath <roland@redhat.com>
1820
1821 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1822 Use __libdwfl_seterrno for elf_memory failure.
1823
Ulrich Dreppere1812e12006-07-12 07:46:03 +000018242006-05-22 Roland McGrath <roland@redhat.com>
1825
1826 * dwfl_module_return_value_location.c
1827 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
1828
Ulrich Drepper41cbd762006-05-27 18:19:23 +000018292006-05-27 Ulrich Drepper <drepper@redhat.com>
1830
1831 * libdwfl.h: Add extern "C".
1832
Ulrich Dreppere7a73172006-05-22 18:16:45 +000018332006-05-22 Ulrich Drepper <drepper@redhat.com>
1834
1835 * cu.c (addrarange): Handle files without aranges information.
1836
Ulrich Dreppera1690682006-05-17 05:28:36 +000018372006-05-16 Ulrich Drepper <drepper@redhat.com>
1838
1839 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
1840 ->modules is NULL.
1841
Roland McGrath687d7e92006-02-27 04:53:00 +000018422006-02-26 Roland McGrath <roland@redhat.com>
1843
Roland McGrath08333122006-02-27 04:54:26 +00001844 * dwfl_version.c: New file.
1845 * Makefile.am (libdwfl_a_SOURCES): Add it.
1846 * libdwfl.h: Declare dwfl_version.
1847
Roland McGrath687d7e92006-02-27 04:53:00 +00001848 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
1849 aligned up from DWFL->offline_next_address when checking for overlap.
1850
Roland McGrathfceb7b42005-12-23 01:45:21 +000018512005-12-22 Roland McGrath <roland@redhat.com>
1852
Roland McGrath1656bc02005-12-23 01:49:50 +00001853 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
1854
1855 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
1856 (dwfl_linux_proc_report): ... here. Call it.
1857 (dwfl_linux_proc_maps_report): New function.
1858 * libdwfl.h: Declare it.
1859 * libdwflP.h: Add INTDECL.
1860 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
1861
Roland McGrathfceb7b42005-12-23 01:45:21 +00001862 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
1863 failed with DWFL_E_NO_DWARF.
1864
Roland McGrath994b4892005-12-05 22:46:21 +000018652005-11-26 Roland McGrath <roland@redhat.com>
1866
1867 * dwfl_end.c (dwfl_end): Free the DWFL itself.
1868
18692005-11-25 Roland McGrath <roland@redhat.com>
1870
1871 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
1872 (load_dw): Use it.
1873 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
1874 * libdwflP.h: Declare it.
1875
1876 * dwfl_module_register_names.c: New file.
1877 * Makefile.am (libdwfl_a_SOURCES): Add it.
1878 * libdwfl.h: Declare dwfl_module_register_names.
1879
Roland McGratha5640892005-11-26 00:38:14 +000018802005-11-21 Roland McGrath <roland@redhat.com>
1881
1882 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1883 Don't leak malloc'd file name.
1884 If a /sys/.../sections file is missing and starts with ".init",
1885 try the variant with "_init" too; catches PPC64 kernel braindamage.
1886
Roland McGrathe47ab762005-11-17 03:16:00 +000018872005-11-15 Roland McGrath <roland@redhat.com>
1888
1889 * libdwfl.h: Comment fixes.
1890
1891 * dwfl_module_return_value_location.c: Add unlikely for error case.
1892
18932005-11-13 Roland McGrath <roland@redhat.com>
1894
1895 * dwfl_return_value_location.c: New file.
1896 * Makefile.am (libdwfl_a_SOURCES): Add it.
1897 * libdwfl.h: Declare dwfl_module_return_value_location.
1898 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
1899
Roland McGrath07d4f2f2005-10-28 06:56:24 +000019002005-10-20 Roland McGrath <roland@redhat.com>
1901
1902 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
1903 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
1904 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
1905
19062005-10-01 Roland McGrath <roland@redhat.com>
1907
1908 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
1909 with errno 0.
1910
19112005-09-19 Roland McGrath <roland@redhat.com>
1912
1913 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1914 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
1915 the signed integer reading; they will just have to be in hexadecimal.
1916 (dwfl_linux_kernel_module_section_address): Likewise.
1917
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000019182005-08-28 Ulrich Drepper <drepper@redhat.com>
1919
1920 * Makefile.am (%.os): Use COMPILE.os.
1921 (COMPILE.os): Filter out gconv options.
1922
Roland McGrath995f92d2005-08-26 05:55:04 +000019232005-08-25 Roland McGrath <roland@redhat.com>
1924
1925 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
1926 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
1927
Roland McGrath80e43a72005-08-24 21:12:15 +000019282005-08-24 Roland McGrath <roland@redhat.com>
1929
Roland McGrathefb5caa2005-08-25 01:49:53 +00001930 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
1931
Roland McGrath80e43a72005-08-24 21:12:15 +00001932 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
1933 magic initializer to set -heur-stack-bound option.
1934
Roland McGrath3712b282005-08-23 05:58:42 +000019352005-08-22 Roland McGrath <roland@redhat.com>
1936
Roland McGrathd17fac72005-08-23 08:20:21 +00001937 * dwfl_validate_address.c: New file.
1938 * Makefile.am (libdwfl_a_SOURCES): Add it.
1939 * libdwfl.h: Declare dwfl_validate_address.
1940
1941 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
1942 * libdwflP.h: Add INTDECL.
1943
Roland McGrath3712b282005-08-23 05:58:42 +00001944 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
1945 elf_rawdata for symbol-related sections.
1946
Roland McGrathd17fac72005-08-23 08:20:21 +00001947 * offline.c (dwfl_report_offline): Move offline_next_address outside
1948 module's range, in case it's an ET_EXEC using fixed segment locations.
1949 * libdwfl.h: Update comment.
1950
1951 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
1952 required alignment.
1953
19542005-08-20 Roland McGrath <roland@redhat.com>
1955
1956 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
1957 function to choose whether to report.
1958 (dwfl_linux_kernel_report_offline): Likewise.
1959 * libdwfl.h: Update decl.
1960 * argp-std.c (parse_opt): Update caller.
1961
1962 * dwfl_getsrclines.c: New file.
1963 * dwfl_onesrcline.c: New file.
1964 * Makefile.am (libdwfl_a_SOURCES): Add them.
1965 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
1966
1967 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
1968 MODULESDIR[0]. Call fts_close on failure.
1969
1970 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
1971 Close ET_REL file descriptors after relocation.
1972 (find_dw): Update caller.
1973 * offline.c (dwfl_report_offline): Get the file into memory and close
1974 the file descriptor.
1975
1976 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1977 MOD->debug.elf is already set.
1978
1979 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1980 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1981
1982 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1983 dwfl_linux_kernel_report_offline with offline_callbacks.
1984
1985 * linux-kernel-modules.c (report_kernel): New function, broken out of
1986 ...
1987 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1988 (dwfl_linux_kernel_report_offline): New function.
1989 * libdwfl.h: Declare it.
1990 * libdwflP.h: Add INTDECL.
1991
19922005-08-19 Roland McGrath <roland@redhat.com>
1993
1994 Use standard debuginfo search path to look for vmlinux.
1995 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1996 passed zero.
1997 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1998 of ...
1999 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2000
2001 * argp-std.c (offline_callbacks): New variable.
2002 (parse_opt): Use it for -e. Allow multiple -e options.
2003
2004 * offline.c: New file.
2005 * Makefile.am (libdwfl_a_SOURCES): Add it.
2006 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
2007 * libdwflP.h: Add INTDECLs.
2008 (OFFLINE_REDZONE): New macro.
2009 (struct Dwfl): New member `offline_next_address'.
2010 * dwfl_begin.c (dwfl_begin): Initialize it.
2011 * dwfl_module.c (dwfl_report_begin): Likewise.
2012
2013 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
2014 do a nominal absolute section layout starting at BASE.
2015 * libdwfl.h: Update comment.
2016
20172005-08-18 Roland McGrath <roland@redhat.com>
2018
2019 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
2020 dwfl_module_getdwarf if necessary.
2021
2022 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
2023 * libdwfl.h: Update comment.
2024
2025 * derelocate.c: New file.
2026 * Makefile.am (libdwfl_a_SOURCES): Add it.
2027
2028 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
2029 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
2030 * dwfl_module_getdwarf.c (open_elf): Update initialization.
2031 (load_dw, dwfl_module_addrname): Update uses.
2032 * relocate.c (__libdwfl_relocate): Likewise.
2033
20342005-08-04 Roland McGrath <roland@redhat.com>
2035
2036 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
2037 arguments SHNDX, SHDR.
2038 (dwfl_linux_kernel_module_section_address): Update prototype.
2039 * relocate.c (__libdwfl_relocate_value): Update caller.
2040 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2041 Take the new arguments.
2042
Roland McGrathd2c59962005-08-10 22:13:57 +000020432005-08-10 Roland McGrath <roland@redhat.com>
2044
2045 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
2046 use it instead of MOD->debug.file.
2047 * libdwflP.h: Update decl.
2048 * dwfl_module_getdwarf.c (load_dw): Update caller.
2049 Fixes bug #165598.
2050
Roland McGrath4959bf82005-08-09 10:31:08 +000020512005-08-09 Roland McGrath <roland@redhat.com>
2052
2053 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
2054 * cu.c: Use INTUSE on dwarf_* calls.
2055 * dwfl_error.c: Likewise.
2056 * dwfl_module.c: Likewise.
2057 * dwfl_module_getdwarf.c: Likewise.
2058 * dwfl_module_getsrc_file.c: Likewise.
2059 * lines.c: Likewise.
2060
Roland McGrath5678f872005-08-07 21:42:56 +000020612005-08-07 Roland McGrath <roland@redhat.com>
2062
2063 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
2064 names contain '_' or '-', look for files named either "foo-bar.ko"
2065 or "foo_bar.ko".
2066
Roland McGrath83fcb482005-08-02 00:58:33 +000020672005-07-29 Roland McGrath <roland@redhat.com>
2068
2069 * loc2c.c: File removed.
2070 * loc2c.h: File removed.
2071 * loc2c-runtime.h: File removed.
2072 * test2.c: File removed.
2073 * Makefile.am (EXTRA_DIST): Variable removed.
2074 (noinst_HEADERS): Remove loc2c.h from here.
2075
Ulrich Drepper18618fd2005-07-28 21:29:22 +000020762005-07-28 Ulrich Drepper <drepper@redhat.com>
2077
Ulrich Drepper4d527362005-07-28 22:32:58 +00002078 * libdwfl.h: Add a few missing extern for function prototypes.
2079
Ulrich Drepper18618fd2005-07-28 21:29:22 +00002080 * libdwfl_crc32.c: New file.
2081 * libdwfl_crc32_file.c: New file.
2082 * libdwflP.h: Declare the new functions.
2083 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
2084 libdwfl_crc32_file.c.
2085 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
2086 instead of crc32_file.
2087
Roland McGrathd89bbe42005-07-28 07:08:01 +000020882005-07-28 Roland McGrath <roland@redhat.com>
2089
Roland McGrath244501f2005-07-28 09:15:47 +00002090 * ptest.c: Moved to ../tests/dwflmodtest.c.
2091
Roland McGrath18385902005-07-28 07:12:38 +00002092 * Makefile.am (noinst_PROGRAMS): Variable removed.
2093 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
2094 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
2095 (libdwfl): Don't use libdwfl.so any more.
2096 (libdwfl.so, install, uninstall): Targets removed.
2097 (test2_SOURCES): Define EXTRA_DIST instead of this.
2098 * libdwfl.map: File removed.
2099
Roland McGrathd89bbe42005-07-28 07:08:01 +00002100 * libdwfl.h: Use "" for libdw.h #include.
2101
Roland McGrath5bab2442005-07-28 00:44:29 +000021022005-07-27 Roland McGrath <roland@redhat.com>
2103
2104 * libdwfl.map: Add dwfl_getmodules.
2105
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000021062005-07-23 Ulrich Drepper <drepper@redhat.com>
2107
2108 * Makefile.am: Fix rules to allow building with mudflap.
2109
21102005-07-21 Roland McGrath <roland@redhat.com>
2111
2112 * Makefile.am (noinst_HEADERS): Add loc2c.c.
2113
2114 * test2.c (main): Check sscanf result to quiet warning.
2115
21162005-07-20 Roland McGrath <roland@redhat.com>
2117
2118 * libdwfl-branch merged, creating this direcotry.