blob: 3f9c52554ff6bcbbc35052e46fc7f408face7da0 [file] [log] [blame]
Mark Wielaard05a44122013-12-24 10:37:58 +010012013-12-24 Mark Wielaard <mjw@redhat.com>
2
3 * linux-core-attach.c (core_next_thread): Check whether thread_argp
4 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
5 in that case. Free thread_arg if there are no more threads.
6
Mark Wielaard97bbf9b2013-12-23 14:20:06 +010072013-12-23 Mark Wielaard <mjw@redhat.com>
8
Mark Wielaardb20ca0b2013-12-23 23:21:59 +01009 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
10 build_id before returning early.
11
122013-12-23 Mark Wielaard <mjw@redhat.com>
13
Mark Wielaard97bbf9b2013-12-23 14:20:06 +010014 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
15 pid (thread group leader) to dwfl_attach_state.
16
Mark Wielaard3e98ab72013-12-21 21:56:35 +0100172013-12-21 Mark Wielaard <mjw@redhat.com>
18
19 * frame_unwind.c (handle_cfi): Track whether the return register
20 has been set and only allow it to be set once.
21
Mark Wielaard641a4f62013-12-21 00:04:21 +0100222013-12-20 Mark Wielaard <mjw@redhat.com>
23
Mark Wielaarde962ec32013-12-20 10:09:12 +010024 * dwfl_frame.c (one_arg): New struct.
25 (get_one_thread_cb): New function.
26 (dwfl_getthread): Likewise.
27 (one_thread): New struct.
28 (get_one_thread_frames_cb): New function.
29 (dwfl_getthread_frames): Likewise.
30 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
31 (dwfl_getthread_frames): Likewise.
32 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
33 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
34 to NULL.
35 * linux-pid-attach.c (pid_getthread): New function.
36 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
37
382013-12-20 Mark Wielaard <mjw@redhat.com>
39
Mark Wielaard641a4f62013-12-21 00:04:21 +010040 * linux-kernel-modules.c (report_kernel_archive): Correct nested
41 asprintf result check for debug.a.
42
Mark Wielaard159ac522013-12-18 11:05:54 +0100432013-12-18 Mark Wielaard <mjw@redhat.com>
44
45 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
46 * dwfl_module_addrname.c (dwfl_module_addrname): Use
47 dwfl_module_addrinfo.
48 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
49 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
50 for comparisons, not st_value. Fill in off. Search for both value
51 and the (adjusted) sym.st_value when different.
52 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
53 (dwfl_module_addrinfo): New function.
54 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
55 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
56 and possible. Adjust sym->st_value only when requested. Fill in addr
57 if available.
58 (dwfl_module_getsym_info): New function.
59 (dwfl_module_getsym): Use __libdwfl_getsym.
60 * libdwfl.h (dwfl_module_getsym_elf): Removed.
61 (dwfl_module_getsym_info): New function declaration.
62 (dwfl_module_addrinfo): Likewise.
63 (dwfl_module_addrsym): Add documentation describing differences
64 with addrinfo variants.
65 (dwfl_module_addrsym_elf): Removed.
66 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
67 (__libdwfl_addrsym): Likewise.
68 (__libdwfl_find_section_ndx): Likewise.
69 (dwfl_module_addrinfo): New internal declaration.
70 (dwfl_module_getsym_info): Likewise.
71 (dwfl_module_addrsym_elf): Removed.
72 (dwfl_module_getsym_elf): Likewise.
73
Jan Kratochvilc6a41482013-12-17 18:49:54 +0100742013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
75
Jan Kratochvilc5309462013-12-18 15:02:19 +010076 * argp-std.c (offline_find_elf): Remove.
77 (offline_callbacks): Use dwfl_build_id_find_elf instead.
78 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
79 removed above.
80
812013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
82
Jan Kratochvilc6a41482013-12-17 18:49:54 +010083 unwinder: s390 and s390x
84 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
85 * frame_unwind.c (new_unwound): New function from ...
86 (handle_cfi): ... here. Call it.
87 (setfunc, getfunc, readfunc): New functions.
88 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
89 * linux-core-attach.c (core_set_initial_registers): Always iterate
90 through the Ebl_Register_Location loop. Call
91 dwfl_thread_state_register_pc there.
92
Jan Kratochvil6cd283c2013-12-17 18:17:32 +0100932013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
94
95 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
96
Mark Wielaardc76b2ff2013-12-17 10:37:29 +0100972013-12-17 Mark Wielaard <mjw@redhat.com>
98
99 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
100 traversal.
101
Mark Wielaard14c2d9e2013-12-16 13:28:59 +01001022013-12-16 Mark Wielaard <mjw@redhat.com>
103
104 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
105 definition.
106 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
107 function.
108 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
109 function definition.
110 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
111
Mark Wielaarde6e6cc82013-12-14 15:02:56 +01001122013-12-14 Mark Wielaard <mjw@redhat.com>
113
114 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
115 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
116 * frame_unwind.c (handle_cfi): Free frame result from
117 dwarf_cfi_addrframe when done.
118
Jan Kratochvil5cbf42a2013-12-15 18:56:17 +01001192013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
120
121 unwinder: ppc and ppc64
122 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
123 Call ebl_dwarf_to_regno.
124 * linux-core-attach.c (core_set_initial_registers): Implement
125 pc_register support.
126 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
127 FIRSTREG -1.
128
Jan Kratochvil5ef96c92013-11-30 21:40:29 +01001292013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
130
131 Introduce process_attach_error.
132 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
133 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
134 PROCESS is NULL.
135 * libdwflP.h (struct Dwfl): New field process_attach_error.
136 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
137 (attach_state_for_core): ... here, make it static, change return type,
138 no longer use __libdwfl_seterrno.
139 (__libdwfl_attach_state_for_core): New wrapper for it.
140
Mark Wielaard819c3492013-11-27 16:45:44 +01001412013-11-27 Mark Wielaard <mjw@redhat.com>
142
143 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
144 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
145 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
146 instead of tracking dwfl_files.
147 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
148 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
149 new elfp and biasp arguments. Track elf instead of file.
150 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
151 dwfl_module_info.c (dwfl_module_info): Pass elf to
152 dwfl_adjusted_st_value.
153 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
154 (dwfl_module_getsym_elf): New function declaration.
155 (dwfl_module_addrsym_elf): Likewise.
156 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
157 (dwfl_module_getsym_elf): Likewise.
158 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
159 (dwfl_deadjust_st_value): Likewise.
160 (__libdwfl_module_getsym): Removed.
161 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
162
Jan Kratochvil463e9832013-11-21 15:28:02 +01001632013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
164
Jan Kratochvil99a29492013-11-21 15:33:22 +0100165 Fix non-build-id core files on build-id system.
166 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
167 be read from memory.
168
1692013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
170
Jan Kratochvilb301c2e2013-11-21 15:31:04 +0100171 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
172 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
173 content, if possible.
174
1752013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
176
Jan Kratochvil463e9832013-11-21 15:28:02 +0100177 link_map: Use proper bias, not l_addr.
178 * core-file.c (dynamic_vaddr_get): Rename to ...
179 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
180 internal_function.
181 (dwfl_core_file_report): Update name in the caller.
182 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
183 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
184 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
185 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
186
Jan Kratochvil10d7a392013-11-19 15:00:15 +01001872013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
188
189 Compatibility with older kernels such as RHEL-6.
190 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
191 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
192 (pid_set_initial_registers): Pass tid_was_stopped.
193 (pid_thread_detach): Use tid_was_stopped.
194
Josh Stonedb35c872013-11-18 14:29:35 -08001952013-11-18 Josh Stone <jistone@redhat.com>
196
197 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
198 (find_aux_sym): Use it.
199
Jan Kratochviled782372013-11-14 20:53:20 +01002002013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
201
Jan Kratochvil1c1a53b2013-11-14 20:55:41 +0100202 Code cleanup: Remove const in prototype
203 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
204 firstreg.
205 * libdwfl.h (dwfl_thread_state_registers): Likewise.
206 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
207
2082013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
209
Jan Kratochviled782372013-11-14 20:53:20 +0100210 Fix dwfl_attach_state machine->elf.
211 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
212 Call ebl_openbackend instead of ebl_openbackend_machine.
213 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
214 Update the function description.
215 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
216 dwfl_attach_state.
217 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
218 dwfl_attach_state.
219
Jan Kratochvil954a7b02013-11-13 20:00:56 +01002202013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
221
222 Provide __libdwfl_module_getsym to get dwfl_file *.
223 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
224 (dwfl_module_addrsym) (search_table): New variable file. Use
225 __libdwfl_module_getsym. Use file.
226 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
227 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
228 (dwfl_module_getsym): New wrapper.
229 * libdwflP.h (__libdwfl_module_getsym): New declaration.
230
Jan Kratochvil5dca2b62013-11-13 19:58:06 +01002312013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
232
233 Fix dwfl_module_addrsym for minidebuginfo.
234 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
235 addr_symfile.
236 (dwfl_module_addrsym) (same_section): Use it.
237 (dwfl_module_addrsym) (i_to_symfile): New function.
238 (dwfl_module_addrsym) (search_table): Use it.
239
Jan Kratochvil21783b52013-11-07 16:34:58 +01002402013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil0b867462013-05-30 14:37:38 +0200241 Mark Wielaard <mjw@redhat.com>
242
243 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
244 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
245 dwfl_frame_regs.c.
246 * core-file.c (dwfl_core_file_report): Call
247 __libdwfl_attach_state_for_core.
248 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
249 * dwfl_frame.c: New file.
250 * frame_unwind.c: New file.
251 * dwfl_frame_pc.c: New file.
252 * linux-pid-attach.c: New file.
253 * linux-core-attach.c: New file.
254 * dwfl_frame_regs.c: New file.
255 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
256 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
257 (Dwfl_Thread_Callbacks): New definition.
258 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
259 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
260 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
261 (dwfl_frame_pc): New declarations.
262 * libdwflP.h (Dwfl_Process): New typedef.
263 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
264 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
265 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
266 (INVALID_ARGUMENT): New DWFL_ERROR entries.
267 (struct Dwfl): New entry process.
268 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
269 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
270 (__libdwfl_process_free, __libdwfl_frame_unwind)
271 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
272 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
273 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
274 (dwfl_frame_thread, dwfl_thread_state_registers)
275 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
276 (dwfl_frame_pc): New INTDECL entries.
277 * linux-proc-maps.c (dwfl_linux_proc_report): Call
278 __libdwfl_attach_state_for_pid.
279 * segment.c (segment_start): Rename to ...
280 (__libdwfl_segment_start): ... here and make it internal_function.
281 (segment_end): Rename to ...
282 (__libdwfl_segment_end): ... here and make it internal_function.
283 (reify_segments, dwfl_report_segment): Rename them at the callers.
284
2852013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil21783b52013-11-07 16:34:58 +0100286
Jan Kratochvil22f867a2013-11-07 21:30:17 +0100287 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
288
2892013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
290
Jan Kratochvilb947ee12013-11-07 21:27:54 +0100291 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
292 retval. Fix one forgotten LISTED increase.
293
2942013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
295
Jan Kratochvil35d95f32013-11-07 16:47:19 +0100296 Fix core files for re-prelink-ed files.
297 * core-file.c (dynamic_vaddr_get): New function.
298 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
299 dynamic_vaddr_get instead of using L_ADDR.
300 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
301 * link_map.c (report_r_debug): Do not initialize l_addr.
302
3032013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
304
Jan Kratochvil21783b52013-11-07 16:34:58 +0100305 Code cleanup.
306 * core-file.c (dwfl_core_file_report): Reindent block of code by
307 continue keyword.
308
Jan Kratochvil3cf491e2013-10-30 10:48:20 +01003092013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
310
311 * argp-std.c (parse_opt): Use executable parameter of
312 dwfl_core_file_report.
313 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
314 it to DWFL. Add NEW_VERSION for it.
315 (_compat_without_executable_dwfl_core_file_report): New. Twice.
316 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
317 the function comment.
318
Mark Wielaardd1829742013-10-15 23:53:32 +02003192013-10-15 Mark Wielaard <mjw@redhat.com>
320
321 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
322 mappings.
323 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
324
Mark Wielaard2e73a8a2013-09-12 11:27:56 +02003252013-09-12 Mark Wielaard <mjw@redhat.com>
326
Mark Wielaardead7d192013-09-12 16:49:25 +0200327 * cu.c (intern_cu): If dwarf_offdie fails free cu.
328
3292013-09-12 Mark Wielaard <mjw@redhat.com>
330
Mark Wielaardcc392482013-09-12 15:16:13 +0200331 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
332 bad_report.
333
3342013-09-12 Mark Wielaard <mjw@redhat.com>
335
Mark Wielaard2e73a8a2013-09-12 11:27:56 +0200336 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
337 aux_xndxscn, not xndxscn, for aux_symxndxdata.
338
Mark Wielaard16fa4142013-08-22 13:45:16 +02003392013-08-25 Mark Wielaard <mjw@redhat.com>
340
341 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
342 to dwfl_report_elf.
343
Jan Kratochvil10edf472013-07-25 11:05:35 +02003442013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
345
346 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
347 conflicts all the modules, not just the first one. Compare L_LD if it
348 is equal, not if it is in a module address range.
349
Jan Kratochvil596d4302013-07-23 16:30:01 +02003502013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
351
Jan Kratochvil744fc6f2013-07-23 17:52:01 +0200352 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
353
3542013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
355
Jan Kratochvil596d4302013-07-23 16:30:01 +0200356 * core-file.c (clear_r_debug_info): Close also ELF and FD.
357 (dwfl_core_file_report): Call __libdwfl_report_elf for
358 R_DEBUG_INFO.MODULE.
359 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
360 code of ...
361 (__libdwfl_report_elf): ... this function. Call it.
362 * dwfl_segment_report_module.c: Include unistd.h.
363 (dwfl_segment_report_module): Use basename for MODULE->NAME.
364 Clear MODULE if it has no build-id and we have segment with build-id.
365 Ignore this segment only if MODULE still contains valid ELF.
366 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
367 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
368 and disk_file_has_build_id.
369 (dwfl_link_map_report): Extend the comment.
370 * link_map.c (report_r_debug): Extend the comment. Always fill in new
371 r_debug_info_module. Initialize also the new r_debug_info_module
372 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
373 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
374
Jan Kratochvil8af254a2013-07-19 21:41:31 +02003752013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
376
377 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
378
Mark Wielaard8e5393c2013-07-02 13:35:29 +02003792013-07-02 Mark Wielaard <mjw@redhat.com>
380
381 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
382
Mark Wielaard24b26ec2013-06-05 17:03:25 +02003832013-06-05 Mark Wielaard <mjw@redhat.com>
384
385 * link_map.c (report_r_debug): Always call release_buffer after
386 memory_callback succeeded reading build_id.
387
Jan Kratochvil8ff86292013-05-30 13:21:20 +02003882013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
389
390 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
391 executable_for_core before calling dwfl_core_file_report.
392 * core-file.c (clear_r_debug_info): New function.
393 (dwfl_core_file_report): Move raw segments reporting lower. New
394 variable r_debug_info, pass it to dwfl_segment_report_module. Call
395 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
396 * dwfl_module_build_id.c (check_notes): Move into
397 __libdwfl_find_elf_build_id.
398 (__libdwfl_find_build_id): Rename to ...
399 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
400 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
401 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
402 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
403 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
404 adjust its data_elfaddr parameter.
405 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
406 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
407 parameter r_debug_info. New variable name_is_final. Adjust addresses
408 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
409 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
410 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
411 (struct r_debug_info_module, struct r_debug_info): New definitions.
412 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
413 r_debug_info.
414 * link_map.c: Include fcntl.h.
415 (report_r_debug): Add parameter r_debug_info, describe it in the
416 function comment. Delete dwfl_addrmodule call and its dependent code.
417 Verify build-id before calling dwfl_report_elf, also supply
418 executable_for_core to it. Store r_debug_info->module info when
419 appropriate.
420 (dwfl_link_map_report): Add parameter r_debug_info. New variable
421 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
422 caller parameters.
423
Jan Kratochvil904aec22013-04-30 14:27:16 +02004242013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
425
426 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
427 Set it to true for ET_EXEC and ET_CORE. Provide alternative
428 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
429 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
430 NEW_VERSION.
431 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
432 COMPAT_VERSION.
433 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
434 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
435 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
436 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
437 dwfl_report_elf.
438 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
439
Mark Wielaard9efa9e62013-04-27 20:50:32 +02004402013-04-27 Mark Wielaard <mjw@redhat.com>
441
442 * link_map.c: #include system.h.
443
Jan Kratochvil1704baf2013-04-26 17:00:50 +02004442013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
445
446 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
447 them to lib/system.h.
448
Mark Wielaardcdaaf212013-04-25 16:50:11 -04004492013-04-24 Mark Wielaard <mjw@redhat.com>
450
451 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
452
Jan Kratochvila1d44822013-03-19 13:40:13 +01004532013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
454
455 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
456
Mark Wielaardf1b06b52013-03-12 12:02:51 +01004572013-03-12 Mark Wielaard <mjw@redhat.com>
458
459 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
460
Mark Wielaardf6185a72013-02-22 23:42:59 +01004612013-02-22 Mark Wielaard <mjw@redhat.com>
462
463 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
464 as DWFL_E_BADELF when not used.
465
Mark Wielaard40025812013-02-10 15:07:33 +01004662013-02-10 Mark Wielaard <mjw@redhat.com>
467
468 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
469 failure messages When handling ARGP_KEY_SUCCESS because arg will
470 not have been set.
471
Jan Kratochvil84476372012-10-10 20:42:30 +02004722013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
473
474 * linux-proc-maps.c: Include system.h.
475 (PROCEXEFMT, get_pid_class): New.
476 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
477 get_pid_class.
478
Mark Wielaard697bdca2013-01-23 17:39:19 +01004792013-01-23 Mark Wielaard <mjw@redhat.com>
480
481 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
482 from aux_syments by default.
483 (find_symtab): Also succeed when only aux_symdata is found.
484 When no symtab is found always try to load auxiliary table.
485 (dwfl_module_getsymtab): Substract one from result when both
486 tables have symbols.
487 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
488 zero entry when both tables have symbols.
489 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
490 one from first_global when both tables have symbols.
491
Mark Wielaard5083a702013-01-16 15:19:32 +01004922013-01-16 Mark Wielaard <mjw@redhat.com>
493
494 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
495 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
496 (dwfl_adjusted_aux_sym_addr): New function.
497 (dwfl_deadjust_aux_sym_addr): Likewise.
498 (dwfl_adjusted_st_value): Take and check symfile argument.
499 (dwfl_deadjust_st_value): Likewise.
500 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
501 use dwfl_file as argument to set address_sync.
502 (find_debuginfo): Call find_prelink_address_sync with debug file.
503 (find_aux_sym): New function.
504 (find_symtab): Use find_aux_sym if all we have is the dynsym table
505 and fill in aux DwflModule fields.
506 (dwfl_module_getsymtab): Return syments plus aux_syments.
507 (load_symtab): Always set first_global.
508 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
509 when using same_section. Calculate first_global based on both
510 mod->first_global and mod->aux_first_global.
511 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
512 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
513 to retrieve symbol and name if necessary, making sure all locals
514 from any table come before any globals.
515 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
516 with symfile.
517 * relocate.c (resolve_symbol): Likewise.
518
Roland McGrath3999ce12013-01-07 14:53:37 -08005192013-01-07 Roland McGrath <roland@hack.frob.com>
520
521 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
522 still assume the data is at least 32-bit aligned anyway.
523 (dwfl_link_map_report): Handle unaligned auxv data.
524
Mark Wielaard76c54592012-12-11 14:21:01 +01005252012-12-11 Mark Wielaard <mjw@redhat.com>
526
527 * linux-kernel-modules.c (report_kernel): Only free fname if
528 find_kernel_elf succeeds and allocates it.
529 (report_kernel_archive): Fix brackets around unlikely expression.
530
Jan Kratochvild5784af2012-10-18 00:11:30 +02005312012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
532
533 * argp-std.c: Update Copyright year.
534 (offline_find_elf): New function.
535 (offline_callbacks): Use it for find_elf.
536 (struct parse_opt): New.
537 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
538 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
539 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
540 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
541 final state->input initialization optional.
542 * dwfl_end.c: Update Copyright year.
543 (dwfl_end): Free executable_for_core.
544 * libdwflP.h: Update Copyright year.
545 (struct Dwfl): New field executable_for_core.
546
Jan Kratochvilae81c702012-10-27 20:45:27 +02005472012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
548
549 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
550 calculation.
551
Jan Kratochvil50f413e2012-10-17 22:04:24 +02005522012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
553
Jan Kratochvil3fdcdcb2012-10-17 21:49:10 +0200554 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
555 from ...
556 (__libdwfl_getelf): ... here. Call it.
557
5582012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
559
Jan Kratochvil50f413e2012-10-17 22:04:24 +0200560 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
561
Jan Kratochvil78dec222012-10-10 08:04:01 +02005622012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
563
Jan Kratochvil387654d2012-10-10 08:08:44 +0200564 * dwfl_segment_report_module.c (dwfl_segment_report_module):
565 Initialize mod->MAIN_BIAS.
566
5672012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
568
Jan Kratochvil78dec222012-10-10 08:04:01 +0200569 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
570 binding_value. Use it for both zero and non-zero size symbols
571 comparisons.
572
Mark Wielaard5b257822012-10-01 16:10:46 +02005732012-10-01 Mark Wielaard <mjw@redhat.com>
574
Mark Wielaardea45ac82012-10-01 16:12:10 +0200575 * cu.c (cudie_offset): Don't use type_sig8, it might not be
576 initialized and these are always real CUs, never TUs.
577
5782012-10-01 Mark Wielaard <mjw@redhat.com>
579
Mark Wielaard5b257822012-10-01 16:10:46 +0200580 * derelocate.c (find_section): Check next section exists before
581 accessing it.
582
Petr Machatae1873142012-08-01 21:37:52 +02005832012-08-01 Petr Machata <pmachata@redhat.com>
584
585 * offline.c (process_archive_member): Ignore entry "/SYM64/".
586
Roland McGrath210c2f02012-03-28 10:22:35 -07005872012-03-28 Roland McGrath <roland@hack.frob.com>
588
589 * dwfl_segment_report_module.c
590 (dwfl_segment_report_module: read_portion): Don't use existing buffer
591 when FILESZ is zero (string mode) and available portion doesn't hold
592 a terminated string.
593
Roland McGrath01fef9d2011-12-02 09:45:53 -08005942011-12-02 Roland McGrath <roland@hack.frob.com>
595
596 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
597 to use elf64_xlatetom and PHDRS.p64.
598 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
599
Mark Wielaard75ee33f2011-10-31 15:33:49 +01006002011-11-31 Mark Wielaard <mjw@redhat.com>
601
Mark Wielaardef431cd2011-10-31 23:17:06 +0100602 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
603 global symbols. Then only when that doesn't provide a match search
604 all local symbols too.
605 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
606 and fill it in.
607 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
608 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
609
6102011-11-31 Mark Wielaard <mjw@redhat.com>
611
Mark Wielaard75ee33f2011-10-31 15:33:49 +0100612 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
613 sizeless_sym if needed and closer to desired addr.
614
Mark Wielaardf43feb52011-10-20 16:53:54 +02006152011-10-20 Mark Wielaard <mjw@redhat.com>
616
617 * derelocate.c (cache_sections): Intern mod->reloc_info check.
618 (dwfl_module_relocations): Don't check mod->reloc_info.
619 (dwfl_module_relocation_info): Likewise.
620 (find_section): Likewise.
621
Roland McGrath32899ac2011-07-09 03:17:24 -07006222011-07-09 Roland McGrath <roland@hack.frob.com>
623
624 * image-header.c (LE32): Macro removed (now in lib/system.h).
625
Mark Wielaarddbb490f2011-04-11 17:24:16 +02006262011-04-11 Mark Wielaard <mjw@redhat.com>
627
628 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
629 by check for zlib, bzlib or lzma defines to check it isn't empty.
630 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
631
Roland McGrathe07da4f2011-03-08 16:26:02 -08006322011-03-08 Roland McGrath <roland@redhat.com>
633
634 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
635 Reported by Kurt Roeckx <kurt@roeckx.be>.
636
Roland McGrath6ecdead2011-02-11 12:29:45 -08006372011-02-11 Roland McGrath <roland@redhat.com>
638
639 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
640 suffixes if corresponding decompression support is enabled.
641
Roland McGrath9fdd4612011-02-01 16:09:43 -08006422011-02-01 Roland McGrath <roland@redhat.com>
643
Roland McGrath3a44c9a2011-02-01 19:06:21 -0800644 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
645 section-end address as the synchronization point, rather than sh_addr.
646
Roland McGrath0ef40202011-02-01 16:58:32 -0800647 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
648 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
649
Roland McGrath9fdd4612011-02-01 16:09:43 -0800650 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
651 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
652
Roland McGrath5ad466d2011-01-11 10:17:01 -08006532011-01-11 Roland McGrath <roland@redhat.com>
654
655 * dwfl_module_getdwarf.c (open_elf): Remove section-based
656 address_sync fixup from here.
657 (find_prelink_address_sync): New function.
658 (find_debuginfo): Call it.
659 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
660
Roland McGrath2c7d0dd2011-01-04 19:29:53 -08006612011-01-04 Roland McGrath <roland@redhat.com>
662
663 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
664 logic to consider section addresses, the better to survive all the
665 possible prelink machinations.
666 * libdwflP.h (struct dwfl_file): Comment change.
667
Roland McGrath33d305f2010-11-30 17:39:55 -08006682010-11-30 Roland McGrath <roland@redhat.com>
669
670 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
671
Roland McGrath1743d7f2010-11-12 16:46:47 -08006722010-11-12 Roland McGrath <roland@redhat.com>
673
674 * libdwflP.h (struct Dwfl_Module): New member main_bias.
675 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
676 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
677
678 * libdwflP.h (dwfl_deadjust_address): New function.
679 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
680 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
681 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
682
6832010-11-11 Roland McGrath <roland@redhat.com>
684
685 * libdwflP.h (struct dwfl_file): Remove bias member.
686 Add vaddr and address_sync members instead.
687 (dwfl_adjusted_address): Calculate using vaddr.
688 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
689 (dwfl_adjusted_st_value): Use one of those calls.
690 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
691 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
692 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
693 * link_map.c (consider_executable): Adjust only MOD->low_addr for
694 detected PIE bias change.
695
696 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
697 * dwfl_module_info.c: Use it.
698 * cu.c (addrarange): Likewise.
699 * dwfl_dwarf_line.c: Likewise.
700 * dwfl_module_dwarf_cfi.c: Likewise.
701 * dwfl_lineinfo.c: Likewise.
702 * dwfl_nextcu.c: Likewise.
703 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
704
705 * libdwflP.h (dwfl_adjusted_st_value): New function.
706 * relocate.c (resolve_symbol): Use it.
707 * dwfl_module_getsym.c: Likewise.
708 * dwfl_module_addrsym.c: Likewise.
709 * dwfl_module_info.c: Likewise.
710
711 * libdwflP.h (dwfl_adjusted_address): New function.
712 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
713 * relocate.c (__libdwfl_relocate_value): Likewise.
714 * derelocate.c (cache_sections): Likewise.
715 (dwfl_module_address_section): Likewise.
716 * dwfl_module_getelf.c: Likewise.
717 * dwfl_module_eh_cfi.c: Likewise.
718 * link_map.c (consider_executable): Likewise.
719
Roland McGrathde44f132010-08-24 15:38:42 -07007202010-08-24 Roland McGrath <roland@redhat.com>
721
722 * dwfl_dwarf_line.c: New file.
723 * Makefile.am (libdwfl_a_SOURCES): Add it.
724
Roland McGrath7503c892010-08-18 02:54:29 -07007252010-08-18 Roland McGrath <roland@redhat.com>
726
727 * link_map.c (report_r_debug): Use found name if we have no name,
728 even if we already have an Elf handle.
729
Roland McGrath81cfcca2010-06-30 00:45:58 -07007302010-06-30 Roland McGrath <roland@redhat.com>
731
732 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
733 confused by -1 return from dwfl_build_id_find_elf after it opened
734 the Elf handle.
Roland McGrath82a63362010-06-30 01:18:43 -0700735 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
736 dwfl_build_id_find_debuginfo.
Roland McGrath81cfcca2010-06-30 00:45:58 -0700737
Roland McGrath3e0f7d12010-06-15 23:10:35 -07007382010-06-16 Roland McGrath <roland@redhat.com>
739
740 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
741
Roland McGrathb9e85182010-06-14 12:45:25 -07007422010-06-14 Roland McGrath <roland@redhat.com>
743
744 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
745 candidate file to that st_dev/st_ino and pretend it didn't exist
746 if they match.
747 (find_debuginfo_in_path): Update caller, pass main file's info.
748
Roland McGratha0635db2010-05-20 00:04:59 -07007492010-05-20 Roland McGrath <roland@redhat.com>
750
751 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
752 (grovel_auxv): ... this. Take DWFL argument.
753 (dwfl_linux_proc_report): Update caller.
754
755 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
756 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
757
Roland McGrathbe9c4d72010-05-19 21:24:27 -07007582010-05-19 Roland McGrath <roland@redhat.com>
759
760 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
761
Roland McGrathed431dd2010-05-06 00:52:51 -07007622010-05-06 Roland McGrath <roland@redhat.com>
763
Roland McGrathaba26e02010-05-06 01:12:15 -0700764 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
765
Roland McGrathed431dd2010-05-06 00:52:51 -0700766 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
767 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
768 ID but we didn't find a file.
769 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
770 and refuse any fallback file-by-name if it lacks the matching ID.
771
772 * dwfl_error.c (dwfl_errno): Add INTDEF.
773 * libdwflP.h: Add INTDECL.
774
775 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
776 failure cases.
777
Roland McGrath77cda9d2010-05-04 16:31:43 -07007782010-05-04 Roland McGrath <roland@redhat.com>
779
Roland McGrathb4bb3012010-05-04 20:09:30 -0700780 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
781 ET_DYN that has a DT_DEBUG.
782
783 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
Roland McGrath89bb5d32010-05-04 18:03:42 -0700784
Roland McGrath4820a052010-05-04 19:46:56 -0700785 * segment.c (insert): Fix moving of values following insertion.
786 (reify_segments): Fix up MOD->segment backpointer indices after
787 later insertions in the main loop invalidate them.
788
Roland McGrathd05c5962010-05-04 18:05:22 -0700789 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
790 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
791
Roland McGrath77cda9d2010-05-04 16:31:43 -0700792 * core-file.c (dwfl_core_file_report): Return any nonzero count of
793 modules reported, even if link_map grovelling failed and only sniffing
794 found anything.
795
Roland McGrathd17f9de2010-04-26 13:09:33 -07007962010-04-26 Roland McGrath <roland@redhat.com>
797
798 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
799 Works around probably-wrong ld -r behavior for case of a DWARF address
800 constant that refers to a discarded SHF_ALLOC section.
801
Roland McGrathbe139302010-04-14 12:54:45 -07008022010-04-14 Roland McGrath <roland@redhat.com>
803
804 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
805 an upper bound on sane possible number of elements.
806
Roland McGrath5ea349b2010-04-06 00:04:49 -07008072010-03-11 Roland McGrath <roland@redhat.com>
808
809 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
810 the second half for 32-bit matches.
811
Roland McGrath8068e062010-03-10 23:49:13 -08008122010-03-10 Roland McGrath <roland@redhat.com>
813
814 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
815 * argp-std.c (parse_opt): Update caller.
816 * libdwfl.h: Declare dwfl_core_file_report.
817 * libdwflP.h: Don't.
818
Roland McGrathca84a552010-02-17 01:44:42 -08008192010-02-17 Roland McGrath <roland@redhat.com>
820
821 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
822 If set, find the first index not below ADDR.
823 (dwfl_segment_report_module): Update callers.
824 Pass true when calculating return value.
825
Roland McGrathbf963472010-02-15 15:16:44 -08008262010-02-15 Roland McGrath <roland@redhat.com>
827
Roland McGrath22359e22010-02-15 15:57:03 -0800828 * Makefile.am: Use config/eu.am for common stuff.
829
Roland McGrathbf963472010-02-15 15:16:44 -0800830 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
831 variable in failure path.
832
Mark Wielaardeacdcf32010-02-02 15:45:24 +01008332010-02-02 Mark Wielaard <mjw@redhat.com>
834
835 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
836 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
837
Roland McGrathf95760a2010-01-07 20:24:34 -08008382010-01-07 Roland McGrath <roland@redhat.com>
839
840 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
841 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
842 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
843 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
844
Roland McGrath1d7cbd12010-01-06 04:22:40 -08008452010-01-06 Roland McGrath <roland@redhat.com>
846
847 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
848 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
849
Roland McGrath15426bd2009-11-16 20:38:17 -08008502009-11-16 Roland McGrath <roland@redhat.com>
851
852 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
853
Petr Machata003dd322009-11-13 00:38:27 +01008542009-11-12 Petr Machata <pmachata@redhat.com>
855
856 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
857 the chunk is both offset-contiguous and vaddr-contiguous.
858
Roland McGrathcdb48e02009-11-05 11:34:08 -08008592009-11-05 Roland McGrath <roland@redhat.com>
860
861 * link_map.c (report_r_debug): Skip entries with l_ld==0.
Roland McGrath6229eb52009-11-05 11:43:38 -0800862 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
Roland McGrathcdb48e02009-11-05 11:34:08 -0800863
Roland McGrathde6730c2009-09-04 03:05:31 -07008642009-09-04 Roland McGrath <roland@redhat.com>
865
866 * image-header.c (__libdw_image_header): Fix tranposed comparison.
867
Roland McGrath6bb90712009-08-27 12:36:47 -07008682009-08-27 Roland McGrath <roland@redhat.com>
869
870 * image-header.c: New file.
871 * Makefile.am (libdwfl_a_SOURCES): Add it.
872 * libdwflP.h: Declare __libdw_image_header.
873 * open.c (decompress): Don't consume ELF on failure.
874 (what_kind): New function, broken out of ...
875 (__libdw_open_file): ... here. Call it.
876 If it fails, try __libdw_image_header and then try what_kind again.
877
878 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
879 leave it behind for next decompressor.
880 * open.c (decompress): Free BUFFER on failure.
881
Roland McGrathd6ccdc12009-08-26 00:23:01 -07008822009-08-26 Roland McGrath <roland@redhat.com>
883
Roland McGrathe5a1a812009-08-26 03:05:50 -0700884 * gzip.c (find_zImage_payload): New function, broken out of ...
885 (mapped_zImage): ... here. Call it.
886 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
887 stupid method of just trying the decoder.
888
Roland McGrath24169642009-08-26 02:26:34 -0700889 * open.c [USE_LZMA]: Try __libdw_unlzma.
890 * libdwflP.h: Declare it.
891 (DWFL_ERRORS): Add DWFL_E_LZMA.
892 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
893 * lzma.c: New file.
894 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
895
Roland McGrathd6ccdc12009-08-26 00:23:01 -0700896 * gzip.c (mapped_zImage): Limit scan to 32kb.
897 Make this unconditional, support bzip2 kernel images too.
Roland McGrathae1d7dc2009-08-26 01:27:59 -0700898 (unzip): Use direct inflate method for non-mmap case too.
899 Only zlib uses the stream method.
Roland McGrathd6ccdc12009-08-26 00:23:01 -0700900
Roland McGrathebfb6482009-08-09 15:40:52 -07009012009-08-09 Roland McGrath <roland@redhat.com>
902
903 * dwfl_module_build_id.c: Use new macros for versioned definitions.
904
Roland McGrathfe8b42e2009-07-08 14:54:16 -07009052009-07-08 Roland McGrath <roland@redhat.com>
906
Roland McGrath3c84db32009-06-24 17:41:40 -0700907 * dwfl_module_dwarf_cfi.c: New file.
908 * dwfl_module_eh_cfi.c: New file.
909 * Makefile.am (libdwfl_a_SOURCES): Add them.
910 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
911 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
912
9132009-07-08 Roland McGrath <roland@redhat.com>
914
Roland McGrathfe8b42e2009-07-08 14:54:16 -0700915 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
916
Mark Wielaard2256e362009-06-18 13:31:56 +02009172009-06-18 Mark Wielaard <mjw@redhat.com>
918
919 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
920
Ulrich Drepperf1894932009-06-13 15:55:42 -07009212009-06-13 Ulrich Drepper <drepper@redhat.com>
922
923 * derelocate.c: Don't use deprecated libelf functions.
924 * dwfl_module_getdwarf.c: Likewise.
925 * relocate.c: Likewise.
926
Ulrich Drepper4f515712009-04-23 07:54:53 -07009272009-04-23 Ulrich Drepper <drepper@redhat.com>
928
929 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
930 defined. Otherwise just define the latest version.
931
Roland McGrathcc480472009-04-22 11:32:20 -07009322009-04-22 Roland McGrath <roland@redhat.com>
933
Roland McGrathc65558b2009-04-22 12:29:32 -0700934 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
935 a non-ET_REL module.
936
Roland McGrathcc480472009-04-22 11:32:20 -0700937 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
938 adjust properly for non-ET_REL.
939
Roland McGrath19a8e4d2009-04-21 15:44:07 -07009402009-04-21 Roland McGrath <roland@redhat.com>
941
942 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
943
944 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
945 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
946 for ET_REL.
947 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
948
Roland McGrath10361572009-04-20 11:50:50 -07009492009-04-20 Roland McGrath <roland@redhat.com>
950
951 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
952
Roland McGratha605a3c2009-04-19 18:27:01 -07009532009-04-19 Roland McGrath <roland@redhat.com>
954
955 * dwfl_module_getdwarf.c (find_file): Renamed to ...
956 (__libdwfl_getelf): ... this. Make it global.
957 (find_symtab, find_dw): Update callers.
958 (dwfl_module_getelf): Functions moved ...
959 * dwfl_module_getelf.c: ... here, new file.
960 * Makefile.am (libdwfl_a_SOURCES): Add it.
961 * libdwflP.h: Declare __libdwfl_getelf.
962
Roland McGrathfa253262009-04-14 02:38:19 -07009632009-04-14 Roland McGrath <roland@redhat.com>
964
965 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
966 absolute (already adjusted in place) or needing load bias adjustment.
967
968 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
969 gelf_getphdr failure. Fix file size limit checks.
970
971 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
972
Roland McGrath243fa262009-04-08 17:05:43 -07009732009-04-08 Roland McGrath <roland@redhat.com>
974
Roland McGrath785dbb12009-04-08 17:15:01 -0700975 * dwfl_module_getsym.c: Don't adjust for bias again after
976 __libdwfl_relocate_value.
977
Roland McGrath243fa262009-04-08 17:05:43 -0700978 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
979 a non-SHF_ALLOC section.
980 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
981 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
982
Roland McGrath8651c5e2009-03-09 20:42:56 -07009832009-03-09 Roland McGrath <roland@redhat.com>
984
Roland McGrath329ed9f2009-03-09 20:49:53 -0700985 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
986 variable to outer scope, so we cache it for the loop.
987
Roland McGrath8651c5e2009-03-09 20:42:56 -0700988 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
989
Roland McGrath31fd6542009-02-12 17:26:39 -08009902009-02-12 Roland McGrath <roland@redhat.com>
991
992 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
993 __libdwfl_relocate_value to find correct sh_addr value.
994
Roland McGrath45c01cd2009-02-10 17:03:19 -08009952009-02-10 Roland McGrath <roland@redhat.com>
996
Roland McGrath5453abf2009-02-10 17:33:49 -0800997 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
998 If false, don't fail for NO_PHDR.
999 (dwfl_report_elf): Update caller.
1000 * libdwflP.h: Update decl.
1001 * offline.c (process_elf): Call it with false, so we don't refuse
1002 dubiously-formed objects here.
1003
Roland McGrath45c01cd2009-02-10 17:03:19 -08001004 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1005 finds our module. We shouldn't crash when we confuse some guesses.
1006
Ulrich Dreppera9d51bf2009-02-10 12:55:07 -080010072009-02-10 Ulrich Drepper <drepper@redhat.com>
1008
1009 * open.c (decompress): Avoid crash with empty input file.
1010
Roland McGrathe738ad22009-01-27 16:41:54 -080010112009-01-27 Roland McGrath <roland@redhat.com>
1012
1013 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1014 with zero vaddr and memsz.
1015
Roland McGrath74afbee2009-01-22 04:52:56 -080010162009-01-22 Roland McGrath <roland@redhat.com>
1017
Roland McGrathe34a3f82009-01-22 12:59:23 -08001018 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1019
Roland McGrath74afbee2009-01-22 04:52:56 -08001020 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1021 after address-matching loop.
1022
1023 * segment.c (lookup): Fix fencepost in checking for HINT match.
1024
Roland McGrath8dc9f932009-01-14 12:56:53 -080010252009-01-14 Roland McGrath <roland@redhat.com>
1026
1027 * gzip.c [!BZLIB] (mapped_zImage): New function.
1028 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1029
Ulrich Drepper7e678fa2009-01-10 18:02:05 -080010302009-01-10 Ulrich Drepper <drepper@redhat.com>
1031
1032 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1033
Roland McGratha4b1a952009-01-08 20:53:26 -080010342009-01-08 Roland McGrath <roland@redhat.com>
1035
1036 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1037 Skip subdirectory named "source".
1038 (dwfl_linux_kernel_find_elf): Likewise.
1039
Roland McGrath60205c92009-01-06 00:10:23 -080010402009-01-06 Roland McGrath <roland@redhat.com>
1041
Roland McGrath705364b2009-01-06 02:04:51 -08001042 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -08001043 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1044 (dwfl_linux_kernel_report_offline): Use it.
1045 (dwfl_linux_kernel_find_elf): Likewise.
1046
Roland McGrathbca43152009-01-05 23:59:32 -080010472009-01-05 Roland McGrath <roland@redhat.com>
1048
1049 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1050 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1051 * dwfl_build_id_find_elf.c: Likewise.
1052 * dwfl_module_getdwarf.c (open_elf): Likewise.
1053 * dwfl_report_elf.c: Likewise.
1054 * find-debuginfo.c (validate): Likewise.
1055 * offline.c (__libdwfl_report_offline): Likewise.
1056
1057 * libdwflP.h: Declare __libdw_open_file.
1058 * open.c: New file.
1059 * Makefile.am (libdwfl_a_SOURCES): Add it.
1060
1061 * gzip.c: New file.
1062 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1063 * bzip2.c: New file.
1064 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1065 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1066
Roland McGrath45d7b292008-12-16 16:21:40 -080010672008-12-16 Roland McGrath <roland@redhat.com>
1068
1069 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1070 symver magic to bind to ELFUTILS_0.138.
1071 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1072 wrapper for ELFUTILS_0.130 version set.
1073
Roland McGrath7d9b8212008-12-18 15:08:09 -080010742008-12-18 Roland McGrath <roland@redhat.com>
1075
1076 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1077 addresses are taken as relative to MOD->low_addr.
1078
Roland McGrath74825c42008-12-15 19:33:33 -080010792008-12-15 Roland McGrath <roland@redhat.com>
1080
1081 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1082 debug.bias.
1083
Roland McGrathb28a8942008-12-11 02:09:28 -080010842008-12-11 Roland McGrath <roland@redhat.com>
1085
1086 * offline.c (process_archive): Don't call elf_end and close if
1087 returning NULL. Check first elf_begin call and set error code
1088 specially for empty archive.
1089 Fixes RHBZ#465878.
1090
Roland McGratha845f682008-12-03 03:41:58 +000010912008-12-02 Roland McGrath <roland@redhat.com>
1092
1093 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1094
10952008-11-26 Roland McGrath <roland@redhat.com>
1096
1097 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1098 return value, and interpret encoded OFFSET argument.
1099
11002008-10-07 Roland McGrath <roland@redhat.com>
1101
1102 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1103
Roland McGrath9cf28e42008-09-30 06:35:35 +000011042008-09-29 Roland McGrath <roland@redhat.com>
1105
1106 * segment.c (insert): Must realloc DWFL->lookup_module here too.
1107 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1108
11092008-08-28 Roland McGrath <roland@redhat.com>
1110
1111 * segment.c (reify_segments): Fix last change.
1112
11132008-08-27 Roland McGrath <roland@redhat.com>
1114
1115 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1116 failure from pread64.
1117
Roland McGrath122f3882008-08-26 07:20:29 +000011182008-08-26 Roland McGrath <roland@redhat.com>
1119
1120 * segment.c (reify_segments): Insert a trailing segment for a module
1121 end that is above the highest current segment.
1122
11232008-08-25 Roland McGrath <roland@redhat.com>
1124
1125 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1126 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
1127 if FILE->elf is not ELF_K_ELF.
1128
1129 * dwfl_segment_report_module.c: Add a cast.
1130
Roland McGrathb4d6f0f2008-08-25 22:55:17 +000011312008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001132
Roland McGrathb4d6f0f2008-08-25 22:55:17 +00001133 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1134 which decides which symbol is "closest" to a given address.
1135
11362008-08-15 Roland McGrath <roland@redhat.com>
1137
1138 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1139 (options, parse_opt): Handle --core.
1140
1141 * core-file.c: New file.
1142 * Makefile.am (libdwfl_a_SOURCES): Add it.
1143 * libdwflP.h (dwfl_core_file_report): Declare it.
1144
1145 * link_map.c: New file.
1146 * Makefile.am (libdwfl_a_SOURCES): Add it.
1147 * libdwflP.h (dwfl_link_map_report): Declare it.
1148
1149 * libdwflP.h (MIN, MAX): New macros.
1150 (Dwfl_Memory_Callback): New typedef.
1151 (Dwfl_Module_Callback): New typedef.
1152 (dwfl_segment_report_module): Declare it.
1153 * dwfl_segment_report_module.c: New file.
1154 * Makefile.am (libdwfl_a_SOURCES): Add it.
1155
1156 * derelocate.c (dwfl_module_address_section): Add INTDEF.
1157 * libdwflP.h: Add INTDECL.
1158
1159 * segment.c: New file.
1160 * Makefile.am (libdwfl_a_SOURCES): Add it.
1161 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1162 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1163 lookup_addr, lookup_module, lookup_segndx, replace removed members
1164 modules, nmodules.
1165 (struct Dwfl_Module): New member segment.
1166 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
1167 to each free module.
1168 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1169 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
1170 (dwfl_report_module): Don't touch DWFL->nmodules.
1171 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1172 (compare_modules): Function removed.
1173 * dwfl_getmodules.c: Rewritten.
1174 Add INTDEF.
1175 * libdwflP.h: Add INTDECLs.
1176 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1177 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001178
Roland McGrath1d8bb252008-08-07 08:39:41 +000011792008-08-03 Roland McGrath <roland@redhat.com>
1180
1181 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1182
11832008-07-17 Roland McGrath <roland@redhat.com>
1184
1185 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1186 zero if the failure was only ENOENT.
1187
11882008-06-03 Roland McGrath <roland@redhat.com>
1189
1190 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1191 symbols.
1192
Roland McGrath9d2f3ee2008-05-22 20:28:05 +000011932008-05-22 Petr Machata <pmachata@redhat.com>
1194
1195 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1196
Roland McGrath0fa20e82008-05-07 18:37:14 +000011972008-05-06 Roland McGrath <roland@frob.com>
1198
1199 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1200 FTS_LOGICAL here too.
1201 (dwfl_linux_kernel_find_elf): Likewise.
1202
12032008-04-29 Roland McGrath <roland@redhat.com>
1204
1205 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1206 based on canonicalize_file_name if it differs from the supplied name.
1207
1208 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1209 we accept symlinks.
1210
Roland McGrath9897d662008-04-29 01:49:50 +000012112008-04-27 Roland McGrath <roland@redhat.com>
1212
1213 * linux-kernel-modules.c (report_kernel): Fix crash when
1214 dwfl_report_elf fails.
1215
Roland McGrathbfc01702008-04-06 01:57:32 +000012162008-04-05 Roland McGrath <roland@redhat.com>
1217
1218 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1219
1220 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1221 Clear it after freeing.
1222 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1223
Roland McGrathd11f9cb2008-03-26 20:51:59 +000012242008-03-26 Roland McGrath <roland@redhat.com>
1225
1226 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1227 SHT_DYNSYM, just set *SYMSCN like the comment says.
1228
1229 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1230
1231 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1232
12332008-03-19 Roland McGrath <roland@redhat.com>
1234
1235 * dwfl_module_getsrc.c: Adjust address for module bias before search.
1236
12372008-03-01 Roland McGrath <roland@redhat.com>
1238
1239 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1240 prototype to avoid older compiler's complaint about reuse of the name.
1241 (__libdwfl_canon_error): Likewise.
1242
Roland McGrath059c83e2008-02-21 06:19:39 +000012432008-02-19 Roland McGrath <roland@redhat.com>
1244
1245 * relocate.c (relocate_section): Check for an unhandled relocation
1246 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
1247 DWFL_E_UNKNOWN_MACHINE check out of loops.
1248
1249 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1250 DEBUGFILE->relocated is already set.
1251
12522008-01-26 Roland McGrath <roland@redhat.com>
1253
1254 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1255
1256 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1257 incoming *FILE_NAME at the start.
1258
Ulrich Dreppere219f1c2008-01-09 05:49:49 +000012592008-01-08 Roland McGrath <roland@redhat.com>
1260
1261 * Makefile.am (euinclude): Variable removed.
1262 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1263
Roland McGrathe4c22ea2007-10-23 13:07:39 +000012642007-10-23 Roland McGrath <roland@redhat.com>
1265
1266 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1267 module to appear first.
1268
12692007-10-20 Roland McGrath <roland@redhat.com>
1270
1271 * offline.c (process_archive_member): Take FD argument, pass it down
1272 to process_file. Return Elf_Cmd, not bool.
1273 Call elf_next here, always before elf_end.
1274 (process_archive): Update caller. Don't close FD here unless there
1275 are no member refs.
1276
1277 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
1278
1279 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
1280 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
1281 partial relocation to one or both files.
1282 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
1283 relocations have been applied to the debug file if dwfl_module_getelf
1284 has been used before.
1285
1286 * relocate.c (resolve_symbol): New function.
1287 (relocate_section): Call it.
1288
1289 * relocate.c (relocate_getsym): Handle null MOD->symfile.
1290 (relocate_section): Take new bool arg, PARTIAL. If true,
1291 no error for BADRELTYPE/RELUNDEF, instead just skip them
1292 and leave only those skipped relocs behind the reloc section.
1293 (__libdwfl_relocate_section): Take new arg, pass it down.
1294 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
1295 do partial relocation on all sections.
1296 * dwfl_module_getdwarf.c (load_dw): Update caller.
1297 * libdwflP.h: Update decls.
1298 * derelocate.c (dwfl_module_address_section): Pass new argument
1299 to __libdwfl_relocate_section, true.
1300
1301 * derelocate.c (cache_sections): Don't cache reloc sections when
1302 section_address callback is null.
1303
13042007-10-19 Roland McGrath <roland@redhat.com>
1305
1306 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
1307
1308 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
1309 (struct secref): Likewise.
1310 (cache_sections): Cache the relocation section referring to each
1311 section we cache, if any.
1312 (dwfl_module_address_section): Use __libdwfl_relocate_section as
1313 necessary.
1314
1315 * relocate.c (struct reloc_symtab_cache): New type.
1316 (relocate_getsym): Use it instead of four arguments.
1317 (__libdwfl_relocate): Update caller.
1318 (relocate_section): New function, broken out of ...
1319 (__libdwfl_relocate): ... here.
1320 (__libdwfl_relocate_section): New function.
1321 * libdwflP.h: Declare it.
1322
13232007-10-17 Roland McGrath <roland@redhat.com>
1324
1325 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
1326 to relocated st_value.
1327
1328 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
1329 ET_REL to 0x100.
1330
13312007-10-16 Roland McGrath <roland@redhat.com>
1332
1333 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
1334 section has larger alignment requirements not met by the original BASE,
1335 rather than padding more between sections.
1336
1337 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
1338
1339 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
1340 to sh_addr value.
1341
1342 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
1343 at zero in ET_REL case. Adjust BASE to necessary alignment.
1344
1345 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
1346 for DATA_VADDR.
1347 (__libdwfl_find_build_id): Update caller.
1348
1349 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
1350 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1351 * offline.c (dwfl_offline_section_address): Bail early if there is
1352 separate debug file.
1353
1354 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
1355
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000013562007-10-09 Roland McGrath <roland@redhat.com>
1357
1358 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
1359 caching SHDR->sh_addr = 0.
1360 * offline.c (dwfl_offline_section_address): Never called for sh_addr
1361 really at 0, don't check for it. Use MOD->debug directly, not symfile.
1362
1363 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
1364 we've found SHT_SYMTAB.
1365
1366 * relocate.c (relocate_getsym): New function.
1367 (__libdwfl_relocate): Use it.
1368 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
1369 be a pointer instead of value; cache getshstrndx result there.
1370 * libdwflP.h: Update decl.
1371 * derelocate.c (cache_sections): Update caller.
1372 Always work on the main file, not the symfile.
1373 (dwfl_module_address_section): Likewise.
1374 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
1375
13762007-10-07 Roland McGrath <roland@redhat.com>
1377
1378 * offline.c (process_archive): Initialize MOD.
1379
1380 * linux-kernel-modules.c (get_release): New function, broken out of ...
1381 (report_kernel): ... here. Call it.
1382 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
1383 (find_kernel_elf): Update caller.
1384 (report_kernel_archive): New function.
1385 (dwfl_linux_kernel_report_offline): Call it.
1386
1387 * offline.c (process_file): Take new arg PREDICATE, pass it down.
1388 (process_archive): Likewise.
1389 (process_archive_member): Likewise. When nonnull, let the predicate
1390 decide whether to use this member.
1391 (__libdwfl_report_offline): New function, broken out of ...
1392 (dwfl_report_offline): ... here. Call it.
1393 * libdwflP.h: Declare it.
1394
1395 * offline.c (process_archive, process_archive_member): New functions.
1396 (process_elf, process_file): New functions, broken out of ...
1397 (dwfl_report_offline): ... here. Call process_file, which recurses on
1398 ELF_K_AR files.
1399
1400 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
1401 (dwfl_report_elf): ... here. Call it.
1402 * libdwflP.h: Declare it.
1403
14042007-10-06 Roland McGrath <roland@redhat.com>
1405
1406 * derelocate.c (dwfl_module_relocations): Don't call
1407 dwfl_module_getdwarf.
1408
1409 * derelocate.c (find_section): Use __libdwfl_seterrno, not
1410 __libdw_seterrno.
1411
1412 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
1413 SHF_ALLOC, to cache sh_addr resolved to 0.
1414
1415 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
1416 values nonzero already, just use its existing layout.
1417
1418 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
1419 in-core shdr after applying it.
1420
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +000014212007-10-04 Ulrich Drepper <drepper@redhat.com>
1422
1423 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
1424 initialization of notes variable.
1425
Roland McGrath59ea7f32007-10-04 08:50:09 +000014262007-10-04 Roland McGrath <roland@redhat.com>
1427
1428 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
1429 fill in with vaddr of "__start_notes" symbol if found.
1430 (check_notes): New function.
1431 (check_kernel_notes): New function.
1432 (dwfl_linux_kernel_report_kernel): Call it.
1433 (check_module_notes): New function.
1434 (dwfl_linux_kernel_report_modules): Call it.
1435
1436 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
1437 Try dwfl_build_id_find_elf first.
1438
1439 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
1440 Set kernel module e_type to ET_DYN.
1441
14422007-10-03 Roland McGrath <roland@redhat.com>
1443
1444 * find-debuginfo.c (validate): New function, broken out of ...
1445 (find_debuginfo_in_path): ... here. New function, broken out of ...
1446 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
1447 dwfl_build_id_find_debuginfo first.
1448
1449 * dwfl_build_id_find_elf.c: New file.
1450 * dwfl_build_id_find_debuginfo.c: New file.
1451 * Makefile.am (libdwfl_a_SOURCES): Add them.
1452 * libdwfl.h: Declare them.
1453 * libdwflP.h: Add INTDECLs.
1454
1455 * dwfl_module_build_id.c: New file.
1456 * dwfl_module_report_build_id.c: New file.
1457 * Makefile.am (libdwfl_a_SOURCES): Add them.
1458 * libdwfl.h: Declare them.
1459 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
1460 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
1461 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
1462
1463 * dwfl_module_getdwarf.c (find_offsets): New function.
1464 (find_dynsym): New function, calls that.
1465 (find_symtab): Call it.
1466
Roland McGrathc76f0b02007-09-27 07:31:33 +000014672007-09-11 Roland McGrath <roland@redhat.com>
1468
1469 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
1470 address if its st_size is smaller.
1471
Roland McGrath099dd522007-08-13 22:58:36 +000014722007-08-13 Roland McGrath <roland@redhat.com>
1473
1474 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
1475
14762007-08-12 Roland McGrath <roland@redhat.com>
1477
1478 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
1479 FTS_LOGICAL.
1480
1481 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
1482 a second phdr if it happens to match EHDR_VMA exactly.
1483
Roland McGrath42f68682007-08-09 07:54:22 +000014842007-08-08 Roland McGrath <roland@redhat.com>
1485
1486 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
1487 those with no names. Rewrite best symbol algorithm not to assume a
1488 sorted table and to be smarter handling sizeless symbols.
1489
Roland McGrath87d47802007-07-16 22:23:37 +000014902007-07-16 Roland McGrath <roland@redhat.com>
1491
1492 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
1493 reviving an existing module.
1494
14952007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +00001496
1497 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
1498
Roland McGrath9aa8ef72007-05-18 08:59:43 +000014992007-05-17 Roland McGrath <roland@redhat.com>
1500
1501 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
1502 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
1503 (dwfl_linux_kernel_find_elf): Likewise.
1504
1505 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1506 getline and sscanf instead of fscanf.
1507
15082007-05-08 Roland McGrath <roland@redhat.com>
1509
1510 * offline.c (dwfl_offline_section_address): Don't assume section
1511 numbers match between stripped and debuginfo files. Instead, assume
1512 only that the ordering among SHF_ALLOC sections matches.
1513
1514 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
1515 pointer to string.
1516 (dwfl_linux_kernel_report_offline): Update caller.
1517 (dwfl_linux_kernel_report_kernel): Likewise.
1518
Roland McGrath4be15242007-04-25 03:09:33 +000015192007-04-23 Roland McGrath <roland@redhat.com>
1520
1521 * argp-std.c (options): Fix group title string.
1522
1523 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
1524 Update via STATE->input every time we set STATE->hook, not only at
1525 ARGP_KEY_SUCCESS.
1526
1527 * dwfl_module.c (free_file): Free FILE->name.
1528
Roland McGrath43da9892007-04-16 23:13:37 +000015292007-04-16 Roland McGrath <roland@redhat.com>
1530
1531 * derelocate.c (cache_sections): Apply bias to sh_addr.
1532 (compare_secrefs): Fix address comparison to avoid signed overflow.
1533 (find_section): New function, broken out of ...
1534 (dwfl_module_relocate_address): ... here, call it.
1535 (check_module): New function, broken out of ...
1536 (dwfl_module_relocate_address): ... here, call it.
1537 (dwfl_module_address_section): New function.
1538 * libdwfl.h: Declare it.
1539
Ulrich Drepperc07fbb32007-03-30 19:14:59 +000015402007-03-26 Roland McGrath <roland@redhat.com>
1541
1542 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
1543
15442007-03-18 Roland McGrath <roland@redhat.com>
1545
1546 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
1547 (find_debuginfo): ... here. Call it.
1548 Don't return error for libelf errors finding .gnu_debuglink section.
1549
Ulrich Drepper6258e742007-03-13 06:22:40 +000015502007-03-12 Roland McGrath <roland@redhat.com>
1551
1552 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
1553 (dwfl_report_begin): ... here. Call it.
1554 * libdwfl.h: Declare it.
1555 * libdwflP.h: Add INTDECL.
1556
1557 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1558
1559 * offline.c: Comment typo fix.
1560
15612007-03-04 Roland McGrath <roland@redhat.com>
1562
1563 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
1564 (find_kernel_elf): New function, broken out of ...
1565 (report_kernel): ... here. Call it.
1566 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
1567 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
1568 virtual address bounds of kernel from symbols rounded to page size.
1569 (dwfl_linux_kernel_report_kernel): Use that if it works, before
1570 resorting to report_kernel.
1571
1572 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
1573 ET_EXEC file with nonzero bias.
1574
1575 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
1576 dwfl_module_addrsym. Guts moved to ...
1577 * dwfl_module_addrsym.c: ... here; new file.
1578 * Makefile.am (libdwfl_a_SOURCES): Add it.
1579 * libdwfl.h: Declare dwfl_module_addrsym.
1580 * libdwflP.h: Add INTDECL.
1581
15822007-03-03 Roland McGrath <roland@redhat.com>
1583
1584 * dwfl_module.c (free_file): New function, broken out of ...
1585 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
1586
1587 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
1588 on libelf failure.
1589
15902007-03-02 Roland McGrath <roland@redhat.com>
1591
1592 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
1593
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000015942007-02-02 Roland McGrath <roland@redhat.com>
1595
1596 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
1597 address exactly if it's no other module's low boundary.
1598
1599 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
1600 and size cover the address, select the closest symbol with st_size==0
1601 that lies in the same section.
1602
16032007-01-29 Roland McGrath <roland@redhat.com>
1604
1605 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
1606 not PACKAGE_STRING.
1607
16082007-01-20 Roland McGrath <roland@redhat.com>
1609
1610 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
1611 as omitted, not 0.
1612 * libdwfl.h (Dwfl_Callbacks): Update comment.
1613 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
1614 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1615 For ignored missing section, use -1 instead of 0.
1616 * offline.c (dwfl_offline_section_address): Expect a call for 0.
1617
16182007-01-19 Roland McGrath <roland@redhat.com>
1619
1620 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
1621 zero so a lone -e foo.so is shown without address bias.
1622
Roland McGrathba949b32007-01-10 20:44:29 +000016232007-01-10 Roland McGrath <roland@redhat.com>
1624
Roland McGrath44865b92007-01-11 05:06:16 +00001625 * linux-kernel-modules.c (report_kernel): Check asprintf return value
1626 directly instead of via side effect, to silence warn_unused_result.
1627 (dwfl_linux_kernel_report_offline): Likewise.
1628 (dwfl_linux_kernel_find_elf): Likewise.
1629 (dwfl_linux_kernel_module_section_address): Likewise.
1630 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +00001631 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
1632 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +00001633
Roland McGrathba949b32007-01-10 20:44:29 +00001634 * libdwfl.h (dwfl_begin): Require nonnull argument.
1635
Roland McGrath70008802006-12-29 20:44:16 +000016362006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001637
Roland McGrath70008802006-12-29 20:44:16 +00001638 * dwfl_module.c (compare_modules): Fix address comparison to avoid
1639 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001640
Roland McGrath8190db62006-12-17 23:56:51 +000016412006-10-30 Roland McGrath <roland@redhat.com>
1642
1643 * dwfl_module.c (dwfl_report_module): Comment typo fix.
1644
Roland McGrathc373d852006-10-10 00:25:21 +000016452006-09-05 Roland McGrath <roland@redhat.com>
1646
1647 * derelocate.c (cache_sections): Use alloca instead of variable-sized
Roland McGrath3c84db32009-06-24 17:41:40 -07001648 auto array, in function already using alloca.
Roland McGrathc373d852006-10-10 00:25:21 +00001649
Roland McGratha1cee072006-08-15 01:37:23 +000016502006-08-14 Roland McGrath <roland@redhat.com>
1651
1652 * linux-kernel-modules.c (try_kernel_name): If the call to
1653 dwfl_standard_find_debuginfo produces no results, try it again
1654 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
1655
1656 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
1657 * libdwflP.h: ... to here.
1658 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
1659 repeats the first thing dwfl_standard_find_debuginfo will try.
1660
1661 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
1662 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
1663 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
1664 section name.
1665
Ulrich Drepper077c65f2006-07-12 19:54:51 +000016662006-07-12 Ulrich Drepper <drepper@redhat.com>
1667
1668 * cu.c: Adjust for internal_function_def removal.
1669 * dwfl_error.c: Likewise.
1670 * dwfl_module.c: Likewise.
1671 * dwfl_module_getdwarf.c: Likewise.
1672 * lines.c: Likewise.
1673 * relocate.c: Likewise.
1674
Ulrich Drepperc87b6e72006-07-11 22:32:28 +000016752006-07-11 Ulrich Drepper <drepper@redhat.com>
1676
1677 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
1678 it can overflow the return value type.
1679 Patch by Tim Moore <timoore@redhat.com>.
1680
Ulrich Dreppere1812e12006-07-12 07:46:03 +000016812006-06-28 Roland McGrath <roland@redhat.com>
1682
1683 * libdwfl.h: Cosmetic changes.
1684
1685 * dwfl_line_comp_dir.c: New file.
1686 * Makefile.am (libdwfl_a_SOURCES): Add it.
1687 * libdwfl.h: Declare dwfl_line_comp_dir.
1688
1689 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
1690
1691 * dwfl_linecu.c: New file.
1692 * Makefile.am (libdwfl_a_SOURCES): Add it.
1693 * libdwfl.h: Declare dwfl_linecu.
1694
1695 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
1696 (dwfl_linecu): Define as macro.
1697
1698 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
1699
1700 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
1701 (dwfl_module_addrname): Function moved ...
1702 * dwfl_module_addrname.c: ... here, new file.
1703 * dwfl_module_getsym.c: New file.
1704 * Makefile.am (libdwfl_a_SOURCES): Add them.
1705 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
1706 * libdwflP.h: Add INTDECLs.
1707
17082006-06-27 Roland McGrath <roland@redhat.com>
1709
1710 * dwfl_module.c (dwfl_report_end): Whitespace fix.
1711
Ulrich Drepperd5a75192006-06-15 03:07:46 +000017122006-06-13 Roland McGrath <roland@redhat.com>
1713
1714 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1715 Use __libdwfl_seterrno for elf_memory failure.
1716
Ulrich Dreppere1812e12006-07-12 07:46:03 +000017172006-05-22 Roland McGrath <roland@redhat.com>
1718
1719 * dwfl_module_return_value_location.c
1720 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
1721
Ulrich Drepper41cbd762006-05-27 18:19:23 +000017222006-05-27 Ulrich Drepper <drepper@redhat.com>
1723
1724 * libdwfl.h: Add extern "C".
1725
Ulrich Dreppere7a73172006-05-22 18:16:45 +000017262006-05-22 Ulrich Drepper <drepper@redhat.com>
1727
1728 * cu.c (addrarange): Handle files without aranges information.
1729
Ulrich Dreppera1690682006-05-17 05:28:36 +000017302006-05-16 Ulrich Drepper <drepper@redhat.com>
1731
1732 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
1733 ->modules is NULL.
1734
Roland McGrath687d7e92006-02-27 04:53:00 +000017352006-02-26 Roland McGrath <roland@redhat.com>
1736
Roland McGrath08333122006-02-27 04:54:26 +00001737 * dwfl_version.c: New file.
1738 * Makefile.am (libdwfl_a_SOURCES): Add it.
1739 * libdwfl.h: Declare dwfl_version.
1740
Roland McGrath687d7e92006-02-27 04:53:00 +00001741 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
1742 aligned up from DWFL->offline_next_address when checking for overlap.
1743
Roland McGrathfceb7b42005-12-23 01:45:21 +000017442005-12-22 Roland McGrath <roland@redhat.com>
1745
Roland McGrath1656bc02005-12-23 01:49:50 +00001746 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
1747
1748 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
1749 (dwfl_linux_proc_report): ... here. Call it.
1750 (dwfl_linux_proc_maps_report): New function.
1751 * libdwfl.h: Declare it.
1752 * libdwflP.h: Add INTDECL.
1753 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
1754
Roland McGrathfceb7b42005-12-23 01:45:21 +00001755 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
1756 failed with DWFL_E_NO_DWARF.
1757
Roland McGrath994b4892005-12-05 22:46:21 +000017582005-11-26 Roland McGrath <roland@redhat.com>
1759
1760 * dwfl_end.c (dwfl_end): Free the DWFL itself.
1761
17622005-11-25 Roland McGrath <roland@redhat.com>
1763
1764 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
1765 (load_dw): Use it.
1766 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
1767 * libdwflP.h: Declare it.
1768
1769 * dwfl_module_register_names.c: New file.
1770 * Makefile.am (libdwfl_a_SOURCES): Add it.
1771 * libdwfl.h: Declare dwfl_module_register_names.
1772
Roland McGratha5640892005-11-26 00:38:14 +000017732005-11-21 Roland McGrath <roland@redhat.com>
1774
1775 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1776 Don't leak malloc'd file name.
1777 If a /sys/.../sections file is missing and starts with ".init",
1778 try the variant with "_init" too; catches PPC64 kernel braindamage.
1779
Roland McGrathe47ab762005-11-17 03:16:00 +000017802005-11-15 Roland McGrath <roland@redhat.com>
1781
1782 * libdwfl.h: Comment fixes.
1783
1784 * dwfl_module_return_value_location.c: Add unlikely for error case.
1785
17862005-11-13 Roland McGrath <roland@redhat.com>
1787
1788 * dwfl_return_value_location.c: New file.
1789 * Makefile.am (libdwfl_a_SOURCES): Add it.
1790 * libdwfl.h: Declare dwfl_module_return_value_location.
1791 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
1792
Roland McGrath07d4f2f2005-10-28 06:56:24 +000017932005-10-20 Roland McGrath <roland@redhat.com>
1794
1795 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
1796 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
1797 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
1798
17992005-10-01 Roland McGrath <roland@redhat.com>
1800
1801 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
1802 with errno 0.
1803
18042005-09-19 Roland McGrath <roland@redhat.com>
1805
1806 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1807 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
1808 the signed integer reading; they will just have to be in hexadecimal.
1809 (dwfl_linux_kernel_module_section_address): Likewise.
1810
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000018112005-08-28 Ulrich Drepper <drepper@redhat.com>
1812
1813 * Makefile.am (%.os): Use COMPILE.os.
1814 (COMPILE.os): Filter out gconv options.
1815
Roland McGrath995f92d2005-08-26 05:55:04 +000018162005-08-25 Roland McGrath <roland@redhat.com>
1817
1818 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
1819 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
1820
Roland McGrath80e43a72005-08-24 21:12:15 +000018212005-08-24 Roland McGrath <roland@redhat.com>
1822
Roland McGrathefb5caa2005-08-25 01:49:53 +00001823 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
1824
Roland McGrath80e43a72005-08-24 21:12:15 +00001825 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
1826 magic initializer to set -heur-stack-bound option.
1827
Roland McGrath3712b282005-08-23 05:58:42 +000018282005-08-22 Roland McGrath <roland@redhat.com>
1829
Roland McGrathd17fac72005-08-23 08:20:21 +00001830 * dwfl_validate_address.c: New file.
1831 * Makefile.am (libdwfl_a_SOURCES): Add it.
1832 * libdwfl.h: Declare dwfl_validate_address.
1833
1834 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
1835 * libdwflP.h: Add INTDECL.
1836
Roland McGrath3712b282005-08-23 05:58:42 +00001837 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
1838 elf_rawdata for symbol-related sections.
1839
Roland McGrathd17fac72005-08-23 08:20:21 +00001840 * offline.c (dwfl_report_offline): Move offline_next_address outside
1841 module's range, in case it's an ET_EXEC using fixed segment locations.
1842 * libdwfl.h: Update comment.
1843
1844 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
1845 required alignment.
1846
18472005-08-20 Roland McGrath <roland@redhat.com>
1848
1849 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
1850 function to choose whether to report.
1851 (dwfl_linux_kernel_report_offline): Likewise.
1852 * libdwfl.h: Update decl.
1853 * argp-std.c (parse_opt): Update caller.
1854
1855 * dwfl_getsrclines.c: New file.
1856 * dwfl_onesrcline.c: New file.
1857 * Makefile.am (libdwfl_a_SOURCES): Add them.
1858 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
1859
1860 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
1861 MODULESDIR[0]. Call fts_close on failure.
1862
1863 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
1864 Close ET_REL file descriptors after relocation.
1865 (find_dw): Update caller.
1866 * offline.c (dwfl_report_offline): Get the file into memory and close
1867 the file descriptor.
1868
1869 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
1870 MOD->debug.elf is already set.
1871
1872 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
1873 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
1874
1875 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
1876 dwfl_linux_kernel_report_offline with offline_callbacks.
1877
1878 * linux-kernel-modules.c (report_kernel): New function, broken out of
1879 ...
1880 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1881 (dwfl_linux_kernel_report_offline): New function.
1882 * libdwfl.h: Declare it.
1883 * libdwflP.h: Add INTDECL.
1884
18852005-08-19 Roland McGrath <roland@redhat.com>
1886
1887 Use standard debuginfo search path to look for vmlinux.
1888 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
1889 passed zero.
1890 * linux-kernel-modules.c (try_kernel_name): New function, broken out
1891 of ...
1892 (dwfl_linux_kernel_report_kernel): ... here. Use it.
1893
1894 * argp-std.c (offline_callbacks): New variable.
1895 (parse_opt): Use it for -e. Allow multiple -e options.
1896
1897 * offline.c: New file.
1898 * Makefile.am (libdwfl_a_SOURCES): Add it.
1899 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
1900 * libdwflP.h: Add INTDECLs.
1901 (OFFLINE_REDZONE): New macro.
1902 (struct Dwfl): New member `offline_next_address'.
1903 * dwfl_begin.c (dwfl_begin): Initialize it.
1904 * dwfl_module.c (dwfl_report_begin): Likewise.
1905
1906 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
1907 do a nominal absolute section layout starting at BASE.
1908 * libdwfl.h: Update comment.
1909
19102005-08-18 Roland McGrath <roland@redhat.com>
1911
1912 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
1913 dwfl_module_getdwarf if necessary.
1914
1915 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
1916 * libdwfl.h: Update comment.
1917
1918 * derelocate.c: New file.
1919 * Makefile.am (libdwfl_a_SOURCES): Add it.
1920
1921 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
1922 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
1923 * dwfl_module_getdwarf.c (open_elf): Update initialization.
1924 (load_dw, dwfl_module_addrname): Update uses.
1925 * relocate.c (__libdwfl_relocate): Likewise.
1926
19272005-08-04 Roland McGrath <roland@redhat.com>
1928
1929 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
1930 arguments SHNDX, SHDR.
1931 (dwfl_linux_kernel_module_section_address): Update prototype.
1932 * relocate.c (__libdwfl_relocate_value): Update caller.
1933 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1934 Take the new arguments.
1935
Roland McGrathd2c59962005-08-10 22:13:57 +000019362005-08-10 Roland McGrath <roland@redhat.com>
1937
1938 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
1939 use it instead of MOD->debug.file.
1940 * libdwflP.h: Update decl.
1941 * dwfl_module_getdwarf.c (load_dw): Update caller.
1942 Fixes bug #165598.
1943
Roland McGrath4959bf82005-08-09 10:31:08 +000019442005-08-09 Roland McGrath <roland@redhat.com>
1945
1946 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
1947 * cu.c: Use INTUSE on dwarf_* calls.
1948 * dwfl_error.c: Likewise.
1949 * dwfl_module.c: Likewise.
1950 * dwfl_module_getdwarf.c: Likewise.
1951 * dwfl_module_getsrc_file.c: Likewise.
1952 * lines.c: Likewise.
1953
Roland McGrath5678f872005-08-07 21:42:56 +000019542005-08-07 Roland McGrath <roland@redhat.com>
1955
1956 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
1957 names contain '_' or '-', look for files named either "foo-bar.ko"
1958 or "foo_bar.ko".
1959
Roland McGrath83fcb482005-08-02 00:58:33 +000019602005-07-29 Roland McGrath <roland@redhat.com>
1961
1962 * loc2c.c: File removed.
1963 * loc2c.h: File removed.
1964 * loc2c-runtime.h: File removed.
1965 * test2.c: File removed.
1966 * Makefile.am (EXTRA_DIST): Variable removed.
1967 (noinst_HEADERS): Remove loc2c.h from here.
1968
Ulrich Drepper18618fd2005-07-28 21:29:22 +000019692005-07-28 Ulrich Drepper <drepper@redhat.com>
1970
Ulrich Drepper4d527362005-07-28 22:32:58 +00001971 * libdwfl.h: Add a few missing extern for function prototypes.
1972
Ulrich Drepper18618fd2005-07-28 21:29:22 +00001973 * libdwfl_crc32.c: New file.
1974 * libdwfl_crc32_file.c: New file.
1975 * libdwflP.h: Declare the new functions.
1976 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
1977 libdwfl_crc32_file.c.
1978 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
1979 instead of crc32_file.
1980
Roland McGrathd89bbe42005-07-28 07:08:01 +000019812005-07-28 Roland McGrath <roland@redhat.com>
1982
Roland McGrath244501f2005-07-28 09:15:47 +00001983 * ptest.c: Moved to ../tests/dwflmodtest.c.
1984
Roland McGrath18385902005-07-28 07:12:38 +00001985 * Makefile.am (noinst_PROGRAMS): Variable removed.
1986 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
1987 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
1988 (libdwfl): Don't use libdwfl.so any more.
1989 (libdwfl.so, install, uninstall): Targets removed.
1990 (test2_SOURCES): Define EXTRA_DIST instead of this.
1991 * libdwfl.map: File removed.
1992
Roland McGrathd89bbe42005-07-28 07:08:01 +00001993 * libdwfl.h: Use "" for libdw.h #include.
1994
Roland McGrath5bab2442005-07-28 00:44:29 +000019952005-07-27 Roland McGrath <roland@redhat.com>
1996
1997 * libdwfl.map: Add dwfl_getmodules.
1998
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000019992005-07-23 Ulrich Drepper <drepper@redhat.com>
2000
2001 * Makefile.am: Fix rules to allow building with mudflap.
2002
20032005-07-21 Roland McGrath <roland@redhat.com>
2004
2005 * Makefile.am (noinst_HEADERS): Add loc2c.c.
2006
2007 * test2.c (main): Check sscanf result to quiet warning.
2008
20092005-07-20 Roland McGrath <roland@redhat.com>
2010
2011 * libdwfl-branch merged, creating this direcotry.