c++: Some cp-tree.def comment fixes
[official-gcc.git] / libbacktrace / ChangeLog
blob5aa070d3182019d00b9ea5bdef47884a82bae852
1 2024-07-18  Ian Lance Taylor  <iant@golang.org>
3         * internal.h: Use __has_attribute to check for fallthrough
4         attribute.
5         * elf.c (elf_zstd_decompress): Use ATTRIBUTE_FALLTHROUGH rather
6         than a FALLTHROUGH comment.
8 2024-07-18  Ian Lance Taylor  <iant@golang.org>
10         * print.c (print_syminfo_callback): Add cast to avoid warning.
12 2024-07-18  Ian Lance Taylor  <iant@golang.org>
14         * print.c (print_syminfo_callback): New static function.
15         (print_callback): Call backtrace_syminfo if there is no function
16         or file name.
18 2024-07-18  Ian Lance Taylor  <iant@golang.org>
20         * README: Add notes about dl_iterate_phdr.
22 2024-07-17  Ian Lance Taylor  <iant@golang.org>
24         * xcoff.c (struct xcoff_fileline_data): Change base_address field
25         to struct libbacktrace_base_address.
26         (xcoff_initialize_syminfo): Change base_address to struct
27         libbacktrace_base_address.  Use libbacktrace_add_base.
28         (xcoff_initialize_fileline): Likewise.
29         (xcoff_lookup_pc): Use libbacktrace_add_base.
30         (xcoff_add): Change base_address to struct
31         libbacktrace_base_address.
32         (xcoff_armem_add, xcoff_add_shared_libs): Likewise.
33         (backtrace_initialize): Likewise.
34         * Makefile.am (xcoff.lo): Remove unused target.
35         (xcoff_32.lo, xcoff_64.lo): New targets.
36         * Makefile.in: Regenerate.
38 2024-07-16  Ian Lance Taylor  <iant@golang.org>
40         * internal.h: If FDPIC, #include <link.h> and/or <sys/link.h>.
41         (libbacktrace_using_fdpic): Define.
42         (struct libbacktrace_base_address): Define.
43         (libbacktrace_add_base): Define.
44         (backtrace_dwarf_add): Change base_address to struct
45         libbacktrace_base_address.
46         * dwarf.c (struct dwarf_data): Change base_address to struct
47         libbacktrace_base_address.
48         (add_ranges, find_address_ranges, build_ddress_map): Likewise.
49         (build_dwarf_data, build_dwarf_add): Likewise.
50         (add_low_high_range): Change base_address to struct
51         libbacktrace_base_address.  Use libbacktrace_add_base.
52         (add_ranges_from_ranges, add_ranges_from_rnglists): Likewise.
53         (add_line): Use libbacktrace_add_base.
54         * elf.c (elf_initialize_syminfo): Change base_address to struct
55         libbacktrace_base_address.  Use libbacktrace_add_base.
56         (elf_add): Change base_address to struct
57         libbacktrace_base_address.
58         (phdr_callback): Likewise.  Initialize base_address.m.
59         (backtrace_initialize): If using FDPIC, don't call elf_add with
60         main executable; always use dl_iterate_phdr.
61         * macho.c (macho_add_symtab): Change base_address to struct
62         libbacktrace_base_address.  Use libbacktrace_add_base.
63         (macho_syminfo): Change base_address to struct
64         libbacktrace_base_address.
65         (macho_add_fat, macho_add_dsym, macho_add): Likewise.
66         (backtrace_initialize): Likewise.  Initialize base_address.m.
67         * pecoff.c (coff_initialize_syminfo): Change base_address to
68         struct libbacktrace_base_address.  Use libbacktrace_add_base.
69         (coff_add): Change base_address to struct
70         libbacktrace_base_address.  Initialize base_address.m.
72 2024-07-12  Ian Lance Taylor  <iant@golang.org>
74         * elf.c (elf_add): Don't use .gnu_debugdata if we are already
75         reading a debuginfo file.
76         * Makefile.am (m2test_*): New test targets.
77         (CHECK_PROGRAMS): Add m2test.
78         (MAKETESTS): Add m2test_minidebug2.
79         (%_minidebug2): New pattern.
80         (CLEANFILES): Remove minidebug2 files.
81         * Makefile.in: Regenerate.
83 2024-07-12  Ian Lance Taylor  <iant@golang.org>
85         * btest.c (test5): Don't fail if symbol size is 0.
86         * mtest.c (test5): Likewise.
88 2024-07-12  Ian Lance Taylor  <iant@golang.org>
90         * macho.c (MACH_O_N_EXT): Don't define.
91         (MACH_O_N_UNDF): Define.
92         (macho_defined_symbol): Don't discard N_EXT symbols.  Do
93         discard N_UNDF symbols.
95 2024-07-11  Ian Lance Taylor  <iant@golang.org>
97         * btest.c (test1, test3): Add optnone attribute.
98         * edtest.c (test1): Likewise.
99         * mtest.c (test1, test3): Likewise.
100         * configure.ac: Use -Wno-attributes and -Wno-unknown-attributes.
101         * configure: Regenerate.
103 2024-07-11  Ian Lance Taylor  <iant@golang.org>
105         * elf.c (elf_nodebug): Suggest -g.
106         * macho.c (macho_nodebug): Suggest -g and dsymutil.
107         * pecoff.c (coff_nodebug): Suggest -g.
109 2024-07-11  Ian Lance Taylor  <iant@golang.org>
111         * dwarf.c: Remove trailing whitespace.
112         * macho.c: Likewise.
114 2024-06-16  Ian Lance Taylor  <iant@golang.org>
116         * elf.c (elf_fetch_bits_backward) Don't fail if no bits are
117         available.
119 2024-05-03  Ian Lance Taylor  <iant@golang.org>
121         * pecoff.c (struct dll_notification_data): Define.
122         (LDR_DLL_NOTIFICATION): New typedef.
123         (LDR_REGISTER_FUNCTION): New typedef.
124         (struct dll_notification_context): Define.
125         (dll_notification): New static function.
126         (backtrace_initialize): Register DLL notification.
128 2024-04-28  Ian Lance Taylor  <iant@golang.org>
130         * configure.ac: Checked for tlhelp32.h
131         * pecoff.c: Include <tlhelp32.h> if available.
132         (backtrace_initialize): Use tlhelp32 api for a snapshot to
133         detect loaded modules.
134         (coff_add): New argument for the module handle of the file,
135         to get the base address.
136         * configure, config.h.in: Regenerate.
138 2024-04-23  Ian Lance Taylor  <iant@golang.org>
140         * configure.ac: Test --compress-debug-sections=zlib-gnu and
141         --compress-debug-sections=zlib-gabi separately, setting new
142         automake conditionals.
143         * Makefile.am (ctestg, ctestg_alloc): Only build if
144         HAVE_COMPRESSED_DEBUG_ZLIB_GNU.
145         (ctesta, ctesta_alloc): Only build if
146         HAVE_COMPRESSED_DEBUG_ZLIB_GABI.
147         (ctestzstd_alloc): New test if HAVE_COMPRESSED_DEBUG_ZSTD.
148         * configure, Makefile.in: Regenerate.
150 2024-03-08  Ian Lance Taylor  <iant@golang.org>
152         * elf.c (elf_uncompress_chdr): Don't assume compressed section is
153         aligned.
155 2024-03-02  Ian Lance Taylor  <iant@golang.org>
157         * Makefile.am (libbacktrace_testing_ldflags): Define.
158         (*_LDFLAGS): Add $(libbacktrace_testing_ldflags) for test
159         programs.
160         * Makefile.in: Regenerate
162 2024-03-02  Ian Lance Taylor  <iant@golang.org>
164         * elf.c (elf_uncompress_lzma_block): Skip all header padding bytes
165         and verify that they are zero.
167 2024-03-02  Ian Lance Taylor  <iant@golang.org>
169         PR libbacktrace/114201
170         * elf.c (elf_add): Add caller_opd parameter.  Change all callers.
171         Release opd data after all recursive calls.
173 2024-03-01  Ian Lance Taylor  <iant@golang.org>
175         * elf.c (elf_add): Add the symbol table from a debuginfo file.
176         * Makefile.am (MAKETESTS): Add buildidfull and gnudebuglinkfull
177         variants of buildid and gnudebuglink tests.
178         (%_gnudebuglinkfull, %_buildidfull): New patterns.
179         * Makefile.in: Regenerate.
181 2023-11-30  Ian Lance Taylor  <iant@golang.org>
183         * pecoff.c: Include <windows.h> if available.
184         (coff_add): On Windows call GetModuleHandle to get base address.
186 2023-11-29  Ian Lance Taylor  <iant@golang.org>
188         * fileline.c: Include <windows.h> if available.
189         (windows_get_executable_path): New static function.
190         (fileline_initialize): Call windows_get_executable_path.
191         * configure.ac: Checked for windows.h
192         * configure: Regenerate.
193         * config.h.in: Regenerate.
195 2023-10-22  Iain Sandoe  <iain@sandoe.co.uk>
197         * configure: Regenerate.
198         * configure.ac: Handle Darwin rpaths.
200 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
202         * configure: Regenerate.
204 2023-08-07  Alexander von Gluck IV  <kallisti5@unixzen.com>
206         * configure: Regenerate.
208 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
210         * configure: Regenerate.
212 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
214         * configure: Regenerate.
216 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
218         * configure: Regenerate.
220 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
222         * configure: Regenerate.
224 2023-08-03  Richard Biener  <rguenther@suse.de>
226         * zstdtest.c (test_samples): Properly compute the allocation
227         size for the uncompressed data.
229 2023-07-31  Ian Lance Taylor  <iant@golang.org>
231         * configure.ac: Check for _pgmptr declaration.
232         * fileline.c (fileline_initialize): Check for _pgmfptr before
233         /proc/self/exec.
234         * configure, config.h.in: Regenerate.
236 2023-03-28  Ian Lance Taylor  <iant@golang.org>
238         * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading
239         bits, not before.  Add unlikely for error case.
240         (elf_zstd_offset_table): Regenerate.
241         (elf_zstd_read_huff): Clear 13 entries in weight_mark, not 12.
242         (elf_zstd_read_literals): For a single stream adjust by
243         total_streams_size, not compressed_size.
245 2023-01-20  Ian Lance Taylor  <iant@golang.org>
247         * dwarf.c (struct function_addrs): Change low and high fields to
248         uintptr_t.
249         (struct unit_addrs): Likewise.
250         (resolve_addr_index): Change address parameter to uintptr_t*.
251         (add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
252         (add_function_range): Likewise.
253         (struct pcrange): Change lowpc and highpc fields to uintptr_t.
254         (add_low_high_range): Change add_range lowpc and highpc parameters
255         to uintptr_t.
256         (add_ranges_from_ranges): Likewise.
257         (add_ranges_from_rnglists): Likewise.
258         (add_low_high_range): Chnage lowpc and highpc variables to
259         uintpr_t.
260         (add_ranges_from_rnglists): Change some local variables to
261         uintptr_t.
262         (add_ranges_from_ranges): Change base parameter to uintptr_t.
263         (add_ranges_from_rnglists): Likewise.
264         (read_function_entry): Likewise.
265         (resolve_addr_index): Add explicit casts to uintptr_t.
266         (update_pcrange): Likewise.
267         (add_ranges_from_ranges): Likewise.
268         (add_ranges_from_rnglists): Likewise.
269         (read_function_entry): Likewise.
271 2023-01-17  Martin Liska  <mliska@suse.cz>
273         * Makefile.in: Regenerate.
275 2023-01-06  Ian Lance Taylor  <iant@golang.org>
277         PR libbacktrace/108297
278         * configure.ac: Test whether linker supports --build-id.
279         * Makefile.am: Only run --build-id tests if supported.
280         * configure, Makefile.in: Regenerate.
282 2022-12-17  Ian Lance Taylor  <iant@golang.org>
284         * elf.c (elf_fetch_backward_init): New static function.
285         (ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
286         literal size.
287         (ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
288         (elf_zstd_read_huff): Use elf_fetch_backward_init.
289         (elf_zstd_read_literals): New static function.
290         (ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
291         (struct elf_zstd_literals): Don't define.
292         (elf_zstd_literal_output): Remove static function.
293         (elf_zstd_decompress): Use elf_fetch_backward_init and
294         elf_zstd_read_literals.  Rewrite literal copying.<
296 2022-12-10  Ian Lance Taylor  <iant@golang.org>
298         * elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
299         (ZSTD_ENCODE_BASELINE_BITS): Define.
300         (ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
301         (elf_zstd_literal_length_base): New static const array.
302         (elf_zstd_match_length_base): Likewise.
303         (struct elf_zstd_fse_baseline_entry): Define.
304         (elf_zstd_make_literal_baseline_fse): New static function.
305         (elf_zstd_make_offset_baseline_fse): Likewise.
306         (elf_zstd_make_match_baseline_fse): Likewise.
307         (print_table, main): Use elf_zstd_fse_baseline_entry.
308         (elf_zstd_lit_table, elf_zstd_match_table): Likewise.
309         (elf_zstd_offset_table): Likewise.
310         (struct elf_zstd_seq_decode): Likewise.  Remove use_rle and rle
311         fields.
312         (elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
313         taking a conversion function.  Convert RLE to FSE.
314         (elf_zstd_literal_length_baseline): Remove.
315         (elf_zstd_literal_length_bits): Remove.
316         (elf_zstd_match_length_baseline): Remove.
317         (elf_zstd_match_length_bits): Remove.
318         (elf_zstd_decompress): Use elf_zstd_fse_baseline_entry.  Rewrite
319         and simplify main loop.
321 2022-12-08  Ian Lance Taylor  <iant@golang.org>
323         * configure.ac: Check for zstd library and
324         --compress-debug-sections=zstd linker option.
325         * Makefile.am (zstdtest_*): New targets.
326         (zstdtest_alloc_*, ctestzstd_*): New targets.
327         (BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
328         appropriate.
329         * elf.c (ELFCOMPRESS_ZSTD): Define.
330         (elf_fetch_bits): Rename from elf_zlib_fetch.  Update uses.
331         (elf_fetch_bits_backward): New static function.
332         (ZLIB_HUFFMAN_*): Rename from HUFFMAN_*.  Update uses.
333         (ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*.  Update uses.
334         (ZSTD_TABLE_*): Define.
335         (struct elf_zstd_fse_entry): Define.
336         (elf_zstd_read_fse): New static function.
337         (elf_zstd_build_fse): Likewise.
338         (lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
339         (match, offset, next, print_table, main): Likewise.
340         (elf_zstd_lit_table): New static const array.
341         (elf_zstd_match_table, elf_zstd_offset_table): Likewise.
342         (elf_zstd_read_huff): New static function.
343         (struct elf_zstd_seq_decode): Define.
344         (elf_zstd_unpack_seq_decode): New static function.
345         (ZSTD_LIT_*): Define.
346         (struct elf_zstd_literals): Define.
347         (elf_zstd_literal_output): New static function.
348         (ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
349         (elf_zstd_literal_length_baseline): New static const array.
350         (elf_zstd_literal_length_bits): Likewise.
351         (ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
352         (elf_zstd_match_length_baseline): New static const array.
353         (elf_zstd_match_length_bits): Likewise.
354         (elf_zstd_decompress): New static function.
355         (ZDEBUG_TABLE_SIZE): New definition.
356         (elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
357         (backtrace_uncompress_zstd): New function.
358         (elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
359         * internal.h (backtrace_uncompress_zstd): Declare.
360         * zstdtest.c: New file.
361         * configure, config.h.in, Makefile.in: Regenerate.
363 2022-10-12  Martin Liska  <mliska@suse.cz>
365         * configure: Regenerate.
367 2022-10-11  Olivier Hainque  <hainque@adacore.com>
368             Olivier Hainque  <hainque@adacore.com>
370         * configure: Regenerate.
372 2022-07-08  Ian Lance Taylor  <iant@golang.org>
374         * configure.ac: Check for sys/link.h.  Use either link.h or
375         sys/link.h when checking for dl_iterate_phdr.
376         * elf.c: Include sys/link.h if available.
377         * configure, config.h.in: Regenerate.
379 2022-07-07  Ian Lance Taylor  <iant@golang.org>
381         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
382         loop if we can't find debug info for one shared library.
384 2022-07-07  Ian Lance Taylor  <iant@golang.org>
386         * Makefile.am (MAKETESTS): New variable split out of TESTS.
387         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
388         * Makefile.in: Regenerate.
390 2022-06-27  Ian Lance Taylor  <iant@golang.org>
392         * configure.ac: Use grep instead of fgrep.
393         * configure, Makefile.in: Regenerate.
395 2022-05-28  Ian Lance Taylor  <iant@golang.org>
397         PR libbacktrace/105721
398         * README: Update.
400 2022-04-05  Ian Lance Taylor  <iant@golang.org>
402         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
403         uncompressed block.
405 2022-02-17  Ian Lance Taylor  <iant@golang.org>
407         * dwarf.c (find_address_ranges): Handle skeleton units.
408         (read_function_entry): Likewise.
410 2022-02-16  Ian Lance Taylor  <iant@golang.org>
412         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
414 2022-02-03  David Seifert  <soap@gentoo.org>
415             Jakub Jelinek  <jakub@redhat.com>
417         * configure.ac: Support --disable-werror.
418         * configure: Regenerate.
420 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
422         PR libbacktrace/103822
423         * Makefile.am: Fix newline.
424         * Makefile.in: Regenerate.
426 2021-11-12  Martin Liska  <mliska@suse.cz>
428         PR libbacktrace/103167
429         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
430         (elf_uncompress_lzma): Likewise.
431         * xztest.c (test_samples): memcpy only if v > 0.
433 2021-10-22  Martin Liska  <mliska@suse.cz>
435         PR testsuite/102742
436         * btest.c (MIN_DESCRIPTOR): New.
437         (MAX_DESCRIPTOR): Likewise.
438         (check_available_files): Likewise.
439         (check_open_files): Check only file descriptors that
440         were not available at the entry.
441         (main): Call check_available_files.
443 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
445         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
446         output with LANG=C.
448 2021-06-28  Clément Chigot  <clement.chigot@atos.net>
450         * xcoff.c (SSUBTYP_DWRNGES): New define.
451         (xcoff_add): Use correct XCOFF DWARF section subtype
452         for DEBUG_RANGES. Remove lineoff workaround.
453         Adjust base_address.
454         (xcoff_initialize_syminfo): Adapt to new base_address.
455         (xcoff_lookup_pc): Likewise.
456         (xcoff_initialize_fileline): Likewise.
458 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
460         PR bootstrap/99703
461         * configure: Regenerated.
463 2021-03-03  Ian Lance Taylor  <iant@golang.org>
465         * dwarf.c (read_line_program): Don't special case file 0.
466         (read_function_entry): Likewise.
468 2021-03-02  Ian Lance Taylor  <iant@golang.org>
470         PR libbacktrace/98818
471         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
472         callers.
473         * backtrace.h: Update backtrace_error_callback comment.
475 2021-02-12  Ian Lance Taylor  <iant@golang.org>
477         * configure.ac: Check for objcopy --add-gnu-debuglink by using
478         objcopy --help.
479         * configure: Regenerate
481 2021-01-18  Ian Lance Taylor  <iant@golang.org>
483         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
484         * Makefile.in: Regenerate.
485         * configure: Regenerate.
487 2021-01-18  Ian Lance Taylor  <iant@golang.org>
489         PR debug/98716
490         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
491         filenames.
492         (read_line_program): Remove parameter u, change caller.  Don't
493         subtract one from dirs and filenames index.
494         (read_function_entry): Don't subtract one from filenames index.
496 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
498         * configure: Re-generate.
500 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
502         PR target/97865
503         * configure: Regenerate.
505 2020-12-02  Ian Lance Taylor  <iant@golang.org>
507         * dwarf.c (resolve_string): Use > rather than >= to check whether
508         string index extends past buffer.
509         (resolve_addr_index): Similarly for address index.
511 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
513         * configure: Regenerate.
515 2020-10-20  Ian Lance Taylor  <iant@golang.org>
517         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
518         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
520 2020-09-28  Ian Lance Taylor  <iant@golang.org>
522         PR libbacktrace/97082
523         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
524         * Makefile.in: Regenerate.
526 2020-09-28  Ian Lance Taylor  <iant@golang.org>
528         PR libbacktrace/97227
529         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
530         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
531         * configure: Regenerate.
532         * Makefile.in: Regenerate.
534 2020-09-23  Ian Lance Taylor  <iant@golang.org>
536         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
537         p->low.
538         (dwarf_lookup_pc): Likewise.
540 2020-09-17  Ian Lance Taylor  <iant@golang.org>
542         PR libbacktrace/97080
543         * fileline.c (backtrace_syminfo_to_full_callback): New function.
544         (backtrace_syminfo_to_full_error_callback): New function.
545         * elf.c (elf_nodebug): Call syminfo_fn if possible.
546         * internal.h (struct backtrace_call_full): Define.
547         (backtrace_syminfo_to_full_callback): Declare.
548         (backtrace_syminfo_to_full_error_callback): Declare.
549         * mtest.c (f3): Only check all[i] if data.index permits.
551 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
553         * macho.c (MACH_O_CPU_TYPE_PPC): New.
554         (MACH_O_CPU_TYPE_PPC64): New.
555         Add compile-tests for powerpc to the Mach-O variants.
557 2020-09-14  Ian Lance Taylor  <iant@golang.org>
559         PR libbacktrace/93608
560         Add support for MiniDebugInfo.
561         * elf.c (struct elf_view): Define.  Replace most uses of
562         backtrace_view with elf_view.
563         (elf_get_view): New static functions.  Replace most calls of
564         backtrace_get_view with elf_get_view.
565         (elf_release_view): New static functions.  Replace most calls of
566         backtrace_release_view with elf_release_view.
567         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
568         callers.
569         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
570         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
571         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
572         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
573         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
574         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
575         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
576         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
577         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
578         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
579         (LZMA_PROB_DIST_ALIGN_LEN): Define.
580         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
581         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
582         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
583         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
584         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
585         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
586         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
587         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
588         (LZMA_PROB_REP_LEN_MID_LEN): Define.
589         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
590         (LZMA_PROB_LITERAL_LEN): Define.
591         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
592         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
593         (LZMA_PROB_IS_REP2_OFFSET): Define.
594         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
595         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
596         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
597         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
598         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
599         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
600         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
601         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
602         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
603         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
604         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
605         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
606         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
607         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
608         (LZMA_PROB_LITERAL_OFFSET): Define.
609         (LZMA_PROB_TOTAL_COUNT): Define.
610         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
611         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
612         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
613         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
614         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
615         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
616         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
617         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
618         (elf_lzma_varint): New static function.
619         (elf_lzma_range_normalize): New static function.
620         (elf_lzma_bit, elf_lzma_integer): New static functions.
621         (elf_lzma_reverse_integer): New static function.
622         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
623         (elf_uncompress_lzma): New static function.
624         (backtrace_uncompress_lzma): New function.
625         (elf_add): Add memory and memory_size parameters.  Change all
626         callers.  Look for .gnu_debugdata section, and, if found,
627         decompress it and use it for symbols and debug info.  Permit the
628         descriptor parameter to be -1.
629         * internal.h (backtrace_uncompress_lzma): Declare.
630         * mtest.c: New file.
631         * xztest.c: New file.
632         * configure.ac: Check for nm, xz, and comm programs.  Check for
633         liblzma library.
634         (HAVE_MINIDEBUG): Define.
635         * Makefile.am (mtest_SOURCES): Define.
636         (mtest_CFLAGS, mtest_LDADD): Define.
637         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
638         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
639         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
640         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
641         (xztest_alloc_LDADD): Define.
642         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
643         (CLEANFILES): Add files created by minidebug pattern.
644         (btest.lo): Correct INCDIR reference.
645         (mtest.lo, xztest.lo, ztest.lo): New targets.
646         * configure: Regenerate.
647         * config.h.in: Regenerate.
648         * Makefile.in: Regenerate.
650 2020-09-09  Ian Lance Taylor  <iant@golang.org>
652         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
653         (coff_add): Determine and pass is_64.
655 2020-09-09  Ian Lance Taylor  <iant@golang.org>
657         PR libbacktrace/96973
658         * fileline.c (macho_get_executable_path): New static function.
659         (fileline_initialize): Call macho_get_executable_path.
661 2020-09-09  Ian Lance Taylor  <iant@golang.org>
663         * dwarf.c (function_addrs_search): Compare against the next entry
664         low address, not the high address.
665         (unit_addrs_search): Likewise.
666         (build_address_map): Add a trailing unit_addrs.
667         (read_function_entry): Add a trailing function_addrs.
668         (read_function_info): Likewise.
669         (report_inlined_functions): Search backward for function_addrs
670         match.
671         (dwarf_lookup_pc): Search backward for unit_addrs and
672         function_addrs matches.
674 2020-09-08  Ian Lance Taylor  <iant@golang.org>
676         * simple.c (simple_unwind): Correct comment spelling.
678 2020-09-08  Ian Lance Taylor  <iant@golang.org>
680         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
681         correct length when freeing diralc.
683 2020-09-08  Ian Lance Taylor  <iant@golang.org>
685         PR libbacktrace/96973
686         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
688 2020-09-08  Ian Lance Taylor  <iant@golang.org>
690         PR libbacktrace/96971
691         * filetype.awk: Only match magic number at start of line.
693 2020-08-24  Ian Lance Taylor  <iant@golang.org>
695         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
696         (MACH_O_MH_CIGAM_FAT_64): Define.
697         (struct macho_fat_arch_64): Define.
698         (macho_add_fat): Add and use is_64 parameter.
699         (macho_add): Recognize 64-bit fat files.
701 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
703         PR bootstrap/96202
704         * configure: Regenerated.
706 2020-07-08  Ian Lance Taylor  <iant@golang.org>
708         * configure.ac: Test linker support for DWARF5
709         * configure: Regenerate
711 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
713         PR bootstrap/95413
714         * configure: Regenerated.
716 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
718         PR bootstrap/95147
719         * configure: Regenerated.
721 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
723         * configure: Regenerated.
725 2020-05-13  Ian Lance Taylor  <iant@golang.org>
727         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
729 2020-05-13  Ian Lance Taylor  <iant@golang.org>
731         PR go/95061
732         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
734 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
736         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
737         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
738         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
739         enabled.
740         * Makefile.in: Regenerated.
741         * configure: Likewise.
743 2020-05-11  Ian Lance Taylor  <iant@golang.org>
745         PR libbacktrace/95012
746         * configure.ac: Check for getpagesize declaration.
747         * mmap.c: Declare getpagesize if necessary.
748         * mmapio.c: Likewise.
749         * configure: Regenerate.
750         * config.h.in: Regenerate.
751         * Makefile.in: Regenerate.
753 2020-05-09  Roland McGrath  <mcgrathr@google.com>
755         * elf.c (elf_add): Bail early if there are no section headers at all.
757 2020-05-09  Ian Lance Taylor  <iant@golang.org>
759         * elf.c (elf_add): Don't free strtab if an error occurs after
760         recording symbol information.
762 2020-05-09  Ian Lance Taylor  <iant@golang.org>
764         PR libbacktrace/88745
765         * macho.c: New file.
766         * filetype.awk: Recognize Mach-O files.
767         * Makefile.am (FORMAT_FILES): Add macho.c.
768         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
769         (%.dSYM): New pattern target.
770         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
771         (test_macho_LDADD): New target.
772         (BUILDTESTS): Add test_macho.
773         (macho.lo): Add dependencies.
774         * configure.ac: Recognize macho file type.  Check for
775         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
776         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
777         * Makefile.in: Regenerate.
778         * configure: Regenerate.
779         * config.h.in: Regenerate.
781 2020-05-09  Ian Lance Taylor  <iant@golang.org>
783         * read.c (backtrace_get_view): Support short read.
785 2020-05-09  Ian Lance Taylor  <iant@golang.org>
787         * elf.c (elf_add): If debug sections are very large or far apart,
788         read them individually rather than as a single view.
790 2020-05-08  Ian Lance Taylor  <iant@golang.org>
792         * fileline.c (sysctl_exec_name): New static function.
793         (sysctl_exec_name1): New macro or static function.
794         (sysctl_exec_name2): Likewise.
795         (fileline_initialize): Try sysctl_exec_name[12].
796         * configure.ac: Check for sysctl args to fetch executable name.
797         * configure: Regenerate.
798         * config.h.in: Regenerate.
800 2020-02-15  Ian Lance Taylor  <iant@golang.org>
802         * ztest.c (test_large): Update file to current libgo test file.
804 2020-02-03  Ian Lance Taylor  <iant@golang.org>
806         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
807         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
808         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
809         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
810         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
811         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
812         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
813         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
814         (stest_alloc_CFLAGS): Likewise.
815         * Makefile.in: Regenerate.
816         * ztest.c (error_callback_compress): Mark vdata unused.
817         (test_large): Add casts to avoid warnings.
819 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
821         Update copyright years.
823 2019-12-13  Ian Lance Taylor  <iant@golang.org>
825         Add DWARF 5 support.
826         * dwarf.c (struct attr): Add val field.
827         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
828         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
829         (struct line_header): Add addrsize field.
830         (struct line_header_format): Define.
831         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
832         fields.
833         (read_uint24): New static function.
834         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
835         and dwarf_str_size parameters with dwarf_sections parameter.  Add
836         support for new DWARF 5 forms.  Change all callers.
837         (resolve_string): New static function.
838         (resolve_addr_index): Likewise.
839         (read_abbrevs): Support DW_FORM_implicit_const.
840         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
841         and ranges_is_index fields.
842         (update_pcrange): Support DWARF 5 encodings.
843         (add_high_low_range): New static function, split out of
844         add_ranges.
845         (add_ranges_from_ranges): Likewise.
846         (add_ranges_from_rnglists): New static function.
847         (add_ranges): Just call new helper functions.
848         (find_address_ranges): Use resolve_string for strings, after
849         reading all attributes.  Handle new DWARF 5 attributes.
850         (build_address_map): Support DWARF 5 compilation units.
851         (read_v2_paths): New static function, split out of
852         read_line_header.
853         (read_lnct): New static function.
854         (read_line_header_format_entries): Likewise.
855         (read_line_header): Add ddata parameter.  Support DWARF 5 line
856         headers.  Call new helper functions.  Change all callers.
857         (read_line_program): Use addrsize from line program header.  Don't
858         special case directory index 0 for DWARF 5.
859         (read_referenced_name): Use resolve_string.
860         (read_function_entry): Handle DWARF 5 encodings.  Use
861         resolve_string.
862         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
863         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
864         * elf.c (dwarf_section_names): Add new section names.
865         * pecoff.c (dwarf_section_names): Likewise.
866         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
867         fields.
868         * configure.ac: Define HAVE_DWARF5 automake conditional.
869         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
870         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
871         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
872         (dwarf5_alloc_LDADD): Likewise.
873         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
874         (CLEANFILES, clean-local): Define.
876 2019-12-08  Ian Lance Taylor  <iant@golang.org>
878         * dwarf.c (struct pcrange): Define.
879         (update_pcrange, add_ranges): New static functions.
880         (add_unit_addr): Change signature to work with add_ranges.  Don't
881         add base_address here.
882         (add_unit_ranges): Remove.
883         (find_address_ranges): Replace str/ranges parameters with
884         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
885         callers.
886         (add_function_range): Change signature to work with add_ranges.
887         Don't add base_address here.
888         (add_function_ranges): Remove.
889         (read_function_entry): Use update_pcrange and add_ranges.
891 2019-12-04  Ian Lance Taylor  <iant@golang.org>
893         * edtest.c (test1): Add noclone attribute.
895 2019-12-04  Ian Lance Taylor  <iant@golang.org>
897         * internal.h (enum dwarf_section): Define.
898         (struct dwarf_sections): Define.
899         (backtrace_dwarf_add): Update declaration to replace specific
900         section parameters with dwarf_sections parameter.
901         * dwarf.c (struct dwarf_data): Replace specific section fields
902         with dwarf_sections field.
903         (read_attribute): Use dwarf_sections with altlink.
904         (build_address_map): Replace specific section parameters with
905         dwarf_sections parameter.  Change all callers.
906         (read_line_info): Use dwarf_sections with ddata.
907         (read_referenced_name): Likewise.
908         (add_function_ranges): Likewise.
909         (read_function_entry): Likewise.
910         (read_function_info): Likewise.
911         (build_dwarf_data): Replace specific section parameters with
912         dwarf_sections parameter.  Change all callers.
913         (backtrace_dwarf_add): Likewise.
914         * elf.c (enum debug_section): Remove.
915         (dwarf_section_names): Remove .zdebug names.
916         (elf_add): Track zsections separately.  Build dwarf_sections.
917         * pecoff.c (enum debug_section): Remove.
918         (struct debug_section_info): Remove data field.
919         (coff_add): Build dwarf_sections.
920         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
921         references with DEBUG_xxx references.
922         (xcoff_add): Build dwarf_sections.
924 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
926         * configure: Regenerate.
928 2019-09-26  Ian Lance Taylor  <iant@golang.org>
930         PR libbacktrace/91908
931         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
932         __sync_bool_compare_and_swap to void.
933         * xcoff.c (backtrace_initialize): Likewise.
935 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
937         * configure.ac: Remove references to spu.
938         * configure: Regenerate.
940 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
942         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
943         test_elf_64.
944         * Makefile.in: Regenerate.
946 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
948         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
949         handling.
950         * configure: Regenerate.
952 2019-03-11  Ian Lance Taylor  <iant@golang.org>
954         PR libbacktrace/89669
955         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
956         HAVE_ELF.
957         * Makefile.in: Regenerate.
959 2019-02-26  Tom de Vries  <tdevries@suse.de>
961         * btest.c (test5): Allow global.* as minimal symbol name for global.
963 2019-02-26  Tom de Vries  <tdevries@suse.de>
965         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
966         * Makefile.in: Regenerate.
968 2019-02-12  Tom de Vries  <tdevries@suse.de>
970         PR libbacktrace/81983
971         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
973 2019-02-10  Tom de Vries  <tdevries@suse.de>
975         * Makefile.am (BUILDTESTS): Add btest_lto.
976         * Makefile.in: Regenerate.
977         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
978         __attribute__((noclone)).
980 2019-02-08  Tom de Vries  <tdevries@suse.de>
982         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
983         * print.c (backtrace_print): Same.
984         * simple.c (backtrace_simple): Same.
986 2019-02-08  Tom de Vries  <tdevries@suse.de>
988         PR libbacktrace/78063
989         * dwarf.c (build_address_map): Keep all parsed units.
990         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
992 2019-01-31  Tom de Vries  <tdevries@suse.de>
994         PR libbacktrace/89136
995         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
996         'debugaltlink_name_len =+ 1'.
998 2019-01-29  Tom de Vries  <tdevries@suse.de>
1000         * install-debuginfo-for-buildid.sh.in: New script.
1001         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
1002         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
1003         * Makefile.in: Regenerate.
1004         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
1005         (READELF): Set with AC_CHECK_PROG.
1006         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
1007         * configure: Regenerate.
1008         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
1009         (elf_open_debugfile_by_buildid): ... here.
1011 2019-01-29  Tom de Vries  <tdevries@suse.de>
1013         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
1014         allocfail.
1015         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
1016         (check_PROGRAMS): Add BUILDTESTS.
1017         * Makefile.in: Regenerate.
1019 2019-01-28  Tom de Vries  <tdevries@suse.de>
1021         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
1022         Use $< to access prerequisite.
1023         * Makefile.in: Regenerate.
1025 2019-01-25  Nathan Sidwell  <nathan@acm.org>
1027         * elf.c (elf_add): Pass "" filename to recursive call with
1028         separated debug.
1030 2019-01-25  Tom de Vries  <tdevries@suse.de>
1032         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
1033         filename == "".
1034         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
1035         * Makefile.in: Regenerate.
1037 2019-01-25  Tom de Vries  <tdevries@suse.de>
1039         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
1040         (TESTS): Rename dtest to btest_gnudebuglink.
1041         * Makefile.in: Regenerate.
1043 2019-01-23  Tom de Vries  <tdevries@suse.de>
1045         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
1046         (units_search, find_unit): Use size_t for offset.
1047         (build_address_map): Use size_t for unit_offset.
1049 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
1051         * allocfail.c (main): Increase portability of printf statement.
1053 2019-01-18  Ian Lance Taylor  <iant@golang.org>
1055         PR libbacktrace/88890
1056         * mmapio.c (backtrace_get_view): Change size parameter to
1057         uint64_t.  Check that value fits in size_t.
1058         * read.c (backtrace_get_view): Likewise.
1059         * internal.h (backtrace_get_view): Update declaration.
1060         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
1062 2019-01-17  Tom de Vries  <tdevries@suse.de>
1064         PR libbacktrace/82857
1065         * configure.ac (DWZ): Set with AC_CHECK_PROG.
1066         (HAVE_DWZ): Set with AM_CONDITIONAL.
1067         * configure: Regenerate.
1068         * Makefile.am (TESTS): Add btest_dwz.
1069         * Makefile.in: Regenerate.
1071 2019-01-17  Tom de Vries  <tdevries@suse.de>
1073         PR libbacktrace/82857
1074         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
1075         (read_attribute): Handle DW_FORM_GNU_ref_alt using
1076         ATTR_VAL_REF_ALT_INFO.
1077         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
1079 2019-01-17  Tom de Vries  <tdevries@suse.de>
1081         * dwarf.c (struct unit): Add low_offset and high_offset fields.
1082         (struct unit_vector): New type.
1083         (struct dwarf_data): Add units and units_counts fields.
1084         (find_unit): New function.
1085         (find_address_ranges): Add and handle unit_tag parameter.
1086         (build_address_map): Add and handle units_vec parameter.
1087         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
1088         units vector.
1090 2019-01-17  Tom de Vries  <tdevries@suse.de>
1092         PR libbacktrace/82857
1093         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
1094         using altlink.
1096 2019-01-17  Tom de Vries  <tdevries@suse.de>
1098         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
1099         (read_attribute): Add altlink parameter.  Handle missing altlink for
1100         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
1101         (find_address_ranges, build_address_map, build_dwarf_data): Add and
1102         handle altlink parameter.
1103         (read_referenced_name, read_function_entry): Add argument to
1104         read_attribute call.
1106 2019-01-17  Tom de Vries  <tdevries@suse.de>
1108         * dwarf.c (struct dwarf_data): Add altlink field.
1109         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
1110         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
1111         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
1112         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
1113         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
1114         * xcoff.c (xcoff_add): Same.
1116 2019-01-17  Tom de Vries  <tdevries@suse.de>
1118         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
1119         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
1120         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
1121         argument to backtrace_dwarf_add call.
1122         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
1123         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
1124         * xcoff.c (xcoff_add): Same.
1126 2019-01-17  Tom de Vries  <tdevries@suse.de>
1128         * elf.c (elf_add): Add and handle with_buildid_data and
1129         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
1130         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
1132 2019-01-16  Tom de Vries  <tdevries@suse.de>
1134         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
1135         of ...
1136         (read_referenced_name): ... here, and ...
1137         (read_function_entry): ... here.
1139 2019-01-16  Tom de Vries  <tdevries@suse.de>
1141         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
1142         name.
1143         (read_function_entry): Same.  Don't allow name found via
1144         DW_AT_abstract_origin or case DW_AT_specification to override linkage
1145         name.
1147 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
1149         PR other/16615
1151         * backtrace.h: Mechanically replace "can not" with "cannot".
1153 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
1155         Update copyright years.
1157 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
1159         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
1160         in sed pattern.
1161         * Makefile.in: Regenerate.
1163 2018-12-28  Tom de Vries  <tdevries@suse.de>
1165         * dwarf.c (build_address_map): Reuse unused units.
1167 2018-12-28  Tom de Vries  <tdevries@suse.de>
1169         * dwarf.c (build_address_map): Simplify by removing local variable
1170         abbrevs.
1172 2018-12-28  Ian Lance Taylor  <iant@golang.org>
1173             Tom de Vries  <tdevries@suse.de>
1175         PR libbacktrace/88063
1176         * dwarf.c (free_unit_addrs_vector): Remove.
1177         (build_address_map): Keep track of allocated units in vector.  Free
1178         allocated units and corresponding abbrevs upon failure.  Remove now
1179         redundant call to free_unit_addrs_vector.  Free addrs vector upon
1180         failure.  Free allocated unit vector.
1182 2018-12-28  Tom de Vries  <tdevries@suse.de>
1184         * dwarf.c (build_address_map): Free addrs vector upon failure.
1186 2018-12-14  Tom de Vries  <tdevries@suse.de>
1188         PR testsuite/88491
1189         * allocfail.sh: Remove "set -o pipefail".
1191 2018-12-12  Tom de Vries  <tdevries@suse.de>
1193         * Makefile.am (TESTS): Add allocfail.sh.
1194         (check_PROGRAMS): Add allocfail.
1195         * Makefile.in: Regenerate.
1196         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
1197         Include alloc.c.
1198         * allocfail.c: New file.
1199         * allocfail.sh: New file.
1201 2018-11-30  Tom de Vries  <tdevries@suse.de>
1203         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
1204         test_xcoff_64, test_pecoff and test_unknown.
1205         * Makefile.in: Regenerate.
1206         * test_format.c: New file.
1208 2018-11-30  Tom de Vries  <tdevries@suse.de>
1210         * Makefile.am : Add _with_alloc version for each test in
1211         check_PROGRAMS.
1212         * Makefile.in: Regenerate.
1214 2018-11-30  Tom de Vries  <tdevries@suse.de>
1216         * internal.h (backtrace_vector_free): New static inline fuction,
1217         factored out of ...
1218         * dwarf.c (read_line_info): ... here.
1220 2018-11-28  Tom de Vries  <tdevries@suse.de>
1222         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
1223         failure.
1225 2018-11-27  Tom de Vries  <tdevries@suse.de>
1227         * mmap.c (backtrace_vector_release): Same.
1228         * unittest.c (test1): Add check.
1230 2018-11-27  Tom de Vries  <tdevries@suse.de>
1232         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
1233         instead of realloc.
1234         * Makefile.am (check_PROGRAMS): Add unittest.
1235         * Makefile.in: Regenerate.
1236         * unittest.c: New file.
1238 2018-11-22  Tom de Vries  <tdevries@suse.de>
1240         * dwarf.c (read_initial_length): Factor out of ...
1241         (build_address_map, read_line_info): ... here.
1243 2018-11-21  Tom de Vries  <tdevries@suse.de>
1245         * dwarf.c (read_string): Factor out of ...
1246         (read_attribute, read_line_header, read_line_program): ... here.
1248 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
1250         PR bootstrap/82856
1251         * Makefile.am: Include multilib.am.
1252         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
1253         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
1255 2018-10-05  Ian Lance Taylor  <iant@golang.org>
1257         PR libbacktrace/87529
1258         * backtrace.h: Document that backtrace_create_state should be
1259         called only once.
1261 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
1263         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
1264         * Makefile.in: Regenerate.
1265         * config.h.in: Likewise.
1266         * configure: Likewise.
1268 2018-08-01  Tony Reix  <tony.reix@atos.net>
1270         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
1271         (struct xcoff_func, struct xcoff_func_vector): New structs.
1272         (xcoff_syminfo): Drop leading dot from symbol name.
1273         (xcoff_line_compare, xcoff_line_search): Remove.
1274         (xcoff_func_compare, xcoff_func_search): New static functions.
1275         (xcoff_lookup_pc): Search function table.
1276         (xcoff_add_line, xcoff_process_linenos): Remove.
1277         (xcoff_initialize_fileline): Build function table.
1279 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
1281         PR other/86198
1282         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
1283         checking up to 36 bytes.
1285 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1287         * configure: Regenerated.
1289 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
1291         * configure: Regenerated.
1293 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1295         * backtrace.c: Revert last two changes.  Don't call mmap
1296         directly.
1298 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1300         * backtrace.c: Include backtrace-supported.h before checking
1301         BACKTRACE_USES_MALLOC.
1303 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1305         * backtrace.c (backtrace_full): When testing whether we can
1306         allocate memory, call mmap directly, and munmap the memory.
1308 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
1310         PR other/85161
1311         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
1312         big endian, only use 32-bit loads if endianity macros are predefined
1313         and indicate big or little endian.
1315 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1317         PR target/84148
1318         * configure: Regenerate.
1320 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
1322         PR other/82368
1323         * elf.c (SHT_PROGBITS): Undefine and define.
1325 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
1327         PR other/82368
1328         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
1329         (struct elf_ppc64_opd_data): New type.
1330         (elf_initialize_syminfo): Add opd argument, handle symbols
1331         pointing into the PowerPC64 ELFv1 .opd section.
1332         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
1333         to structure with .opd data to elf_initialize_syminfo.
1335 2018-01-31  Ian Lance Taylor  <iant@golang.org>
1337         * elf.c (elf_add): Close descriptor if we use a debugfile.
1338         * btest.c (check_open_files): New static function.
1339         (main): Call check_open_files.
1341 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1343         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
1344         desired CRC is zero.
1345         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
1347 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1349         * pecoff.c (coff_add): Only release syms_view if it is valid.
1351 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1353         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
1355 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1357         * pecoff.c (coff_add): Use coff_read4, not memcpy.
1359 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1361         PR other/68239
1362         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
1363         on the free list.
1365 2018-01-19  Tony Reix  <tony.reix@atos.net>
1367         * xcoff.c (xcoff_incl_compare): New function.
1368         (xcoff_incl_search): New function.
1369         (xcoff_process_linenos): Use bsearch to find include file.
1370         (xcoff_initialize_fileline): Sort include file information.
1372 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1374         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1375         288.
1376         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1377         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1378         (elf_zlib_default_table): Update.
1379         (elf_zlib_default_dist_table): New static array.
1380         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1381         for block type 1.
1382         * ztest.c (struct zlib_test): Add uncompressed_len.
1383         (tests): Initialize uncompressed_len field.  Add new test case.
1384         (test_samples): Use uncompressed_len field.
1386 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1388         Update copyright years.
1390 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1392         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1393         * aclocal.m4: Regenerate.
1394         * Makefile.in: Likewise.
1395         * configure: Likewise.
1397 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1399         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1400         zlib uncompress function.
1402 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1404         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1405         Read a four byte integer.
1406         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1407         boundary before ever calling elf_zlib_fetch.
1408         * ztest.c (test_large): Simplify print statements a bit.
1410 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1412         * ztest.c: #include <errno.h>.
1413         (TEST_TIMING): Don't define, don't test.
1414         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1415         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1416         (ZLIB_CLOCK_GETTIME_ARG): Define.
1417         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1418         * Makefile.am: Likewise.
1419         * configure, Makefile.in: Rebuild.
1421 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1423         PR other/67165
1424         * Makefile.am: Append the content of clock_gettime_link to
1425         ztest_LDADD.
1426         * configure.ac: Test for the case that clock_gettime is in librt.
1427         * Makefile.in: Regenerate.
1428         * configure: Likewise.
1430         PR other/67165
1431         * configure.ac: Check for clock_gettime.
1432         * config.h.in: Regenerate.
1433         * configure: Likewise.
1434         * ztest.c (average_time, test_large): Conditionalize test timing
1435         on clock_gettime availability.
1437 2017-09-29  Tony Reix  <tony.reix@atos.net>
1439         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1440         (STYP_DWARF, SSUBTYP_DW*): Define.
1441         (enum dwarf_section): Define.
1442         (struct dwsect_info): Define.
1443         (xcoff_add): Look for DWARF sections, pass them to
1444         backtrace_dwarf_add.
1446 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1448         PR other/67165
1449         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1450         (unlikely): Define.
1451         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1452         (b_elf_chdr): Define type.
1453         (enum debug_section): Add ZDEBUG_xxx values.
1454         (debug_section_names): Add names for new sections.
1455         (struct debug_section_info): Add compressed field.
1456         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1457         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1458         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1459         (HUFFMAN_SECONDARY_SHIFT): Define.
1460         (ZDEBUG_TABLE_SIZE): Define.
1461         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1462         (final_next_secondary): New static variable if
1463         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1464         (elf_zlib_inflate_table): New static function.
1465         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1466         function to produce fixed Huffman table.
1467         (elf_zlib_default_table): New static variable.
1468         (elf_zlib_inflate): New static function.
1469         (elf_zlib_verify_checksum): Likewise.
1470         (elf_zlib_inflate_and_verify): Likewise.
1471         (elf_uncompress_zdebug): Likewise.
1472         (elf_uncompress_chdr): Likewise.
1473         (backtrace_uncompress_zdebug): New extern function.
1474         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1475         sections, and uncompress them.
1476         * internal.h (backtrace_compress_zdebug): Declare.
1477         * ztest.c: New file.
1478         * configure.ac: Check for -lz and check whether the linker
1479         supports --compress-debug-sections.
1480         * Makefile.am (ztest_SOURCES): New variable.
1481         (ztest_CFLAGS, ztest_LDADD): New variables.
1482         (check_PROGRAMS): Add ztest.
1483         (ctestg_SOURCES): New variable.
1484         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1485         (ctesta_SOURCES): New variable.
1486         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1487         (check_PROGRAMS): Add ctestg and ctesta.
1488         * configure, config.h.in, Makefile.in: Rebuild.
1490 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1492         PR sanitizer/77631
1493         * configure.ac: Check for lstat and readlink.
1494         * elf.c (lstat, readlink): Provide dummy versions if real versions
1495         are not available.
1496         * configure, config.h.in: Rebuild.
1498 2017-09-21  Ian Lance Taylor  <iant@google.com>
1500         PR go/82284
1501         * elf.c (backtrace_initialize): Set pd.exe_filename.
1503 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1504             Denis Khalikov  <d.khalikov@partner.samsung.com>
1506         PR sanitizer/77631
1507         Support for external debug info.
1508         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1509         (S_ISLNK): Define if not defined.
1510         (xstrnlen): Define if strnlen is not available.
1511         (b_elf_note): Define type.
1512         (NT_GNU_BUILD_ID): Define macro.
1513         (elf_crc32, elf_crc32_file): New static functions.
1514         (elf_is_symlink, elf_readlink): New static functions.
1515         (elf_open_debugfile_by_buildid): New static function.
1516         (elf_try_debugfile): New static function.
1517         (elf_find_debugfile_by_debuglink): New static function.
1518         (elf_open_debugfile_by_debuglink): New static function.
1519         (elf_add): Add filename and debuginfo parameters.  Adjust all
1520         callers.  Look for external debug info notes, and try to fetch
1521         debug info from external file.
1522         (struct phdr_data): Add exe_filename field.
1523         (phdr_callback): Pass filename to elf_add.
1524         (backtrace_initialize): Add filename parameter.
1525         * internal.h (backtrace_initialize): Add filename parameter.
1526         * fileline.c (fileline_initialize): Pass filename to
1527         backtrace_initialize.
1528         * pecoff.c (fileline_initialize): Add unused filename parameter.
1529         * unknown.c (fileline_initialize): Likewise.
1530         * xcoff.c (fileline_initialize): Likewise.
1531         * configure.ac: Check for objcopy --add-gnu-debuglink.
1532         * Makefile.am (dtest): New test target.
1533         * configure, Makefile.in: Rebuild.
1535 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1537         PR other/81096
1538         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1539         * Makefile.in: Regenerate.
1541 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1543         PR other/81096
1544         * libbacktrace/Makefile.in
1545         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1547 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1549         PR bootstrap/81638
1550         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1552 2017-07-28  Tony Reix  <tony.reix@atos.net>
1554         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1556 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1558         * fileline.c (fileline_initialize): Print pid_t as long.
1560 2017-07-26  Tony Reix  <tony.reix@atos.net>
1562         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1563         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1564         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1565         * configure, config.h.in: Regenerate.
1567 2017-07-21  Tony Reix  <tony.reix@atos.net>
1569         * filetype.awk: Add AIX XCOFF type detection.
1570         * configure.ac: Recognize xcoff format.
1571         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1572         * fileline.c: Include <unistd.h>.
1573         (fileline_initialize): Add case for AIX procfs.
1574         * xcoff.c: New file.
1575         * configure, Makefile.in: Rebuild.
1577 2017-06-21  Richard Biener  <rguenther@suse.de>
1579         * configure.ac: Add AC_SYS_LARGEFILE.
1580         * config.h.in: Regenerate.
1581         * configure: Likewise.
1583 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1585         * elf.c (backtrace_initialize): Always set *fileline_fn.
1586         * ttest.c: New file.
1587         * btest.c: Move support functions into testlib.c.  Change calls to
1588         check to pass file name.
1589         * testlib.c: New file, copied from (part of) btest.c.
1590         * testlib.h: New file, declarations for testlib.c.
1591         * edtest.c: Use testlib.h and testlib.c.
1592         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1593         * Makefile.am (btest_SOURCES): Add testlib.c.
1594         (edtest_SOURCES): Likewise.
1595         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1596         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1597         * configure, Makefile.in: Rebuild.
1599 2017-05-19  Than McIntosh  <thanm@google.com>
1601         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1602         (read_line_header): Don't allocate dirs if dirs_count == 0.
1603         * edtest.c: New file.
1604         * edtest2.c: New file.
1605         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1606         (check_PROGRAMS): Add edtest.
1607         (edtest2_build.c, gen_edtest2_build): New targets.
1608         * Makefile.in: Rebuild.
1610 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1612         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1613         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1615 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1617         Update copyright years.
1619 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1621         * configure: Regenerate.
1623 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1625         * all: Remove meaningless trailing whitespace.
1627 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1629         PR target/71161
1630         * elf.c (phdr_callback) [__i386__]: Add
1631         __attribute__((__force_align_arg_pointer__)).
1633 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1635         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1636         avoid possible crash.
1637         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1638         missing debug info anymore.
1640 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1642         * mmap.c (MAP_FAILED): Define if not defined.
1644 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1646         Update copyright years.
1648 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1650         * configure.ac: Specify that DJGPP do not have mmap
1651         even when sys/mman.h exists.
1652         * configure: Regenerate
1654 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1656         PR libgfortran/68115
1657         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1658         * configure: Regenerate.
1659         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1660         to void.
1662 2015-09-17  Ian Lance Taylor  <iant@google.com>
1664         * posix.c (backtrace_open): Cast second argument of open() to int.
1666 2015-09-11  Ian Lance Taylor  <iant@google.com>
1668         * Makefile.am (backtrace.lo): Depend on internal.h.
1669         (sort.lo, stest.lo): Add explicit dependencies.
1670         * Makefile.in: Rebuild.
1672 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1674         * backtrace.c: #include <sys/types.h>.
1676 2015-09-08  Ian Lance Taylor  <iant@google.com>
1678         PR other/67457
1679         * backtrace.c: #include "internal.h".
1680         (struct backtrace_data): Add can_alloc field.
1681         (unwind): If can_alloc is false, don't try to get file/line
1682         information.
1683         (backtrace_full): Set can_alloc field in bdata.
1684         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1685         NULL.
1686         * mmap.c (backtrace_alloc): Likewise.
1687         * internal.h: Update comments for backtrace_alloc and
1688         backtrace_free.
1690 2015-09-08  Ian Lance Taylor  <iant@google.com>
1692         PR other/67457
1693         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1695 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1697         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1698         * configure: Regenerate.
1700 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1702         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1703         Remove setting PIC_FLAG when building as target library.
1704         * configure: Regenerate.
1706 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1708         * configure.ac: Only compile with -fPIC if the target
1709         supports it.
1710         * configure: Regenerate.
1712 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1714         * configure.ac: Set have_mmap to no on spu-*-* targets.
1715         * configure: Regenerate.
1717 2015-08-13  Ian Lance Taylor  <iant@google.com>
1719         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1720         Change all callers.
1722 2015-06-11  Martin Sebor  <msebor@redhat.com>
1724         PR sanitizer/65479
1725         * dwarf.c (struct line): Add new field idx.
1726         (line_compare): Use it.
1727         (add_line): Set it.
1728         (read_line_info): Reset it.
1730 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1732         * pecoff.c: New file.
1733         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1734         * Makefile.in: Regenerate.
1735         * filetype.awk: Detect pecoff.
1736         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1737         Add pecoff.
1738         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1739         true.
1740         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1741         * configure: Regenerate.
1742         * pecoff.c: New file.
1744 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1746         * Makefile.in: Regenerated with automake-1.11.6.
1747         * aclocal.m4: Likewise.
1748         * configure: Likewise.
1750 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1752         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1753         * configure: Regenerate.
1755 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1757         Update copyright years.
1759 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1761         PR bootstrap/63784
1762         * configure: Regenerated.
1764 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1766         * ChangeLog.jit: New.
1768 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1770         PR target/63610
1771         * configure: Regenerate.
1773 2014-10-23  Ian Lance Taylor  <iant@google.com>
1775         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1776         Fix to return void *.
1778 2014-05-08  Ian Lance Taylor  <iant@google.com>
1780         * mmap.c (backtrace_free): If freeing a large aligned block of
1781         memory, call munmap rather than holding onto it.
1782         (backtrace_vector_grow): When growing a vector, double the number
1783         of pages requested.  When releasing the old version of a grown
1784         vector, pass the correct size to backtrace_free.
1786 2014-03-07  Ian Lance Taylor  <iant@google.com>
1788         * sort.c (backtrace_qsort): Use middle element as pivot.
1790 2014-03-06  Ian Lance Taylor  <iant@google.com>
1792         * sort.c: New file.
1793         * stest.c: New file.
1794         * internal.h (backtrace_qsort): Declare.
1795         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1796         (read_line_info, read_function_entry): Likewise.
1797         (read_function_info, build_dwarf_data): Likewise.
1798         * elf.c (elf_initialize_syminfo): Likewise.
1799         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1800         (stest_SOURCES, stest_LDADD): Define.
1801         (check_PROGRAMS): Add stest.
1803 2014-02-07  Misty De Meo  <misty@brew.sh>
1805         PR target/58710
1806         * configure.ac: Use AC_LINK_IFELSE in check for
1807         _Unwind_GetIPInfo.
1808         * configure: Regenerate.
1810 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1812         Update copyright years
1814 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1816         * elf.c (ET_DYN): Undefine and define again.
1817         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1818         return early -1 without closing the descriptor.
1819         (struct phdr_data): Add exe_descriptor.
1820         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1821         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1822         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1823         call to elf_add.
1824         (backtrace_initialize): Adjust call to elf_add.  If it returns
1825         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1827 2013-12-05  Ian Lance Taylor  <iant@google.com>
1829         * alloc.c (backtrace_vector_finish): Add error_callback and data
1830         parameters.  Call backtrace_vector_release.  Return address base.
1831         * mmap.c (backtrace_vector_finish): Add error_callback and data
1832         parameters.  Return address base.
1833         * dwarf.c (read_function_info): Get new address base from
1834         backtrace_vector_finish.
1835         * internal.h (backtrace_vector_finish): Update declaration.
1837 2013-11-27  Ian Lance Taylor  <iant@google.com>
1839         * dwarf.c (find_address_ranges): New static function, broken out
1840         of build_address_map.
1841         (build_address_map): Call it.
1842         * btest.c (check): Check for missing filename or function, rather
1843         than crashing.
1844         (f3): Check that enough frames were returned.
1846 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1848         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1849         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1850         last argument.
1851         * btest.c (struct symdata): Add size field.
1852         (callback_three): Add symsize argument.  Copy it to the data->size
1853         field.
1854         (f23): Set symdata.size to 0.
1855         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1856         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1857         values.
1859         * atomic.c: Include sys/types.h.
1861 2013-11-18  Ian Lance Taylor  <iant@google.com>
1863         * configure.ac: Check for support of __atomic extensions.
1864         * internal.h: Declare or #define atomic functions for use in
1865         backtrace code.
1866         * atomic.c: New file.
1867         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1868         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1869         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1870         (backtrace_initialize): Likewise.
1871         * fileline.c (fileline_initialize): Likewise.
1872         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1873         * configure, config.h.in, Makefile.in: Rebuild.
1875 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1877         * elf.c (SHN_UNDEF): Define.
1878         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1879         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1880         (elf_add): Adjust caller.
1882         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1884 2013-11-16  Ian Lance Taylor  <iant@google.com>
1886         * backtrace.h (backtrace_create_state): Correct comment about
1887         threading.
1889 2013-11-15  Ian Lance Taylor  <iant@google.com>
1891         * backtrace.h (backtrace_syminfo): Update comment and parameter
1892         name to take any address, not just a PC value.
1893         * elf.c (STT_OBJECT): Define.
1894         (elf_nosyms): Rename parameter pc to addr.
1895         (elf_symbol_search): Rename local variable pc to addr.
1896         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1897         (elf_syminfo): Rename parameter pc to addr.
1898         * btest.c (global): New global variable.
1899         (test5): New test.
1900         (main): Call test5.
1902 2013-10-17  Ian Lance Taylor  <iant@google.com>
1904         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1905         is missing.
1907 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1909         * configure.ac: Add --enable-host-shared, setting up
1910         pre-existing PIC_FLAG variable within Makefile.am et al.
1911         * configure: Regenerate.
1913 2013-09-20  Alan Modra  <amodra@gmail.com>
1915         * configure: Regenerate.
1917 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1919         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1921 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1923         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1924         dl_iterate_phdr callbacks.
1926 2013-03-25  Ian Lance Taylor  <iant@google.com>
1928         * alloc.c: #include <sys/types.h>.
1929         * mmap.c: Likewise.
1931 2013-01-31  Ian Lance Taylor  <iant@google.com>
1933         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1934         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1936 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1938         PR other/56076
1939         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1940         attribute was not seen.
1942 2013-01-16  Ian Lance Taylor  <iant@google.com>
1944         * dwarf.c (struct unit): Add filename and abs_filename fields.
1945         (build_address_map): Set new fields when reading unit.
1946         (dwarf_lookup_pc): If we don't find an entry in the line table,
1947         just return the main file name.
1949 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1951         Update copyright years.
1953 2013-01-01  Ian Lance Taylor  <iant@google.com>
1955         PR bootstrap/54834
1956         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1957         $(MULTIBUILDTOP)/../../gcc/include.
1958         * Makefile.in: Rebuild.
1960 2013-01-01  Ian Lance Taylor  <iant@google.com>
1962         PR other/55536
1963         * mmap.c (backtrace_alloc): Don't call sync functions if not
1964         threaded.
1965         (backtrace_free): Likewise.
1967 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1969         * mmapio.c: Define MAP_FAILED if not defined.
1971 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1973         PR bootstrap/54926
1974         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1975         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1976         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1977         accepts it.
1978         * Makefile.in: Regenerated.
1979         * configure: Regenerated.
1981 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1983         PR bootstrap/54926
1984         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1985         * Makefile.in: Regenerated.
1987 2012-11-20  Ian Lance Taylor  <iant@google.com>
1989         * dwarf.c (read_attribute): Always clear val.
1991 2012-11-13  Ian Lance Taylor  <iant@google.com>
1993         PR other/55312
1994         * configure.ac: Only add -Werror if building a target library.
1995         * configure: Rebuild.
1997 2012-11-12  Ian Lance Taylor  <iant@google.com>
1998             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1999             Gerald Pfeifer  <gerald@pfeifer.com>
2001         * configure.ac: Check for getexecname.
2002         * fileline.c: #include <errno.h>.  Define getexecname if not
2003         available.
2004         (fileline_initialize): Try to find the executable in a few
2005         different ways.
2006         * print.c (error_callback): Only print the filename if it came
2007         from the backtrace state.
2008         * configure, config.h.in: Rebuild.
2010 2012-10-29  Ian Lance Taylor  <iant@google.com>
2012         * mmap.c (backtrace_vector_release): Correct last patch: add
2013         aligned, not size.
2015 2012-10-29  Ian Lance Taylor  <iant@google.com>
2017         * mmap.c (backtrace_vector_release): Make sure freed block is
2018         aligned on 8-byte boundary.
2020 2012-10-26  Ian Lance Taylor  <iant@google.com>
2022         PR other/55087
2023         * posix.c (backtrace_open): Add does_not_exist parameter.
2024         * elf.c (phdr_callback): Do not warn if shared library could not
2025         be opened.
2026         * fileline.c (fileline_initialize): Update calls to
2027         backtrace_open.
2028         * internal.h (backtrace_open): Update declaration.
2030 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
2032         PR target/55061
2033         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
2034         * configure: Regenerate.
2036 2012-10-24  Ian Lance Taylor  <iant@google.com>
2038         PR target/55061
2039         * configure.ac: Check whether -funwind-tables option works.
2040         * configure: Rebuild.
2042 2012-10-11  Ian Lance Taylor  <iant@google.com>
2044         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
2045         * configure: Rebuild.
2047 2012-10-10  Ian Lance Taylor  <iant@google.com>
2049         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
2050         lower case.
2052 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
2054         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
2056 2012-10-09  Ian Lance Taylor  <iant@google.com>
2058         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
2059         (backtrace_dwarf_add): Likewise.
2061 2012-10-09  Ian Lance Taylor  <iant@google.com>
2063         Add support for tracing through shared libraries.
2064         * configure.ac: Check for link.h and dl_iterate_phdr.
2065         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
2066         ELF macros before #defining them.
2067         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
2068         dl_iterate_phdr.
2069         (struct elf_syminfo_data): Add next field.
2070         (elf_initialize_syminfo): Initialize next field.
2071         (elf_add_syminfo_data): New static function.
2072         (elf_add): New static function, broken out of
2073         backtrace_initialize.  Call backtrace_dwarf_add instead of
2074         backtrace_dwarf_initialize.
2075         (struct phdr_data): Define.
2076         (phdr_callback): New static function.
2077         (backtrace_initialize): Call elf_add.
2078         * dwarf.c (struct dwarf_data): Add next and base_address fields.
2079         (add_unit_addr): Add base_address parameter.  Change all callers.
2080         (add_unit_ranges, build_address_map): Likewise.
2081         (add_line): Add ddata parameter.  Change all callers.
2082         (read_line_program, add_function_range): Likewise.
2083         (dwarf_lookup_pc): New static function, broken out of
2084         dwarf_fileline.
2085         (dwarf_fileline): Call dwarf_lookup_pc.
2086         (build_dwarf_data): New static function.
2087         (backtrace_dwarf_add): New function.
2088         (backtrace_dwarf_initialize): Remove.
2089         * internal.h (backtrace_dwarf_initialize): Don't declare.
2090         (backtrace_dwarf_add): Declare.
2091         * configure, config.h.in: Rebuild.
2093 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
2095         * btest.c (f23): Avoid uninitialized variable warning.
2097 2012-10-04  Ian Lance Taylor  <iant@google.com>
2099         * dwarf.c: If the system header files do not declare strnlen,
2100         provide our own version.
2102 2012-10-03  Ian Lance Taylor  <iant@google.com>
2104         * dwarf.c (read_uleb128): Fix overflow test.
2105         (read_sleb128): Likewise.
2106         (build_address_map): Don't change unit_buf.start.
2108 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
2110         PR other/54761
2111         * configure.ac (EXTRA_FLAGS): New.
2112         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
2113         * configure, Makefile.in: Regenerate.
2115 2012-09-29  Ian Lance Taylor  <iant@google.com>
2117         PR other/54749
2118         * fileline.c (fileline_initialize): Pass errnum as -1 when
2119         reporting that we could not read executable information after a
2120         previous failure.
2122 2012-09-27  Ian Lance Taylor  <iant@google.com>
2124         PR bootstrap/54732
2125         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
2126         * Makefile.am: Add dependencies for all objects.
2127         * configure, aclocal.m4, Makefile.in: Rebuild.
2129 2012-09-27  Ian Lance Taylor  <iant@google.com>
2131         PR other/54726
2132         * elf.c (backtrace_initialize): Set *fileln_fn, not
2133         state->fileln_fn.
2135 2012-09-19  Ian Lance Taylor  <iant@google.com>
2137         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
2138         as a target library.
2139         * configure: Rebuild.
2141 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2142             Ian Lance Taylor  <iant@google.com>
2144         * configure.ac (GCC_HEADER_STDINT): Invoke.
2145         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
2146         * btest.c: Don't include <stdint.h>.
2147         * dwarf.c: Likewise.
2148         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
2150 2012-09-18  Ian Lance Taylor  <iant@google.com>
2152         PR bootstrap/54623
2153         * Makefile.am (AM_CPPFLAGS): Define.
2154         (AM_CFLAGS): Remove -I options.
2155         * Makefile.in: Rebuild.
2157 2012-09-18  Ian Lance Taylor  <iant@google.com>
2159         * posix.c (O_BINARY): Define if not defined.
2160         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
2161         HAVE_FCNTL is defined.
2162         * configure.ac: Test for the fcntl function.
2163         * configure, config.h.in: Rebuild.
2165 2012-09-18  Ian Lance Taylor  <iant@google.com>
2167         * btest.c (test1, test2, test3, test4): Add the unused attribute.
2169 2012-09-18  Ian Lance Taylor  <iant@google.com>
2171         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
2173 2012-09-18  Ian Lance Taylor  <iant@google.com>
2175         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
2176         * mmapio.c: Don't define _GNU_SOURCE.
2177         * configure, config.h.in: Rebuild.
2179 2012-09-18  Ian Lance Taylor  <iant@google.com>
2181         * configure.ac: Check whether strnlen is declared.
2182         * dwarf.c: Declare strnlen if not declared.
2183         * configure, config.h.in: Rebuild.
2185 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2187         * fileline.c: Include <stdlib.h>.
2188         * mmap.c: Likewise.
2190 2012-09-17  Ian Lance Taylor  <iant@google.com>
2192         PR bootstrap/54611
2193         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
2194         parameter.
2196 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
2198         PR bootstrap/54611
2199         * nounwind.c (backtrace_simple): Add state parameter.
2201 2012-09-17  Ian Lance Taylor  <iant@google.com>
2203         PR bootstrap/54609
2204         * unknown.c (unknown_fileline): Add state parameter, remove
2205         fileline_data parameter, name error_callback parameter.
2206         (backtrace_initialize): Add state parameter.
2208 2012-09-17  Ian Lance Taylor  <iant@google.com>
2210         * Initial implementation.
2212 Copyright (C) 2012-2024 Free Software Foundation, Inc.
2214 Copying and distribution of this file, with or without modification,
2215 are permitted in any medium without royalty provided the copyright
2216 notice and this notice are preserved.