1 2019-01-25 Tom de Vries <tdevries@suse.de>
3 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
5 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
6 * Makefile.in: Regenerate.
8 2019-01-25 Tom de Vries <tdevries@suse.de>
10 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
11 (TESTS): Rename dtest to btest_gnudebuglink.
12 * Makefile.in: Regenerate.
14 2019-01-23 Tom de Vries <tdevries@suse.de>
16 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
17 (units_search, find_unit): Use size_t for offset.
18 (build_address_map): Use size_t for unit_offset.
20 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
22 * allocfail.c (main): Increase portability of printf statement.
24 2019-01-18 Ian Lance Taylor <iant@golang.org>
27 * mmapio.c (backtrace_get_view): Change size parameter to
28 uint64_t. Check that value fits in size_t.
29 * read.c (backtrace_get_view): Likewise.
30 * internal.h (backtrace_get_view): Update declaration.
31 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
33 2019-01-17 Tom de Vries <tdevries@suse.de>
36 * configure.ac (DWZ): Set with AC_CHECK_PROG.
37 (HAVE_DWZ): Set with AM_CONDITIONAL.
38 * configure: Regenerate.
39 * Makefile.am (TESTS): Add btest_dwz.
40 * Makefile.in: Regenerate.
42 2019-01-17 Tom de Vries <tdevries@suse.de>
45 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
46 (read_attribute): Handle DW_FORM_GNU_ref_alt using
47 ATTR_VAL_REF_ALT_INFO.
48 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
50 2019-01-17 Tom de Vries <tdevries@suse.de>
52 * dwarf.c (struct unit): Add low_offset and high_offset fields.
53 (struct unit_vector): New type.
54 (struct dwarf_data): Add units and units_counts fields.
55 (find_unit): New function.
56 (find_address_ranges): Add and handle unit_tag parameter.
57 (build_address_map): Add and handle units_vec parameter.
58 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
61 2019-01-17 Tom de Vries <tdevries@suse.de>
64 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
67 2019-01-17 Tom de Vries <tdevries@suse.de>
69 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
70 (read_attribute): Add altlink parameter. Handle missing altlink for
71 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
72 (find_address_ranges, build_address_map, build_dwarf_data): Add and
73 handle altlink parameter.
74 (read_referenced_name, read_function_entry): Add argument to
77 2019-01-17 Tom de Vries <tdevries@suse.de>
79 * dwarf.c (struct dwarf_data): Add altlink field.
80 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
81 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
82 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
83 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
84 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
85 * xcoff.c (xcoff_add): Same.
87 2019-01-17 Tom de Vries <tdevries@suse.de>
89 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
90 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
91 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
92 argument to backtrace_dwarf_add call.
93 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
94 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
95 * xcoff.c (xcoff_add): Same.
97 2019-01-17 Tom de Vries <tdevries@suse.de>
99 * elf.c (elf_add): Add and handle with_buildid_data and
100 with_buildid_size parameters. Handle .gnu_debugaltlink section.
101 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
103 2019-01-16 Tom de Vries <tdevries@suse.de>
105 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
107 (read_referenced_name): ... here, and ...
108 (read_function_entry): ... here.
110 2019-01-16 Tom de Vries <tdevries@suse.de>
112 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
114 (read_function_entry): Same. Don't allow name found via
115 DW_AT_abstract_origin or case DW_AT_specification to override linkage
118 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
122 * backtrace.h: Mechanically replace "can not" with "cannot".
124 2019-01-01 Jakub Jelinek <jakub@redhat.com>
126 Update copyright years.
128 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
130 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
132 * Makefile.in: Regenerate.
134 2018-12-28 Tom de Vries <tdevries@suse.de>
136 * dwarf.c (build_address_map): Reuse unused units.
138 2018-12-28 Tom de Vries <tdevries@suse.de>
140 * dwarf.c (build_address_map): Simplify by removing local variable
143 2018-12-28 Ian Lance Taylor <iant@golang.org>
144 Tom de Vries <tdevries@suse.de>
146 PR libbacktrace/88063
147 * dwarf.c (free_unit_addrs_vector): Remove.
148 (build_address_map): Keep track of allocated units in vector. Free
149 allocated units and corresponding abbrevs upon failure. Remove now
150 redundant call to free_unit_addrs_vector. Free addrs vector upon
151 failure. Free allocated unit vector.
153 2018-12-28 Tom de Vries <tdevries@suse.de>
155 * dwarf.c (build_address_map): Free addrs vector upon failure.
157 2018-12-14 Tom de Vries <tdevries@suse.de>
160 * allocfail.sh: Remove "set -o pipefail".
162 2018-12-12 Tom de Vries <tdevries@suse.de>
164 * Makefile.am (TESTS): Add allocfail.sh.
165 (check_PROGRAMS): Add allocfail.
166 * Makefile.in: Regenerate.
167 * instrumented_alloc.c: New file. Redefine malloc and realloc.
169 * allocfail.c: New file.
170 * allocfail.sh: New file.
172 2018-11-30 Tom de Vries <tdevries@suse.de>
174 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
175 test_xcoff_64, test_pecoff and test_unknown.
176 * Makefile.in: Regenerate.
177 * test_format.c: New file.
179 2018-11-30 Tom de Vries <tdevries@suse.de>
181 * Makefile.am : Add _with_alloc version for each test in
183 * Makefile.in: Regenerate.
185 2018-11-30 Tom de Vries <tdevries@suse.de>
187 * internal.h (backtrace_vector_free): New static inline fuction,
189 * dwarf.c (read_line_info): ... here.
191 2018-11-28 Tom de Vries <tdevries@suse.de>
193 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
196 2018-11-27 Tom de Vries <tdevries@suse.de>
198 * mmap.c (backtrace_vector_release): Same.
199 * unittest.c (test1): Add check.
201 2018-11-27 Tom de Vries <tdevries@suse.de>
203 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
205 * Makefile.am (check_PROGRAMS): Add unittest.
206 * Makefile.in: Regenerate.
207 * unittest.c: New file.
209 2018-11-22 Tom de Vries <tdevries@suse.de>
211 * dwarf.c (read_initial_length): Factor out of ...
212 (build_address_map, read_line_info): ... here.
214 2018-11-21 Tom de Vries <tdevries@suse.de>
216 * dwarf.c (read_string): Factor out of ...
217 (read_attribute, read_line_header, read_line_program): ... here.
219 2018-10-31 Joseph Myers <joseph@codesourcery.com>
222 * Makefile.am: Include multilib.am.
223 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
224 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
226 2018-10-05 Ian Lance Taylor <iant@golang.org>
228 PR libbacktrace/87529
229 * backtrace.h: Document that backtrace_create_state should be
232 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
234 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
235 * Makefile.in: Regenerate.
236 * config.h.in: Likewise.
237 * configure: Likewise.
239 2018-08-01 Tony Reix <tony.reix@atos.net>
241 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
242 (struct xcoff_func, struct xcoff_func_vector): New structs.
243 (xcoff_syminfo): Drop leading dot from symbol name.
244 (xcoff_line_compare, xcoff_line_search): Remove.
245 (xcoff_func_compare, xcoff_func_search): New static functions.
246 (xcoff_lookup_pc): Search function table.
247 (xcoff_add_line, xcoff_process_linenos): Remove.
248 (xcoff_initialize_fileline): Build function table.
250 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
253 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
254 checking up to 36 bytes.
256 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
258 * configure: Regenerated.
260 2018-04-19 Jakub Jelinek <jakub@redhat.com>
262 * configure: Regenerated.
264 2018-04-17 Ian Lance Taylor <iant@golang.org>
266 * backtrace.c: Revert last two changes. Don't call mmap
269 2018-04-17 Ian Lance Taylor <iant@golang.org>
271 * backtrace.c: Include backtrace-supported.h before checking
272 BACKTRACE_USES_MALLOC.
274 2018-04-17 Ian Lance Taylor <iant@golang.org>
276 * backtrace.c (backtrace_full): When testing whether we can
277 allocate memory, call mmap directly, and munmap the memory.
279 2018-04-04 Jakub Jelinek <jakub@redhat.com>
282 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
283 big endian, only use 32-bit loads if endianity macros are predefined
284 and indicate big or little endian.
286 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
289 * configure: Regenerate.
291 2018-02-15 Jakub Jelinek <jakub@redhat.com>
294 * elf.c (SHT_PROGBITS): Undefine and define.
296 2018-02-14 Jakub Jelinek <jakub@redhat.com>
299 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
300 (struct elf_ppc64_opd_data): New type.
301 (elf_initialize_syminfo): Add opd argument, handle symbols
302 pointing into the PowerPC64 ELFv1 .opd section.
303 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
304 to structure with .opd data to elf_initialize_syminfo.
306 2018-01-31 Ian Lance Taylor <iant@golang.org>
308 * elf.c (elf_add): Close descriptor if we use a debugfile.
309 * btest.c (check_open_files): New static function.
310 (main): Call check_open_files.
312 2018-01-25 Ian Lance Taylor <iant@golang.org>
314 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
316 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
318 2018-01-25 Ian Lance Taylor <iant@golang.org>
320 * pecoff.c (coff_add): Only release syms_view if it is valid.
322 2018-01-25 Ian Lance Taylor <iant@golang.org>
324 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
326 2018-01-24 Ian Lance Taylor <iant@golang.org>
328 * pecoff.c (coff_add): Use coff_read4, not memcpy.
330 2018-01-24 Ian Lance Taylor <iant@golang.org>
333 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
336 2018-01-19 Tony Reix <tony.reix@atos.net>
338 * xcoff.c (xcoff_incl_compare): New function.
339 (xcoff_incl_search): New function.
340 (xcoff_process_linenos): Use bsearch to find include file.
341 (xcoff_initialize_fileline): Sort include file information.
343 2018-01-16 Ian Lance Taylor <iant@golang.org>
345 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
347 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
348 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
349 (elf_zlib_default_table): Update.
350 (elf_zlib_default_dist_table): New static array.
351 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
353 * ztest.c (struct zlib_test): Add uncompressed_len.
354 (tests): Initialize uncompressed_len field. Add new test case.
355 (test_samples): Use uncompressed_len field.
357 2018-01-03 Jakub Jelinek <jakub@redhat.com>
359 Update copyright years.
361 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
363 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
364 * aclocal.m4: Regenerate.
365 * Makefile.in: Likewise.
366 * configure: Likewise.
368 2017-10-06 Ian Lance Taylor <iant@golang.org>
370 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
371 zlib uncompress function.
373 2017-10-05 Ian Lance Taylor <iant@golang.org>
375 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
376 Read a four byte integer.
377 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
378 boundary before ever calling elf_zlib_fetch.
379 * ztest.c (test_large): Simplify print statements a bit.
381 2017-10-02 Ian Lance Taylor <iant@golang.org>
383 * ztest.c: #include <errno.h>.
384 (TEST_TIMING): Don't define, don't test.
385 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
386 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
387 (ZLIB_CLOCK_GETTIME_ARG): Define.
388 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
389 * Makefile.am: Likewise.
390 * configure, Makefile.in: Rebuild.
392 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
395 * Makefile.am: Append the content of clock_gettime_link to
397 * configure.ac: Test for the case that clock_gettime is in librt.
398 * Makefile.in: Regenerate.
399 * configure: Likewise.
402 * configure.ac: Check for clock_gettime.
403 * config.h.in: Regenerate.
404 * configure: Likewise.
405 * ztest.c (average_time, test_large): Conditionalize test timing
406 on clock_gettime availability.
408 2017-09-29 Tony Reix <tony.reix@atos.net>
410 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
411 (STYP_DWARF, SSUBTYP_DW*): Define.
412 (enum dwarf_section): Define.
413 (struct dwsect_info): Define.
414 (xcoff_add): Look for DWARF sections, pass them to
417 2017-09-28 Ian Lance Taylor <iant@golang.org>
420 * elf.c (__builtin_prefetch): Define if not __GNUC__.
422 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
423 (b_elf_chdr): Define type.
424 (enum debug_section): Add ZDEBUG_xxx values.
425 (debug_section_names): Add names for new sections.
426 (struct debug_section_info): Add compressed field.
427 (elf_zlib_failed, elf_zlib_fetch): New static functions.
428 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
429 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
430 (HUFFMAN_SECONDARY_SHIFT): Define.
431 (ZDEBUG_TABLE_SIZE): Define.
432 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
433 (final_next_secondary): New static variable if
434 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
435 (elf_zlib_inflate_table): New static function.
436 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
437 function to produce fixed Huffman table.
438 (elf_zlib_default_table): New static variable.
439 (elf_zlib_inflate): New static function.
440 (elf_zlib_verify_checksum): Likewise.
441 (elf_zlib_inflate_and_verify): Likewise.
442 (elf_uncompress_zdebug): Likewise.
443 (elf_uncompress_chdr): Likewise.
444 (backtrace_uncompress_zdebug): New extern function.
445 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
446 sections, and uncompress them.
447 * internal.h (backtrace_compress_zdebug): Declare.
449 * configure.ac: Check for -lz and check whether the linker
450 supports --compress-debug-sections.
451 * Makefile.am (ztest_SOURCES): New variable.
452 (ztest_CFLAGS, ztest_LDADD): New variables.
453 (check_PROGRAMS): Add ztest.
454 (ctestg_SOURCES): New variable.
455 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
456 (ctesta_SOURCES): New variable.
457 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
458 (check_PROGRAMS): Add ctestg and ctesta.
459 * configure, config.h.in, Makefile.in: Rebuild.
461 2017-09-22 Ian Lance Taylor <iant@golang.org>
464 * configure.ac: Check for lstat and readlink.
465 * elf.c (lstat, readlink): Provide dummy versions if real versions
467 * configure, config.h.in: Rebuild.
469 2017-09-21 Ian Lance Taylor <iant@google.com>
472 * elf.c (backtrace_initialize): Set pd.exe_filename.
474 2017-09-20 Ian Lance Taylor <iant@golang.org>
475 Denis Khalikov <d.khalikov@partner.samsung.com>
478 Support for external debug info.
479 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
480 (S_ISLNK): Define if not defined.
481 (xstrnlen): Define if strnlen is not available.
482 (b_elf_note): Define type.
483 (NT_GNU_BUILD_ID): Define macro.
484 (elf_crc32, elf_crc32_file): New static functions.
485 (elf_is_symlink, elf_readlink): New static functions.
486 (elf_open_debugfile_by_buildid): New static function.
487 (elf_try_debugfile): New static function.
488 (elf_find_debugfile_by_debuglink): New static function.
489 (elf_open_debugfile_by_debuglink): New static function.
490 (elf_add): Add filename and debuginfo parameters. Adjust all
491 callers. Look for external debug info notes, and try to fetch
492 debug info from external file.
493 (struct phdr_data): Add exe_filename field.
494 (phdr_callback): Pass filename to elf_add.
495 (backtrace_initialize): Add filename parameter.
496 * internal.h (backtrace_initialize): Add filename parameter.
497 * fileline.c (fileline_initialize): Pass filename to
498 backtrace_initialize.
499 * pecoff.c (fileline_initialize): Add unused filename parameter.
500 * unknown.c (fileline_initialize): Likewise.
501 * xcoff.c (fileline_initialize): Likewise.
502 * configure.ac: Check for objcopy --add-gnu-debuglink.
503 * Makefile.am (dtest): New test target.
504 * configure, Makefile.in: Rebuild.
506 2017-09-12 Steve Ellcey <sellcey@cavium.com>
509 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
510 * Makefile.in: Regenerate.
512 2017-09-12 Steve Ellcey <sellcey@cavium.com>
515 * libbacktrace/Makefile.in
516 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
518 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
521 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
523 2017-07-28 Tony Reix <tony.reix@atos.net>
525 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
527 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
529 * fileline.c (fileline_initialize): Print pid_t as long.
531 2017-07-26 Tony Reix <tony.reix@atos.net>
533 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
534 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
535 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
536 * configure, config.h.in: Regenerate.
538 2017-07-21 Tony Reix <tony.reix@atos.net>
540 * filetype.awk: Add AIX XCOFF type detection.
541 * configure.ac: Recognize xcoff format.
542 * Makefile.am (FORMAT_FILES): Add xcoff.c.
543 * fileline.c: Include <unistd.h>.
544 (fileline_initialize): Add case for AIX procfs.
546 * configure, Makefile.in: Rebuild.
548 2017-06-21 Richard Biener <rguenther@suse.de>
550 * configure.ac: Add AC_SYS_LARGEFILE.
551 * config.h.in: Regenerate.
552 * configure: Likewise.
554 2017-06-11 Ian Lance Taylor <iant@golang.org>
556 * elf.c (backtrace_initialize): Always set *fileline_fn.
558 * btest.c: Move support functions into testlib.c. Change calls to
559 check to pass file name.
560 * testlib.c: New file, copied from (part of) btest.c.
561 * testlib.h: New file, declarations for testlib.c.
562 * edtest.c: Use testlib.h and testlib.c.
563 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
564 * Makefile.am (btest_SOURCES): Add testlib.c.
565 (edtest_SOURCES): Likewise.
566 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
567 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
568 * configure, Makefile.in: Rebuild.
570 2017-05-19 Than McIntosh <thanm@google.com>
572 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
573 (read_line_header): Don't allocate dirs if dirs_count == 0.
574 * edtest.c: New file.
575 * edtest2.c: New file.
576 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
577 (check_PROGRAMS): Add edtest.
578 (edtest2_build.c, gen_edtest2_build): New targets.
579 * Makefile.in: Rebuild.
581 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
583 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
584 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
586 2017-01-01 Jakub Jelinek <jakub@redhat.com>
588 Update copyright years.
590 2016-11-15 Matthias Klose <doko@ubuntu.com>
592 * configure: Regenerate.
594 2016-09-11 Carlos Liam <carlos@aarzee.me>
596 * all: Remove meaningless trailing whitespace.
598 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
601 * elf.c (phdr_callback) [__i386__]: Add
602 __attribute__((__force_align_arg_pointer__)).
604 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
606 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
607 avoid possible crash.
608 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
609 missing debug info anymore.
611 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
613 * mmap.c (MAP_FAILED): Define if not defined.
615 2016-01-04 Jakub Jelinek <jakub@redhat.com>
617 Update copyright years.
619 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
621 * configure.ac: Specify that DJGPP do not have mmap
622 even when sys/mman.h exists.
623 * configure: Regenerate
625 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
628 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
629 * configure: Regenerate.
630 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
633 2015-09-17 Ian Lance Taylor <iant@google.com>
635 * posix.c (backtrace_open): Cast second argument of open() to int.
637 2015-09-11 Ian Lance Taylor <iant@google.com>
639 * Makefile.am (backtrace.lo): Depend on internal.h.
640 (sort.lo, stest.lo): Add explicit dependencies.
641 * Makefile.in: Rebuild.
643 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
645 * backtrace.c: #include <sys/types.h>.
647 2015-09-08 Ian Lance Taylor <iant@google.com>
650 * backtrace.c: #include "internal.h".
651 (struct backtrace_data): Add can_alloc field.
652 (unwind): If can_alloc is false, don't try to get file/line
654 (backtrace_full): Set can_alloc field in bdata.
655 * alloc.c (backtrace_alloc): Don't call error_callback if it is
657 * mmap.c (backtrace_alloc): Likewise.
658 * internal.h: Update comments for backtrace_alloc and
661 2015-09-08 Ian Lance Taylor <iant@google.com>
664 * mmap.c (backtrace_alloc): Correct test for mmap failure.
666 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
668 * configure.ac: For spu-*-* targets, set have_fcntl to no.
669 * configure: Regenerate.
671 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
673 * configure.ac: Remove [disable-shared] argument to LT_INIT.
674 Remove setting PIC_FLAG when building as target library.
675 * configure: Regenerate.
677 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
679 * configure.ac: Only compile with -fPIC if the target
681 * configure: Regenerate.
683 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
685 * configure.ac: Set have_mmap to no on spu-*-* targets.
686 * configure: Regenerate.
688 2015-08-13 Ian Lance Taylor <iant@google.com>
690 * dwarf.c (read_function_entry): Add vec_inlined parameter.
693 2015-06-11 Martin Sebor <msebor@redhat.com>
696 * dwarf.c (struct line): Add new field idx.
697 (line_compare): Use it.
699 (read_line_info): Reset it.
701 2015-05-29 Tristan Gingold <gingold@adacore.com>
703 * pecoff.c: New file.
704 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
705 * Makefile.in: Regenerate.
706 * filetype.awk: Detect pecoff.
707 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
709 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
711 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
712 * configure: Regenerate.
713 * pecoff.c: New file.
715 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
717 * Makefile.in: Regenerated with automake-1.11.6.
718 * aclocal.m4: Likewise.
719 * configure: Likewise.
721 2015-01-24 Matthias Klose <doko@ubuntu.com>
723 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
724 * configure: Regenerate.
726 2015-01-05 Jakub Jelinek <jakub@redhat.com>
728 Update copyright years.
730 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
733 * configure: Regenerated.
735 2014-11-11 David Malcolm <dmalcolm@redhat.com>
737 * ChangeLog.jit: New.
739 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
742 * configure: Regenerate.
744 2014-10-23 Ian Lance Taylor <iant@google.com>
746 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
747 Fix to return void *.
749 2014-05-08 Ian Lance Taylor <iant@google.com>
751 * mmap.c (backtrace_free): If freeing a large aligned block of
752 memory, call munmap rather than holding onto it.
753 (backtrace_vector_grow): When growing a vector, double the number
754 of pages requested. When releasing the old version of a grown
755 vector, pass the correct size to backtrace_free.
757 2014-03-07 Ian Lance Taylor <iant@google.com>
759 * sort.c (backtrace_qsort): Use middle element as pivot.
761 2014-03-06 Ian Lance Taylor <iant@google.com>
765 * internal.h (backtrace_qsort): Declare.
766 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
767 (read_line_info, read_function_entry): Likewise.
768 (read_function_info, build_dwarf_data): Likewise.
769 * elf.c (elf_initialize_syminfo): Likewise.
770 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
771 (stest_SOURCES, stest_LDADD): Define.
772 (check_PROGRAMS): Add stest.
774 2014-02-07 Misty De Meo <misty@brew.sh>
777 * configure.ac: Use AC_LINK_IFELSE in check for
779 * configure: Regenerate.
781 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
783 Update copyright years
785 2013-12-06 Jakub Jelinek <jakub@redhat.com>
787 * elf.c (ET_DYN): Undefine and define again.
788 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
789 return early -1 without closing the descriptor.
790 (struct phdr_data): Add exe_descriptor.
791 (phdr_callback): If pd->exe_descriptor is not -1, for very first
792 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
793 otherwise backtrace_close the exe_descriptor if not -1. Adjust
795 (backtrace_initialize): Adjust call to elf_add. If it returns
796 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
798 2013-12-05 Ian Lance Taylor <iant@google.com>
800 * alloc.c (backtrace_vector_finish): Add error_callback and data
801 parameters. Call backtrace_vector_release. Return address base.
802 * mmap.c (backtrace_vector_finish): Add error_callback and data
803 parameters. Return address base.
804 * dwarf.c (read_function_info): Get new address base from
805 backtrace_vector_finish.
806 * internal.h (backtrace_vector_finish): Update declaration.
808 2013-11-27 Ian Lance Taylor <iant@google.com>
810 * dwarf.c (find_address_ranges): New static function, broken out
811 of build_address_map.
812 (build_address_map): Call it.
813 * btest.c (check): Check for missing filename or function, rather
815 (f3): Check that enough frames were returned.
817 2013-11-19 Jakub Jelinek <jakub@redhat.com>
819 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
820 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
822 * btest.c (struct symdata): Add size field.
823 (callback_three): Add symsize argument. Copy it to the data->size
825 (f23): Set symdata.size to 0.
826 (test5): Likewise. If sizeof (int) > 1, lookup address of
827 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
830 * atomic.c: Include sys/types.h.
832 2013-11-18 Ian Lance Taylor <iant@google.com>
834 * configure.ac: Check for support of __atomic extensions.
835 * internal.h: Declare or #define atomic functions for use in
837 * atomic.c: New file.
838 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
839 (dwarf_fileline, backtrace_dwarf_add): Likewise.
840 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
841 (backtrace_initialize): Likewise.
842 * fileline.c (fileline_initialize): Likewise.
843 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
844 * configure, config.h.in, Makefile.in: Rebuild.
846 2013-11-18 Jakub Jelinek <jakub@redhat.com>
848 * elf.c (SHN_UNDEF): Define.
849 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
850 with st_shndx == SHN_UNDEF. Add base_address to address fields.
851 (elf_add): Adjust caller.
853 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
855 2013-11-16 Ian Lance Taylor <iant@google.com>
857 * backtrace.h (backtrace_create_state): Correct comment about
860 2013-11-15 Ian Lance Taylor <iant@google.com>
862 * backtrace.h (backtrace_syminfo): Update comment and parameter
863 name to take any address, not just a PC value.
864 * elf.c (STT_OBJECT): Define.
865 (elf_nosyms): Rename parameter pc to addr.
866 (elf_symbol_search): Rename local variable pc to addr.
867 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
868 (elf_syminfo): Rename parameter pc to addr.
869 * btest.c (global): New global variable.
873 2013-10-17 Ian Lance Taylor <iant@google.com>
875 * elf.c (elf_add): Don't get the wrong offsets if a debug section
878 2013-10-15 David Malcolm <dmalcolm@redhat.com>
880 * configure.ac: Add --enable-host-shared, setting up
881 pre-existing PIC_FLAG variable within Makefile.am et al.
882 * configure: Regenerate.
884 2013-09-20 Alan Modra <amodra@gmail.com>
886 * configure: Regenerate.
888 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
890 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
892 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
894 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
895 dl_iterate_phdr callbacks.
897 2013-03-25 Ian Lance Taylor <iant@google.com>
899 * alloc.c: #include <sys/types.h>.
902 2013-01-31 Ian Lance Taylor <iant@google.com>
904 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
905 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
907 2013-01-25 Jakub Jelinek <jakub@redhat.com>
910 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
911 attribute was not seen.
913 2013-01-16 Ian Lance Taylor <iant@google.com>
915 * dwarf.c (struct unit): Add filename and abs_filename fields.
916 (build_address_map): Set new fields when reading unit.
917 (dwarf_lookup_pc): If we don't find an entry in the line table,
918 just return the main file name.
920 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
922 Update copyright years.
924 2013-01-01 Ian Lance Taylor <iant@google.com>
927 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
928 $(MULTIBUILDTOP)/../../gcc/include.
929 * Makefile.in: Rebuild.
931 2013-01-01 Ian Lance Taylor <iant@google.com>
934 * mmap.c (backtrace_alloc): Don't call sync functions if not
936 (backtrace_free): Likewise.
938 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
940 * mmapio.c: Define MAP_FAILED if not defined.
942 2012-12-11 Jakub Jelinek <jakub@redhat.com>
945 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
946 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
947 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
949 * Makefile.in: Regenerated.
950 * configure: Regenerated.
952 2012-12-07 Jakub Jelinek <jakub@redhat.com>
955 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
956 * Makefile.in: Regenerated.
958 2012-11-20 Ian Lance Taylor <iant@google.com>
960 * dwarf.c (read_attribute): Always clear val.
962 2012-11-13 Ian Lance Taylor <iant@google.com>
965 * configure.ac: Only add -Werror if building a target library.
966 * configure: Rebuild.
968 2012-11-12 Ian Lance Taylor <iant@google.com>
969 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
970 Gerald Pfeifer <gerald@pfeifer.com>
972 * configure.ac: Check for getexecname.
973 * fileline.c: #include <errno.h>. Define getexecname if not
975 (fileline_initialize): Try to find the executable in a few
977 * print.c (error_callback): Only print the filename if it came
978 from the backtrace state.
979 * configure, config.h.in: Rebuild.
981 2012-10-29 Ian Lance Taylor <iant@google.com>
983 * mmap.c (backtrace_vector_release): Correct last patch: add
986 2012-10-29 Ian Lance Taylor <iant@google.com>
988 * mmap.c (backtrace_vector_release): Make sure freed block is
989 aligned on 8-byte boundary.
991 2012-10-26 Ian Lance Taylor <iant@google.com>
994 * posix.c (backtrace_open): Add does_not_exist parameter.
995 * elf.c (phdr_callback): Do not warn if shared library could not
997 * fileline.c (fileline_initialize): Update calls to
999 * internal.h (backtrace_open): Update declaration.
1001 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1004 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1005 * configure: Regenerate.
1007 2012-10-24 Ian Lance Taylor <iant@google.com>
1010 * configure.ac: Check whether -funwind-tables option works.
1011 * configure: Rebuild.
1013 2012-10-11 Ian Lance Taylor <iant@google.com>
1015 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1016 * configure: Rebuild.
1018 2012-10-10 Ian Lance Taylor <iant@google.com>
1020 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1023 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1025 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1027 2012-10-09 Ian Lance Taylor <iant@google.com>
1029 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1030 (backtrace_dwarf_add): Likewise.
1032 2012-10-09 Ian Lance Taylor <iant@google.com>
1034 Add support for tracing through shared libraries.
1035 * configure.ac: Check for link.h and dl_iterate_phdr.
1036 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1037 ELF macros before #defining them.
1038 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1040 (struct elf_syminfo_data): Add next field.
1041 (elf_initialize_syminfo): Initialize next field.
1042 (elf_add_syminfo_data): New static function.
1043 (elf_add): New static function, broken out of
1044 backtrace_initialize. Call backtrace_dwarf_add instead of
1045 backtrace_dwarf_initialize.
1046 (struct phdr_data): Define.
1047 (phdr_callback): New static function.
1048 (backtrace_initialize): Call elf_add.
1049 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1050 (add_unit_addr): Add base_address parameter. Change all callers.
1051 (add_unit_ranges, build_address_map): Likewise.
1052 (add_line): Add ddata parameter. Change all callers.
1053 (read_line_program, add_function_range): Likewise.
1054 (dwarf_lookup_pc): New static function, broken out of
1056 (dwarf_fileline): Call dwarf_lookup_pc.
1057 (build_dwarf_data): New static function.
1058 (backtrace_dwarf_add): New function.
1059 (backtrace_dwarf_initialize): Remove.
1060 * internal.h (backtrace_dwarf_initialize): Don't declare.
1061 (backtrace_dwarf_add): Declare.
1062 * configure, config.h.in: Rebuild.
1064 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1066 * btest.c (f23): Avoid uninitialized variable warning.
1068 2012-10-04 Ian Lance Taylor <iant@google.com>
1070 * dwarf.c: If the system header files do not declare strnlen,
1071 provide our own version.
1073 2012-10-03 Ian Lance Taylor <iant@google.com>
1075 * dwarf.c (read_uleb128): Fix overflow test.
1076 (read_sleb128): Likewise.
1077 (build_address_map): Don't change unit_buf.start.
1079 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1082 * configure.ac (EXTRA_FLAGS): New.
1083 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1084 * configure, Makefile.in: Regenerate.
1086 2012-09-29 Ian Lance Taylor <iant@google.com>
1089 * fileline.c (fileline_initialize): Pass errnum as -1 when
1090 reporting that we could not read executable information after a
1093 2012-09-27 Ian Lance Taylor <iant@google.com>
1096 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1097 * Makefile.am: Add dependencies for all objects.
1098 * configure, aclocal.m4, Makefile.in: Rebuild.
1100 2012-09-27 Ian Lance Taylor <iant@google.com>
1103 * elf.c (backtrace_initialize): Set *fileln_fn, not
1106 2012-09-19 Ian Lance Taylor <iant@google.com>
1108 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1109 as a target library.
1110 * configure: Rebuild.
1112 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1113 Ian Lance Taylor <iant@google.com>
1115 * configure.ac (GCC_HEADER_STDINT): Invoke.
1116 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1117 * btest.c: Don't include <stdint.h>.
1118 * dwarf.c: Likewise.
1119 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1121 2012-09-18 Ian Lance Taylor <iant@google.com>
1124 * Makefile.am (AM_CPPFLAGS): Define.
1125 (AM_CFLAGS): Remove -I options.
1126 * Makefile.in: Rebuild.
1128 2012-09-18 Ian Lance Taylor <iant@google.com>
1130 * posix.c (O_BINARY): Define if not defined.
1131 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1132 HAVE_FCNTL is defined.
1133 * configure.ac: Test for the fcntl function.
1134 * configure, config.h.in: Rebuild.
1136 2012-09-18 Ian Lance Taylor <iant@google.com>
1138 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1140 2012-09-18 Ian Lance Taylor <iant@google.com>
1142 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1144 2012-09-18 Ian Lance Taylor <iant@google.com>
1146 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1147 * mmapio.c: Don't define _GNU_SOURCE.
1148 * configure, config.h.in: Rebuild.
1150 2012-09-18 Ian Lance Taylor <iant@google.com>
1152 * configure.ac: Check whether strnlen is declared.
1153 * dwarf.c: Declare strnlen if not declared.
1154 * configure, config.h.in: Rebuild.
1156 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1158 * fileline.c: Include <stdlib.h>.
1161 2012-09-17 Ian Lance Taylor <iant@google.com>
1164 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1167 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1170 * nounwind.c (backtrace_simple): Add state parameter.
1172 2012-09-17 Ian Lance Taylor <iant@google.com>
1175 * unknown.c (unknown_fileline): Add state parameter, remove
1176 fileline_data parameter, name error_callback parameter.
1177 (backtrace_initialize): Add state parameter.
1179 2012-09-17 Ian Lance Taylor <iant@google.com>
1181 * Initial implementation.
1183 Copyright (C) 2012-2019 Free Software Foundation, Inc.
1185 Copying and distribution of this file, with or without modification,
1186 are permitted in any medium without royalty provided the copyright
1187 notice and this notice are preserved.