blob: 36585765ce92e8939aa67885169a58f9fdddace1 [file] [log] [blame]
Mark Wielaard4a330f62014-12-14 00:09:29 +010012014-12-13 Mark Wielaard <mjw@redhat.com>
2
Mark Wielaardc8a02732014-12-13 22:23:45 +01003 * dwfl_module_getdwarf.c (find_dynsym): elf_getdata_rawchunk takes
4 a size_t, make sure it doesn't overflow.
5
62014-12-13 Mark Wielaard <mjw@redhat.com>
7
Mark Wielaard4a330f62014-12-14 00:09:29 +01008 * cu.c (cudie_offset): Make sure Dwarf_Off difference doesn't
9 wrap around before returning as int.
10
Josh Stone7d9b5ac2014-12-11 16:23:46 -0800112014-12-11 Josh Stone <jistone@redhat.com>
12
13 * dwfl_module_getsrc.c (dwfl_module_getsrc): Return the *last* line
14 record <= addr, rather than returning immediately on matches.
15
Mark Wielaarde2bde252014-12-09 13:16:23 +0100162014-12-09 Mark Wielaard <mjw@redhat.com>
17
18 * dwfl_segment_report_module.c (handle_file_note): Check count doesn't
19 overflow.
20
Mark Wielaard27304cb2014-12-07 20:26:56 +0100212014-12-07 Mark Wielaard <mjw@redhat.com>
22
Mark Wielaardcdd0c002014-12-07 20:48:43 +010023 * relocate.c (relocate_section): Sanity check section overlap against
24 actually used ehsize, shentsize and phentsize.
25
262014-12-07 Mark Wielaard <mjw@redhat.com>
27
Mark Wielaard27304cb2014-12-07 20:26:56 +010028 * offline.c (dwfl_offline_section_address): Assert shndx is not zero.
29 * relocate.c (__libdwfl_relocate_value): Don't relocate against
30 section zero.
31
Mark Wielaard99581b62014-11-29 20:23:30 +0100322014-11-29 Mark Wielaard <mjw@redhat.com>
33
34 * relocate.c (relocate_section): Check relocation section and target
35 section data don't overlap any of the ELF headers.
36 (relocate): Check for offset + size overflow.
37
Mark Wielaard712c8fa2014-11-22 23:08:48 +0100382014-11-22 Mark Wielaard <mjw@redhat.com>
39
40 * link_map.c (consider_executable): Use elf_getphdrnum.
41 (dwfl_link_map_report): Likewise.
42
Mark Wielaard86b0b132014-11-18 10:07:10 +0100432014-11-18 Mark Wielaard <mjw@redhat.com>
44
45 * dwfl_module_getdwarf.c (find_symtab): Sanity check the data buffer,
46 number of symbols and first_global before use.
47
Mark Wielaarddf5ad162014-11-14 12:38:12 +0100482014-11-14 Mark Wielaard <mjw@redhat.com>
49
50 * dwfl_module_getdwarf.c (load_symtab): Don't use tables which have
51 a zero sh_entsize.
52
Mark Wielaard5691f862014-11-10 14:49:20 +0100532014-11-10 Mark Wielaard <mjw@redhat.com>
54
55 * dwfl_module_getdwarf.c (find_dynsym): New inner function
56 translate_offs that takes an adjust argument. Try finding
57 the symbol table with and without adjusting to main_bias.
58
Jan Kratochvil6d48bbf2014-09-26 22:42:19 +0200592014-09-26 Jan Kratochvil <jan.kratochvil@redhat.com>
60
61 Support NT_FILE for locating files.
62 * core-file.c (dwfl_core_file_report): New variables note_file and
63 note_file_size, set them and pass them to dwfl_segment_report_module.
64 * dwfl_segment_report_module.c: Include common.h and fcntl.h.
65 (buf_has_data, buf_read_ulong, handle_file_note): New functions.
66 (invalid_elf): New function from code of dwfl_segment_report_module.
67 (dwfl_segment_report_module): Add parameters note_file and
68 note_file_size. New variables elf and fd, clean them up in finish.
69 Move some code to invalid_elf. Call handle_file_note, if it found
70 a name verify the file by invalid_elf. Protect elf and fd against
71 cleanup by finish if we found the file for new Dwfl_Module.
72 * libdwflP.h (dwfl_segment_report_module): Add parameters note_file and
73 note_file_size.
74
Mark Wielaardff61cf12014-09-23 21:31:42 +0200752014-09-23 Mark Wielaard <mjw@redhat.com>
76
77 * dwfl_segment_report_module.c (dwfl_segment_report_module):
78 Extract ei_class, ei_data and e_type early and use the result.
79
Jan Kratochvil6097c002014-09-09 22:58:26 +0200802014-09-18 Jan Kratochvil <jan.kratochvil@redhat.com>
81
82 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Use IS_EXECUTABLE.
83 * dwfl_segment_report_module.c (dwfl_segment_report_module): Set
84 IS_EXECUTABLE.
85 * libdwflP.h (struct Dwfl_Module): New field is_executable.
86
Jan Kratochvil03750562014-08-17 18:49:36 +0200872014-08-28 Jan Kratochvil <jan.kratochvil@redhat.com>
88
89 * dwfl_module_getdwarf.c (find_offsets): Add parameter main_bias, use
90 it.
91 (find_dynsym): Pass the new parameter main_bias.
92
Mark Wielaard9d29ed22014-08-14 22:07:44 +0200932014-08-14 Mark Wielaard <mjw@redhat.com>
94
95 * linux-kernel-modules.c (check-suffix): Also TRY .ko.xz.
96
Jan Kratochvil475849f2014-07-24 20:47:17 +0200972014-07-24 Jan Kratochvil <jan.kratochvil@redhat.com>
98
99 Fix report_r_debug for prelinked libraries.
100 * link_map.c (report_r_debug): Comment out variable l_addr.
101 Use instead new variable base recalculated from l_ld.
102
Kurt Roeckxa7a38552014-06-24 22:08:36 +02001032014-06-24 Kurt Roeckx <kurt@roeckx.be>
104
105 * linux-pid-attach.c: Make it build on non linux hosts.
106
Mark Wielaardc1c1c062014-06-14 17:15:37 +02001072014-06-17 Mark Wielaard <mjw@redhat.com>
108
109 * frame_unwind.c (handle_cfi): Use ebl_func_addr_mask.
110 * dwfl_module_getsym.c (__libdwfl_getsym): Likewise.
111
Mark Wielaardfb863872014-06-15 22:14:04 +02001122014-06-15 Mark Wielaard <mjw@redhat.com>
113
114 * linux-core-attach.c (core_memory_read): Use libdw/memory-access.h
115 macros read_4ubyte_unaligned_noncvt and read_8ubyte_unaligned_noncvt
116 to read possibly unaligned data.
117 (core_next_thread): Likewise.
118 (core_set_initial_registers): Likewise.
119 (dwfl_core_file_attach): Likewise.
120
Mark Wielaard14beac32014-06-11 15:14:23 +02001212014-06-11 Mark Wielaard <mjw@redhat.com>
122
123 * dwfl_frame.c (__libdwfl_process_free): Reset dwfl->attacherr.
124 (dwfl_attach_state): Set dwfl->attacherr.
125 (dwfl_pid): Check and return dwfl->attacherr if set.
126 (dwfl_getthreads): Likewise.
127 (getthread): Likewise.
128 * libdwflP.h: Add DWFL_E_NO_CORE_FILE.
129 (struct Dwfl): Add attacherr field.
130 * linux-core-attach.c (dwfl_core_file_attach): Set dwfl->attacherr.
131 Don't assert if ELF file is not ET_CORE, just return error.
132 * linux-pid-attach.c (dwfl_linux_proc_attach): Set dwfl->attacherr.
133
Mark Wielaard824f3932014-06-10 15:09:23 +02001342014-06-10 Mark Wielaard <mjw@redhat.com>
135
136 * argp-std.c (parse_opt): Ignore errors from dwfl_core_file_attach
137 or dwfl_linux_proc_attach.
138
Mark Wielaard0f5b6322014-05-15 16:03:59 +02001392014-05-15 Mark Wielaard <mjw@redhat.com>
140
141 * linux-proc-maps.c (grovel_auxv): Close fd on error.
142
Mark Wielaardbb096d02014-05-03 00:23:06 +02001432014-05-02 Mark Wielaard <mjw@redhat.com>
144
145 * dwfl_module_getdwarf: Remove ENABLE_DWZ ifdefs so find_debug_altlink
146 is always called.
147
Mark Wielaarddf85bf92014-05-01 14:48:27 +02001482014-05-01 Mark Wielaard <mjw@redhat.com>
149
150 * libdwflP.h (struct Dwfl_Module): Add alt, alt_fd and alt_elf fields.
151 (__libdwfl_open_mod_by_build_id): Renamed __libdwfl_open_by_build_id.
152 (__libdwfl_open_by_build_id): New declaration that takes an explicit
153 build-id.
154 * dwfl_build_id_find_debuginfo.c (dwfl_build_id_find_debuginfo): If
155 we already have the Dwarf then look for the alt dwz multi file by
156 build-id.
157 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Add the
158 build-id we are looking for as argument.
159 (__libdwfl_open_mod_by_build_id): New function, calls
160 __libdwfl_open_by_build_id.
161 (dwfl_build_id_find_elf): Call __libdwfl_open_mod_by_build_id.
162 * dwfl_module.c (__libdwfl_module_free): Release alt, alt_elf and
163 close alt_fd if necessary.
164 * dwfl_module_getdwarf.c (__check_build_id): Removed.
165 (try_debugaltlink): Removed.
166 (open_debugaltlink): Removed.
167 (open_elf_file): First half of open_elf that just opens the elf
168 file but doesn't setup the load address.
169 (open_elf): Call open_elf_file.
170 (find_debug_altlink): New function.
171 (load_dw): Remove loading of dwz multifile.
172 (find_dw): Call find_debug_altlink.
173 * find-debuginfo.c (validate): Handle alt debug case using
174 dwelf_dwarf_gnu_debugaltlink and mod->alt_elf.
175 (find_debuginfo_in_path): Handle alt debug files possibly in .dwz
176 subdirs.
177 * linux-kernel-modules.c (try_kernel_name): Use fakemod.debug.name
178 to store name to find by dwfl_standard_find_debuginfo instead of
179 allocating an extra variable on stack.
180
Mark Wielaardd81d32d2014-04-30 23:00:40 +02001812014-04-30 Mark Wielaard <mjw@redhat.com>
182
183 * dwfl_module_build_id.c (__libdwfl_find_elf_build_id): Moved to
184 dwelf_elf_gnu_build_id.c.
185 (__libdwfl_find_build_id): Add assert to make sure mod is never NULL.
186 * dwfl_segment_report_module.c (dwfl_segment_report_module): Call
187 dwelf_elf_gnu_build_id directly instead of __libdwfl_find_build_id.
188 * dwfl_module_getdwarf.c (__check_build_id): Implement using
189 dwelf_elf_gnu_build_id.
190
Florian Weimer920f03d2014-04-15 17:11:17 +02001912014-04-15 Florian Weimer <fweimer@redhat.com>
192
193 * dwfl_module_getdwarf.c (__check_build_id): Moved from libdw.
194 (try_debugaltlink): Likewise.
195 (open_debugaltlink): Likewise.
196 (load_dw): Locate alternate debug information using
197 dwelf_dwarf_gnu_debugaltlink and call open_debugaltlink.
198
Mark Wielaard93802972014-04-11 23:52:47 +02001992014-04-11 Mark Wielaard <mjw@redhat.com>
200
201 * Makefile.am (AM_CPPFLAGS): Add libdwelf.
202 * libdwflP.h: Include libdwelfP.h.
203 * dwfl_module_getdwarf.c (find_debuglink): Moved to libdwelf.
204 (find_debuginfo): Use dwelf_elf_gnu_debuglink.
205
Mark Wielaard740d1fe2014-04-22 22:52:06 +02002062014-04-22 Mark Wielaard <mjw@redhat.com>
207
208 * frame_unwind.c (__libdwfl_frame_reg_get): Use uint64_t when
209 checking bits.
210 (__libdwfl_frame_reg_set): Likewise.
211
Kurt Roeckx02cefda2014-04-22 21:46:22 +02002122014-04-22 Kurt Roeckx <kurt@roeckx.be>
213
214 * linux-pid-attach.c: Make linux only.
215
Mark Wielaard32324792014-04-13 17:39:57 +02002162014-03-14 Mark Wielaard <mjw@redhat.com>
217
218 * Makefile.am: Remove !MUDFLAP and MUDFLAP conditions.
219 Remove libelf and libdw definitions when MUDFLAP is defined.
220 * argp-std.c (__libdwfl_argp_mudflap_options): Removed.
221
Mark Wielaarddd64d4a2014-03-03 15:07:31 +01002222014-03-03 Mark Wielaard <mjw@redhat.com>
223
224 * elf-from-memory.c (elf_from_remote_memory): Keep track of
225 segments_end_mem. Pass memsz to first handle_segment pass. Only
226 extend contents_size and use shdrs if only file bits are in
227 segment.
228
Josh Stone65cefbd2014-03-11 10:19:28 -07002292014-03-11 Josh Stone <jistone@redhat.com>
230
231 * dwfl_module_getdwarf.c (open_elf): Only explicitly set
232 mod->e_type when processing the main ELF file.
233
Mark Wielaard4b9e1432014-03-04 11:27:15 +01002342014-03-04 Mark Wielaard <mjw@redhat.com>
235
236 * libdwflP.h (struct __libdwfl_pid_arg): Moved here and renamed from
237 linux-pid-attach.c (struct pid_arg).
238 (__libdwfl_get_pid_arg): New internal function declaration.
239 (__libdwfl_ptrace_attach): Likewise.
240 (__libdwfl_ptrace_detach): Likewise.
241 * dwfl_frame.c (dwfl_attach_state): Add "(deleted)" files to the
242 special exception modules that cannot be checked at this point.
243 * linux-pid-attach.c (struct pid_arg): Moved to libdwflP.h
244 (ptrace_attach): Renamed to...
245 (__libdwfl_ptrace_attach): New internal function.
246 (__libdwfl_ptrace_detach): Likewise. Extracted from ...
247 (pid_thread_detach): Call __libdwfl_ptrace_detach now.
248 (__libdwfl_get_pid_arg): New internal function.
249 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Check if special
250 module name contains "(deleted)" and dwfl_pid gives an attached
251 pid. If pid is set and try to (re)use ptrace attach state of
252 process before reading memory.
253
Mark Wielaardf15bcda2014-03-03 11:43:43 +01002542014-03-03 Mark Wielaard <mjw@redhat.com>
255
256 * elf-from-memory.c (elf_from_remote_memory): Take pagesize as
257 argument. Free buffer when detecting bad elf. Check PT_LOAD
258 alignment requirements on first handle_segment pass. Calculate
259 loadbase, start and end of segment using pagesize, not p_align.
260 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Provide pagesize
261 to elf_from_remote_memory.
262
Mark Wielaard48827ec2014-02-26 17:17:07 +01002632014-02-26 Mark Wielaard <mjw@redhat.com>
264
Mark Wielaard8f4402f2014-02-26 17:00:39 +0100265 * linux-proc-maps.c (proc_maps_report): Don't assert on bad input.
266
2672014-02-26 Mark Wielaard <mjw@redhat.com>
268
Mark Wielaard48827ec2014-02-26 17:17:07 +0100269 * elf-from-memory.c (elf_from_remote_memory): Check against p64
270 p_type in case ELFCLASS64, not against p32 p_type.
271
Petr Machataced66872014-01-17 17:00:12 +01002722014-01-17 Petr Machata <pmachata@redhat.com>
273
274 * relocate.c (relocate_section): Use gelf_fsize instead of relying
275 on shdr->sh_entsize.
276
Mark Wielaard27aae182014-01-05 20:37:30 +01002772014-01-05 Mark Wielaard <mjw@redhat.com>
278
279 * frame_unwind.c (handle_cfi): Only skip resetting return register
280 if the regno is not the actual CIE return address register.
281
Mark Wielaard68de4422014-01-02 21:17:18 +01002822014-01-02 Mark Wielaard <mjw@redhat.com>
283
284 * linux-pid-attach.c (dwfl_linux_proc_attach): Use strtol, not atoi.
285
Mark Wielaard19108012013-12-30 22:00:57 +01002862013-12-30 Mark Wielaard <mjw@redhat.com>
287
288 * argp-std.c (parse_opt): Call dwfl_linux_proc_attach and
289 dwfl_core_file_attach explicitly.
290 * core-file.c (dwfl_core_file_report): Don't call
291 __libdwfl_attach_state_for_core implicitly.
292 * dwfl_begin.c (dwfl_begin): Remove setting of process_attach_error.
293 * dwfl_frame.c (dwfl_pid): Set errno to DWFL_E_NO_ATTACH_STATE, not
294 process_attach_error.
295 (dwfl_getthreads): Likewise.
296 (getthread): Likewise.
297 * libdwfl.h (dwfl_core_file_report): Update documentation.
298 (dwfl_linux_proc_report): Likewise.
299 (dwfl_core_file_attach): New function declaration.
300 (dwfl_linux_proc_attach): Likewise.
301 * libdwflP.h (struct Dwfl): Remove process_attach_error.
302 (__libdwfl_attach_state_for_pid): Removed declaration.
303 (__libdwfl_attach_state_for_core): Likewise.
304 (dwfl_core_file_attach): New internal declaration.
305 (dwfl_linux_proc_attach): Likewise.
306 (attach_state_for_core): Renamed to...
307 (dwfl_core_file_attach): ...this. Change return type.
308 (__libdwfl_attach_state_for_core): Removed.
309 * linux-pid-attach.c (struct pid_arg): Add assume_ptrace_stopped.
310 (pid_set_initial_registers): Check assume_ptrace_stopped before
311 calling ptrace.
312 (pid_thread_detach): Likewise.
313 (__libdwfl_attach_state_for_pid): Renamed to...
314 (dwfl_linux_proc_attach): ...this. Adjust return type.
315 * linux-proc-maps.c (dwfl_linux_proc_report): Don't call
316 __libdwfl_attach_state_for_pid implicitly.
317
Mark Wielaardac652612013-12-28 12:58:10 +01003182013-12-28 Mark Wielaard <mjw@redhat.com>
319
320 * linux-proc-maps.c (dwfl_linux_proc_find_elf): Don't return special
321 character device files, only regular files.
322
Mark Wielaard05a44122013-12-24 10:37:58 +01003232013-12-24 Mark Wielaard <mjw@redhat.com>
324
325 * linux-core-attach.c (core_next_thread): Check whether thread_argp
326 is NULL. Reset core_arg->thread_note_offset and malloc a thread_arg
327 in that case. Free thread_arg if there are no more threads.
328
Mark Wielaard97bbf9b2013-12-23 14:20:06 +01003292013-12-23 Mark Wielaard <mjw@redhat.com>
330
Mark Wielaardb20ca0b2013-12-23 23:21:59 +0100331 * dwfl_segment_report_module.c (dwfl_segment_report_module): Free
332 build_id before returning early.
333
3342013-12-23 Mark Wielaard <mjw@redhat.com>
335
Mark Wielaard97bbf9b2013-12-23 14:20:06 +0100336 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Report actual
337 pid (thread group leader) to dwfl_attach_state.
338
Mark Wielaard3e98ab72013-12-21 21:56:35 +01003392013-12-21 Mark Wielaard <mjw@redhat.com>
340
341 * frame_unwind.c (handle_cfi): Track whether the return register
342 has been set and only allow it to be set once.
343
Mark Wielaard641a4f62013-12-21 00:04:21 +01003442013-12-20 Mark Wielaard <mjw@redhat.com>
345
Mark Wielaarde962ec32013-12-20 10:09:12 +0100346 * dwfl_frame.c (one_arg): New struct.
347 (get_one_thread_cb): New function.
348 (dwfl_getthread): Likewise.
349 (one_thread): New struct.
350 (get_one_thread_frames_cb): New function.
351 (dwfl_getthread_frames): Likewise.
352 * libdwfl.h (Dwfl_Thread_Callbacks): Add get_thread function.
353 (dwfl_getthread_frames): Likewise.
354 * libdwflP.h (dwfl_getthread_frames): New internal function declaration.
355 * linux-core-attach.c (core_thread_callbacks): Initialize get_thread
356 to NULL.
357 * linux-pid-attach.c (pid_getthread): New function.
358 (pid_thread_callbacks): Initialize get_thread to pid_getthread.
359
3602013-12-20 Mark Wielaard <mjw@redhat.com>
361
Mark Wielaard641a4f62013-12-21 00:04:21 +0100362 * linux-kernel-modules.c (report_kernel_archive): Correct nested
363 asprintf result check for debug.a.
364
Mark Wielaard159ac522013-12-18 11:05:54 +01003652013-12-18 Mark Wielaard <mjw@redhat.com>
366
367 * derelocate.c (__libdwfl_find_section_ndx): New internal function.
368 * dwfl_module_addrname.c (dwfl_module_addrname): Use
369 dwfl_module_addrinfo.
370 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Replace with...
371 (__libdwfl_addrsym): ...this. Use __libdwfl_getsym, use value
372 for comparisons, not st_value. Fill in off. Search for both value
373 and the (adjusted) sym.st_value when different.
374 (dwfl_module_addrsym): Implement using __libdwfl_addrsym.
375 (dwfl_module_addrinfo): New function.
376 * dwfl_module_getsym.c (dwfl_module_getsym_elf): Replace with...
377 (__libdwfl_getsym): ...this. Use ebl_resolve_sym_value if requested
378 and possible. Adjust sym->st_value only when requested. Fill in addr
379 if available.
380 (dwfl_module_getsym_info): New function.
381 (dwfl_module_getsym): Use __libdwfl_getsym.
382 * libdwfl.h (dwfl_module_getsym_elf): Removed.
383 (dwfl_module_getsym_info): New function declaration.
384 (dwfl_module_addrinfo): Likewise.
385 (dwfl_module_addrsym): Add documentation describing differences
386 with addrinfo variants.
387 (dwfl_module_addrsym_elf): Removed.
388 * libdwflP.h (__libdwfl_getsym): New internal function declaration.
389 (__libdwfl_addrsym): Likewise.
390 (__libdwfl_find_section_ndx): Likewise.
391 (dwfl_module_addrinfo): New internal declaration.
392 (dwfl_module_getsym_info): Likewise.
393 (dwfl_module_addrsym_elf): Removed.
394 (dwfl_module_getsym_elf): Likewise.
395
Jan Kratochvilc6a41482013-12-17 18:49:54 +01003962013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
397
Jan Kratochvilc5309462013-12-18 15:02:19 +0100398 * argp-std.c (offline_find_elf): Remove.
399 (offline_callbacks): Use dwfl_build_id_find_elf instead.
400 * dwfl_build_id_find_elf.c (dwfl_build_id_find_elf): Move here the code
401 removed above.
402
4032013-12-18 Jan Kratochvil <jan.kratochvil@redhat.com>
404
Jan Kratochvilc6a41482013-12-17 18:49:54 +0100405 unwinder: s390 and s390x
406 * dwfl_frame_pc.c (dwfl_frame_pc): Call ebl_normalize_pc.
407 * frame_unwind.c (new_unwound): New function from ...
408 (handle_cfi): ... here. Call it.
409 (setfunc, getfunc, readfunc): New functions.
410 (__libdwfl_frame_unwind): Call ebl_unwind with those functions.
411 * linux-core-attach.c (core_set_initial_registers): Always iterate
412 through the Ebl_Register_Location loop. Call
413 dwfl_thread_state_register_pc there.
414
Jan Kratochvil6cd283c2013-12-17 18:17:32 +01004152013-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
416
417 * frame_unwind.c (handle_cfi): Call ebl_dwarf_to_regno for RA.
418
Mark Wielaardc76b2ff2013-12-17 10:37:29 +01004192013-12-17 Mark Wielaard <mjw@redhat.com>
420
421 * linux-pid-attach.c (pid_next_thread): Call rewinddir on first
422 traversal.
423
Mark Wielaard14c2d9e2013-12-16 13:28:59 +01004242013-12-16 Mark Wielaard <mjw@redhat.com>
425
426 * libdwfl.h (dwfl_module_getsymtab_first_global): New function
427 definition.
428 * dwfl_module_getdwarf.c (dwfl_module_getsymtab_first_global): New
429 function.
430 * libdwflP.h (dwfl_module_getsymtab_first_global): New internal
431 function definition.
432 * dwfl_module_addrsym.c (dwfl_module_addrsym_elf): Use new function.
433
Mark Wielaarde6e6cc82013-12-14 15:02:56 +01004342013-12-14 Mark Wielaard <mjw@redhat.com>
435
436 * dwfl_module.c (__libdwfl_module_free): Free mod->reloc_info if
437 allocated. Call dwarf_cfi_end on mod->eh_cfi if necessary.
438 * frame_unwind.c (handle_cfi): Free frame result from
439 dwarf_cfi_addrframe when done.
440
Jan Kratochvil5cbf42a2013-12-15 18:56:17 +01004412013-12-15 Jan Kratochvil <jan.kratochvil@redhat.com>
442
443 unwinder: ppc and ppc64
444 * frame_unwind.c (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set):
445 Call ebl_dwarf_to_regno.
446 * linux-core-attach.c (core_set_initial_registers): Implement
447 pc_register support.
448 * linux-pid-attach.c (pid_thread_state_registers_cb): Implement
449 FIRSTREG -1.
450
Jan Kratochvil5ef96c92013-11-30 21:40:29 +01004512013-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
452
453 Introduce process_attach_error.
454 * dwfl_begin.c (dwfl_begin): Initialize process_attach_error.
455 * dwfl_frame.c (dwfl_pid, dwfl_getthreads): Use PROCESS_ATTACH_ERROR if
456 PROCESS is NULL.
457 * libdwflP.h (struct Dwfl): New field process_attach_error.
458 * linux-core-attach.c (__libdwfl_attach_state_for_core): Rename to ...
459 (attach_state_for_core): ... here, make it static, change return type,
460 no longer use __libdwfl_seterrno.
461 (__libdwfl_attach_state_for_core): New wrapper for it.
462
Mark Wielaard819c3492013-11-27 16:45:44 +01004632013-11-27 Mark Wielaard <mjw@redhat.com>
464
465 * dwfl_module_addrsym.c (dwfl_module_addrsym): Rename to and call...
466 (dwfl_module_addrsym_elf): this. Add elfp and biasp arguments,
467 keep track of symelf, addr_symelf, closest_elf and sizeless_elf
468 instead of tracking dwfl_files.
469 * dwfl_module_getsym.c (__libdwfl_module_getsym): Renamed to...
470 (dwfl_module_getsym_elf): ...this. Remove dwfl_file argument, add
471 new elfp and biasp arguments. Track elf instead of file.
472 (dwfl_module_getsym): Call dwfl_module_getsym_elf.
473 dwfl_module_info.c (dwfl_module_info): Pass elf to
474 dwfl_adjusted_st_value.
475 * libdwfl.h (dwfl_module_getsym): Document limitations of shndx.
476 (dwfl_module_getsym_elf): New function declaration.
477 (dwfl_module_addrsym_elf): Likewise.
478 * libdwflP.h (dwfl_module_addrsym_elf): INTDECL.
479 (dwfl_module_getsym_elf): Likewise.
480 (dwfl_adjusted_st_value): Take and check elf not dwfl_file.
481 (dwfl_deadjust_st_value): Likewise.
482 (__libdwfl_module_getsym): Removed.
483 * relocate.c (resolve_symbol): Pass elf to dwfl_adjusted_st_value.
484
Jan Kratochvil463e9832013-11-21 15:28:02 +01004852013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
486
Jan Kratochvil99a29492013-11-21 15:33:22 +0100487 Fix non-build-id core files on build-id system.
488 * link_map.c (report_r_debug): Remove valid clearing if build-id cannot
489 be read from memory.
490
4912013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
492
Jan Kratochvilb301c2e2013-11-21 15:31:04 +0100493 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
494 variable close_elf. Call __libdwfl_find_elf_build_id and compare the
495 content, if possible.
496
4972013-11-21 Jan Kratochvil <jan.kratochvil@redhat.com>
498
Jan Kratochvil463e9832013-11-21 15:28:02 +0100499 link_map: Use proper bias, not l_addr.
500 * core-file.c (dynamic_vaddr_get): Rename to ...
501 (__libdwfl_dynamic_vaddr_get): ... here, make it global,
502 internal_function.
503 (dwfl_core_file_report): Update name in the caller.
504 * libdwflP.h (__libdwfl_dynamic_vaddr_get): New declaration.
505 * link_map.c (report_r_debug): New variable elf_dynamic_vaddr. Call
506 __libdwfl_dynamic_vaddr_get for it. Remove L_ADDR FIXME comment.
507 Use ELF_DYNAMIC_VADDR instead of L_ADDR.
508
Jan Kratochvil10d7a392013-11-19 15:00:15 +01005092013-11-19 Jan Kratochvil <jan.kratochvil@redhat.com>
510
511 Compatibility with older kernels such as RHEL-6.
512 * linux-pid-attach.c (struct pid_arg): New field tid_was_stopped.
513 (ptrace_attach): New parameter tid_was_stoppedp. Set it.
514 (pid_set_initial_registers): Pass tid_was_stopped.
515 (pid_thread_detach): Use tid_was_stopped.
516
Josh Stonedb35c872013-11-18 14:29:35 -08005172013-11-18 Josh Stone <jistone@redhat.com>
518
519 * dwfl_module_getdwarf.c (find_aux_address_sync): New function.
520 (find_aux_sym): Use it.
521
Jan Kratochviled782372013-11-14 20:53:20 +01005222013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
523
Jan Kratochvil1c1a53b2013-11-14 20:55:41 +0100524 Code cleanup: Remove const in prototype
525 * dwfl_frame_regs.c (dwfl_thread_state_registers): Remove const from
526 firstreg.
527 * libdwfl.h (dwfl_thread_state_registers): Likewise.
528 * linux-pid-attach.c (pid_thread_state_registers_cb): Likewise.
529
5302013-11-14 Jan Kratochvil <jan.kratochvil@redhat.com>
531
Jan Kratochviled782372013-11-14 20:53:20 +0100532 Fix dwfl_attach_state machine->elf.
533 * dwfl_frame.c (dwfl_attach_state): Change parameter machine to elf.
534 Call ebl_openbackend instead of ebl_openbackend_machine.
535 * libdwfl.h (dwfl_attach_state): Change parameter machine to elf.
536 Update the function description.
537 * linux-core-attach.c (__libdwfl_attach_state_for_core): Pass CORE to
538 dwfl_attach_state.
539 * linux-pid-attach.c (__libdwfl_attach_state_for_pid): Pass NULL to
540 dwfl_attach_state.
541
Jan Kratochvil954a7b02013-11-13 20:00:56 +01005422013-11-06 Jan Kratochvil <jan.kratochvil@redhat.com>
543
544 Provide __libdwfl_module_getsym to get dwfl_file *.
545 * dwfl_module_addrsym.c (dwfl_module_addrsym) (i_to_symfile): Remove.
546 (dwfl_module_addrsym) (search_table): New variable file. Use
547 __libdwfl_module_getsym. Use file.
548 * dwfl_module_getsym.c (dwfl_module_getsym): Rename to ...
549 (__libdwfl_module_getsym): ... here. Add parameter filep. Set it.
550 (dwfl_module_getsym): New wrapper.
551 * libdwflP.h (__libdwfl_module_getsym): New declaration.
552
Jan Kratochvil5dca2b62013-11-13 19:58:06 +01005532013-11-13 Jan Kratochvil <jan.kratochvil@redhat.com>
554
555 Fix dwfl_module_addrsym for minidebuginfo.
556 * dwfl_module_addrsym.c (dwfl_module_addrsym): New variable
557 addr_symfile.
558 (dwfl_module_addrsym) (same_section): Use it.
559 (dwfl_module_addrsym) (i_to_symfile): New function.
560 (dwfl_module_addrsym) (search_table): Use it.
561
Jan Kratochvil21783b52013-11-07 16:34:58 +01005622013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil0b867462013-05-30 14:37:38 +0200563 Mark Wielaard <mjw@redhat.com>
564
565 * Makefile.am (libdwfl_a_SOURCES): Add dwfl_frame.c, frame_unwind.c,
566 dwfl_frame_pc.c, linux-pid-attach.c, linux-core-attach.c and
567 dwfl_frame_regs.c.
568 * core-file.c (dwfl_core_file_report): Call
569 __libdwfl_attach_state_for_core.
570 * dwfl_end.c (dwfl_end): Call __libdwfl_process_free.
571 * dwfl_frame.c: New file.
572 * frame_unwind.c: New file.
573 * dwfl_frame_pc.c: New file.
574 * linux-pid-attach.c: New file.
575 * linux-core-attach.c: New file.
576 * dwfl_frame_regs.c: New file.
577 * libdwfl.h (Dwfl_Thread, Dwfl_Frame): New typedefs.
578 (dwfl_core_file_report, dwfl_linux_proc_report): Extend comments.
579 (Dwfl_Thread_Callbacks): New definition.
580 (struct ebl, dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl)
581 (dwfl_thread_tid, dwfl_frame_thread, dwfl_thread_state_registers)
582 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
583 (dwfl_frame_pc): New declarations.
584 * libdwflP.h (Dwfl_Process): New typedef.
585 (LIBEBL_BAD, CORE_MISSING, INVALID_REGISTER, PROCESS_MEMORY_READ)
586 (PROCESS_NO_ARCH, PARSE_PROC, INVALID_DWARF, UNSUPPORTED_DWARF)
587 (NEXT_THREAD_FAIL, ATTACH_STATE_CONFLICT, NO_ATTACH_STATE, NO_UNWIND)
588 (INVALID_ARGUMENT): New DWFL_ERROR entries.
589 (struct Dwfl): New entry process.
590 (struct Dwfl_Process, struct Dwfl_Thread, struct Dwfl_Frame)
591 (__libdwfl_frame_reg_get, __libdwfl_frame_reg_set)
592 (__libdwfl_process_free, __libdwfl_frame_unwind)
593 (__libdwfl_attach_state_for_pid, __libdwfl_attach_state_for_core)
594 (__libdwfl_segment_start, __libdwfl_segment_end): New declarations.
595 (dwfl_attach_state, dwfl_pid, dwfl_thread_dwfl, dwfl_thread_tid)
596 (dwfl_frame_thread, dwfl_thread_state_registers)
597 (dwfl_thread_state_register_pc, dwfl_getthreads, dwfl_thread_getframes)
598 (dwfl_frame_pc): New INTDECL entries.
599 * linux-proc-maps.c (dwfl_linux_proc_report): Call
600 __libdwfl_attach_state_for_pid.
601 * segment.c (segment_start): Rename to ...
602 (__libdwfl_segment_start): ... here and make it internal_function.
603 (segment_end): Rename to ...
604 (__libdwfl_segment_end): ... here and make it internal_function.
605 (reify_segments, dwfl_report_segment): Rename them at the callers.
606
6072013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
Jan Kratochvil21783b52013-11-07 16:34:58 +0100608
Jan Kratochvil22f867a2013-11-07 21:30:17 +0100609 * core-file.c (dwfl_core_file_report): Remove the use of MAX.
610
6112013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
612
Jan Kratochvilb947ee12013-11-07 21:27:54 +0100613 * core-file.c (dwfl_core_file_report): Replaced variable sniffed by
614 retval. Fix one forgotten LISTED increase.
615
6162013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
617
Jan Kratochvil35d95f32013-11-07 16:47:19 +0100618 Fix core files for re-prelink-ed files.
619 * core-file.c (dynamic_vaddr_get): New function.
620 (dwfl_core_file_report): New variable file_dynamic_vaddr. Call
621 dynamic_vaddr_get instead of using L_ADDR.
622 * libdwflP.h (struct r_debug_info_module): Remove field l_addr.
623 * link_map.c (report_r_debug): Do not initialize l_addr.
624
6252013-11-07 Jan Kratochvil <jan.kratochvil@redhat.com>
626
Jan Kratochvil21783b52013-11-07 16:34:58 +0100627 Code cleanup.
628 * core-file.c (dwfl_core_file_report): Reindent block of code by
629 continue keyword.
630
Jan Kratochvil3cf491e2013-10-30 10:48:20 +01006312013-10-30 Jan Kratochvil <jan.kratochvil@redhat.com>
632
633 * argp-std.c (parse_opt): Use executable parameter of
634 dwfl_core_file_report.
635 * core-file.c (dwfl_core_file_report): Add parameter executable. Set
636 it to DWFL. Add NEW_VERSION for it.
637 (_compat_without_executable_dwfl_core_file_report): New. Twice.
638 * libdwfl.h (dwfl_core_file_report): Add parameter executable, update
639 the function comment.
640
Mark Wielaardd1829742013-10-15 23:53:32 +02006412013-10-15 Mark Wielaard <mjw@redhat.com>
642
643 * linux-proc-maps.c (proc_maps_report): Ignore non-absolute file
644 mappings.
645 (dwfl_linux_proc_find_elf): Don't abort, just return failure.
646
Mark Wielaard2e73a8a2013-09-12 11:27:56 +02006472013-09-12 Mark Wielaard <mjw@redhat.com>
648
Mark Wielaardead7d192013-09-12 16:49:25 +0200649 * cu.c (intern_cu): If dwarf_offdie fails free cu.
650
6512013-09-12 Mark Wielaard <mjw@redhat.com>
652
Mark Wielaardcc392482013-09-12 15:16:13 +0200653 * linux-proc-maps.c (proc_maps_report): Don't fclose FILE in
654 bad_report.
655
6562013-09-12 Mark Wielaard <mjw@redhat.com>
657
Mark Wielaard2e73a8a2013-09-12 11:27:56 +0200658 * dwfl_module_getdwarf.c (find_symtab): Call elf_getdata with
659 aux_xndxscn, not xndxscn, for aux_symxndxdata.
660
Mark Wielaard16fa4142013-08-22 13:45:16 +02006612013-08-25 Mark Wielaard <mjw@redhat.com>
662
663 * linux-kernel-modules.c (report_kernel): Pass add_p_vaddr as true
664 to dwfl_report_elf.
665
Jan Kratochvil10edf472013-07-25 11:05:35 +02006662013-07-25 Jan Kratochvil <jan.kratochvil@redhat.com>
667
668 * dwfl_segment_report_module.c (dwfl_segment_report_module): Check for
669 conflicts all the modules, not just the first one. Compare L_LD if it
670 is equal, not if it is in a module address range.
671
Jan Kratochvil596d4302013-07-23 16:30:01 +02006722013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
673
Jan Kratochvil744fc6f2013-07-23 17:52:01 +0200674 * libdwflP.h (__libdwfl_elf_address_range): Add internal_function.
675
6762013-07-23 Jan Kratochvil <jan.kratochvil@redhat.com>
677
Jan Kratochvil596d4302013-07-23 16:30:01 +0200678 * core-file.c (clear_r_debug_info): Close also ELF and FD.
679 (dwfl_core_file_report): Call __libdwfl_report_elf for
680 R_DEBUG_INFO.MODULE.
681 * dwfl_report_elf.c (__libdwfl_elf_address_range): New function from
682 code of ...
683 (__libdwfl_report_elf): ... this function. Call it.
684 * dwfl_segment_report_module.c: Include unistd.h.
685 (dwfl_segment_report_module): Use basename for MODULE->NAME.
686 Clear MODULE if it has no build-id and we have segment with build-id.
687 Ignore this segment only if MODULE still contains valid ELF.
688 * libdwflP.h (__libdwfl_elf_address_range): New declaration.
689 (struct r_debug_info_module): New fields fd, elf, l_addr, start, end
690 and disk_file_has_build_id.
691 (dwfl_link_map_report): Extend the comment.
692 * link_map.c (report_r_debug): Extend the comment. Always fill in new
693 r_debug_info_module. Initialize also the new r_debug_info_module
694 fields. Remove one FIXME comment. Call __libdwfl_elf_address_range
695 instead of __libdwfl_report_elf when R_DEBUG_INFO is not NULL.
696
Jan Kratochvil8af254a2013-07-19 21:41:31 +02006972013-07-19 Jan Kratochvil <jan.kratochvil@redhat.com>
698
699 * libdwflP.h (__libdwfl_find_elf_build_id): Add internal_function.
700
Mark Wielaard8e5393c2013-07-02 13:35:29 +02007012013-07-02 Mark Wielaard <mjw@redhat.com>
702
703 * relocate.c (__libdwfl_relocate_value): Remove mod->e_type assert.
704
Mark Wielaard24b26ec2013-06-05 17:03:25 +02007052013-06-05 Mark Wielaard <mjw@redhat.com>
706
707 * link_map.c (report_r_debug): Always call release_buffer after
708 memory_callback succeeded reading build_id.
709
Jan Kratochvil8ff86292013-05-30 13:21:20 +02007102013-05-30 Jan Kratochvil <jan.kratochvil@redhat.com>
711
712 * argp-std.c (parse_opt) <ARGP_KEY_SUCCESS> <opt->core> <opt->e>: Set
713 executable_for_core before calling dwfl_core_file_report.
714 * core-file.c (clear_r_debug_info): New function.
715 (dwfl_core_file_report): Move raw segments reporting lower. New
716 variable r_debug_info, pass it to dwfl_segment_report_module. Call
717 clear_r_debug_info in the end. Return sum of LISTED and SNIFFED.
718 * dwfl_module_build_id.c (check_notes): Move into
719 __libdwfl_find_elf_build_id.
720 (__libdwfl_find_build_id): Rename to ...
721 (__libdwfl_find_elf_build_id): ... here. Add parameters build_id_bits,
722 build_id_elfaddr and build_id_len. Verify MOD vs. ELF.
723 (__libdwfl_find_elf_build_id) (check_notes): Remove parameters mod and
724 set, rename data_vaddr to data_elfaddr. Do not call found_build_id.
725 (__libdwfl_find_elf_build_id): Update the check_notes caller, do not
726 adjust its data_elfaddr parameter.
727 (__libdwfl_find_build_id): New wrapper of __libdwfl_find_elf_build_id.
728 * dwfl_segment_report_module.c (dwfl_segment_report_module): New
729 parameter r_debug_info. New variable name_is_final. Adjust addresses
730 according to R_DEBUG_INFO->MODULE. Check conflicts against DWFL.
731 Do not overwrite NAME by SONAME if NAME_IS_FINAL.
732 * libdwflP.h (__libdwfl_find_elf_build_id): New declaration.
733 (struct r_debug_info_module, struct r_debug_info): New definitions.
734 (dwfl_segment_report_module, dwfl_link_map_report): Add parameter
735 r_debug_info.
736 * link_map.c: Include fcntl.h.
737 (report_r_debug): Add parameter r_debug_info, describe it in the
738 function comment. Delete dwfl_addrmodule call and its dependent code.
739 Verify build-id before calling dwfl_report_elf, also supply
740 executable_for_core to it. Store r_debug_info->module info when
741 appropriate.
742 (dwfl_link_map_report): Add parameter r_debug_info. New variable
743 in_ok. Try to read IN from EXECUTABLE_FOR_CORE. Update report_r_debug
744 caller parameters.
745
Jan Kratochvil904aec22013-04-30 14:27:16 +02007462013-04-30 Jan Kratochvil <jan.kratochvil@redhat.com>
747
748 * dwfl_report_elf.c (__libdwfl_report_elf): Add parameter add_p_vaddr.
749 Set it to true for ET_EXEC and ET_CORE. Provide alternative
750 setup of START and BIAS if !ADD_P_VADDR. Set END from BIAS, not BASE.
751 (dwfl_report_elf): Add parameter add_p_vaddr. Pass it down. Add
752 NEW_VERSION.
753 (_compat_without_add_p_vaddr_dwfl_report_elf) <SHARED>: New, with
754 COMPAT_VERSION.
755 * libdwfl.h (dwfl_report_elf): Add parameter add_p_vaddr. Describe it.
756 * libdwflP.h (__libdwfl_report_elf): Add parameter add_p_vaddr.
757 * link_map.c (report_r_debug): Use true add_p_vaddr for dwfl_report_elf.
758 * linux-kernel-modules.c (report_kernel): Use false add_p_vaddr for
759 dwfl_report_elf.
760 * offline.c (process_elf): Use true add_p_vaddr for dwfl_report_elf.
761
Mark Wielaard9efa9e62013-04-27 20:50:32 +02007622013-04-27 Mark Wielaard <mjw@redhat.com>
763
764 * link_map.c: #include system.h.
765
Jan Kratochvil1704baf2013-04-26 17:00:50 +02007662013-04-26 Jan Kratochvil <jan.kratochvil@redhat.com>
767
768 * link_map.c (BE32, BE64, LE32, LE64): Delete the definitions, move
769 them to lib/system.h.
770
Mark Wielaardcdaaf212013-04-25 16:50:11 -04007712013-04-24 Mark Wielaard <mjw@redhat.com>
772
773 * Makefile.am: Use AM_CPPFLAGS instead of INCLUDES.
774
Jan Kratochvila1d44822013-03-19 13:40:13 +01007752013-03-20 Jan Kratochvil <jan.kratochvil@redhat.com>
776
777 * dwfl_report_elf.c (__libdwfl_report_elf): Remove BASE aligning.
778
Mark Wielaardf1b06b52013-03-12 12:02:51 +01007792013-03-12 Mark Wielaard <mjw@redhat.com>
780
781 * dwfl_getsrclines.c (dwfl_getsrclines): Return 0 on success.
782
Mark Wielaardf6185a72013-02-22 23:42:59 +01007832013-02-22 Mark Wielaard <mjw@redhat.com>
784
785 * open.c (__libdw_gunzip,__libdw_bunzip2,__libdw_unlzma): Define
786 as DWFL_E_BADELF when not used.
787
Mark Wielaard40025812013-02-10 15:07:33 +01007882013-02-10 Mark Wielaard <mjw@redhat.com>
789
790 * argp-std.c (parse_opt): Use opt->core and opt->e explicitly in
791 failure messages When handling ARGP_KEY_SUCCESS because arg will
792 not have been set.
793
Jan Kratochvil84476372012-10-10 20:42:30 +02007942013-01-30 Jan Kratochvil <jan.kratochvil@redhat.com>
795
796 * linux-proc-maps.c: Include system.h.
797 (PROCEXEFMT, get_pid_class): New.
798 (grovel_auxv): Detect 32-bit vs. 64-bit auxv, possibly call
799 get_pid_class.
800
Mark Wielaard697bdca2013-01-23 17:39:19 +01008012013-01-23 Mark Wielaard <mjw@redhat.com>
802
803 * dwfl_module_getdwarf.c (find_aux_sym): Don't substract one
804 from aux_syments by default.
805 (find_symtab): Also succeed when only aux_symdata is found.
806 When no symtab is found always try to load auxiliary table.
807 (dwfl_module_getsymtab): Substract one from result when both
808 tables have symbols.
809 * dwfl_module_getsym.c (dwfl_module_getsym): Only skip auxiliary
810 zero entry when both tables have symbols.
811 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only substract
812 one from first_global when both tables have symbols.
813
Mark Wielaard5083a702013-01-16 15:19:32 +01008142013-01-16 Mark Wielaard <mjw@redhat.com>
815
816 * libdwflP.h (struct Dwfl_Module): Add aux_sym, aux_symdata,
817 aux_syments, aux_symstrdata, aux_symxndxdata and aux_first_global.
818 (dwfl_adjusted_aux_sym_addr): New function.
819 (dwfl_deadjust_aux_sym_addr): Likewise.
820 (dwfl_adjusted_st_value): Take and check symfile argument.
821 (dwfl_deadjust_st_value): Likewise.
822 * dwfl_module_getdwarf.c (find_prelink_address_sync): Take and
823 use dwfl_file as argument to set address_sync.
824 (find_debuginfo): Call find_prelink_address_sync with debug file.
825 (find_aux_sym): New function.
826 (find_symtab): Use find_aux_sym if all we have is the dynsym table
827 and fill in aux DwflModule fields.
828 (dwfl_module_getsymtab): Return syments plus aux_syments.
829 (load_symtab): Always set first_global.
830 * dwfl_module_addrsym.c (dwfl_module_addrsym): Check symfile
831 when using same_section. Calculate first_global based on both
832 mod->first_global and mod->aux_first_global.
833 * dwfl_module.c (__libdwfl_module_free): Free aux_sym.
834 * dwfl_module_getsym.c (dwfl_module_getsym): Use auxsym table
835 to retrieve symbol and name if necessary, making sure all locals
836 from any table come before any globals.
837 * dwfl_module_info.c (dwfl_module_info): Call dwfl_adjusted_st_value
838 with symfile.
839 * relocate.c (resolve_symbol): Likewise.
840
Roland McGrath3999ce12013-01-07 14:53:37 -08008412013-01-07 Roland McGrath <roland@hack.frob.com>
842
843 * link_map.c (auxv_format_probe): Handle unaligned 64-bit data, but
844 still assume the data is at least 32-bit aligned anyway.
845 (dwfl_link_map_report): Handle unaligned auxv data.
846
Mark Wielaard76c54592012-12-11 14:21:01 +01008472012-12-11 Mark Wielaard <mjw@redhat.com>
848
849 * linux-kernel-modules.c (report_kernel): Only free fname if
850 find_kernel_elf succeeds and allocates it.
851 (report_kernel_archive): Fix brackets around unlikely expression.
852
Jan Kratochvild5784af2012-10-18 00:11:30 +02008532012-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
854
855 * argp-std.c: Update Copyright year.
856 (offline_find_elf): New function.
857 (offline_callbacks): Use it for find_elf.
858 (struct parse_opt): New.
859 (parse_opt): New key ARGP_KEY_INIT. In other make hook struct
860 parse_opt pointer from former Dwfl pointer. Delay 'e and OPT_COREFILE
861 processing till ARGP_KEY_SUCCESS. Initialize state->input already from
862 ARGP_KEY_SUCCESS. Modify the cleanup in ARGP_KEY_ERROR. Make the
863 final state->input initialization optional.
864 * dwfl_end.c: Update Copyright year.
865 (dwfl_end): Free executable_for_core.
866 * libdwflP.h: Update Copyright year.
867 (struct Dwfl): New field executable_for_core.
868
Jan Kratochvilae81c702012-10-27 20:45:27 +02008692012-11-20 Jan Kratochvil <jan.kratochvil@redhat.com>
870
871 * dwfl_report_elf.c (__libdwfl_report_elf): Simplify START and BIAS
872 calculation.
873
Jan Kratochvil50f413e2012-10-17 22:04:24 +02008742012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
875
Jan Kratochvil3fdcdcb2012-10-17 21:49:10 +0200876 * dwfl_module_getdwarf.c (mod_verify_build_id): New function with code
877 from ...
878 (__libdwfl_getelf): ... here. Call it.
879
8802012-10-17 Jan Kratochvil <jan.kratochvil@redhat.com>
881
Jan Kratochvil50f413e2012-10-17 22:04:24 +0200882 * libdwfl.h (dwfl_module_getelf): Add __nonnull_attribute__.
883
Jan Kratochvil78dec222012-10-10 08:04:01 +02008842012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
885
Jan Kratochvil387654d2012-10-10 08:08:44 +0200886 * dwfl_segment_report_module.c (dwfl_segment_report_module):
887 Initialize mod->MAIN_BIAS.
888
8892012-10-10 Jan Kratochvil <jan.kratochvil@redhat.com>
890
Jan Kratochvil78dec222012-10-10 08:04:01 +0200891 * dwfl_module_addrsym.c (dwfl_module_addrsym): New function
892 binding_value. Use it for both zero and non-zero size symbols
893 comparisons.
894
Mark Wielaard5b257822012-10-01 16:10:46 +02008952012-10-01 Mark Wielaard <mjw@redhat.com>
896
Mark Wielaardea45ac82012-10-01 16:12:10 +0200897 * cu.c (cudie_offset): Don't use type_sig8, it might not be
898 initialized and these are always real CUs, never TUs.
899
9002012-10-01 Mark Wielaard <mjw@redhat.com>
901
Mark Wielaard5b257822012-10-01 16:10:46 +0200902 * derelocate.c (find_section): Check next section exists before
903 accessing it.
904
Petr Machatae1873142012-08-01 21:37:52 +02009052012-08-01 Petr Machata <pmachata@redhat.com>
906
907 * offline.c (process_archive_member): Ignore entry "/SYM64/".
908
Roland McGrath210c2f02012-03-28 10:22:35 -07009092012-03-28 Roland McGrath <roland@hack.frob.com>
910
911 * dwfl_segment_report_module.c
912 (dwfl_segment_report_module: read_portion): Don't use existing buffer
913 when FILESZ is zero (string mode) and available portion doesn't hold
914 a terminated string.
915
Roland McGrath01fef9d2011-12-02 09:45:53 -08009162011-12-02 Roland McGrath <roland@hack.frob.com>
917
918 * elf-from-memory.c (elf_from_remote_memory): Fix ELFCLASS64 case
919 to use elf64_xlatetom and PHDRS.p64.
920 Reported by Serge Pavlov <serge.pavlov.at.gnu@gmail.com>.
921
Mark Wielaard75ee33f2011-10-31 15:33:49 +01009222011-11-31 Mark Wielaard <mjw@redhat.com>
923
Mark Wielaardef431cd2011-10-31 23:17:06 +0100924 * dwfl_module_addrsym.c (dwfl_module_addrsym): First search all
925 global symbols. Then only when that doesn't provide a match search
926 all local symbols too.
927 * dwfl_module_getdwarf.c (load_symtab): Take first_global int arg
928 and fill it in.
929 (find_symtab): Initialize mod->first_global and pass it to load_symtab.
930 * libdwfl/libdwflP.h (Dwfl_Module): Add first_global field.
931
9322011-11-31 Mark Wielaard <mjw@redhat.com>
933
Mark Wielaard75ee33f2011-10-31 15:33:49 +0100934 * dwfl_module_addrsym.c (dwfl_module_addrsym): Only update
935 sizeless_sym if needed and closer to desired addr.
936
Mark Wielaardf43feb52011-10-20 16:53:54 +02009372011-10-20 Mark Wielaard <mjw@redhat.com>
938
939 * derelocate.c (cache_sections): Intern mod->reloc_info check.
940 (dwfl_module_relocations): Don't check mod->reloc_info.
941 (dwfl_module_relocation_info): Likewise.
942 (find_section): Likewise.
943
Roland McGrath32899ac2011-07-09 03:17:24 -07009442011-07-09 Roland McGrath <roland@hack.frob.com>
945
946 * image-header.c (LE32): Macro removed (now in lib/system.h).
947
Mark Wielaarddbb490f2011-04-11 17:24:16 +02009482011-04-11 Mark Wielaard <mjw@redhat.com>
949
950 * linux-kernel-modules.c (vmlinux_suffixes): Guard definition
951 by check for zlib, bzlib or lzma defines to check it isn't empty.
952 (try_kernel_name): Use same guard for use of vmlinux_suffixes.
953
Roland McGrathe07da4f2011-03-08 16:26:02 -08009542011-03-08 Roland McGrath <roland@redhat.com>
955
956 * dwfl_module_getdwarf.c (open_elf): Clear errno before CBFAIL.
957 Reported by Kurt Roeckx <kurt@roeckx.be>.
958
Roland McGrath6ecdead2011-02-11 12:29:45 -08009592011-02-11 Roland McGrath <roland@redhat.com>
960
961 * linux-kernel-modules.c (try_kernel_name): Try .gz, .bz2, .xz
962 suffixes if corresponding decompression support is enabled.
963
Roland McGrath9fdd4612011-02-01 16:09:43 -08009642011-02-01 Roland McGrath <roland@redhat.com>
965
Roland McGrath3a44c9a2011-02-01 19:06:21 -0800966 * dwfl_module_getdwarf.c (find_prelink_address_sync): Use the
967 section-end address as the synchronization point, rather than sh_addr.
968
Roland McGrath0ef40202011-02-01 16:58:32 -0800969 * dwfl_module_getdwarf.c (find_prelink_address_sync): Discover
970 PT_INTERP p_vaddr separately from main phdrs and undo phdrs.
971
Roland McGrath9fdd4612011-02-01 16:09:43 -0800972 * dwfl_module_getdwarf.c (find_prelink_address_sync): Fix pasto in
973 last change, so we recognize PT_INTERP in ELFCLASS64 correctly.
974
Roland McGrath5ad466d2011-01-11 10:17:01 -08009752011-01-11 Roland McGrath <roland@redhat.com>
976
977 * dwfl_module_getdwarf.c (open_elf): Remove section-based
978 address_sync fixup from here.
979 (find_prelink_address_sync): New function.
980 (find_debuginfo): Call it.
981 * libdwflP.h (DWFL_ERRORS): Add BAD_PRELINK error.
982
Roland McGrath2c7d0dd2011-01-04 19:29:53 -08009832011-01-04 Roland McGrath <roland@redhat.com>
984
985 * dwfl_module_getdwarf.c (open_elf): Enhance address_sync calculation
986 logic to consider section addresses, the better to survive all the
987 possible prelink machinations.
988 * libdwflP.h (struct dwfl_file): Comment change.
989
Roland McGrath33d305f2010-11-30 17:39:55 -08009902010-11-30 Roland McGrath <roland@redhat.com>
991
992 * derelocate.c (dwfl_module_relocations): Remove over-eager assert.
993
Roland McGrath1743d7f2010-11-12 16:46:47 -08009942010-11-12 Roland McGrath <roland@redhat.com>
995
996 * libdwflP.h (struct Dwfl_Module): New member main_bias.
997 (dwfl_adjusted_address, dwfl_deadjust_address): Use it.
998 * dwfl_module_getdwarf.c (__libdwfl_getelf): Initialize it.
999
1000 * libdwflP.h (dwfl_deadjust_address): New function.
1001 (dwfl_deadjust_dwarf_addr, dwfl_deadjust_st_value): New functions.
1002 * cu.c (addrarange): Use dwfl_deadjust_dwarf_addr.
1003 * dwfl_module_addrsym.c: Use dwfl_deadjust_st_value.
1004
10052010-11-11 Roland McGrath <roland@redhat.com>
1006
1007 * libdwflP.h (struct dwfl_file): Remove bias member.
1008 Add vaddr and address_sync members instead.
1009 (dwfl_adjusted_address): Calculate using vaddr.
1010 (dwfl_adjusted_dwarf_addr): Calculate using address_sync and call that.
1011 (dwfl_adjusted_st_value): Use one of those calls.
1012 * dwfl_module_getdwarf.c (open_elf): Initialize vaddr and address_sync.
1013 * dwfl_segment_report_module.c (dwfl_segment_report_module): Likewise.
1014 * derelocate.c (dwfl_module_relocations): Update ET_EXEC assertions.
1015 * link_map.c (consider_executable): Adjust only MOD->low_addr for
1016 detected PIE bias change.
1017
1018 * libdwflP.h (dwfl_adjusted_dwarf_addr): New function.
1019 * dwfl_module_info.c: Use it.
1020 * cu.c (addrarange): Likewise.
1021 * dwfl_dwarf_line.c: Likewise.
1022 * dwfl_module_dwarf_cfi.c: Likewise.
1023 * dwfl_lineinfo.c: Likewise.
1024 * dwfl_nextcu.c: Likewise.
1025 * dwfl_module_getdwarf.c (dwfl_module_getdwarf): Likewise.
1026
1027 * libdwflP.h (dwfl_adjusted_st_value): New function.
1028 * relocate.c (resolve_symbol): Use it.
1029 * dwfl_module_getsym.c: Likewise.
1030 * dwfl_module_addrsym.c: Likewise.
1031 * dwfl_module_info.c: Likewise.
1032
1033 * libdwflP.h (dwfl_adjusted_address): New function.
1034 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use it.
1035 * relocate.c (__libdwfl_relocate_value): Likewise.
1036 * derelocate.c (cache_sections): Likewise.
1037 (dwfl_module_address_section): Likewise.
1038 * dwfl_module_getelf.c: Likewise.
1039 * dwfl_module_eh_cfi.c: Likewise.
1040 * link_map.c (consider_executable): Likewise.
1041
Roland McGrathde44f132010-08-24 15:38:42 -070010422010-08-24 Roland McGrath <roland@redhat.com>
1043
1044 * dwfl_dwarf_line.c: New file.
1045 * Makefile.am (libdwfl_a_SOURCES): Add it.
1046
Roland McGrath7503c892010-08-18 02:54:29 -070010472010-08-18 Roland McGrath <roland@redhat.com>
1048
1049 * link_map.c (report_r_debug): Use found name if we have no name,
1050 even if we already have an Elf handle.
1051
Roland McGrath81cfcca2010-06-30 00:45:58 -070010522010-06-30 Roland McGrath <roland@redhat.com>
1053
1054 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't be
1055 confused by -1 return from dwfl_build_id_find_elf after it opened
1056 the Elf handle.
Roland McGrath82a63362010-06-30 01:18:43 -07001057 * find-debuginfo.c (dwfl_standard_find_debuginfo): Likewise for
1058 dwfl_build_id_find_debuginfo.
Roland McGrath81cfcca2010-06-30 00:45:58 -07001059
Roland McGrath3e0f7d12010-06-15 23:10:35 -070010602010-06-16 Roland McGrath <roland@redhat.com>
1061
1062 * cu.c (cudie_offset): Use DIE_OFFSET_FROM_CU_OFFSET macro.
1063
Roland McGrathb9e85182010-06-14 12:45:25 -070010642010-06-14 Roland McGrath <roland@redhat.com>
1065
1066 * find-debuginfo.c (try_open): Take new arg MAIN_STAT. Compare
1067 candidate file to that st_dev/st_ino and pretend it didn't exist
1068 if they match.
1069 (find_debuginfo_in_path): Update caller, pass main file's info.
1070
Roland McGratha0635db2010-05-20 00:04:59 -070010712010-05-20 Roland McGrath <roland@redhat.com>
1072
1073 * linux-proc-maps.c (find_sysinfo_ehdr): Renamed to ...
1074 (grovel_auxv): ... this. Take DWFL argument.
1075 (dwfl_linux_proc_report): Update caller.
1076
1077 * dwfl_module_getdwarf.c (open_elf): Calculate alignment for bias
1078 based on dwfl->segment_align or manifest alignment of MOD->low_addr.
1079
Roland McGrathbe9c4d72010-05-19 21:24:27 -070010802010-05-19 Roland McGrath <roland@redhat.com>
1081
1082 * linux-kernel-modules.c (intuit_kernel_bounds): Rewritten.
1083
Roland McGrathed431dd2010-05-06 00:52:51 -070010842010-05-06 Roland McGrath <roland@redhat.com>
1085
Roland McGrathaba26e02010-05-06 01:12:15 -07001086 * segment.c (insert): Clear inserted elements of DWFL->lookup_module.
1087
Roland McGrathed431dd2010-05-06 00:52:51 -07001088 * libdwflP.h (DWFL_ERRORS): Add WRONG_ID_ELF.
1089 * dwfl_build_id_find_elf.c: Set MOD->main.valid when there is a build
1090 ID but we didn't find a file.
1091 * dwfl_module_getdwarf.c (__libdwfl_getelf): When that's set, check
1092 and refuse any fallback file-by-name if it lacks the matching ID.
1093
1094 * dwfl_error.c (dwfl_errno): Add INTDEF.
1095 * libdwflP.h: Add INTDECL.
1096
1097 * dwfl_module_getdwarf.c (open_elf): Do elf_end and clear FILE->elf in
1098 failure cases.
1099
Roland McGrath77cda9d2010-05-04 16:31:43 -070011002010-05-04 Roland McGrath <roland@redhat.com>
1101
Roland McGrathb4bb3012010-05-04 20:09:30 -07001102 * dwfl_segment_report_module.c: Use "[pie]" rather than "[dso]" for an
1103 ET_DYN that has a DT_DEBUG.
1104
1105 * dwfl_segment_report_module.c: Fix jump-start of NDX-finding loop.
Roland McGrath89bb5d32010-05-04 18:03:42 -07001106
Roland McGrath4820a052010-05-04 19:46:56 -07001107 * segment.c (insert): Fix moving of values following insertion.
1108 (reify_segments): Fix up MOD->segment backpointer indices after
1109 later insertions in the main loop invalidate them.
1110
Roland McGrathd05c5962010-05-04 18:05:22 -07001111 * link_map.c (dwfl_link_map_report): Detect bias of embedded phdrs and
1112 apply it to PT_DYNAMIC p_vaddr so we handle a PIE correctly.
1113
Roland McGrath77cda9d2010-05-04 16:31:43 -07001114 * core-file.c (dwfl_core_file_report): Return any nonzero count of
1115 modules reported, even if link_map grovelling failed and only sniffing
1116 found anything.
1117
Roland McGrathd17f9de2010-04-26 13:09:33 -070011182010-04-26 Roland McGrath <roland@redhat.com>
1119
1120 * relocate.c (relocate_section): Treat R_*_NONE reloc as no reloc.
1121 Works around probably-wrong ld -r behavior for case of a DWARF address
1122 constant that refers to a discarded SHF_ALLOC section.
1123
Roland McGrathbe139302010-04-14 12:54:45 -070011242010-04-14 Roland McGrath <roland@redhat.com>
1125
1126 * link_map.c (report_r_debug): Limit iterations on the l_next chain to
1127 an upper bound on sane possible number of elements.
1128
Roland McGrath5ea349b2010-04-06 00:04:49 -070011292010-03-11 Roland McGrath <roland@redhat.com>
1130
1131 * link_map.c (auxv_format_probe): Fix scanning loop, so we really scan
1132 the second half for 32-bit matches.
1133
Roland McGrath8068e062010-03-10 23:49:13 -080011342010-03-10 Roland McGrath <roland@redhat.com>
1135
1136 * core-file.c (dwfl_core_file_report): Punt EHDR argument.
1137 * argp-std.c (parse_opt): Update caller.
1138 * libdwfl.h: Declare dwfl_core_file_report.
1139 * libdwflP.h: Don't.
1140
Roland McGrathca84a552010-02-17 01:44:42 -080011412010-02-17 Roland McGrath <roland@redhat.com>
1142
1143 * dwfl_segment_report_module.c (addr_segndx): Take new flag argument.
1144 If set, find the first index not below ADDR.
1145 (dwfl_segment_report_module): Update callers.
1146 Pass true when calculating return value.
1147
Roland McGrathbf963472010-02-15 15:16:44 -080011482010-02-15 Roland McGrath <roland@redhat.com>
1149
Roland McGrath22359e22010-02-15 15:57:03 -08001150 * Makefile.am: Use config/eu.am for common stuff.
1151
Roland McGrathbf963472010-02-15 15:16:44 -08001152 * find-debuginfo.c (find_debuginfo_in_path): Fix uninitialized
1153 variable in failure path.
1154
Mark Wielaardeacdcf32010-02-02 15:45:24 +010011552010-02-02 Mark Wielaard <mjw@redhat.com>
1156
1157 * dwfl_module_dwarf_cfi.c (dwfl_module_dwarf_cfi): Always set bias.
1158 * dwfl_module_eh_cfi.c (dwfl_module_eh_cfi): Likewise
1159
Roland McGrathf95760a2010-01-07 20:24:34 -080011602010-01-07 Roland McGrath <roland@redhat.com>
1161
1162 * core-file.c (dwfl_core_file_report): Use elf_getphdrnum.
1163 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1164 * dwfl_module_getdwarf.c (open_elf, find_dynsym): Likewise.
1165 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1166
Roland McGrath1d7cbd12010-01-06 04:22:40 -080011672010-01-06 Roland McGrath <roland@redhat.com>
1168
1169 * relocate.c (relocate_getsym): For SHN_COMMON, zero st_value.
1170 (relocate_section): Let unresolved SHN_COMMON symbol stay 0.
1171
Roland McGrath15426bd2009-11-16 20:38:17 -080011722009-11-16 Roland McGrath <roland@redhat.com>
1173
1174 * relocate.c (relocate_section): Skip SHT_NOBITS or empty target scn.
1175
Petr Machata003dd322009-11-13 00:38:27 +010011762009-11-12 Petr Machata <pmachata@redhat.com>
1177
1178 * core-file.c (dwfl_elf_phdr_memory_callback): Only load ahead if
1179 the chunk is both offset-contiguous and vaddr-contiguous.
1180
Roland McGrathcdb48e02009-11-05 11:34:08 -080011812009-11-05 Roland McGrath <roland@redhat.com>
1182
1183 * link_map.c (report_r_debug): Skip entries with l_ld==0.
Roland McGrath6229eb52009-11-05 11:43:38 -08001184 Use dwfl_addrmodule for l_ld lookup, don't bail on lookup failure.
Roland McGrathcdb48e02009-11-05 11:34:08 -08001185
Roland McGrathde6730c2009-09-04 03:05:31 -070011862009-09-04 Roland McGrath <roland@redhat.com>
1187
1188 * image-header.c (__libdw_image_header): Fix tranposed comparison.
1189
Roland McGrath6bb90712009-08-27 12:36:47 -070011902009-08-27 Roland McGrath <roland@redhat.com>
1191
1192 * image-header.c: New file.
1193 * Makefile.am (libdwfl_a_SOURCES): Add it.
1194 * libdwflP.h: Declare __libdw_image_header.
1195 * open.c (decompress): Don't consume ELF on failure.
1196 (what_kind): New function, broken out of ...
1197 (__libdw_open_file): ... here. Call it.
1198 If it fails, try __libdw_image_header and then try what_kind again.
1199
1200 * gzip.c (unzip): Reuse *WHOLE as first INPUT_BUFFER,
1201 leave it behind for next decompressor.
1202 * open.c (decompress): Free BUFFER on failure.
1203
Roland McGrathd6ccdc12009-08-26 00:23:01 -070012042009-08-26 Roland McGrath <roland@redhat.com>
1205
Roland McGrathe5a1a812009-08-26 03:05:50 -07001206 * gzip.c (find_zImage_payload): New function, broken out of ...
1207 (mapped_zImage): ... here. Call it.
1208 (find_zImage_payload) [LZMA]: Match LZMA-compressed kernels with
1209 stupid method of just trying the decoder.
1210
Roland McGrath24169642009-08-26 02:26:34 -07001211 * open.c [USE_LZMA]: Try __libdw_unlzma.
1212 * libdwflP.h: Declare it.
1213 (DWFL_ERRORS): Add DWFL_E_LZMA.
1214 * gzip.c [LZMA]: Implement liblzma version for XZ file format.
1215 * lzma.c: New file.
1216 * Makefile.am [LZMA] (libdwfl_a_SOURCES): Add it.
1217
Roland McGrathd6ccdc12009-08-26 00:23:01 -07001218 * gzip.c (mapped_zImage): Limit scan to 32kb.
1219 Make this unconditional, support bzip2 kernel images too.
Roland McGrathae1d7dc2009-08-26 01:27:59 -07001220 (unzip): Use direct inflate method for non-mmap case too.
1221 Only zlib uses the stream method.
Roland McGrathd6ccdc12009-08-26 00:23:01 -07001222
Roland McGrathebfb6482009-08-09 15:40:52 -070012232009-08-09 Roland McGrath <roland@redhat.com>
1224
1225 * dwfl_module_build_id.c: Use new macros for versioned definitions.
1226
Roland McGrathfe8b42e2009-07-08 14:54:16 -070012272009-07-08 Roland McGrath <roland@redhat.com>
1228
Roland McGrath3c84db32009-06-24 17:41:40 -07001229 * dwfl_module_dwarf_cfi.c: New file.
1230 * dwfl_module_eh_cfi.c: New file.
1231 * Makefile.am (libdwfl_a_SOURCES): Add them.
1232 * libdwflP.h (struct Dwfl_Module): New members `dwarf_cfi', `eh_cfi.
1233 Add INTDECL for dwfl_module_eh_cfi, dwfl_module_dwarf_cfi.
1234
12352009-07-08 Roland McGrath <roland@redhat.com>
1236
Roland McGrathfe8b42e2009-07-08 14:54:16 -07001237 * libdwflP.h (struct Dwfl_Module): Reorder members to pack better.
1238
Mark Wielaard2256e362009-06-18 13:31:56 +020012392009-06-18 Mark Wielaard <mjw@redhat.com>
1240
1241 * dwfl_report_elf.c (__libdwfl_report_elf): Return NULL on overlap.
1242
Ulrich Drepperf1894932009-06-13 15:55:42 -070012432009-06-13 Ulrich Drepper <drepper@redhat.com>
1244
1245 * derelocate.c: Don't use deprecated libelf functions.
1246 * dwfl_module_getdwarf.c: Likewise.
1247 * relocate.c: Likewise.
1248
Ulrich Drepper4f515712009-04-23 07:54:53 -070012492009-04-23 Ulrich Drepper <drepper@redhat.com>
1250
1251 * dwfl_module_build_id.c: Define versioned symbols only if SHARED is
1252 defined. Otherwise just define the latest version.
1253
Roland McGrathcc480472009-04-22 11:32:20 -070012542009-04-22 Roland McGrath <roland@redhat.com>
1255
Roland McGrathc65558b2009-04-22 12:29:32 -07001256 * relocate.c (resolve_symbol): Apply correct bias to st_value found in
1257 a non-ET_REL module.
1258
Roland McGrathcc480472009-04-22 11:32:20 -07001259 * dwfl_module_build_id.c (__libdwfl_find_build_id): Fix last change to
1260 adjust properly for non-ET_REL.
1261
Roland McGrath19a8e4d2009-04-21 15:44:07 -070012622009-04-21 Roland McGrath <roland@redhat.com>
1263
1264 * dwfl_module_getsym.c: Apply non-ET_REL bias only if SHF_ALLOC.
1265
1266 * relocate.c (__libdwfl_relocate_value): Assert that MOD is ET_REL.
1267 * derelocate.c (cache_sections): Call __libdwfl_relocate_value only
1268 for ET_REL.
1269 * dwfl_module_build_id.c (__libdwfl_find_build_id): Likewise.
1270
Roland McGrath10361572009-04-20 11:50:50 -070012712009-04-20 Roland McGrath <roland@redhat.com>
1272
1273 * dwfl_module_getdwarf.c (__libdwfl_getelf): Add internal_function.
1274
Roland McGratha605a3c2009-04-19 18:27:01 -070012752009-04-19 Roland McGrath <roland@redhat.com>
1276
1277 * dwfl_module_getdwarf.c (find_file): Renamed to ...
1278 (__libdwfl_getelf): ... this. Make it global.
1279 (find_symtab, find_dw): Update callers.
1280 (dwfl_module_getelf): Functions moved ...
1281 * dwfl_module_getelf.c: ... here, new file.
1282 * Makefile.am (libdwfl_a_SOURCES): Add it.
1283 * libdwflP.h: Declare __libdwfl_getelf.
1284
Roland McGrathfa253262009-04-14 02:38:19 -070012852009-04-14 Roland McGrath <roland@redhat.com>
1286
1287 * dwfl_segment_report_module.c: Handle DT_STRTAB value being either
1288 absolute (already adjusted in place) or needing load bias adjustment.
1289
1290 * core-file.c (dwfl_elf_phdr_memory_callback): Fix return value for
1291 gelf_getphdr failure. Fix file size limit checks.
1292
1293 * dwfl_segment_report_module.c: Fix underflow in DYNSTRSZ check.
1294
Roland McGrath243fa262009-04-08 17:05:43 -070012952009-04-08 Roland McGrath <roland@redhat.com>
1296
Roland McGrath785dbb12009-04-08 17:15:01 -07001297 * dwfl_module_getsym.c: Don't adjust for bias again after
1298 __libdwfl_relocate_value.
1299
Roland McGrath243fa262009-04-08 17:05:43 -07001300 * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
1301 a non-SHF_ALLOC section.
1302 (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
1303 * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
1304
Roland McGrath8651c5e2009-03-09 20:42:56 -070013052009-03-09 Roland McGrath <roland@redhat.com>
1306
Roland McGrath329ed9f2009-03-09 20:49:53 -07001307 * dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
1308 variable to outer scope, so we cache it for the loop.
1309
Roland McGrath8651c5e2009-03-09 20:42:56 -07001310 * relocate.c (__libdwfl_relocate_value): Add MOD->main.bias to sh_addr.
1311
Roland McGrath31fd6542009-02-12 17:26:39 -080013122009-02-12 Roland McGrath <roland@redhat.com>
1313
1314 * dwfl_module_build_id.c (__libdwfl_find_build_id): Use
1315 __libdwfl_relocate_value to find correct sh_addr value.
1316
Roland McGrath45c01cd2009-02-10 17:03:19 -080013172009-02-10 Roland McGrath <roland@redhat.com>
1318
Roland McGrath5453abf2009-02-10 17:33:49 -08001319 * dwfl_report_elf.c (__libdwfl_report_elf): Take new arg SANITY.
1320 If false, don't fail for NO_PHDR.
1321 (dwfl_report_elf): Update caller.
1322 * libdwflP.h: Update decl.
1323 * offline.c (process_elf): Call it with false, so we don't refuse
1324 dubiously-formed objects here.
1325
Roland McGrath45c01cd2009-02-10 17:03:19 -08001326 * link_map.c (consider_executable): Don't assert dwfl_addrsegment
1327 finds our module. We shouldn't crash when we confuse some guesses.
1328
Ulrich Dreppera9d51bf2009-02-10 12:55:07 -080013292009-02-10 Ulrich Drepper <drepper@redhat.com>
1330
1331 * open.c (decompress): Avoid crash with empty input file.
1332
Roland McGrathe738ad22009-01-27 16:41:54 -080013332009-01-27 Roland McGrath <roland@redhat.com>
1334
1335 * dwfl_report_elf.c (__libdwfl_report_elf): Ignore trailing PT_LOAD
1336 with zero vaddr and memsz.
1337
Roland McGrath74afbee2009-01-22 04:52:56 -080013382009-01-22 Roland McGrath <roland@redhat.com>
1339
Roland McGrathe34a3f82009-01-22 12:59:23 -08001340 * open.c (decompress): Move BUFFER, SIZE decls outside #if.
1341
Roland McGrath74afbee2009-01-22 04:52:56 -08001342 * dwfl_segment_report_module.c (addr_segndx): Remove bogus adjustments
1343 after address-matching loop.
1344
1345 * segment.c (lookup): Fix fencepost in checking for HINT match.
1346
Roland McGrath8dc9f932009-01-14 12:56:53 -080013472009-01-14 Roland McGrath <roland@redhat.com>
1348
1349 * gzip.c [!BZLIB] (mapped_zImage): New function.
1350 (unzip) [!BZLIB]: Grok Linux kernel zImage format.
1351
Ulrich Drepper7e678fa2009-01-10 18:02:05 -080013522009-01-10 Ulrich Drepper <drepper@redhat.com>
1353
1354 * dwfl_error.c: Always use __thread. Remove all !USE_TLS code.
1355
Roland McGratha4b1a952009-01-08 20:53:26 -080013562009-01-08 Roland McGrath <roland@redhat.com>
1357
1358 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
1359 Skip subdirectory named "source".
1360 (dwfl_linux_kernel_find_elf): Likewise.
1361
Roland McGrath60205c92009-01-06 00:10:23 -080013622009-01-06 Roland McGrath <roland@redhat.com>
1363
Roland McGrath705364b2009-01-06 02:04:51 -08001364 * linux-kernel-modules.c (check_suffix): New function.
Roland McGrath60205c92009-01-06 00:10:23 -08001365 Match ".ko", ".ko.gz", and ".ko.bz2" suffixes.
1366 (dwfl_linux_kernel_report_offline): Use it.
1367 (dwfl_linux_kernel_find_elf): Likewise.
1368
Roland McGrathbca43152009-01-05 23:59:32 -080013692009-01-05 Roland McGrath <roland@redhat.com>
1370
1371 * argp-std.c (parse_opt): Use __libdw_open_file for core file.
1372 * dwfl_build_id_find_debuginfo.c: Use it to open the file.
1373 * dwfl_build_id_find_elf.c: Likewise.
1374 * dwfl_module_getdwarf.c (open_elf): Likewise.
1375 * dwfl_report_elf.c: Likewise.
1376 * find-debuginfo.c (validate): Likewise.
1377 * offline.c (__libdwfl_report_offline): Likewise.
1378
1379 * libdwflP.h: Declare __libdw_open_file.
1380 * open.c: New file.
1381 * Makefile.am (libdwfl_a_SOURCES): Add it.
1382
1383 * gzip.c: New file.
1384 * Makefile.am [ZLIB] (libdwfl_a_SOURCES): Add it.
1385 * bzip2.c: New file.
1386 * Makefile.am [BZLIB] (libdwfl_a_SOURCES): Add it.
1387 * libdwflP.h: Declare __libdw_gunzip, __libdw_bunzip2.
1388
Roland McGrath45d7b292008-12-16 16:21:40 -080013892008-12-16 Roland McGrath <roland@redhat.com>
1390
1391 * dwfl_module_build_id.c (dwfl_module_build_id): Define with alias and
1392 symver magic to bind to ELFUTILS_0.138.
1393 (_BUG_COMPAT_dwfl_module_build_id): New function, bug compatible
1394 wrapper for ELFUTILS_0.130 version set.
1395
Roland McGrath7d9b8212008-12-18 15:08:09 -080013962008-12-18 Roland McGrath <roland@redhat.com>
1397
1398 * derelocate.c (dwfl_module_relocate_address): Fix last fix: ET_DYN
1399 addresses are taken as relative to MOD->low_addr.
1400
Roland McGrath74825c42008-12-15 19:33:33 -080014012008-12-15 Roland McGrath <roland@redhat.com>
1402
1403 * derelocate.c (dwfl_module_relocate_address): Apply main.bias, not
1404 debug.bias.
1405
Roland McGrathb28a8942008-12-11 02:09:28 -080014062008-12-11 Roland McGrath <roland@redhat.com>
1407
1408 * offline.c (process_archive): Don't call elf_end and close if
1409 returning NULL. Check first elf_begin call and set error code
1410 specially for empty archive.
1411 Fixes RHBZ#465878.
1412
Roland McGratha845f682008-12-03 03:41:58 +000014132008-12-02 Roland McGrath <roland@redhat.com>
1414
1415 * dwfl_getmodules.c (dwfl_getmodules): Typo fix in last change.
1416
14172008-11-26 Roland McGrath <roland@redhat.com>
1418
1419 * dwfl_getmodules.c (dwfl_getmodules): Encode iteration style in
1420 return value, and interpret encoded OFFSET argument.
1421
14222008-10-07 Roland McGrath <roland@redhat.com>
1423
1424 * dwfl_module_build_id.c (check_notes): Fix typo in vaddr calculation.
1425
Roland McGrath9cf28e42008-09-30 06:35:35 +000014262008-09-29 Roland McGrath <roland@redhat.com>
1427
1428 * segment.c (insert): Must realloc DWFL->lookup_module here too.
1429 (dwfl_report_segment): Clear DWFL->lookup_module before insert calls.
1430
14312008-08-28 Roland McGrath <roland@redhat.com>
1432
1433 * segment.c (reify_segments): Fix last change.
1434
14352008-08-27 Roland McGrath <roland@redhat.com>
1436
1437 * linux-proc-maps.c (read_proc_memory): Return 0 for EINVAL or EPERM
1438 failure from pread64.
1439
Roland McGrath122f3882008-08-26 07:20:29 +000014402008-08-26 Roland McGrath <roland@redhat.com>
1441
1442 * segment.c (reify_segments): Insert a trailing segment for a module
1443 end that is above the highest current segment.
1444
14452008-08-25 Roland McGrath <roland@redhat.com>
1446
1447 * dwfl_module_getdwarf.c (open_elf): Extract elf_errno () for
1448 coded return value, not plain DWFL_E_LIBELF. Return DWFL_E_BADELF
1449 if FILE->elf is not ELF_K_ELF.
1450
1451 * dwfl_segment_report_module.c: Add a cast.
1452
Roland McGrathb4d6f0f2008-08-25 22:55:17 +000014532008-08-21 Denys Vlasenko <dvlasenk@redhat.com>
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001454
Roland McGrathb4d6f0f2008-08-25 22:55:17 +00001455 * dwfl_module_addrsym.c (dwfl_module_addrsym): Improve logic
1456 which decides which symbol is "closest" to a given address.
1457
14582008-08-15 Roland McGrath <roland@redhat.com>
1459
1460 * argp-std.c (offline_callbacks): Use dwfl_build_id_find_elf.
1461 (options, parse_opt): Handle --core.
1462
1463 * core-file.c: New file.
1464 * Makefile.am (libdwfl_a_SOURCES): Add it.
1465 * libdwflP.h (dwfl_core_file_report): Declare it.
1466
1467 * link_map.c: New file.
1468 * Makefile.am (libdwfl_a_SOURCES): Add it.
1469 * libdwflP.h (dwfl_link_map_report): Declare it.
1470
1471 * libdwflP.h (MIN, MAX): New macros.
1472 (Dwfl_Memory_Callback): New typedef.
1473 (Dwfl_Module_Callback): New typedef.
1474 (dwfl_segment_report_module): Declare it.
1475 * dwfl_segment_report_module.c: New file.
1476 * Makefile.am (libdwfl_a_SOURCES): Add it.
1477
1478 * derelocate.c (dwfl_module_address_section): Add INTDEF.
1479 * libdwflP.h: Add INTDECL.
1480
1481 * segment.c: New file.
1482 * Makefile.am (libdwfl_a_SOURCES): Add it.
1483 * libdwfl.h: Declare dwfl_addrsegment, dwfl_report_segment.
1484 * libdwflP.h (struct Dwfl): New members lookup_elts, lookup_alloc,
1485 lookup_addr, lookup_module, lookup_segndx, replace removed members
1486 modules, nmodules.
1487 (struct Dwfl_Module): New member segment.
1488 * dwfl_end.c (dwfl_end): Free the new ones. Iterate via modulelist
1489 to each free module.
1490 * dwfl_module.c (dwfl_report_begin_add): Do nothing.
1491 (dwfl_report_begin): Don't call it. Truncate the segment table instead.
1492 (dwfl_report_module): Don't touch DWFL->nmodules.
1493 (dwfl_report_end): Don't touch DWFL->modules and DWFL->nmodules.
1494 (compare_modules): Function removed.
1495 * dwfl_getmodules.c: Rewritten.
1496 Add INTDEF.
1497 * libdwflP.h: Add INTDECLs.
1498 * dwfl_getdwarf.c: Rewritten to call dwfl_getmodules.
1499 * dwfl_addrmodule.c: Rewritten to just call dwfl_addrsegment.
Ulrich Drepperd56e2322008-08-16 03:09:13 +00001500
Roland McGrath1d8bb252008-08-07 08:39:41 +000015012008-08-03 Roland McGrath <roland@redhat.com>
1502
1503 * linux-kernel-modules.c: Include <fts.h> before <config.h>.
1504
15052008-07-17 Roland McGrath <roland@redhat.com>
1506
1507 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Set errno to
1508 zero if the failure was only ENOENT.
1509
15102008-06-03 Roland McGrath <roland@redhat.com>
1511
1512 * dwfl_module_addrsym.c (dwfl_module_addrsym): Exclude undefined
1513 symbols.
1514
Roland McGrath9d2f3ee2008-05-22 20:28:05 +000015152008-05-22 Petr Machata <pmachata@redhat.com>
1516
1517 * dwfl_module_getdwarf.c (open_elf): Bias of ET_EXEC files is always 0.
1518
Roland McGrath0fa20e82008-05-07 18:37:14 +000015192008-05-06 Roland McGrath <roland@frob.com>
1520
1521 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Use
1522 FTS_LOGICAL here too.
1523 (dwfl_linux_kernel_find_elf): Likewise.
1524
15252008-04-29 Roland McGrath <roland@redhat.com>
1526
1527 * find-debuginfo.c (dwfl_standard_find_debuginfo): Try path search
1528 based on canonicalize_file_name if it differs from the supplied name.
1529
1530 * linux-kernel-modules.c (check_module_notes): Use FTS_LOGICAL so
1531 we accept symlinks.
1532
Roland McGrath9897d662008-04-29 01:49:50 +000015332008-04-27 Roland McGrath <roland@redhat.com>
1534
1535 * linux-kernel-modules.c (report_kernel): Fix crash when
1536 dwfl_report_elf fails.
1537
Roland McGrathbfc01702008-04-06 01:57:32 +000015382008-04-05 Roland McGrath <roland@redhat.com>
1539
1540 * linux-proc-maps.c (proc_maps_report): Don't leak LAST_FILE.
1541
1542 * dwfl_module_getdwarf.c (find_file): Always free build_id_bits.
1543 Clear it after freeing.
1544 * dwfl_module_report_build_id.c (dwfl_module_report_build_id): Likewise.
1545
Roland McGrathd11f9cb2008-03-26 20:51:59 +000015462008-03-26 Roland McGrath <roland@redhat.com>
1547
1548 * dwfl_module_getdwarf.c (load_symtab): Don't return success for
1549 SHT_DYNSYM, just set *SYMSCN like the comment says.
1550
1551 * dwfl_end.c (dwfl_end): Iterate on modulelist chain, not modules array.
1552
1553 * argp-std.c (parse_opt): On failure, call dwfl_end before argp_failure.
1554
15552008-03-19 Roland McGrath <roland@redhat.com>
1556
1557 * dwfl_module_getsrc.c: Adjust address for module bias before search.
1558
15592008-03-01 Roland McGrath <roland@redhat.com>
1560
1561 * libdwflP.h (__libdwfl_seterrno): Remove parameter name from
1562 prototype to avoid older compiler's complaint about reuse of the name.
1563 (__libdwfl_canon_error): Likewise.
1564
Roland McGrath059c83e2008-02-21 06:19:39 +000015652008-02-19 Roland McGrath <roland@redhat.com>
1566
1567 * relocate.c (relocate_section): Check for an unhandled relocation
1568 type before resolving a reloc's symbol. Lift DWFL_E_BADRELTYPE ->
1569 DWFL_E_UNKNOWN_MACHINE check out of loops.
1570
1571 * dwfl_module_getdwarf.c (load_dw): Skip relocation if
1572 DEBUGFILE->relocated is already set.
1573
15742008-01-26 Roland McGrath <roland@redhat.com>
1575
1576 * dwfl_module_getdwarf.c (open_elf): Open FILE->name if it's non-null.
1577
1578 * dwfl_build_id_find_elf.c (__libdwfl_open_by_build_id): Don't clear
1579 incoming *FILE_NAME at the start.
1580
Ulrich Dreppere219f1c2008-01-09 05:49:49 +000015812008-01-08 Roland McGrath <roland@redhat.com>
1582
1583 * Makefile.am (euinclude): Variable removed.
1584 (pkginclude_HEADERS): Set this instead of euinclude_HEADERS.
1585
Roland McGrathe4c22ea2007-10-23 13:07:39 +000015862007-10-23 Roland McGrath <roland@redhat.com>
1587
1588 * linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
1589 module to appear first.
1590
15912007-10-20 Roland McGrath <roland@redhat.com>
1592
1593 * offline.c (process_archive_member): Take FD argument, pass it down
1594 to process_file. Return Elf_Cmd, not bool.
1595 Call elf_next here, always before elf_end.
1596 (process_archive): Update caller. Don't close FD here unless there
1597 are no member refs.
1598
1599 * dwfl_module.c (free_file): Close fd only when elf_end returns zero.
1600
1601 * libdwflP.h (struct dwfl_file): New bool member `relocated'.
1602 * dwfl_module_getdwarf.c (dwfl_module_getelf): For ET_REL, apply
1603 partial relocation to one or both files.
1604 (dwfl_module_getdwarf): For ET_REL, make sure extra sections'
1605 relocations have been applied to the debug file if dwfl_module_getelf
1606 has been used before.
1607
1608 * relocate.c (resolve_symbol): New function.
1609 (relocate_section): Call it.
1610
1611 * relocate.c (relocate_getsym): Handle null MOD->symfile.
1612 (relocate_section): Take new bool arg, PARTIAL. If true,
1613 no error for BADRELTYPE/RELUNDEF, instead just skip them
1614 and leave only those skipped relocs behind the reloc section.
1615 (__libdwfl_relocate_section): Take new arg, pass it down.
1616 (__libdwfl_relocate): Take new bool arg, DEBUG. If false,
1617 do partial relocation on all sections.
1618 * dwfl_module_getdwarf.c (load_dw): Update caller.
1619 * libdwflP.h: Update decls.
1620 * derelocate.c (dwfl_module_address_section): Pass new argument
1621 to __libdwfl_relocate_section, true.
1622
1623 * derelocate.c (cache_sections): Don't cache reloc sections when
1624 section_address callback is null.
1625
16262007-10-19 Roland McGrath <roland@redhat.com>
1627
1628 * relocate.c (relocate_section): Fix fencepost error in r_offset check.
1629
1630 * derelocate.c (struct dwfl_relocation): Add member `relocs'.
1631 (struct secref): Likewise.
1632 (cache_sections): Cache the relocation section referring to each
1633 section we cache, if any.
1634 (dwfl_module_address_section): Use __libdwfl_relocate_section as
1635 necessary.
1636
1637 * relocate.c (struct reloc_symtab_cache): New type.
1638 (relocate_getsym): Use it instead of four arguments.
1639 (__libdwfl_relocate): Update caller.
1640 (relocate_section): New function, broken out of ...
1641 (__libdwfl_relocate): ... here.
1642 (__libdwfl_relocate_section): New function.
1643 * libdwflP.h: Declare it.
1644
16452007-10-17 Roland McGrath <roland@redhat.com>
1646
1647 * dwfl_module_getsym.c (dwfl_module_getsym): Apply MOD->symfile->bias
1648 to relocated st_value.
1649
1650 * dwfl_report_elf.c (__libdwfl_report_elf): Align initial BASE for
1651 ET_REL to 0x100.
1652
16532007-10-16 Roland McGrath <roland@redhat.com>
1654
1655 * dwfl_report_elf.c (__libdwfl_report_elf): Readjust BASE when a later
1656 section has larger alignment requirements not met by the original BASE,
1657 rather than padding more between sections.
1658
1659 * dwfl_report_elf.c (__libdwfl_report_elf): Fix bias calculation.
1660
1661 * dwfl_module_build_id.c (__libdwfl_find_build_id): Apply module bias
1662 to sh_addr value.
1663
1664 * dwfl_report_elf.c (__libdwfl_report_elf): Don't be confused by BASE
1665 at zero in ET_REL case. Adjust BASE to necessary alignment.
1666
1667 * dwfl_module_build_id.c (check_notes): Take -1, not 0, as stub value
1668 for DATA_VADDR.
1669 (__libdwfl_find_build_id): Update caller.
1670
1671 * relocate.c (__libdwfl_relocate_value): Don't use sh_offset.
1672 * dwfl_report_elf.c (__libdwfl_report_elf): Likewise.
1673 * offline.c (dwfl_offline_section_address): Bail early if there is
1674 separate debug file.
1675
1676 * relocate.c (__libdwfl_relocate): Don't return DWFL_E_NO_DWARF.
1677
Ulrich Drepperb597dfa2007-10-16 05:21:27 +000016782007-10-09 Roland McGrath <roland@redhat.com>
1679
1680 * dwfl_report_elf.c (__libdwfl_report_elf): Clear SHDR->sh_offset when
1681 caching SHDR->sh_addr = 0.
1682 * offline.c (dwfl_offline_section_address): Never called for sh_addr
1683 really at 0, don't check for it. Use MOD->debug directly, not symfile.
1684
1685 * dwfl_module_getdwarf.c (load_symtab): Return success properly when
1686 we've found SHT_SYMTAB.
1687
1688 * relocate.c (relocate_getsym): New function.
1689 (__libdwfl_relocate): Use it.
1690 (__libdwfl_relocate_value): Take new Elf * argument. Make SYMSHSTRNDX
1691 be a pointer instead of value; cache getshstrndx result there.
1692 * libdwflP.h: Update decl.
1693 * derelocate.c (cache_sections): Update caller.
1694 Always work on the main file, not the symfile.
1695 (dwfl_module_address_section): Likewise.
1696 * dwfl_module_getsym.c (dwfl_module_getsym): Update caller.
1697
16982007-10-07 Roland McGrath <roland@redhat.com>
1699
1700 * offline.c (process_archive): Initialize MOD.
1701
1702 * linux-kernel-modules.c (get_release): New function, broken out of ...
1703 (report_kernel): ... here. Call it.
1704 (try_kernel_name): Take new arg TRY_DEBUG, only try ".debug" if set.
1705 (find_kernel_elf): Update caller.
1706 (report_kernel_archive): New function.
1707 (dwfl_linux_kernel_report_offline): Call it.
1708
1709 * offline.c (process_file): Take new arg PREDICATE, pass it down.
1710 (process_archive): Likewise.
1711 (process_archive_member): Likewise. When nonnull, let the predicate
1712 decide whether to use this member.
1713 (__libdwfl_report_offline): New function, broken out of ...
1714 (dwfl_report_offline): ... here. Call it.
1715 * libdwflP.h: Declare it.
1716
1717 * offline.c (process_archive, process_archive_member): New functions.
1718 (process_elf, process_file): New functions, broken out of ...
1719 (dwfl_report_offline): ... here. Call process_file, which recurses on
1720 ELF_K_AR files.
1721
1722 * dwfl_report_elf.c (__libdwfl_report_elf): New, broken out of ...
1723 (dwfl_report_elf): ... here. Call it.
1724 * libdwflP.h: Declare it.
1725
17262007-10-06 Roland McGrath <roland@redhat.com>
1727
1728 * derelocate.c (dwfl_module_relocations): Don't call
1729 dwfl_module_getdwarf.
1730
1731 * derelocate.c (find_section): Use __libdwfl_seterrno, not
1732 __libdw_seterrno.
1733
1734 * relocate.c (__libdwfl_relocate_value): Abuse sh_offset, not
1735 SHF_ALLOC, to cache sh_addr resolved to 0.
1736
1737 * dwfl_report_elf.c (dwfl_report_elf): When an ET_REL file has sh_addr
1738 values nonzero already, just use its existing layout.
1739
1740 * relocate.c (__libdwfl_relocate): Clear size of reloc section in its
1741 in-core shdr after applying it.
1742
Ulrich Drepper3fc3d7b2007-10-04 18:40:28 +000017432007-10-04 Ulrich Drepper <drepper@redhat.com>
1744
1745 * linux-kernel-modules.c (dwfl_linux_kernel_report_kernel): Fake
1746 initialization of notes variable.
1747
Roland McGrath59ea7f32007-10-04 08:50:09 +000017482007-10-04 Roland McGrath <roland@redhat.com>
1749
1750 * linux-kernel-modules.c (intuit_kernel_bounds): Take new arg NOTES,
1751 fill in with vaddr of "__start_notes" symbol if found.
1752 (check_notes): New function.
1753 (check_kernel_notes): New function.
1754 (dwfl_linux_kernel_report_kernel): Call it.
1755 (check_module_notes): New function.
1756 (dwfl_linux_kernel_report_modules): Call it.
1757
1758 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf):
1759 Try dwfl_build_id_find_elf first.
1760
1761 * linux-kernel-modules.c (report_kernel): Don't leak FD if !REPORT.
1762 Set kernel module e_type to ET_DYN.
1763
17642007-10-03 Roland McGrath <roland@redhat.com>
1765
1766 * find-debuginfo.c (validate): New function, broken out of ...
1767 (find_debuginfo_in_path): ... here. New function, broken out of ...
1768 (dwfl_standard_find_debuginfo): ... here. Call it, after trying
1769 dwfl_build_id_find_debuginfo first.
1770
1771 * dwfl_build_id_find_elf.c: New file.
1772 * dwfl_build_id_find_debuginfo.c: New file.
1773 * Makefile.am (libdwfl_a_SOURCES): Add them.
1774 * libdwfl.h: Declare them.
1775 * libdwflP.h: Add INTDECLs.
1776
1777 * dwfl_module_build_id.c: New file.
1778 * dwfl_module_report_build_id.c: New file.
1779 * Makefile.am (libdwfl_a_SOURCES): Add them.
1780 * libdwfl.h: Declare them.
1781 * libdwflP.h (struct Dwfl_Module): New members build_id_bits,
1782 build_id_len, build_id_vaddr. Declare __libdwfl_find_build_id.
1783 * dwfl_module.c (__libdwfl_module_free): Free MOD->build_id_bits.
1784
1785 * dwfl_module_getdwarf.c (find_offsets): New function.
1786 (find_dynsym): New function, calls that.
1787 (find_symtab): Call it.
1788
Roland McGrathc76f0b02007-09-27 07:31:33 +000017892007-09-11 Roland McGrath <roland@redhat.com>
1790
1791 * dwfl_module_addrsym.c: Prefer a later global symbol at the same
1792 address if its st_size is smaller.
1793
Roland McGrath099dd522007-08-13 22:58:36 +000017942007-08-13 Roland McGrath <roland@redhat.com>
1795
1796 * dwfl_module_addrsym.c: Add dead initializer for stupid compiler.
1797
17982007-08-12 Roland McGrath <roland@redhat.com>
1799
1800 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Don't use
1801 FTS_LOGICAL.
1802
1803 * elf-from-memory.c (elf_from_remote_memory): Don't reset LOADBASE on
1804 a second phdr if it happens to match EHDR_VMA exactly.
1805
Roland McGrath42f68682007-08-09 07:54:22 +000018062007-08-08 Roland McGrath <roland@redhat.com>
1807
1808 * dwfl_module_addrsym.c: Don't use STT_SECTION, STT_FILE symbols and
1809 those with no names. Rewrite best symbol algorithm not to assume a
1810 sorted table and to be smarter handling sizeless symbols.
1811
Roland McGrath87d47802007-07-16 22:23:37 +000018122007-07-16 Roland McGrath <roland@redhat.com>
1813
1814 * dwfl_module.c (dwfl_report_module): Increment DWFL->nmodules when
1815 reviving an existing module.
1816
18172007-06-08 Roland McGrath <roland@redhat.com>
Roland McGrath55d34a52007-06-08 22:22:01 +00001818
1819 * libdwflP.h: Fix #ifndef for config.h to use PACKAGE_NAME.
1820
Roland McGrath9aa8ef72007-05-18 08:59:43 +000018212007-05-17 Roland McGrath <roland@redhat.com>
1822
1823 * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): Look at
1824 whole /lib/modules/VERSION tree, not just /lib/modules/VERSION/kernel.
1825 (dwfl_linux_kernel_find_elf): Likewise.
1826
1827 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
1828 getline and sscanf instead of fscanf.
1829
18302007-05-08 Roland McGrath <roland@redhat.com>
1831
1832 * offline.c (dwfl_offline_section_address): Don't assume section
1833 numbers match between stripped and debuginfo files. Instead, assume
1834 only that the ordering among SHF_ALLOC sections matches.
1835
1836 * linux-kernel-modules.c (report_kernel): Change RELEASE argument to
1837 pointer to string.
1838 (dwfl_linux_kernel_report_offline): Update caller.
1839 (dwfl_linux_kernel_report_kernel): Likewise.
1840
Roland McGrath4be15242007-04-25 03:09:33 +000018412007-04-23 Roland McGrath <roland@redhat.com>
1842
1843 * argp-std.c (options): Fix group title string.
1844
1845 * argp-std.c (parse_opt): Handle ARGP_KEY_ERROR, free the Dwfl.
1846 Update via STATE->input every time we set STATE->hook, not only at
1847 ARGP_KEY_SUCCESS.
1848
1849 * dwfl_module.c (free_file): Free FILE->name.
1850
Roland McGrath43da9892007-04-16 23:13:37 +000018512007-04-16 Roland McGrath <roland@redhat.com>
1852
1853 * derelocate.c (cache_sections): Apply bias to sh_addr.
1854 (compare_secrefs): Fix address comparison to avoid signed overflow.
1855 (find_section): New function, broken out of ...
1856 (dwfl_module_relocate_address): ... here, call it.
1857 (check_module): New function, broken out of ...
1858 (dwfl_module_relocate_address): ... here, call it.
1859 (dwfl_module_address_section): New function.
1860 * libdwfl.h: Declare it.
1861
Ulrich Drepperc07fbb32007-03-30 19:14:59 +000018622007-03-26 Roland McGrath <roland@redhat.com>
1863
1864 * dwfl_module.c (__libdwfl_module_free): Free MOD itself.
1865
18662007-03-18 Roland McGrath <roland@redhat.com>
1867
1868 * dwfl_module_getdwarf.c (find_debuglink): New function, broken out of
1869 (find_debuginfo): ... here. Call it.
1870 Don't return error for libelf errors finding .gnu_debuglink section.
1871
Ulrich Drepper6258e742007-03-13 06:22:40 +000018722007-03-12 Roland McGrath <roland@redhat.com>
1873
1874 * dwfl_module.c (dwfl_report_begin_add): New function broken out of ...
1875 (dwfl_report_begin): ... here. Call it.
1876 * libdwfl.h: Declare it.
1877 * libdwflP.h: Add INTDECL.
1878
1879 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
1880
1881 * offline.c: Comment typo fix.
1882
18832007-03-04 Roland McGrath <roland@redhat.com>
1884
1885 * linux-kernel-modules.c (KERNEL_MODNAME): New macro for "kernel".
1886 (find_kernel_elf): New function, broken out of ...
1887 (report_kernel): ... here. Call it.
1888 (dwfl_linux_kernel_find_elf): Use it for module named KERNEL_MODNAME.
1889 (intuit_kernel_bounds): New function, grovel /proc/kallsyms to guess
1890 virtual address bounds of kernel from symbols rounded to page size.
1891 (dwfl_linux_kernel_report_kernel): Use that if it works, before
1892 resorting to report_kernel.
1893
1894 * dwfl_module_getdwarf.c (open_elf): Set MOD->e_type to ET_DYN for an
1895 ET_EXEC file with nonzero bias.
1896
1897 * dwfl_module_addrname.c (dwfl_module_addrname): Just call
1898 dwfl_module_addrsym. Guts moved to ...
1899 * dwfl_module_addrsym.c: ... here; new file.
1900 * Makefile.am (libdwfl_a_SOURCES): Add it.
1901 * libdwfl.h: Declare dwfl_module_addrsym.
1902 * libdwflP.h: Add INTDECL.
1903
19042007-03-03 Roland McGrath <roland@redhat.com>
1905
1906 * dwfl_module.c (free_file): New function, broken out of ...
1907 (__libdwfl_module_free): ... here. In it, close fd after elf_end.
1908
1909 * dwfl_module_getdwarf.c (open_elf): Close fd and reset to -1
1910 on libelf failure.
1911
19122007-03-02 Roland McGrath <roland@redhat.com>
1913
1914 * linux-kernel-modules.c: Fix bogus error test for asprintf call.
1915
Ulrich Drepperaa915fd2007-02-05 07:25:33 +000019162007-02-02 Roland McGrath <roland@redhat.com>
1917
1918 * dwfl_addrmodule.c (dwfl_addrmodule): Match a module's high boundary
1919 address exactly if it's no other module's low boundary.
1920
1921 * dwfl_module_addrname.c (dwfl_module_addrname): If no symbol's value
1922 and size cover the address, select the closest symbol with st_size==0
1923 that lies in the same section.
1924
19252007-01-29 Roland McGrath <roland@redhat.com>
1926
1927 * dwfl_version.c (dwfl_version): Return PACKAGE_VERSION,
1928 not PACKAGE_STRING.
1929
19302007-01-20 Roland McGrath <roland@redhat.com>
1931
1932 * relocate.c (__libdwfl_relocate_value): Treat section_address of -1
1933 as omitted, not 0.
1934 * libdwfl.h (Dwfl_Callbacks): Update comment.
1935 * derelocate.c (cache_sections): Don't ignore sh_addr == 0 sections.
1936 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
1937 For ignored missing section, use -1 instead of 0.
1938 * offline.c (dwfl_offline_section_address): Expect a call for 0.
1939
19402007-01-19 Roland McGrath <roland@redhat.com>
1941
1942 * argp-std.c (parse_opt): For -e, reset DWFL->offline_next_address to
1943 zero so a lone -e foo.so is shown without address bias.
1944
Roland McGrathba949b32007-01-10 20:44:29 +000019452007-01-10 Roland McGrath <roland@redhat.com>
1946
Roland McGrath44865b92007-01-11 05:06:16 +00001947 * linux-kernel-modules.c (report_kernel): Check asprintf return value
1948 directly instead of via side effect, to silence warn_unused_result.
1949 (dwfl_linux_kernel_report_offline): Likewise.
1950 (dwfl_linux_kernel_find_elf): Likewise.
1951 (dwfl_linux_kernel_module_section_address): Likewise.
1952 * find-debuginfo.c (try_open): Likewise.
Roland McGrathd39384c2007-01-11 05:15:56 +00001953 * linux-proc-maps.c (find_sysinfo_ehdr): Likewise.
1954 (dwfl_linux_proc_report): Likewise.
Roland McGrath44865b92007-01-11 05:06:16 +00001955
Roland McGrathba949b32007-01-10 20:44:29 +00001956 * libdwfl.h (dwfl_begin): Require nonnull argument.
1957
Roland McGrath70008802006-12-29 20:44:16 +000019582006-12-27 Roland McGrath <roland@redhat.com>
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001959
Roland McGrath70008802006-12-29 20:44:16 +00001960 * dwfl_module.c (compare_modules): Fix address comparison to avoid
1961 signed overflow. Patch by Frank Ch. Eigler <fche@redhat.com>.
Ulrich Dreppera33c3012006-12-29 20:36:38 +00001962
Roland McGrath8190db62006-12-17 23:56:51 +000019632006-10-30 Roland McGrath <roland@redhat.com>
1964
1965 * dwfl_module.c (dwfl_report_module): Comment typo fix.
1966
Roland McGrathc373d852006-10-10 00:25:21 +000019672006-09-05 Roland McGrath <roland@redhat.com>
1968
1969 * derelocate.c (cache_sections): Use alloca instead of variable-sized
Roland McGrath3c84db32009-06-24 17:41:40 -07001970 auto array, in function already using alloca.
Roland McGrathc373d852006-10-10 00:25:21 +00001971
Roland McGratha1cee072006-08-15 01:37:23 +000019722006-08-14 Roland McGrath <roland@redhat.com>
1973
1974 * linux-kernel-modules.c (try_kernel_name): If the call to
1975 dwfl_standard_find_debuginfo produces no results, try it again
1976 with NULL as DEBUGLINK_FILE to try *FNAME with .debug suffix.
1977
1978 * find-debuginfo.c (DEFAULT_DEBUGINFO_PATH): Macro moved ...
1979 * libdwflP.h: ... to here.
1980 * linux-kernel-modules.c (try_kernel_name): Skip manual open if it
1981 repeats the first thing dwfl_standard_find_debuginfo will try.
1982
1983 * linux-kernel-modules.c (MODULE_SECT_NAME_LEN): New macro.
1984 (dwfl_linux_kernel_module_section_address): If a /sys file is missing
1985 and the section name is >= MODULE_SECT_NAME_LEN, try truncating the
1986 section name.
1987
Ulrich Drepper077c65f2006-07-12 19:54:51 +000019882006-07-12 Ulrich Drepper <drepper@redhat.com>
1989
1990 * cu.c: Adjust for internal_function_def removal.
1991 * dwfl_error.c: Likewise.
1992 * dwfl_module.c: Likewise.
1993 * dwfl_module_getdwarf.c: Likewise.
1994 * lines.c: Likewise.
1995 * relocate.c: Likewise.
1996
Ulrich Drepperc87b6e72006-07-11 22:32:28 +000019972006-07-11 Ulrich Drepper <drepper@redhat.com>
1998
1999 * dwfl_module.c (compare_modules): Don't return GElf_Sxword value,
2000 it can overflow the return value type.
2001 Patch by Tim Moore <timoore@redhat.com>.
2002
Ulrich Dreppere1812e12006-07-12 07:46:03 +000020032006-06-28 Roland McGrath <roland@redhat.com>
2004
2005 * libdwfl.h: Cosmetic changes.
2006
2007 * dwfl_line_comp_dir.c: New file.
2008 * Makefile.am (libdwfl_a_SOURCES): Add it.
2009 * libdwfl.h: Declare dwfl_line_comp_dir.
2010
2011 * dwfl_lineinfo.c (dwfl_lineinfo): Remove stray extern in defn.
2012
2013 * dwfl_linecu.c: New file.
2014 * Makefile.am (libdwfl_a_SOURCES): Add it.
2015 * libdwfl.h: Declare dwfl_linecu.
2016
2017 * libdwflP.h (dwfl_linecu_inline): Function renamed from dwfl_linecu.
2018 (dwfl_linecu): Define as macro.
2019
2020 * relocate.c (__libdwfl_relocate): Use dwfl_module_getsym.
2021
2022 * dwfl_module_getdwarf.c (dwfl_module_getsymtab): New function.
2023 (dwfl_module_addrname): Function moved ...
2024 * dwfl_module_addrname.c: ... here, new file.
2025 * dwfl_module_getsym.c: New file.
2026 * Makefile.am (libdwfl_a_SOURCES): Add them.
2027 * libdwfl.h: Declare dwfl_module_getsymtab, dwfl_module_getsym.
2028 * libdwflP.h: Add INTDECLs.
2029
20302006-06-27 Roland McGrath <roland@redhat.com>
2031
2032 * dwfl_module.c (dwfl_report_end): Whitespace fix.
2033
Ulrich Drepperd5a75192006-06-15 03:07:46 +000020342006-06-13 Roland McGrath <roland@redhat.com>
2035
2036 * elf-from-memory.c (elf_from_remote_memory): Fix 32/64 typo.
2037 Use __libdwfl_seterrno for elf_memory failure.
2038
Ulrich Dreppere1812e12006-07-12 07:46:03 +000020392006-05-22 Roland McGrath <roland@redhat.com>
2040
2041 * dwfl_module_return_value_location.c
2042 (dwfl_module_return_value_location): Use __libdwfl_module_getebl.
2043
Ulrich Drepper41cbd762006-05-27 18:19:23 +000020442006-05-27 Ulrich Drepper <drepper@redhat.com>
2045
2046 * libdwfl.h: Add extern "C".
2047
Ulrich Dreppere7a73172006-05-22 18:16:45 +000020482006-05-22 Ulrich Drepper <drepper@redhat.com>
2049
2050 * cu.c (addrarange): Handle files without aranges information.
2051
Ulrich Dreppera1690682006-05-17 05:28:36 +000020522006-05-16 Ulrich Drepper <drepper@redhat.com>
2053
2054 * dwfl_addrmodule.c (dwfl_addrmodule): Also return NULL of
2055 ->modules is NULL.
2056
Roland McGrath687d7e92006-02-27 04:53:00 +000020572006-02-26 Roland McGrath <roland@redhat.com>
2058
Roland McGrath08333122006-02-27 04:54:26 +00002059 * dwfl_version.c: New file.
2060 * Makefile.am (libdwfl_a_SOURCES): Add it.
2061 * libdwfl.h: Declare dwfl_version.
2062
Roland McGrath687d7e92006-02-27 04:53:00 +00002063 * offline.c (dwfl_report_offline): Account for dwfl_report_elf having
2064 aligned up from DWFL->offline_next_address when checking for overlap.
2065
Roland McGrathfceb7b42005-12-23 01:45:21 +000020662005-12-22 Roland McGrath <roland@redhat.com>
2067
Roland McGrath1656bc02005-12-23 01:49:50 +00002068 * argp-std.c (parse_opt): Call dwfl_end in failure cases.
2069
2070 * linux-proc-maps.c (proc_maps_report): New function, broken out of ...
2071 (dwfl_linux_proc_report): ... here. Call it.
2072 (dwfl_linux_proc_maps_report): New function.
2073 * libdwfl.h: Declare it.
2074 * libdwflP.h: Add INTDECL.
2075 * argp-std.c (options, parse_opt): Grok -M/--linux-process-map.
2076
Roland McGrathfceb7b42005-12-23 01:45:21 +00002077 * dwfl_nextcu.c (dwfl_nextcu): Don't fail when dwfl_module_getdwarf
2078 failed with DWFL_E_NO_DWARF.
2079
Roland McGrath994b4892005-12-05 22:46:21 +000020802005-11-26 Roland McGrath <roland@redhat.com>
2081
2082 * dwfl_end.c (dwfl_end): Free the DWFL itself.
2083
20842005-11-25 Roland McGrath <roland@redhat.com>
2085
2086 * dwfl_module_getdwarf.c (__libdwfl_module_getebl): New function.
2087 (load_dw): Use it.
2088 * dwfl_module_register_names.c (dwfl_module_register_names): Likewise.
2089 * libdwflP.h: Declare it.
2090
2091 * dwfl_module_register_names.c: New file.
2092 * Makefile.am (libdwfl_a_SOURCES): Add it.
2093 * libdwfl.h: Declare dwfl_module_register_names.
2094
Roland McGratha5640892005-11-26 00:38:14 +000020952005-11-21 Roland McGrath <roland@redhat.com>
2096
2097 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2098 Don't leak malloc'd file name.
2099 If a /sys/.../sections file is missing and starts with ".init",
2100 try the variant with "_init" too; catches PPC64 kernel braindamage.
2101
Roland McGrathe47ab762005-11-17 03:16:00 +000021022005-11-15 Roland McGrath <roland@redhat.com>
2103
2104 * libdwfl.h: Comment fixes.
2105
2106 * dwfl_module_return_value_location.c: Add unlikely for error case.
2107
21082005-11-13 Roland McGrath <roland@redhat.com>
2109
2110 * dwfl_return_value_location.c: New file.
2111 * Makefile.am (libdwfl_a_SOURCES): Add it.
2112 * libdwfl.h: Declare dwfl_module_return_value_location.
2113 * libdwflP.h (DWFL_ERRORS): Add DWFL_E_WEIRD_TYPE.
2114
Roland McGrath07d4f2f2005-10-28 06:56:24 +000021152005-10-20 Roland McGrath <roland@redhat.com>
2116
2117 * libdwflP.h (DWFL_ERRORS): New error UNKNOWN_MACHINE.
2118 * relocate.c (__libdwfl_relocate): Return DWFL_E_UNKNOWN_MACHINE
2119 instead of DWFL_E_BADRELTYPE if ebl_get_elfmachine yields EM_NONE.
2120
21212005-10-01 Roland McGrath <roland@redhat.com>
2122
2123 * linux-kernel-modules.c (report_kernel): Return ENOENT if we fail
2124 with errno 0.
2125
21262005-09-19 Roland McGrath <roland@redhat.com>
2127
2128 * linux-kernel-modules.c (dwfl_linux_kernel_report_modules): Use
2129 PRIx64 instead of PRIi64, lest addresses with high bits set overflow
2130 the signed integer reading; they will just have to be in hexadecimal.
2131 (dwfl_linux_kernel_module_section_address): Likewise.
2132
Ulrich Drepperfbe998a2005-08-29 16:27:10 +000021332005-08-28 Ulrich Drepper <drepper@redhat.com>
2134
2135 * Makefile.am (%.os): Use COMPILE.os.
2136 (COMPILE.os): Filter out gconv options.
2137
Roland McGrath995f92d2005-08-26 05:55:04 +000021382005-08-25 Roland McGrath <roland@redhat.com>
2139
2140 * cu.c (__libdwfl_nextcu): Return success when dwarf_nextcu hits end.
2141 * dwfl_nextcu.c (dwfl_nextcu): Skip modules with no dwarf info.
2142
Roland McGrath80e43a72005-08-24 21:12:15 +000021432005-08-24 Roland McGrath <roland@redhat.com>
2144
Roland McGrathefb5caa2005-08-25 01:49:53 +00002145 * dwfl_lineinfo.c (dwfl_lineinfo): Add bias, don't subtract it.
2146
Roland McGrath80e43a72005-08-24 21:12:15 +00002147 * argp-std.c [_MUDFLAP] (__libdwfl_argp_mudflap_options): New function,
2148 magic initializer to set -heur-stack-bound option.
2149
Roland McGrath3712b282005-08-23 05:58:42 +000021502005-08-22 Roland McGrath <roland@redhat.com>
2151
Roland McGrathd17fac72005-08-23 08:20:21 +00002152 * dwfl_validate_address.c: New file.
2153 * Makefile.am (libdwfl_a_SOURCES): Add it.
2154 * libdwfl.h: Declare dwfl_validate_address.
2155
2156 * derelocate.c (dwfl_module_relocate_address): Add INTDEF.
2157 * libdwflP.h: Add INTDECL.
2158
Roland McGrath3712b282005-08-23 05:58:42 +00002159 * dwfl_module_getdwarf.c (find_symtab): Use elf_getdata instead of
2160 elf_rawdata for symbol-related sections.
2161
Roland McGrathd17fac72005-08-23 08:20:21 +00002162 * offline.c (dwfl_report_offline): Move offline_next_address outside
2163 module's range, in case it's an ET_EXEC using fixed segment locations.
2164 * libdwfl.h: Update comment.
2165
2166 * dwfl_report_elf.c (dwfl_report_elf): Align BASE to first segment's
2167 required alignment.
2168
21692005-08-20 Roland McGrath <roland@redhat.com>
2170
2171 * linux-kernel-modules.c (report_kernel): Take new argument PREDICATE,
2172 function to choose whether to report.
2173 (dwfl_linux_kernel_report_offline): Likewise.
2174 * libdwfl.h: Update decl.
2175 * argp-std.c (parse_opt): Update caller.
2176
2177 * dwfl_getsrclines.c: New file.
2178 * dwfl_onesrcline.c: New file.
2179 * Makefile.am (libdwfl_a_SOURCES): Add them.
2180 * libdwfl.h: Declare dwfl_getsrclines, dwfl_onesrcline.
2181
2182 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): Don't leak
2183 MODULESDIR[0]. Call fts_close on failure.
2184
2185 * dwfl_module_getdwarf.c (load_dw): Take dwfl_file * instead of Elf *.
2186 Close ET_REL file descriptors after relocation.
2187 (find_dw): Update caller.
2188 * offline.c (dwfl_report_offline): Get the file into memory and close
2189 the file descriptor.
2190
2191 * dwfl_module_getdwarf.c (find_debuginfo): Do nothing when
2192 MOD->debug.elf is already set.
2193
2194 * find-debuginfo.c (try_open): Use TEMP_FAILURE_RETRY.
2195 (dwfl_standard_find_debuginfo): Fail on errors not ENOENT or ENOTDIR.
2196
2197 * argp-std.c (options, parse_opt): Grok -K/--offline-kernel, use
2198 dwfl_linux_kernel_report_offline with offline_callbacks.
2199
2200 * linux-kernel-modules.c (report_kernel): New function, broken out of
2201 ...
2202 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2203 (dwfl_linux_kernel_report_offline): New function.
2204 * libdwfl.h: Declare it.
2205 * libdwflP.h: Add INTDECL.
2206
22072005-08-19 Roland McGrath <roland@redhat.com>
2208
2209 Use standard debuginfo search path to look for vmlinux.
2210 * find-debuginfo.c (dwfl_standard_find_debuginfo): Don't check CRC if
2211 passed zero.
2212 * linux-kernel-modules.c (try_kernel_name): New function, broken out
2213 of ...
2214 (dwfl_linux_kernel_report_kernel): ... here. Use it.
2215
2216 * argp-std.c (offline_callbacks): New variable.
2217 (parse_opt): Use it for -e. Allow multiple -e options.
2218
2219 * offline.c: New file.
2220 * Makefile.am (libdwfl_a_SOURCES): Add it.
2221 * libdwfl.h: Declare dwfl_offline_section_address, dwfl_report_offline.
2222 * libdwflP.h: Add INTDECLs.
2223 (OFFLINE_REDZONE): New macro.
2224 (struct Dwfl): New member `offline_next_address'.
2225 * dwfl_begin.c (dwfl_begin): Initialize it.
2226 * dwfl_module.c (dwfl_report_begin): Likewise.
2227
2228 * dwfl_report_elf.c (dwfl_report_elf): Accept all types. When ET_REL,
2229 do a nominal absolute section layout starting at BASE.
2230 * libdwfl.h: Update comment.
2231
22322005-08-18 Roland McGrath <roland@redhat.com>
2233
2234 * dwfl_module_getsrc_file.c (dwfl_module_getsrc_file): Do
2235 dwfl_module_getdwarf if necessary.
2236
2237 * dwfl_report_elf.c (dwfl_report_elf): Permit ET_REL with BASE==0.
2238 * libdwfl.h: Update comment.
2239
2240 * derelocate.c: New file.
2241 * Makefile.am (libdwfl_a_SOURCES): Add it.
2242
2243 * libdwflP.h (struct Dwfl_Module): isrel -> e_type.
2244 * dwfl_report_elf.c (dwfl_report_elf): Initialize it.
2245 * dwfl_module_getdwarf.c (open_elf): Update initialization.
2246 (load_dw, dwfl_module_addrname): Update uses.
2247 * relocate.c (__libdwfl_relocate): Likewise.
2248
22492005-08-04 Roland McGrath <roland@redhat.com>
2250
2251 * libdwfl.h (Dwfl_Callbacks.section_address): Take additional
2252 arguments SHNDX, SHDR.
2253 (dwfl_linux_kernel_module_section_address): Update prototype.
2254 * relocate.c (__libdwfl_relocate_value): Update caller.
2255 * linux-kernel-modules.c (dwfl_linux_kernel_module_section_address):
2256 Take the new arguments.
2257
Roland McGrathd2c59962005-08-10 22:13:57 +000022582005-08-10 Roland McGrath <roland@redhat.com>
2259
2260 * relocate.c (__libdwfl_relocate): Take argument DEBUGFILE,
2261 use it instead of MOD->debug.file.
2262 * libdwflP.h: Update decl.
2263 * dwfl_module_getdwarf.c (load_dw): Update caller.
2264 Fixes bug #165598.
2265
Roland McGrath4959bf82005-08-09 10:31:08 +000022662005-08-09 Roland McGrath <roland@redhat.com>
2267
2268 * libdwflP.h: Include ../libdw/libdwP.h for its INTDECLs.
2269 * cu.c: Use INTUSE on dwarf_* calls.
2270 * dwfl_error.c: Likewise.
2271 * dwfl_module.c: Likewise.
2272 * dwfl_module_getdwarf.c: Likewise.
2273 * dwfl_module_getsrc_file.c: Likewise.
2274 * lines.c: Likewise.
2275
Roland McGrath5678f872005-08-07 21:42:56 +000022762005-08-07 Roland McGrath <roland@redhat.com>
2277
2278 * linux-kernel-modules.c (dwfl_linux_kernel_find_elf): When module
2279 names contain '_' or '-', look for files named either "foo-bar.ko"
2280 or "foo_bar.ko".
2281
Roland McGrath83fcb482005-08-02 00:58:33 +000022822005-07-29 Roland McGrath <roland@redhat.com>
2283
2284 * loc2c.c: File removed.
2285 * loc2c.h: File removed.
2286 * loc2c-runtime.h: File removed.
2287 * test2.c: File removed.
2288 * Makefile.am (EXTRA_DIST): Variable removed.
2289 (noinst_HEADERS): Remove loc2c.h from here.
2290
Ulrich Drepper18618fd2005-07-28 21:29:22 +000022912005-07-28 Ulrich Drepper <drepper@redhat.com>
2292
Ulrich Drepper4d527362005-07-28 22:32:58 +00002293 * libdwfl.h: Add a few missing extern for function prototypes.
2294
Ulrich Drepper18618fd2005-07-28 21:29:22 +00002295 * libdwfl_crc32.c: New file.
2296 * libdwfl_crc32_file.c: New file.
2297 * libdwflP.h: Declare the new functions.
2298 * Makefile.am (libdwfl_a_SOURCES): Add libdwfl_crc32.c and
2299 libdwfl_crc32_file.c.
2300 * libdwfl/find-debuginfo.c (check_crc): Use __libdwfl_crc32_file
2301 instead of crc32_file.
2302
Roland McGrathd89bbe42005-07-28 07:08:01 +000023032005-07-28 Roland McGrath <roland@redhat.com>
2304
Roland McGrath244501f2005-07-28 09:15:47 +00002305 * ptest.c: Moved to ../tests/dwflmodtest.c.
2306
Roland McGrath18385902005-07-28 07:12:38 +00002307 * Makefile.am (noinst_PROGRAMS): Variable removed.
2308 (libdwfl_so_SOURCES, libdwfl_LIBS, libdwfl_so_LDADD): Likewise.
2309 (EXTRA_DIST, ptest_LDADD, test2_LDADD): Likewise.
2310 (libdwfl): Don't use libdwfl.so any more.
2311 (libdwfl.so, install, uninstall): Targets removed.
2312 (test2_SOURCES): Define EXTRA_DIST instead of this.
2313 * libdwfl.map: File removed.
2314
Roland McGrathd89bbe42005-07-28 07:08:01 +00002315 * libdwfl.h: Use "" for libdw.h #include.
2316
Roland McGrath5bab2442005-07-28 00:44:29 +000023172005-07-27 Roland McGrath <roland@redhat.com>
2318
2319 * libdwfl.map: Add dwfl_getmodules.
2320
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000023212005-07-23 Ulrich Drepper <drepper@redhat.com>
2322
2323 * Makefile.am: Fix rules to allow building with mudflap.
2324
23252005-07-21 Roland McGrath <roland@redhat.com>
2326
2327 * Makefile.am (noinst_HEADERS): Add loc2c.c.
2328
2329 * test2.c (main): Check sscanf result to quiet warning.
2330
23312005-07-20 Roland McGrath <roland@redhat.com>
2332
2333 * libdwfl-branch merged, creating this direcotry.