libbacktrace: don't free ELF strtab if error occurs after saving syminfo
[gcc.git] / libbacktrace / ChangeLog
1 2020-05-09 Ian Lance Taylor <iant@golang.org>
2
3 * elf.c (elf_add): Don't free strtab if an error occurs after
4 recording symbol information.
5
6 2020-05-09 Ian Lance Taylor <iant@golang.org>
7
8 PR libbacktrace/88745
9 * macho.c: New file.
10 * filetype.awk: Recognize Mach-O files.
11 * Makefile.am (FORMAT_FILES): Add macho.c.
12 (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL.
13 (%.dSYM): New pattern target.
14 (test_macho_SOURCES, test_macho_CFLAGS): New targets.
15 (test_macho_LDADD): New target.
16 (BUILDTESTS): Add test_macho.
17 (macho.lo): Add dependencies.
18 * configure.ac: Recognize macho file type. Check for
19 mach-o/dyld.h. Don't try to run objcopy if we don't find it.
20 Look for dsymutil and define a HAVE_DSYMUTIL conditional.
21 * Makefile.in: Regenerate.
22 * configure: Regenerate.
23 * config.h.in: Regenerate.
24
25 2020-05-09 Ian Lance Taylor <iant@golang.org>
26
27 * read.c (backtrace_get_view): Support short read.
28
29 2020-05-09 Ian Lance Taylor <iant@golang.org>
30
31 * elf.c (elf_add): If debug sections are very large or far apart,
32 read them individually rather than as a single view.
33
34 2020-05-08 Ian Lance Taylor <iant@golang.org>
35
36 * fileline.c (sysctl_exec_name): New static function.
37 (sysctl_exec_name1): New macro or static function.
38 (sysctl_exec_name2): Likewise.
39 (fileline_initialize): Try sysctl_exec_name[12].
40 * configure.ac: Check for sysctl args to fetch executable name.
41 * configure: Regenerate.
42 * config.h.in: Regenerate.
43
44 2020-02-15 Ian Lance Taylor <iant@golang.org>
45
46 * ztest.c (test_large): Update file to current libgo test file.
47
48 2020-02-03 Ian Lance Taylor <iant@golang.org>
49
50 * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
51 (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
52 (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
53 (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
54 (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
55 (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
56 (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
57 (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
58 (stest_alloc_CFLAGS): Likewise.
59 * Makefile.in: Regenerate.
60 * ztest.c (error_callback_compress): Mark vdata unused.
61 (test_large): Add casts to avoid warnings.
62
63 2020-01-01 Jakub Jelinek <jakub@redhat.com>
64
65 Update copyright years.
66
67 2019-12-13 Ian Lance Taylor <iant@golang.org>
68
69 Add DWARF 5 support.
70 * dwarf.c (struct attr): Add val field.
71 (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
72 ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
73 (struct line_header): Add addrsize field.
74 (struct line_header_format): Define.
75 (struct unit): Add str_offsets_base, addr_base, and rnglists_base
76 fields.
77 (read_uint24): New static function.
78 (read_attribute): Add implicit_val parameter. Replace dwarf_str
79 and dwarf_str_size parameters with dwarf_sections parameter. Add
80 support for new DWARF 5 forms. Change all callers.
81 (resolve_string): New static function.
82 (resolve_addr_index): Likewise.
83 (read_abbrevs): Support DW_FORM_implicit_const.
84 (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
85 and ranges_is_index fields.
86 (update_pcrange): Support DWARF 5 encodings.
87 (add_high_low_range): New static function, split out of
88 add_ranges.
89 (add_ranges_from_ranges): Likewise.
90 (add_ranges_from_rnglists): New static function.
91 (add_ranges): Just call new helper functions.
92 (find_address_ranges): Use resolve_string for strings, after
93 reading all attributes. Handle new DWARF 5 attributes.
94 (build_address_map): Support DWARF 5 compilation units.
95 (read_v2_paths): New static function, split out of
96 read_line_header.
97 (read_lnct): New static function.
98 (read_line_header_format_entries): Likewise.
99 (read_line_header): Add ddata parameter. Support DWARF 5 line
100 headers. Call new helper functions. Change all callers.
101 (read_line_program): Use addrsize from line program header. Don't
102 special case directory index 0 for DWARF 5.
103 (read_referenced_name): Use resolve_string.
104 (read_function_entry): Handle DWARF 5 encodings. Use
105 resolve_string.
106 * internal.h (enum dwarf_section): Add DEBUG_ADDR,
107 DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
108 * elf.c (dwarf_section_names): Add new section names.
109 * pecoff.c (dwarf_section_names): Likewise.
110 * xcoff.c (xcoff_add): Clear dwarf_sections before setting
111 fields.
112 * configure.ac: Define HAVE_DWARF5 automake conditional.
113 * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
114 (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
115 (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
116 (dwarf5_alloc_LDADD): Likewise.
117 (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
118 (CLEANFILES, clean-local): Define.
119
120 2019-12-08 Ian Lance Taylor <iant@golang.org>
121
122 * dwarf.c (struct pcrange): Define.
123 (update_pcrange, add_ranges): New static functions.
124 (add_unit_addr): Change signature to work with add_ranges. Don't
125 add base_address here.
126 (add_unit_ranges): Remove.
127 (find_address_ranges): Replace str/ranges parameters with
128 dwarf_sections. Use update_pcrange and add_ranges. Change all
129 callers.
130 (add_function_range): Change signature to work with add_ranges.
131 Don't add base_address here.
132 (add_function_ranges): Remove.
133 (read_function_entry): Use update_pcrange and add_ranges.
134
135 2019-12-04 Ian Lance Taylor <iant@golang.org>
136
137 * edtest.c (test1): Add noclone attribute.
138
139 2019-12-04 Ian Lance Taylor <iant@golang.org>
140
141 * internal.h (enum dwarf_section): Define.
142 (struct dwarf_sections): Define.
143 (backtrace_dwarf_add): Update declaration to replace specific
144 section parameters with dwarf_sections parameter.
145 * dwarf.c (struct dwarf_data): Replace specific section fields
146 with dwarf_sections field.
147 (read_attribute): Use dwarf_sections with altlink.
148 (build_address_map): Replace specific section parameters with
149 dwarf_sections parameter. Change all callers.
150 (read_line_info): Use dwarf_sections with ddata.
151 (read_referenced_name): Likewise.
152 (add_function_ranges): Likewise.
153 (read_function_entry): Likewise.
154 (read_function_info): Likewise.
155 (build_dwarf_data): Replace specific section parameters with
156 dwarf_sections parameter. Change all callers.
157 (backtrace_dwarf_add): Likewise.
158 * elf.c (enum debug_section): Remove.
159 (dwarf_section_names): Remove .zdebug names.
160 (elf_add): Track zsections separately. Build dwarf_sections.
161 * pecoff.c (enum debug_section): Remove.
162 (struct debug_section_info): Remove data field.
163 (coff_add): Build dwarf_sections.
164 * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx
165 references with DEBUG_xxx references.
166 (xcoff_add): Build dwarf_sections.
167
168 2019-09-27 Maciej W. Rozycki <macro@wdc.com>
169
170 * configure: Regenerate.
171
172 2019-09-26 Ian Lance Taylor <iant@golang.org>
173
174 PR libbacktrace/91908
175 * pecoff.c (backtrace_initialize): Explicitly cast unchecked
176 __sync_bool_compare_and_swap to void.
177 * xcoff.c (backtrace_initialize): Likewise.
178
179 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
180
181 * configure.ac: Remove references to spu.
182 * configure: Regenerate.
183
184 2019-05-24 Clement Chigot <clement.chigot@atos.net>
185
186 * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
187 test_elf_64.
188 * Makefile.in: Regenerate.
189
190 2019-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
191
192 * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
193 handling.
194 * configure: Regenerate.
195
196 2019-03-11 Ian Lance Taylor <iant@golang.org>
197
198 PR libbacktrace/89669
199 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
200 HAVE_ELF.
201 * Makefile.in: Regenerate.
202
203 2019-02-26 Tom de Vries <tdevries@suse.de>
204
205 * btest.c (test5): Allow global.* as minimal symbol name for global.
206
207 2019-02-26 Tom de Vries <tdevries@suse.de>
208
209 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
210 * Makefile.in: Regenerate.
211
212 2019-02-12 Tom de Vries <tdevries@suse.de>
213
214 PR libbacktrace/81983
215 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
216
217 2019-02-10 Tom de Vries <tdevries@suse.de>
218
219 * Makefile.am (BUILDTESTS): Add btest_lto.
220 * Makefile.in: Regenerate.
221 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
222 __attribute__((noclone)).
223
224 2019-02-08 Tom de Vries <tdevries@suse.de>
225
226 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
227 * print.c (backtrace_print): Same.
228 * simple.c (backtrace_simple): Same.
229
230 2019-02-08 Tom de Vries <tdevries@suse.de>
231
232 PR libbacktrace/78063
233 * dwarf.c (build_address_map): Keep all parsed units.
234 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
235
236 2019-01-31 Tom de Vries <tdevries@suse.de>
237
238 PR libbacktrace/89136
239 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
240 'debugaltlink_name_len =+ 1'.
241
242 2019-01-29 Tom de Vries <tdevries@suse.de>
243
244 * install-debuginfo-for-buildid.sh.in: New script.
245 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
246 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
247 * Makefile.in: Regenerate.
248 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
249 (READELF): Set with AC_CHECK_PROG.
250 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
251 * configure: Regenerate.
252 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
253 (elf_open_debugfile_by_buildid): ... here.
254
255 2019-01-29 Tom de Vries <tdevries@suse.de>
256
257 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
258 allocfail.
259 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
260 (check_PROGRAMS): Add BUILDTESTS.
261 * Makefile.in: Regenerate.
262
263 2019-01-28 Tom de Vries <tdevries@suse.de>
264
265 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
266 Use $< to access prerequisite.
267 * Makefile.in: Regenerate.
268
269 2019-01-25 Nathan Sidwell <nathan@acm.org>
270
271 * elf.c (elf_add): Pass "" filename to recursive call with
272 separated debug.
273
274 2019-01-25 Tom de Vries <tdevries@suse.de>
275
276 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
277 filename == "".
278 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
279 * Makefile.in: Regenerate.
280
281 2019-01-25 Tom de Vries <tdevries@suse.de>
282
283 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
284 (TESTS): Rename dtest to btest_gnudebuglink.
285 * Makefile.in: Regenerate.
286
287 2019-01-23 Tom de Vries <tdevries@suse.de>
288
289 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
290 (units_search, find_unit): Use size_t for offset.
291 (build_address_map): Use size_t for unit_offset.
292
293 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
294
295 * allocfail.c (main): Increase portability of printf statement.
296
297 2019-01-18 Ian Lance Taylor <iant@golang.org>
298
299 PR libbacktrace/88890
300 * mmapio.c (backtrace_get_view): Change size parameter to
301 uint64_t. Check that value fits in size_t.
302 * read.c (backtrace_get_view): Likewise.
303 * internal.h (backtrace_get_view): Update declaration.
304 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
305
306 2019-01-17 Tom de Vries <tdevries@suse.de>
307
308 PR libbacktrace/82857
309 * configure.ac (DWZ): Set with AC_CHECK_PROG.
310 (HAVE_DWZ): Set with AM_CONDITIONAL.
311 * configure: Regenerate.
312 * Makefile.am (TESTS): Add btest_dwz.
313 * Makefile.in: Regenerate.
314
315 2019-01-17 Tom de Vries <tdevries@suse.de>
316
317 PR libbacktrace/82857
318 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
319 (read_attribute): Handle DW_FORM_GNU_ref_alt using
320 ATTR_VAL_REF_ALT_INFO.
321 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
322
323 2019-01-17 Tom de Vries <tdevries@suse.de>
324
325 * dwarf.c (struct unit): Add low_offset and high_offset fields.
326 (struct unit_vector): New type.
327 (struct dwarf_data): Add units and units_counts fields.
328 (find_unit): New function.
329 (find_address_ranges): Add and handle unit_tag parameter.
330 (build_address_map): Add and handle units_vec parameter.
331 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
332 units vector.
333
334 2019-01-17 Tom de Vries <tdevries@suse.de>
335
336 PR libbacktrace/82857
337 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
338 using altlink.
339
340 2019-01-17 Tom de Vries <tdevries@suse.de>
341
342 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
343 (read_attribute): Add altlink parameter. Handle missing altlink for
344 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
345 (find_address_ranges, build_address_map, build_dwarf_data): Add and
346 handle altlink parameter.
347 (read_referenced_name, read_function_entry): Add argument to
348 read_attribute call.
349
350 2019-01-17 Tom de Vries <tdevries@suse.de>
351
352 * dwarf.c (struct dwarf_data): Add altlink field.
353 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
354 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
355 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
356 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
357 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
358 * xcoff.c (xcoff_add): Same.
359
360 2019-01-17 Tom de Vries <tdevries@suse.de>
361
362 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
363 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
364 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
365 argument to backtrace_dwarf_add call.
366 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
367 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
368 * xcoff.c (xcoff_add): Same.
369
370 2019-01-17 Tom de Vries <tdevries@suse.de>
371
372 * elf.c (elf_add): Add and handle with_buildid_data and
373 with_buildid_size parameters. Handle .gnu_debugaltlink section.
374 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
375
376 2019-01-16 Tom de Vries <tdevries@suse.de>
377
378 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
379 of ...
380 (read_referenced_name): ... here, and ...
381 (read_function_entry): ... here.
382
383 2019-01-16 Tom de Vries <tdevries@suse.de>
384
385 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
386 name.
387 (read_function_entry): Same. Don't allow name found via
388 DW_AT_abstract_origin or case DW_AT_specification to override linkage
389 name.
390
391 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
392
393 PR other/16615
394
395 * backtrace.h: Mechanically replace "can not" with "cannot".
396
397 2019-01-01 Jakub Jelinek <jakub@redhat.com>
398
399 Update copyright years.
400
401 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
402
403 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
404 in sed pattern.
405 * Makefile.in: Regenerate.
406
407 2018-12-28 Tom de Vries <tdevries@suse.de>
408
409 * dwarf.c (build_address_map): Reuse unused units.
410
411 2018-12-28 Tom de Vries <tdevries@suse.de>
412
413 * dwarf.c (build_address_map): Simplify by removing local variable
414 abbrevs.
415
416 2018-12-28 Ian Lance Taylor <iant@golang.org>
417 Tom de Vries <tdevries@suse.de>
418
419 PR libbacktrace/88063
420 * dwarf.c (free_unit_addrs_vector): Remove.
421 (build_address_map): Keep track of allocated units in vector. Free
422 allocated units and corresponding abbrevs upon failure. Remove now
423 redundant call to free_unit_addrs_vector. Free addrs vector upon
424 failure. Free allocated unit vector.
425
426 2018-12-28 Tom de Vries <tdevries@suse.de>
427
428 * dwarf.c (build_address_map): Free addrs vector upon failure.
429
430 2018-12-14 Tom de Vries <tdevries@suse.de>
431
432 PR testsuite/88491
433 * allocfail.sh: Remove "set -o pipefail".
434
435 2018-12-12 Tom de Vries <tdevries@suse.de>
436
437 * Makefile.am (TESTS): Add allocfail.sh.
438 (check_PROGRAMS): Add allocfail.
439 * Makefile.in: Regenerate.
440 * instrumented_alloc.c: New file. Redefine malloc and realloc.
441 Include alloc.c.
442 * allocfail.c: New file.
443 * allocfail.sh: New file.
444
445 2018-11-30 Tom de Vries <tdevries@suse.de>
446
447 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
448 test_xcoff_64, test_pecoff and test_unknown.
449 * Makefile.in: Regenerate.
450 * test_format.c: New file.
451
452 2018-11-30 Tom de Vries <tdevries@suse.de>
453
454 * Makefile.am : Add _with_alloc version for each test in
455 check_PROGRAMS.
456 * Makefile.in: Regenerate.
457
458 2018-11-30 Tom de Vries <tdevries@suse.de>
459
460 * internal.h (backtrace_vector_free): New static inline fuction,
461 factored out of ...
462 * dwarf.c (read_line_info): ... here.
463
464 2018-11-28 Tom de Vries <tdevries@suse.de>
465
466 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
467 failure.
468
469 2018-11-27 Tom de Vries <tdevries@suse.de>
470
471 * mmap.c (backtrace_vector_release): Same.
472 * unittest.c (test1): Add check.
473
474 2018-11-27 Tom de Vries <tdevries@suse.de>
475
476 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
477 instead of realloc.
478 * Makefile.am (check_PROGRAMS): Add unittest.
479 * Makefile.in: Regenerate.
480 * unittest.c: New file.
481
482 2018-11-22 Tom de Vries <tdevries@suse.de>
483
484 * dwarf.c (read_initial_length): Factor out of ...
485 (build_address_map, read_line_info): ... here.
486
487 2018-11-21 Tom de Vries <tdevries@suse.de>
488
489 * dwarf.c (read_string): Factor out of ...
490 (read_attribute, read_line_header, read_line_program): ... here.
491
492 2018-10-31 Joseph Myers <joseph@codesourcery.com>
493
494 PR bootstrap/82856
495 * Makefile.am: Include multilib.am.
496 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
497 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
498
499 2018-10-05 Ian Lance Taylor <iant@golang.org>
500
501 PR libbacktrace/87529
502 * backtrace.h: Document that backtrace_create_state should be
503 called only once.
504
505 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
506
507 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
508 * Makefile.in: Regenerate.
509 * config.h.in: Likewise.
510 * configure: Likewise.
511
512 2018-08-01 Tony Reix <tony.reix@atos.net>
513
514 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
515 (struct xcoff_func, struct xcoff_func_vector): New structs.
516 (xcoff_syminfo): Drop leading dot from symbol name.
517 (xcoff_line_compare, xcoff_line_search): Remove.
518 (xcoff_func_compare, xcoff_func_search): New static functions.
519 (xcoff_lookup_pc): Search function table.
520 (xcoff_add_line, xcoff_process_linenos): Remove.
521 (xcoff_initialize_fileline): Build function table.
522
523 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
524
525 PR other/86198
526 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
527 checking up to 36 bytes.
528
529 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
530
531 * configure: Regenerated.
532
533 2018-04-19 Jakub Jelinek <jakub@redhat.com>
534
535 * configure: Regenerated.
536
537 2018-04-17 Ian Lance Taylor <iant@golang.org>
538
539 * backtrace.c: Revert last two changes. Don't call mmap
540 directly.
541
542 2018-04-17 Ian Lance Taylor <iant@golang.org>
543
544 * backtrace.c: Include backtrace-supported.h before checking
545 BACKTRACE_USES_MALLOC.
546
547 2018-04-17 Ian Lance Taylor <iant@golang.org>
548
549 * backtrace.c (backtrace_full): When testing whether we can
550 allocate memory, call mmap directly, and munmap the memory.
551
552 2018-04-04 Jakub Jelinek <jakub@redhat.com>
553
554 PR other/85161
555 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
556 big endian, only use 32-bit loads if endianity macros are predefined
557 and indicate big or little endian.
558
559 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
560
561 PR target/84148
562 * configure: Regenerate.
563
564 2018-02-15 Jakub Jelinek <jakub@redhat.com>
565
566 PR other/82368
567 * elf.c (SHT_PROGBITS): Undefine and define.
568
569 2018-02-14 Jakub Jelinek <jakub@redhat.com>
570
571 PR other/82368
572 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
573 (struct elf_ppc64_opd_data): New type.
574 (elf_initialize_syminfo): Add opd argument, handle symbols
575 pointing into the PowerPC64 ELFv1 .opd section.
576 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
577 to structure with .opd data to elf_initialize_syminfo.
578
579 2018-01-31 Ian Lance Taylor <iant@golang.org>
580
581 * elf.c (elf_add): Close descriptor if we use a debugfile.
582 * btest.c (check_open_files): New static function.
583 (main): Call check_open_files.
584
585 2018-01-25 Ian Lance Taylor <iant@golang.org>
586
587 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
588 desired CRC is zero.
589 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
590
591 2018-01-25 Ian Lance Taylor <iant@golang.org>
592
593 * pecoff.c (coff_add): Only release syms_view if it is valid.
594
595 2018-01-25 Ian Lance Taylor <iant@golang.org>
596
597 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
598
599 2018-01-24 Ian Lance Taylor <iant@golang.org>
600
601 * pecoff.c (coff_add): Use coff_read4, not memcpy.
602
603 2018-01-24 Ian Lance Taylor <iant@golang.org>
604
605 PR other/68239
606 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
607 on the free list.
608
609 2018-01-19 Tony Reix <tony.reix@atos.net>
610
611 * xcoff.c (xcoff_incl_compare): New function.
612 (xcoff_incl_search): New function.
613 (xcoff_process_linenos): Use bsearch to find include file.
614 (xcoff_initialize_fileline): Sort include file information.
615
616 2018-01-16 Ian Lance Taylor <iant@golang.org>
617
618 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
619 288.
620 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
621 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
622 (elf_zlib_default_table): Update.
623 (elf_zlib_default_dist_table): New static array.
624 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
625 for block type 1.
626 * ztest.c (struct zlib_test): Add uncompressed_len.
627 (tests): Initialize uncompressed_len field. Add new test case.
628 (test_samples): Use uncompressed_len field.
629
630 2018-01-03 Jakub Jelinek <jakub@redhat.com>
631
632 Update copyright years.
633
634 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
635
636 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
637 * aclocal.m4: Regenerate.
638 * Makefile.in: Likewise.
639 * configure: Likewise.
640
641 2017-10-06 Ian Lance Taylor <iant@golang.org>
642
643 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
644 zlib uncompress function.
645
646 2017-10-05 Ian Lance Taylor <iant@golang.org>
647
648 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
649 Read a four byte integer.
650 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
651 boundary before ever calling elf_zlib_fetch.
652 * ztest.c (test_large): Simplify print statements a bit.
653
654 2017-10-02 Ian Lance Taylor <iant@golang.org>
655
656 * ztest.c: #include <errno.h>.
657 (TEST_TIMING): Don't define, don't test.
658 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
659 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
660 (ZLIB_CLOCK_GETTIME_ARG): Define.
661 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
662 * Makefile.am: Likewise.
663 * configure, Makefile.in: Rebuild.
664
665 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
666
667 PR other/67165
668 * Makefile.am: Append the content of clock_gettime_link to
669 ztest_LDADD.
670 * configure.ac: Test for the case that clock_gettime is in librt.
671 * Makefile.in: Regenerate.
672 * configure: Likewise.
673
674 PR other/67165
675 * configure.ac: Check for clock_gettime.
676 * config.h.in: Regenerate.
677 * configure: Likewise.
678 * ztest.c (average_time, test_large): Conditionalize test timing
679 on clock_gettime availability.
680
681 2017-09-29 Tony Reix <tony.reix@atos.net>
682
683 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
684 (STYP_DWARF, SSUBTYP_DW*): Define.
685 (enum dwarf_section): Define.
686 (struct dwsect_info): Define.
687 (xcoff_add): Look for DWARF sections, pass them to
688 backtrace_dwarf_add.
689
690 2017-09-28 Ian Lance Taylor <iant@golang.org>
691
692 PR other/67165
693 * elf.c (__builtin_prefetch): Define if not __GNUC__.
694 (unlikely): Define.
695 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
696 (b_elf_chdr): Define type.
697 (enum debug_section): Add ZDEBUG_xxx values.
698 (debug_section_names): Add names for new sections.
699 (struct debug_section_info): Add compressed field.
700 (elf_zlib_failed, elf_zlib_fetch): New static functions.
701 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
702 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
703 (HUFFMAN_SECONDARY_SHIFT): Define.
704 (ZDEBUG_TABLE_SIZE): Define.
705 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
706 (final_next_secondary): New static variable if
707 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
708 (elf_zlib_inflate_table): New static function.
709 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
710 function to produce fixed Huffman table.
711 (elf_zlib_default_table): New static variable.
712 (elf_zlib_inflate): New static function.
713 (elf_zlib_verify_checksum): Likewise.
714 (elf_zlib_inflate_and_verify): Likewise.
715 (elf_uncompress_zdebug): Likewise.
716 (elf_uncompress_chdr): Likewise.
717 (backtrace_uncompress_zdebug): New extern function.
718 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
719 sections, and uncompress them.
720 * internal.h (backtrace_compress_zdebug): Declare.
721 * ztest.c: New file.
722 * configure.ac: Check for -lz and check whether the linker
723 supports --compress-debug-sections.
724 * Makefile.am (ztest_SOURCES): New variable.
725 (ztest_CFLAGS, ztest_LDADD): New variables.
726 (check_PROGRAMS): Add ztest.
727 (ctestg_SOURCES): New variable.
728 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
729 (ctesta_SOURCES): New variable.
730 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
731 (check_PROGRAMS): Add ctestg and ctesta.
732 * configure, config.h.in, Makefile.in: Rebuild.
733
734 2017-09-22 Ian Lance Taylor <iant@golang.org>
735
736 PR sanitizer/77631
737 * configure.ac: Check for lstat and readlink.
738 * elf.c (lstat, readlink): Provide dummy versions if real versions
739 are not available.
740 * configure, config.h.in: Rebuild.
741
742 2017-09-21 Ian Lance Taylor <iant@google.com>
743
744 PR go/82284
745 * elf.c (backtrace_initialize): Set pd.exe_filename.
746
747 2017-09-20 Ian Lance Taylor <iant@golang.org>
748 Denis Khalikov <d.khalikov@partner.samsung.com>
749
750 PR sanitizer/77631
751 Support for external debug info.
752 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
753 (S_ISLNK): Define if not defined.
754 (xstrnlen): Define if strnlen is not available.
755 (b_elf_note): Define type.
756 (NT_GNU_BUILD_ID): Define macro.
757 (elf_crc32, elf_crc32_file): New static functions.
758 (elf_is_symlink, elf_readlink): New static functions.
759 (elf_open_debugfile_by_buildid): New static function.
760 (elf_try_debugfile): New static function.
761 (elf_find_debugfile_by_debuglink): New static function.
762 (elf_open_debugfile_by_debuglink): New static function.
763 (elf_add): Add filename and debuginfo parameters. Adjust all
764 callers. Look for external debug info notes, and try to fetch
765 debug info from external file.
766 (struct phdr_data): Add exe_filename field.
767 (phdr_callback): Pass filename to elf_add.
768 (backtrace_initialize): Add filename parameter.
769 * internal.h (backtrace_initialize): Add filename parameter.
770 * fileline.c (fileline_initialize): Pass filename to
771 backtrace_initialize.
772 * pecoff.c (fileline_initialize): Add unused filename parameter.
773 * unknown.c (fileline_initialize): Likewise.
774 * xcoff.c (fileline_initialize): Likewise.
775 * configure.ac: Check for objcopy --add-gnu-debuglink.
776 * Makefile.am (dtest): New test target.
777 * configure, Makefile.in: Rebuild.
778
779 2017-09-12 Steve Ellcey <sellcey@cavium.com>
780
781 PR other/81096
782 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
783 * Makefile.in: Regenerate.
784
785 2017-09-12 Steve Ellcey <sellcey@cavium.com>
786
787 PR other/81096
788 * libbacktrace/Makefile.in
789 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
790
791 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
792
793 PR bootstrap/81638
794 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
795
796 2017-07-28 Tony Reix <tony.reix@atos.net>
797
798 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
799
800 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
801
802 * fileline.c (fileline_initialize): Print pid_t as long.
803
804 2017-07-26 Tony Reix <tony.reix@atos.net>
805
806 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
807 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
808 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
809 * configure, config.h.in: Regenerate.
810
811 2017-07-21 Tony Reix <tony.reix@atos.net>
812
813 * filetype.awk: Add AIX XCOFF type detection.
814 * configure.ac: Recognize xcoff format.
815 * Makefile.am (FORMAT_FILES): Add xcoff.c.
816 * fileline.c: Include <unistd.h>.
817 (fileline_initialize): Add case for AIX procfs.
818 * xcoff.c: New file.
819 * configure, Makefile.in: Rebuild.
820
821 2017-06-21 Richard Biener <rguenther@suse.de>
822
823 * configure.ac: Add AC_SYS_LARGEFILE.
824 * config.h.in: Regenerate.
825 * configure: Likewise.
826
827 2017-06-11 Ian Lance Taylor <iant@golang.org>
828
829 * elf.c (backtrace_initialize): Always set *fileline_fn.
830 * ttest.c: New file.
831 * btest.c: Move support functions into testlib.c. Change calls to
832 check to pass file name.
833 * testlib.c: New file, copied from (part of) btest.c.
834 * testlib.h: New file, declarations for testlib.c.
835 * edtest.c: Use testlib.h and testlib.c.
836 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
837 * Makefile.am (btest_SOURCES): Add testlib.c.
838 (edtest_SOURCES): Likewise.
839 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
840 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
841 * configure, Makefile.in: Rebuild.
842
843 2017-05-19 Than McIntosh <thanm@google.com>
844
845 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
846 (read_line_header): Don't allocate dirs if dirs_count == 0.
847 * edtest.c: New file.
848 * edtest2.c: New file.
849 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
850 (check_PROGRAMS): Add edtest.
851 (edtest2_build.c, gen_edtest2_build): New targets.
852 * Makefile.in: Rebuild.
853
854 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
855
856 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
857 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
858
859 2017-01-01 Jakub Jelinek <jakub@redhat.com>
860
861 Update copyright years.
862
863 2016-11-15 Matthias Klose <doko@ubuntu.com>
864
865 * configure: Regenerate.
866
867 2016-09-11 Carlos Liam <carlos@aarzee.me>
868
869 * all: Remove meaningless trailing whitespace.
870
871 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
872
873 PR target/71161
874 * elf.c (phdr_callback) [__i386__]: Add
875 __attribute__((__force_align_arg_pointer__)).
876
877 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
878
879 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
880 avoid possible crash.
881 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
882 missing debug info anymore.
883
884 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
885
886 * mmap.c (MAP_FAILED): Define if not defined.
887
888 2016-01-04 Jakub Jelinek <jakub@redhat.com>
889
890 Update copyright years.
891
892 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
893
894 * configure.ac: Specify that DJGPP do not have mmap
895 even when sys/mman.h exists.
896 * configure: Regenerate
897
898 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
899
900 PR libgfortran/68115
901 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
902 * configure: Regenerate.
903 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
904 to void.
905
906 2015-09-17 Ian Lance Taylor <iant@google.com>
907
908 * posix.c (backtrace_open): Cast second argument of open() to int.
909
910 2015-09-11 Ian Lance Taylor <iant@google.com>
911
912 * Makefile.am (backtrace.lo): Depend on internal.h.
913 (sort.lo, stest.lo): Add explicit dependencies.
914 * Makefile.in: Rebuild.
915
916 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
917
918 * backtrace.c: #include <sys/types.h>.
919
920 2015-09-08 Ian Lance Taylor <iant@google.com>
921
922 PR other/67457
923 * backtrace.c: #include "internal.h".
924 (struct backtrace_data): Add can_alloc field.
925 (unwind): If can_alloc is false, don't try to get file/line
926 information.
927 (backtrace_full): Set can_alloc field in bdata.
928 * alloc.c (backtrace_alloc): Don't call error_callback if it is
929 NULL.
930 * mmap.c (backtrace_alloc): Likewise.
931 * internal.h: Update comments for backtrace_alloc and
932 backtrace_free.
933
934 2015-09-08 Ian Lance Taylor <iant@google.com>
935
936 PR other/67457
937 * mmap.c (backtrace_alloc): Correct test for mmap failure.
938
939 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
940
941 * configure.ac: For spu-*-* targets, set have_fcntl to no.
942 * configure: Regenerate.
943
944 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
945
946 * configure.ac: Remove [disable-shared] argument to LT_INIT.
947 Remove setting PIC_FLAG when building as target library.
948 * configure: Regenerate.
949
950 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
951
952 * configure.ac: Only compile with -fPIC if the target
953 supports it.
954 * configure: Regenerate.
955
956 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
957
958 * configure.ac: Set have_mmap to no on spu-*-* targets.
959 * configure: Regenerate.
960
961 2015-08-13 Ian Lance Taylor <iant@google.com>
962
963 * dwarf.c (read_function_entry): Add vec_inlined parameter.
964 Change all callers.
965
966 2015-06-11 Martin Sebor <msebor@redhat.com>
967
968 PR sanitizer/65479
969 * dwarf.c (struct line): Add new field idx.
970 (line_compare): Use it.
971 (add_line): Set it.
972 (read_line_info): Reset it.
973
974 2015-05-29 Tristan Gingold <gingold@adacore.com>
975
976 * pecoff.c: New file.
977 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
978 * Makefile.in: Regenerate.
979 * filetype.awk: Detect pecoff.
980 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
981 Add pecoff.
982 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
983 true.
984 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
985 * configure: Regenerate.
986 * pecoff.c: New file.
987
988 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
989
990 * Makefile.in: Regenerated with automake-1.11.6.
991 * aclocal.m4: Likewise.
992 * configure: Likewise.
993
994 2015-01-24 Matthias Klose <doko@ubuntu.com>
995
996 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
997 * configure: Regenerate.
998
999 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1000
1001 Update copyright years.
1002
1003 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1004
1005 PR bootstrap/63784
1006 * configure: Regenerated.
1007
1008 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1009
1010 * ChangeLog.jit: New.
1011
1012 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1013
1014 PR target/63610
1015 * configure: Regenerate.
1016
1017 2014-10-23 Ian Lance Taylor <iant@google.com>
1018
1019 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1020 Fix to return void *.
1021
1022 2014-05-08 Ian Lance Taylor <iant@google.com>
1023
1024 * mmap.c (backtrace_free): If freeing a large aligned block of
1025 memory, call munmap rather than holding onto it.
1026 (backtrace_vector_grow): When growing a vector, double the number
1027 of pages requested. When releasing the old version of a grown
1028 vector, pass the correct size to backtrace_free.
1029
1030 2014-03-07 Ian Lance Taylor <iant@google.com>
1031
1032 * sort.c (backtrace_qsort): Use middle element as pivot.
1033
1034 2014-03-06 Ian Lance Taylor <iant@google.com>
1035
1036 * sort.c: New file.
1037 * stest.c: New file.
1038 * internal.h (backtrace_qsort): Declare.
1039 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1040 (read_line_info, read_function_entry): Likewise.
1041 (read_function_info, build_dwarf_data): Likewise.
1042 * elf.c (elf_initialize_syminfo): Likewise.
1043 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1044 (stest_SOURCES, stest_LDADD): Define.
1045 (check_PROGRAMS): Add stest.
1046
1047 2014-02-07 Misty De Meo <misty@brew.sh>
1048
1049 PR target/58710
1050 * configure.ac: Use AC_LINK_IFELSE in check for
1051 _Unwind_GetIPInfo.
1052 * configure: Regenerate.
1053
1054 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1055
1056 Update copyright years
1057
1058 2013-12-06 Jakub Jelinek <jakub@redhat.com>
1059
1060 * elf.c (ET_DYN): Undefine and define again.
1061 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1062 return early -1 without closing the descriptor.
1063 (struct phdr_data): Add exe_descriptor.
1064 (phdr_callback): If pd->exe_descriptor is not -1, for very first
1065 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1066 otherwise backtrace_close the exe_descriptor if not -1. Adjust
1067 call to elf_add.
1068 (backtrace_initialize): Adjust call to elf_add. If it returns
1069 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1070
1071 2013-12-05 Ian Lance Taylor <iant@google.com>
1072
1073 * alloc.c (backtrace_vector_finish): Add error_callback and data
1074 parameters. Call backtrace_vector_release. Return address base.
1075 * mmap.c (backtrace_vector_finish): Add error_callback and data
1076 parameters. Return address base.
1077 * dwarf.c (read_function_info): Get new address base from
1078 backtrace_vector_finish.
1079 * internal.h (backtrace_vector_finish): Update declaration.
1080
1081 2013-11-27 Ian Lance Taylor <iant@google.com>
1082
1083 * dwarf.c (find_address_ranges): New static function, broken out
1084 of build_address_map.
1085 (build_address_map): Call it.
1086 * btest.c (check): Check for missing filename or function, rather
1087 than crashing.
1088 (f3): Check that enough frames were returned.
1089
1090 2013-11-19 Jakub Jelinek <jakub@redhat.com>
1091
1092 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1093 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1094 last argument.
1095 * btest.c (struct symdata): Add size field.
1096 (callback_three): Add symsize argument. Copy it to the data->size
1097 field.
1098 (f23): Set symdata.size to 0.
1099 (test5): Likewise. If sizeof (int) > 1, lookup address of
1100 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
1101 values.
1102
1103 * atomic.c: Include sys/types.h.
1104
1105 2013-11-18 Ian Lance Taylor <iant@google.com>
1106
1107 * configure.ac: Check for support of __atomic extensions.
1108 * internal.h: Declare or #define atomic functions for use in
1109 backtrace code.
1110 * atomic.c: New file.
1111 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1112 (dwarf_fileline, backtrace_dwarf_add): Likewise.
1113 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1114 (backtrace_initialize): Likewise.
1115 * fileline.c (fileline_initialize): Likewise.
1116 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1117 * configure, config.h.in, Makefile.in: Rebuild.
1118
1119 2013-11-18 Jakub Jelinek <jakub@redhat.com>
1120
1121 * elf.c (SHN_UNDEF): Define.
1122 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
1123 with st_shndx == SHN_UNDEF. Add base_address to address fields.
1124 (elf_add): Adjust caller.
1125
1126 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1127
1128 2013-11-16 Ian Lance Taylor <iant@google.com>
1129
1130 * backtrace.h (backtrace_create_state): Correct comment about
1131 threading.
1132
1133 2013-11-15 Ian Lance Taylor <iant@google.com>
1134
1135 * backtrace.h (backtrace_syminfo): Update comment and parameter
1136 name to take any address, not just a PC value.
1137 * elf.c (STT_OBJECT): Define.
1138 (elf_nosyms): Rename parameter pc to addr.
1139 (elf_symbol_search): Rename local variable pc to addr.
1140 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1141 (elf_syminfo): Rename parameter pc to addr.
1142 * btest.c (global): New global variable.
1143 (test5): New test.
1144 (main): Call test5.
1145
1146 2013-10-17 Ian Lance Taylor <iant@google.com>
1147
1148 * elf.c (elf_add): Don't get the wrong offsets if a debug section
1149 is missing.
1150
1151 2013-10-15 David Malcolm <dmalcolm@redhat.com>
1152
1153 * configure.ac: Add --enable-host-shared, setting up
1154 pre-existing PIC_FLAG variable within Makefile.am et al.
1155 * configure: Regenerate.
1156
1157 2013-09-20 Alan Modra <amodra@gmail.com>
1158
1159 * configure: Regenerate.
1160
1161 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1162
1163 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1164
1165 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1166
1167 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1168 dl_iterate_phdr callbacks.
1169
1170 2013-03-25 Ian Lance Taylor <iant@google.com>
1171
1172 * alloc.c: #include <sys/types.h>.
1173 * mmap.c: Likewise.
1174
1175 2013-01-31 Ian Lance Taylor <iant@google.com>
1176
1177 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1178 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1179
1180 2013-01-25 Jakub Jelinek <jakub@redhat.com>
1181
1182 PR other/56076
1183 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1184 attribute was not seen.
1185
1186 2013-01-16 Ian Lance Taylor <iant@google.com>
1187
1188 * dwarf.c (struct unit): Add filename and abs_filename fields.
1189 (build_address_map): Set new fields when reading unit.
1190 (dwarf_lookup_pc): If we don't find an entry in the line table,
1191 just return the main file name.
1192
1193 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1194
1195 Update copyright years.
1196
1197 2013-01-01 Ian Lance Taylor <iant@google.com>
1198
1199 PR bootstrap/54834
1200 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1201 $(MULTIBUILDTOP)/../../gcc/include.
1202 * Makefile.in: Rebuild.
1203
1204 2013-01-01 Ian Lance Taylor <iant@google.com>
1205
1206 PR other/55536
1207 * mmap.c (backtrace_alloc): Don't call sync functions if not
1208 threaded.
1209 (backtrace_free): Likewise.
1210
1211 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1212
1213 * mmapio.c: Define MAP_FAILED if not defined.
1214
1215 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1216
1217 PR bootstrap/54926
1218 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1219 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1220 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1221 accepts it.
1222 * Makefile.in: Regenerated.
1223 * configure: Regenerated.
1224
1225 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1226
1227 PR bootstrap/54926
1228 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1229 * Makefile.in: Regenerated.
1230
1231 2012-11-20 Ian Lance Taylor <iant@google.com>
1232
1233 * dwarf.c (read_attribute): Always clear val.
1234
1235 2012-11-13 Ian Lance Taylor <iant@google.com>
1236
1237 PR other/55312
1238 * configure.ac: Only add -Werror if building a target library.
1239 * configure: Rebuild.
1240
1241 2012-11-12 Ian Lance Taylor <iant@google.com>
1242 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1243 Gerald Pfeifer <gerald@pfeifer.com>
1244
1245 * configure.ac: Check for getexecname.
1246 * fileline.c: #include <errno.h>. Define getexecname if not
1247 available.
1248 (fileline_initialize): Try to find the executable in a few
1249 different ways.
1250 * print.c (error_callback): Only print the filename if it came
1251 from the backtrace state.
1252 * configure, config.h.in: Rebuild.
1253
1254 2012-10-29 Ian Lance Taylor <iant@google.com>
1255
1256 * mmap.c (backtrace_vector_release): Correct last patch: add
1257 aligned, not size.
1258
1259 2012-10-29 Ian Lance Taylor <iant@google.com>
1260
1261 * mmap.c (backtrace_vector_release): Make sure freed block is
1262 aligned on 8-byte boundary.
1263
1264 2012-10-26 Ian Lance Taylor <iant@google.com>
1265
1266 PR other/55087
1267 * posix.c (backtrace_open): Add does_not_exist parameter.
1268 * elf.c (phdr_callback): Do not warn if shared library could not
1269 be opened.
1270 * fileline.c (fileline_initialize): Update calls to
1271 backtrace_open.
1272 * internal.h (backtrace_open): Update declaration.
1273
1274 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1275
1276 PR target/55061
1277 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1278 * configure: Regenerate.
1279
1280 2012-10-24 Ian Lance Taylor <iant@google.com>
1281
1282 PR target/55061
1283 * configure.ac: Check whether -funwind-tables option works.
1284 * configure: Rebuild.
1285
1286 2012-10-11 Ian Lance Taylor <iant@google.com>
1287
1288 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1289 * configure: Rebuild.
1290
1291 2012-10-10 Ian Lance Taylor <iant@google.com>
1292
1293 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1294 lower case.
1295
1296 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1297
1298 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1299
1300 2012-10-09 Ian Lance Taylor <iant@google.com>
1301
1302 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1303 (backtrace_dwarf_add): Likewise.
1304
1305 2012-10-09 Ian Lance Taylor <iant@google.com>
1306
1307 Add support for tracing through shared libraries.
1308 * configure.ac: Check for link.h and dl_iterate_phdr.
1309 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1310 ELF macros before #defining them.
1311 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1312 dl_iterate_phdr.
1313 (struct elf_syminfo_data): Add next field.
1314 (elf_initialize_syminfo): Initialize next field.
1315 (elf_add_syminfo_data): New static function.
1316 (elf_add): New static function, broken out of
1317 backtrace_initialize. Call backtrace_dwarf_add instead of
1318 backtrace_dwarf_initialize.
1319 (struct phdr_data): Define.
1320 (phdr_callback): New static function.
1321 (backtrace_initialize): Call elf_add.
1322 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1323 (add_unit_addr): Add base_address parameter. Change all callers.
1324 (add_unit_ranges, build_address_map): Likewise.
1325 (add_line): Add ddata parameter. Change all callers.
1326 (read_line_program, add_function_range): Likewise.
1327 (dwarf_lookup_pc): New static function, broken out of
1328 dwarf_fileline.
1329 (dwarf_fileline): Call dwarf_lookup_pc.
1330 (build_dwarf_data): New static function.
1331 (backtrace_dwarf_add): New function.
1332 (backtrace_dwarf_initialize): Remove.
1333 * internal.h (backtrace_dwarf_initialize): Don't declare.
1334 (backtrace_dwarf_add): Declare.
1335 * configure, config.h.in: Rebuild.
1336
1337 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1338
1339 * btest.c (f23): Avoid uninitialized variable warning.
1340
1341 2012-10-04 Ian Lance Taylor <iant@google.com>
1342
1343 * dwarf.c: If the system header files do not declare strnlen,
1344 provide our own version.
1345
1346 2012-10-03 Ian Lance Taylor <iant@google.com>
1347
1348 * dwarf.c (read_uleb128): Fix overflow test.
1349 (read_sleb128): Likewise.
1350 (build_address_map): Don't change unit_buf.start.
1351
1352 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1353
1354 PR other/54761
1355 * configure.ac (EXTRA_FLAGS): New.
1356 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1357 * configure, Makefile.in: Regenerate.
1358
1359 2012-09-29 Ian Lance Taylor <iant@google.com>
1360
1361 PR other/54749
1362 * fileline.c (fileline_initialize): Pass errnum as -1 when
1363 reporting that we could not read executable information after a
1364 previous failure.
1365
1366 2012-09-27 Ian Lance Taylor <iant@google.com>
1367
1368 PR bootstrap/54732
1369 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1370 * Makefile.am: Add dependencies for all objects.
1371 * configure, aclocal.m4, Makefile.in: Rebuild.
1372
1373 2012-09-27 Ian Lance Taylor <iant@google.com>
1374
1375 PR other/54726
1376 * elf.c (backtrace_initialize): Set *fileln_fn, not
1377 state->fileln_fn.
1378
1379 2012-09-19 Ian Lance Taylor <iant@google.com>
1380
1381 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1382 as a target library.
1383 * configure: Rebuild.
1384
1385 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1386 Ian Lance Taylor <iant@google.com>
1387
1388 * configure.ac (GCC_HEADER_STDINT): Invoke.
1389 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1390 * btest.c: Don't include <stdint.h>.
1391 * dwarf.c: Likewise.
1392 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1393
1394 2012-09-18 Ian Lance Taylor <iant@google.com>
1395
1396 PR bootstrap/54623
1397 * Makefile.am (AM_CPPFLAGS): Define.
1398 (AM_CFLAGS): Remove -I options.
1399 * Makefile.in: Rebuild.
1400
1401 2012-09-18 Ian Lance Taylor <iant@google.com>
1402
1403 * posix.c (O_BINARY): Define if not defined.
1404 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1405 HAVE_FCNTL is defined.
1406 * configure.ac: Test for the fcntl function.
1407 * configure, config.h.in: Rebuild.
1408
1409 2012-09-18 Ian Lance Taylor <iant@google.com>
1410
1411 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1412
1413 2012-09-18 Ian Lance Taylor <iant@google.com>
1414
1415 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1416
1417 2012-09-18 Ian Lance Taylor <iant@google.com>
1418
1419 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1420 * mmapio.c: Don't define _GNU_SOURCE.
1421 * configure, config.h.in: Rebuild.
1422
1423 2012-09-18 Ian Lance Taylor <iant@google.com>
1424
1425 * configure.ac: Check whether strnlen is declared.
1426 * dwarf.c: Declare strnlen if not declared.
1427 * configure, config.h.in: Rebuild.
1428
1429 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1430
1431 * fileline.c: Include <stdlib.h>.
1432 * mmap.c: Likewise.
1433
1434 2012-09-17 Ian Lance Taylor <iant@google.com>
1435
1436 PR bootstrap/54611
1437 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1438 parameter.
1439
1440 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1441
1442 PR bootstrap/54611
1443 * nounwind.c (backtrace_simple): Add state parameter.
1444
1445 2012-09-17 Ian Lance Taylor <iant@google.com>
1446
1447 PR bootstrap/54609
1448 * unknown.c (unknown_fileline): Add state parameter, remove
1449 fileline_data parameter, name error_callback parameter.
1450 (backtrace_initialize): Add state parameter.
1451
1452 2012-09-17 Ian Lance Taylor <iant@google.com>
1453
1454 * Initial implementation.
1455 \f
1456 Copyright (C) 2012-2020 Free Software Foundation, Inc.
1457
1458 Copying and distribution of this file, with or without modification,
1459 are permitted in any medium without royalty provided the copyright
1460 notice and this notice are preserved.