Limit dg-xfail-run-if for *-*-hpux11.[012]* to -O0
[official-gcc.git] / libbacktrace / ChangeLog
blobf1e8e297c41d76ef9d87a33c92e44069f633b36a
1 2023-11-30  Ian Lance Taylor  <iant@golang.org>
3         * pecoff.c: Include <windows.h> if available.
4         (coff_add): On Windows call GetModuleHandle to get base address.
6 2023-11-29  Ian Lance Taylor  <iant@golang.org>
8         * fileline.c: Include <windows.h> if available.
9         (windows_get_executable_path): New static function.
10         (fileline_initialize): Call windows_get_executable_path.
11         * configure.ac: Checked for windows.h
12         * configure: Regenerate.
13         * config.h.in: Regenerate.
15 2023-10-22  Iain Sandoe  <iain@sandoe.co.uk>
17         * configure: Regenerate.
18         * configure.ac: Handle Darwin rpaths.
20 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
22         * configure: Regenerate.
24 2023-08-07  Alexander von Gluck IV  <kallisti5@unixzen.com>
26         * configure: Regenerate.
28 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
30         * configure: Regenerate.
32 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
34         * configure: Regenerate.
36 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
38         * configure: Regenerate.
40 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
42         * configure: Regenerate.
44 2023-08-03  Richard Biener  <rguenther@suse.de>
46         * zstdtest.c (test_samples): Properly compute the allocation
47         size for the uncompressed data.
49 2023-07-31  Ian Lance Taylor  <iant@golang.org>
51         * configure.ac: Check for _pgmptr declaration.
52         * fileline.c (fileline_initialize): Check for _pgmfptr before
53         /proc/self/exec.
54         * configure, config.h.in: Regenerate.
56 2023-03-28  Ian Lance Taylor  <iant@golang.org>
58         * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading
59         bits, not before.  Add unlikely for error case.
60         (elf_zstd_offset_table): Regenerate.
61         (elf_zstd_read_huff): Clear 13 entries in weight_mark, not 12.
62         (elf_zstd_read_literals): For a single stream adjust by
63         total_streams_size, not compressed_size.
65 2023-01-20  Ian Lance Taylor  <iant@golang.org>
67         * dwarf.c (struct function_addrs): Change low and high fields to
68         uintptr_t.
69         (struct unit_addrs): Likewise.
70         (resolve_addr_index): Change address parameter to uintptr_t*.
71         (add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
72         (add_function_range): Likewise.
73         (struct pcrange): Change lowpc and highpc fields to uintptr_t.
74         (add_low_high_range): Change add_range lowpc and highpc parameters
75         to uintptr_t.
76         (add_ranges_from_ranges): Likewise.
77         (add_ranges_from_rnglists): Likewise.
78         (add_low_high_range): Chnage lowpc and highpc variables to
79         uintpr_t.
80         (add_ranges_from_rnglists): Change some local variables to
81         uintptr_t.
82         (add_ranges_from_ranges): Change base parameter to uintptr_t.
83         (add_ranges_from_rnglists): Likewise.
84         (read_function_entry): Likewise.
85         (resolve_addr_index): Add explicit casts to uintptr_t.
86         (update_pcrange): Likewise.
87         (add_ranges_from_ranges): Likewise.
88         (add_ranges_from_rnglists): Likewise.
89         (read_function_entry): Likewise.
91 2023-01-17  Martin Liska  <mliska@suse.cz>
93         * Makefile.in: Regenerate.
95 2023-01-06  Ian Lance Taylor  <iant@golang.org>
97         PR libbacktrace/108297
98         * configure.ac: Test whether linker supports --build-id.
99         * Makefile.am: Only run --build-id tests if supported.
100         * configure, Makefile.in: Regenerate.
102 2022-12-17  Ian Lance Taylor  <iant@golang.org>
104         * elf.c (elf_fetch_backward_init): New static function.
105         (ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
106         literal size.
107         (ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
108         (elf_zstd_read_huff): Use elf_fetch_backward_init.
109         (elf_zstd_read_literals): New static function.
110         (ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
111         (struct elf_zstd_literals): Don't define.
112         (elf_zstd_literal_output): Remove static function.
113         (elf_zstd_decompress): Use elf_fetch_backward_init and
114         elf_zstd_read_literals.  Rewrite literal copying.<
116 2022-12-10  Ian Lance Taylor  <iant@golang.org>
118         * elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
119         (ZSTD_ENCODE_BASELINE_BITS): Define.
120         (ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
121         (elf_zstd_literal_length_base): New static const array.
122         (elf_zstd_match_length_base): Likewise.
123         (struct elf_zstd_fse_baseline_entry): Define.
124         (elf_zstd_make_literal_baseline_fse): New static function.
125         (elf_zstd_make_offset_baseline_fse): Likewise.
126         (elf_zstd_make_match_baseline_fse): Likewise.
127         (print_table, main): Use elf_zstd_fse_baseline_entry.
128         (elf_zstd_lit_table, elf_zstd_match_table): Likewise.
129         (elf_zstd_offset_table): Likewise.
130         (struct elf_zstd_seq_decode): Likewise.  Remove use_rle and rle
131         fields.
132         (elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
133         taking a conversion function.  Convert RLE to FSE.
134         (elf_zstd_literal_length_baseline): Remove.
135         (elf_zstd_literal_length_bits): Remove.
136         (elf_zstd_match_length_baseline): Remove.
137         (elf_zstd_match_length_bits): Remove.
138         (elf_zstd_decompress): Use elf_zstd_fse_baseline_entry.  Rewrite
139         and simplify main loop.
141 2022-12-08  Ian Lance Taylor  <iant@golang.org>
143         * configure.ac: Check for zstd library and
144         --compress-debug-sections=zstd linker option.
145         * Makefile.am (zstdtest_*): New targets.
146         (zstdtest_alloc_*, ctestzstd_*): New targets.
147         (BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
148         appropriate.
149         * elf.c (ELFCOMPRESS_ZSTD): Define.
150         (elf_fetch_bits): Rename from elf_zlib_fetch.  Update uses.
151         (elf_fetch_bits_backward): New static function.
152         (ZLIB_HUFFMAN_*): Rename from HUFFMAN_*.  Update uses.
153         (ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*.  Update uses.
154         (ZSTD_TABLE_*): Define.
155         (struct elf_zstd_fse_entry): Define.
156         (elf_zstd_read_fse): New static function.
157         (elf_zstd_build_fse): Likewise.
158         (lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
159         (match, offset, next, print_table, main): Likewise.
160         (elf_zstd_lit_table): New static const array.
161         (elf_zstd_match_table, elf_zstd_offset_table): Likewise.
162         (elf_zstd_read_huff): New static function.
163         (struct elf_zstd_seq_decode): Define.
164         (elf_zstd_unpack_seq_decode): New static function.
165         (ZSTD_LIT_*): Define.
166         (struct elf_zstd_literals): Define.
167         (elf_zstd_literal_output): New static function.
168         (ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
169         (elf_zstd_literal_length_baseline): New static const array.
170         (elf_zstd_literal_length_bits): Likewise.
171         (ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
172         (elf_zstd_match_length_baseline): New static const array.
173         (elf_zstd_match_length_bits): Likewise.
174         (elf_zstd_decompress): New static function.
175         (ZDEBUG_TABLE_SIZE): New definition.
176         (elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
177         (backtrace_uncompress_zstd): New function.
178         (elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
179         * internal.h (backtrace_uncompress_zstd): Declare.
180         * zstdtest.c: New file.
181         * configure, config.h.in, Makefile.in: Regenerate.
183 2022-10-12  Martin Liska  <mliska@suse.cz>
185         * configure: Regenerate.
187 2022-10-11  Olivier Hainque  <hainque@adacore.com>
188             Olivier Hainque  <hainque@adacore.com>
190         * configure: Regenerate.
192 2022-07-08  Ian Lance Taylor  <iant@golang.org>
194         * configure.ac: Check for sys/link.h.  Use either link.h or
195         sys/link.h when checking for dl_iterate_phdr.
196         * elf.c: Include sys/link.h if available.
197         * configure, config.h.in: Regenerate.
199 2022-07-07  Ian Lance Taylor  <iant@golang.org>
201         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
202         loop if we can't find debug info for one shared library.
204 2022-07-07  Ian Lance Taylor  <iant@golang.org>
206         * Makefile.am (MAKETESTS): New variable split out of TESTS.
207         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
208         * Makefile.in: Regenerate.
210 2022-06-27  Ian Lance Taylor  <iant@golang.org>
212         * configure.ac: Use grep instead of fgrep.
213         * configure, Makefile.in: Regenerate.
215 2022-05-28  Ian Lance Taylor  <iant@golang.org>
217         PR libbacktrace/105721
218         * README: Update.
220 2022-04-05  Ian Lance Taylor  <iant@golang.org>
222         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
223         uncompressed block.
225 2022-02-17  Ian Lance Taylor  <iant@golang.org>
227         * dwarf.c (find_address_ranges): Handle skeleton units.
228         (read_function_entry): Likewise.
230 2022-02-16  Ian Lance Taylor  <iant@golang.org>
232         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
234 2022-02-03  David Seifert  <soap@gentoo.org>
235             Jakub Jelinek  <jakub@redhat.com>
237         * configure.ac: Support --disable-werror.
238         * configure: Regenerate.
240 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
242         PR libbacktrace/103822
243         * Makefile.am: Fix newline.
244         * Makefile.in: Regenerate.
246 2021-11-12  Martin Liska  <mliska@suse.cz>
248         PR libbacktrace/103167
249         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
250         (elf_uncompress_lzma): Likewise.
251         * xztest.c (test_samples): memcpy only if v > 0.
253 2021-10-22  Martin Liska  <mliska@suse.cz>
255         PR testsuite/102742
256         * btest.c (MIN_DESCRIPTOR): New.
257         (MAX_DESCRIPTOR): Likewise.
258         (check_available_files): Likewise.
259         (check_open_files): Check only file descriptors that
260         were not available at the entry.
261         (main): Call check_available_files.
263 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
265         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
266         output with LANG=C.
268 2021-06-28  Clément Chigot  <clement.chigot@atos.net>
270         * xcoff.c (SSUBTYP_DWRNGES): New define.
271         (xcoff_add): Use correct XCOFF DWARF section subtype
272         for DEBUG_RANGES. Remove lineoff workaround.
273         Adjust base_address.
274         (xcoff_initialize_syminfo): Adapt to new base_address.
275         (xcoff_lookup_pc): Likewise.
276         (xcoff_initialize_fileline): Likewise.
278 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
280         PR bootstrap/99703
281         * configure: Regenerated.
283 2021-03-03  Ian Lance Taylor  <iant@golang.org>
285         * dwarf.c (read_line_program): Don't special case file 0.
286         (read_function_entry): Likewise.
288 2021-03-02  Ian Lance Taylor  <iant@golang.org>
290         PR libbacktrace/98818
291         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
292         callers.
293         * backtrace.h: Update backtrace_error_callback comment.
295 2021-02-12  Ian Lance Taylor  <iant@golang.org>
297         * configure.ac: Check for objcopy --add-gnu-debuglink by using
298         objcopy --help.
299         * configure: Regenerate
301 2021-01-18  Ian Lance Taylor  <iant@golang.org>
303         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
304         * Makefile.in: Regenerate.
305         * configure: Regenerate.
307 2021-01-18  Ian Lance Taylor  <iant@golang.org>
309         PR debug/98716
310         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
311         filenames.
312         (read_line_program): Remove parameter u, change caller.  Don't
313         subtract one from dirs and filenames index.
314         (read_function_entry): Don't subtract one from filenames index.
316 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
318         * configure: Re-generate.
320 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
322         PR target/97865
323         * configure: Regenerate.
325 2020-12-02  Ian Lance Taylor  <iant@golang.org>
327         * dwarf.c (resolve_string): Use > rather than >= to check whether
328         string index extends past buffer.
329         (resolve_addr_index): Similarly for address index.
331 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
333         * configure: Regenerate.
335 2020-10-20  Ian Lance Taylor  <iant@golang.org>
337         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
338         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
340 2020-09-28  Ian Lance Taylor  <iant@golang.org>
342         PR libbacktrace/97082
343         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
344         * Makefile.in: Regenerate.
346 2020-09-28  Ian Lance Taylor  <iant@golang.org>
348         PR libbacktrace/97227
349         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
350         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
351         * configure: Regenerate.
352         * Makefile.in: Regenerate.
354 2020-09-23  Ian Lance Taylor  <iant@golang.org>
356         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
357         p->low.
358         (dwarf_lookup_pc): Likewise.
360 2020-09-17  Ian Lance Taylor  <iant@golang.org>
362         PR libbacktrace/97080
363         * fileline.c (backtrace_syminfo_to_full_callback): New function.
364         (backtrace_syminfo_to_full_error_callback): New function.
365         * elf.c (elf_nodebug): Call syminfo_fn if possible.
366         * internal.h (struct backtrace_call_full): Define.
367         (backtrace_syminfo_to_full_callback): Declare.
368         (backtrace_syminfo_to_full_error_callback): Declare.
369         * mtest.c (f3): Only check all[i] if data.index permits.
371 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
373         * macho.c (MACH_O_CPU_TYPE_PPC): New.
374         (MACH_O_CPU_TYPE_PPC64): New.
375         Add compile-tests for powerpc to the Mach-O variants.
377 2020-09-14  Ian Lance Taylor  <iant@golang.org>
379         PR libbacktrace/93608
380         Add support for MiniDebugInfo.
381         * elf.c (struct elf_view): Define.  Replace most uses of
382         backtrace_view with elf_view.
383         (elf_get_view): New static functions.  Replace most calls of
384         backtrace_get_view with elf_get_view.
385         (elf_release_view): New static functions.  Replace most calls of
386         backtrace_release_view with elf_release_view.
387         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
388         callers.
389         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
390         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
391         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
392         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
393         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
394         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
395         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
396         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
397         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
398         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
399         (LZMA_PROB_DIST_ALIGN_LEN): Define.
400         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
401         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
402         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
403         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
404         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
405         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
406         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
407         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
408         (LZMA_PROB_REP_LEN_MID_LEN): Define.
409         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
410         (LZMA_PROB_LITERAL_LEN): Define.
411         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
412         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
413         (LZMA_PROB_IS_REP2_OFFSET): Define.
414         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
415         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
416         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
417         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
418         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
419         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
420         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
421         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
422         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
423         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
424         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
425         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
426         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
427         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
428         (LZMA_PROB_LITERAL_OFFSET): Define.
429         (LZMA_PROB_TOTAL_COUNT): Define.
430         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
431         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
432         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
433         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
434         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
435         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
436         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
437         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
438         (elf_lzma_varint): New static function.
439         (elf_lzma_range_normalize): New static function.
440         (elf_lzma_bit, elf_lzma_integer): New static functions.
441         (elf_lzma_reverse_integer): New static function.
442         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
443         (elf_uncompress_lzma): New static function.
444         (backtrace_uncompress_lzma): New function.
445         (elf_add): Add memory and memory_size parameters.  Change all
446         callers.  Look for .gnu_debugdata section, and, if found,
447         decompress it and use it for symbols and debug info.  Permit the
448         descriptor parameter to be -1.
449         * internal.h (backtrace_uncompress_lzma): Declare.
450         * mtest.c: New file.
451         * xztest.c: New file.
452         * configure.ac: Check for nm, xz, and comm programs.  Check for
453         liblzma library.
454         (HAVE_MINIDEBUG): Define.
455         * Makefile.am (mtest_SOURCES): Define.
456         (mtest_CFLAGS, mtest_LDADD): Define.
457         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
458         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
459         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
460         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
461         (xztest_alloc_LDADD): Define.
462         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
463         (CLEANFILES): Add files created by minidebug pattern.
464         (btest.lo): Correct INCDIR reference.
465         (mtest.lo, xztest.lo, ztest.lo): New targets.
466         * configure: Regenerate.
467         * config.h.in: Regenerate.
468         * Makefile.in: Regenerate.
470 2020-09-09  Ian Lance Taylor  <iant@golang.org>
472         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
473         (coff_add): Determine and pass is_64.
475 2020-09-09  Ian Lance Taylor  <iant@golang.org>
477         PR libbacktrace/96973
478         * fileline.c (macho_get_executable_path): New static function.
479         (fileline_initialize): Call macho_get_executable_path.
481 2020-09-09  Ian Lance Taylor  <iant@golang.org>
483         * dwarf.c (function_addrs_search): Compare against the next entry
484         low address, not the high address.
485         (unit_addrs_search): Likewise.
486         (build_address_map): Add a trailing unit_addrs.
487         (read_function_entry): Add a trailing function_addrs.
488         (read_function_info): Likewise.
489         (report_inlined_functions): Search backward for function_addrs
490         match.
491         (dwarf_lookup_pc): Search backward for unit_addrs and
492         function_addrs matches.
494 2020-09-08  Ian Lance Taylor  <iant@golang.org>
496         * simple.c (simple_unwind): Correct comment spelling.
498 2020-09-08  Ian Lance Taylor  <iant@golang.org>
500         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
501         correct length when freeing diralc.
503 2020-09-08  Ian Lance Taylor  <iant@golang.org>
505         PR libbacktrace/96973
506         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
508 2020-09-08  Ian Lance Taylor  <iant@golang.org>
510         PR libbacktrace/96971
511         * filetype.awk: Only match magic number at start of line.
513 2020-08-24  Ian Lance Taylor  <iant@golang.org>
515         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
516         (MACH_O_MH_CIGAM_FAT_64): Define.
517         (struct macho_fat_arch_64): Define.
518         (macho_add_fat): Add and use is_64 parameter.
519         (macho_add): Recognize 64-bit fat files.
521 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
523         PR bootstrap/96202
524         * configure: Regenerated.
526 2020-07-08  Ian Lance Taylor  <iant@golang.org>
528         * configure.ac: Test linker support for DWARF5
529         * configure: Regenerate
531 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
533         PR bootstrap/95413
534         * configure: Regenerated.
536 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
538         PR bootstrap/95147
539         * configure: Regenerated.
541 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
543         * configure: Regenerated.
545 2020-05-13  Ian Lance Taylor  <iant@golang.org>
547         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
549 2020-05-13  Ian Lance Taylor  <iant@golang.org>
551         PR go/95061
552         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
554 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
556         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
557         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
558         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
559         enabled.
560         * Makefile.in: Regenerated.
561         * configure: Likewise.
563 2020-05-11  Ian Lance Taylor  <iant@golang.org>
565         PR libbacktrace/95012
566         * configure.ac: Check for getpagesize declaration.
567         * mmap.c: Declare getpagesize if necessary.
568         * mmapio.c: Likewise.
569         * configure: Regenerate.
570         * config.h.in: Regenerate.
571         * Makefile.in: Regenerate.
573 2020-05-09  Roland McGrath  <mcgrathr@google.com>
575         * elf.c (elf_add): Bail early if there are no section headers at all.
577 2020-05-09  Ian Lance Taylor  <iant@golang.org>
579         * elf.c (elf_add): Don't free strtab if an error occurs after
580         recording symbol information.
582 2020-05-09  Ian Lance Taylor  <iant@golang.org>
584         PR libbacktrace/88745
585         * macho.c: New file.
586         * filetype.awk: Recognize Mach-O files.
587         * Makefile.am (FORMAT_FILES): Add macho.c.
588         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
589         (%.dSYM): New pattern target.
590         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
591         (test_macho_LDADD): New target.
592         (BUILDTESTS): Add test_macho.
593         (macho.lo): Add dependencies.
594         * configure.ac: Recognize macho file type.  Check for
595         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
596         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
597         * Makefile.in: Regenerate.
598         * configure: Regenerate.
599         * config.h.in: Regenerate.
601 2020-05-09  Ian Lance Taylor  <iant@golang.org>
603         * read.c (backtrace_get_view): Support short read.
605 2020-05-09  Ian Lance Taylor  <iant@golang.org>
607         * elf.c (elf_add): If debug sections are very large or far apart,
608         read them individually rather than as a single view.
610 2020-05-08  Ian Lance Taylor  <iant@golang.org>
612         * fileline.c (sysctl_exec_name): New static function.
613         (sysctl_exec_name1): New macro or static function.
614         (sysctl_exec_name2): Likewise.
615         (fileline_initialize): Try sysctl_exec_name[12].
616         * configure.ac: Check for sysctl args to fetch executable name.
617         * configure: Regenerate.
618         * config.h.in: Regenerate.
620 2020-02-15  Ian Lance Taylor  <iant@golang.org>
622         * ztest.c (test_large): Update file to current libgo test file.
624 2020-02-03  Ian Lance Taylor  <iant@golang.org>
626         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
627         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
628         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
629         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
630         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
631         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
632         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
633         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
634         (stest_alloc_CFLAGS): Likewise.
635         * Makefile.in: Regenerate.
636         * ztest.c (error_callback_compress): Mark vdata unused.
637         (test_large): Add casts to avoid warnings.
639 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
641         Update copyright years.
643 2019-12-13  Ian Lance Taylor  <iant@golang.org>
645         Add DWARF 5 support.
646         * dwarf.c (struct attr): Add val field.
647         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
648         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
649         (struct line_header): Add addrsize field.
650         (struct line_header_format): Define.
651         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
652         fields.
653         (read_uint24): New static function.
654         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
655         and dwarf_str_size parameters with dwarf_sections parameter.  Add
656         support for new DWARF 5 forms.  Change all callers.
657         (resolve_string): New static function.
658         (resolve_addr_index): Likewise.
659         (read_abbrevs): Support DW_FORM_implicit_const.
660         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
661         and ranges_is_index fields.
662         (update_pcrange): Support DWARF 5 encodings.
663         (add_high_low_range): New static function, split out of
664         add_ranges.
665         (add_ranges_from_ranges): Likewise.
666         (add_ranges_from_rnglists): New static function.
667         (add_ranges): Just call new helper functions.
668         (find_address_ranges): Use resolve_string for strings, after
669         reading all attributes.  Handle new DWARF 5 attributes.
670         (build_address_map): Support DWARF 5 compilation units.
671         (read_v2_paths): New static function, split out of
672         read_line_header.
673         (read_lnct): New static function.
674         (read_line_header_format_entries): Likewise.
675         (read_line_header): Add ddata parameter.  Support DWARF 5 line
676         headers.  Call new helper functions.  Change all callers.
677         (read_line_program): Use addrsize from line program header.  Don't
678         special case directory index 0 for DWARF 5.
679         (read_referenced_name): Use resolve_string.
680         (read_function_entry): Handle DWARF 5 encodings.  Use
681         resolve_string.
682         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
683         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
684         * elf.c (dwarf_section_names): Add new section names.
685         * pecoff.c (dwarf_section_names): Likewise.
686         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
687         fields.
688         * configure.ac: Define HAVE_DWARF5 automake conditional.
689         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
690         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
691         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
692         (dwarf5_alloc_LDADD): Likewise.
693         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
694         (CLEANFILES, clean-local): Define.
696 2019-12-08  Ian Lance Taylor  <iant@golang.org>
698         * dwarf.c (struct pcrange): Define.
699         (update_pcrange, add_ranges): New static functions.
700         (add_unit_addr): Change signature to work with add_ranges.  Don't
701         add base_address here.
702         (add_unit_ranges): Remove.
703         (find_address_ranges): Replace str/ranges parameters with
704         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
705         callers.
706         (add_function_range): Change signature to work with add_ranges.
707         Don't add base_address here.
708         (add_function_ranges): Remove.
709         (read_function_entry): Use update_pcrange and add_ranges.
711 2019-12-04  Ian Lance Taylor  <iant@golang.org>
713         * edtest.c (test1): Add noclone attribute.
715 2019-12-04  Ian Lance Taylor  <iant@golang.org>
717         * internal.h (enum dwarf_section): Define.
718         (struct dwarf_sections): Define.
719         (backtrace_dwarf_add): Update declaration to replace specific
720         section parameters with dwarf_sections parameter.
721         * dwarf.c (struct dwarf_data): Replace specific section fields
722         with dwarf_sections field.
723         (read_attribute): Use dwarf_sections with altlink.
724         (build_address_map): Replace specific section parameters with
725         dwarf_sections parameter.  Change all callers.
726         (read_line_info): Use dwarf_sections with ddata.
727         (read_referenced_name): Likewise.
728         (add_function_ranges): Likewise.
729         (read_function_entry): Likewise.
730         (read_function_info): Likewise.
731         (build_dwarf_data): Replace specific section parameters with
732         dwarf_sections parameter.  Change all callers.
733         (backtrace_dwarf_add): Likewise.
734         * elf.c (enum debug_section): Remove.
735         (dwarf_section_names): Remove .zdebug names.
736         (elf_add): Track zsections separately.  Build dwarf_sections.
737         * pecoff.c (enum debug_section): Remove.
738         (struct debug_section_info): Remove data field.
739         (coff_add): Build dwarf_sections.
740         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
741         references with DEBUG_xxx references.
742         (xcoff_add): Build dwarf_sections.
744 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
746         * configure: Regenerate.
748 2019-09-26  Ian Lance Taylor  <iant@golang.org>
750         PR libbacktrace/91908
751         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
752         __sync_bool_compare_and_swap to void.
753         * xcoff.c (backtrace_initialize): Likewise.
755 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
757         * configure.ac: Remove references to spu.
758         * configure: Regenerate.
760 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
762         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
763         test_elf_64.
764         * Makefile.in: Regenerate.
766 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
768         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
769         handling.
770         * configure: Regenerate.
772 2019-03-11  Ian Lance Taylor  <iant@golang.org>
774         PR libbacktrace/89669
775         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
776         HAVE_ELF.
777         * Makefile.in: Regenerate.
779 2019-02-26  Tom de Vries  <tdevries@suse.de>
781         * btest.c (test5): Allow global.* as minimal symbol name for global.
783 2019-02-26  Tom de Vries  <tdevries@suse.de>
785         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
786         * Makefile.in: Regenerate.
788 2019-02-12  Tom de Vries  <tdevries@suse.de>
790         PR libbacktrace/81983
791         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
793 2019-02-10  Tom de Vries  <tdevries@suse.de>
795         * Makefile.am (BUILDTESTS): Add btest_lto.
796         * Makefile.in: Regenerate.
797         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
798         __attribute__((noclone)).
800 2019-02-08  Tom de Vries  <tdevries@suse.de>
802         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
803         * print.c (backtrace_print): Same.
804         * simple.c (backtrace_simple): Same.
806 2019-02-08  Tom de Vries  <tdevries@suse.de>
808         PR libbacktrace/78063
809         * dwarf.c (build_address_map): Keep all parsed units.
810         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
812 2019-01-31  Tom de Vries  <tdevries@suse.de>
814         PR libbacktrace/89136
815         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
816         'debugaltlink_name_len =+ 1'.
818 2019-01-29  Tom de Vries  <tdevries@suse.de>
820         * install-debuginfo-for-buildid.sh.in: New script.
821         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
822         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
823         * Makefile.in: Regenerate.
824         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
825         (READELF): Set with AC_CHECK_PROG.
826         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
827         * configure: Regenerate.
828         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
829         (elf_open_debugfile_by_buildid): ... here.
831 2019-01-29  Tom de Vries  <tdevries@suse.de>
833         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
834         allocfail.
835         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
836         (check_PROGRAMS): Add BUILDTESTS.
837         * Makefile.in: Regenerate.
839 2019-01-28  Tom de Vries  <tdevries@suse.de>
841         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
842         Use $< to access prerequisite.
843         * Makefile.in: Regenerate.
845 2019-01-25  Nathan Sidwell  <nathan@acm.org>
847         * elf.c (elf_add): Pass "" filename to recursive call with
848         separated debug.
850 2019-01-25  Tom de Vries  <tdevries@suse.de>
852         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
853         filename == "".
854         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
855         * Makefile.in: Regenerate.
857 2019-01-25  Tom de Vries  <tdevries@suse.de>
859         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
860         (TESTS): Rename dtest to btest_gnudebuglink.
861         * Makefile.in: Regenerate.
863 2019-01-23  Tom de Vries  <tdevries@suse.de>
865         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
866         (units_search, find_unit): Use size_t for offset.
867         (build_address_map): Use size_t for unit_offset.
869 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
871         * allocfail.c (main): Increase portability of printf statement.
873 2019-01-18  Ian Lance Taylor  <iant@golang.org>
875         PR libbacktrace/88890
876         * mmapio.c (backtrace_get_view): Change size parameter to
877         uint64_t.  Check that value fits in size_t.
878         * read.c (backtrace_get_view): Likewise.
879         * internal.h (backtrace_get_view): Update declaration.
880         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
882 2019-01-17  Tom de Vries  <tdevries@suse.de>
884         PR libbacktrace/82857
885         * configure.ac (DWZ): Set with AC_CHECK_PROG.
886         (HAVE_DWZ): Set with AM_CONDITIONAL.
887         * configure: Regenerate.
888         * Makefile.am (TESTS): Add btest_dwz.
889         * Makefile.in: Regenerate.
891 2019-01-17  Tom de Vries  <tdevries@suse.de>
893         PR libbacktrace/82857
894         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
895         (read_attribute): Handle DW_FORM_GNU_ref_alt using
896         ATTR_VAL_REF_ALT_INFO.
897         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
899 2019-01-17  Tom de Vries  <tdevries@suse.de>
901         * dwarf.c (struct unit): Add low_offset and high_offset fields.
902         (struct unit_vector): New type.
903         (struct dwarf_data): Add units and units_counts fields.
904         (find_unit): New function.
905         (find_address_ranges): Add and handle unit_tag parameter.
906         (build_address_map): Add and handle units_vec parameter.
907         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
908         units vector.
910 2019-01-17  Tom de Vries  <tdevries@suse.de>
912         PR libbacktrace/82857
913         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
914         using altlink.
916 2019-01-17  Tom de Vries  <tdevries@suse.de>
918         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
919         (read_attribute): Add altlink parameter.  Handle missing altlink for
920         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
921         (find_address_ranges, build_address_map, build_dwarf_data): Add and
922         handle altlink parameter.
923         (read_referenced_name, read_function_entry): Add argument to
924         read_attribute call.
926 2019-01-17  Tom de Vries  <tdevries@suse.de>
928         * dwarf.c (struct dwarf_data): Add altlink field.
929         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
930         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
931         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
932         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
933         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
934         * xcoff.c (xcoff_add): Same.
936 2019-01-17  Tom de Vries  <tdevries@suse.de>
938         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
939         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
940         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
941         argument to backtrace_dwarf_add call.
942         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
943         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
944         * xcoff.c (xcoff_add): Same.
946 2019-01-17  Tom de Vries  <tdevries@suse.de>
948         * elf.c (elf_add): Add and handle with_buildid_data and
949         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
950         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
952 2019-01-16  Tom de Vries  <tdevries@suse.de>
954         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
955         of ...
956         (read_referenced_name): ... here, and ...
957         (read_function_entry): ... here.
959 2019-01-16  Tom de Vries  <tdevries@suse.de>
961         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
962         name.
963         (read_function_entry): Same.  Don't allow name found via
964         DW_AT_abstract_origin or case DW_AT_specification to override linkage
965         name.
967 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
969         PR other/16615
971         * backtrace.h: Mechanically replace "can not" with "cannot".
973 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
975         Update copyright years.
977 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
979         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
980         in sed pattern.
981         * Makefile.in: Regenerate.
983 2018-12-28  Tom de Vries  <tdevries@suse.de>
985         * dwarf.c (build_address_map): Reuse unused units.
987 2018-12-28  Tom de Vries  <tdevries@suse.de>
989         * dwarf.c (build_address_map): Simplify by removing local variable
990         abbrevs.
992 2018-12-28  Ian Lance Taylor  <iant@golang.org>
993             Tom de Vries  <tdevries@suse.de>
995         PR libbacktrace/88063
996         * dwarf.c (free_unit_addrs_vector): Remove.
997         (build_address_map): Keep track of allocated units in vector.  Free
998         allocated units and corresponding abbrevs upon failure.  Remove now
999         redundant call to free_unit_addrs_vector.  Free addrs vector upon
1000         failure.  Free allocated unit vector.
1002 2018-12-28  Tom de Vries  <tdevries@suse.de>
1004         * dwarf.c (build_address_map): Free addrs vector upon failure.
1006 2018-12-14  Tom de Vries  <tdevries@suse.de>
1008         PR testsuite/88491
1009         * allocfail.sh: Remove "set -o pipefail".
1011 2018-12-12  Tom de Vries  <tdevries@suse.de>
1013         * Makefile.am (TESTS): Add allocfail.sh.
1014         (check_PROGRAMS): Add allocfail.
1015         * Makefile.in: Regenerate.
1016         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
1017         Include alloc.c.
1018         * allocfail.c: New file.
1019         * allocfail.sh: New file.
1021 2018-11-30  Tom de Vries  <tdevries@suse.de>
1023         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
1024         test_xcoff_64, test_pecoff and test_unknown.
1025         * Makefile.in: Regenerate.
1026         * test_format.c: New file.
1028 2018-11-30  Tom de Vries  <tdevries@suse.de>
1030         * Makefile.am : Add _with_alloc version for each test in
1031         check_PROGRAMS.
1032         * Makefile.in: Regenerate.
1034 2018-11-30  Tom de Vries  <tdevries@suse.de>
1036         * internal.h (backtrace_vector_free): New static inline fuction,
1037         factored out of ...
1038         * dwarf.c (read_line_info): ... here.
1040 2018-11-28  Tom de Vries  <tdevries@suse.de>
1042         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
1043         failure.
1045 2018-11-27  Tom de Vries  <tdevries@suse.de>
1047         * mmap.c (backtrace_vector_release): Same.
1048         * unittest.c (test1): Add check.
1050 2018-11-27  Tom de Vries  <tdevries@suse.de>
1052         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
1053         instead of realloc.
1054         * Makefile.am (check_PROGRAMS): Add unittest.
1055         * Makefile.in: Regenerate.
1056         * unittest.c: New file.
1058 2018-11-22  Tom de Vries  <tdevries@suse.de>
1060         * dwarf.c (read_initial_length): Factor out of ...
1061         (build_address_map, read_line_info): ... here.
1063 2018-11-21  Tom de Vries  <tdevries@suse.de>
1065         * dwarf.c (read_string): Factor out of ...
1066         (read_attribute, read_line_header, read_line_program): ... here.
1068 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
1070         PR bootstrap/82856
1071         * Makefile.am: Include multilib.am.
1072         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
1073         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
1075 2018-10-05  Ian Lance Taylor  <iant@golang.org>
1077         PR libbacktrace/87529
1078         * backtrace.h: Document that backtrace_create_state should be
1079         called only once.
1081 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
1083         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
1084         * Makefile.in: Regenerate.
1085         * config.h.in: Likewise.
1086         * configure: Likewise.
1088 2018-08-01  Tony Reix  <tony.reix@atos.net>
1090         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
1091         (struct xcoff_func, struct xcoff_func_vector): New structs.
1092         (xcoff_syminfo): Drop leading dot from symbol name.
1093         (xcoff_line_compare, xcoff_line_search): Remove.
1094         (xcoff_func_compare, xcoff_func_search): New static functions.
1095         (xcoff_lookup_pc): Search function table.
1096         (xcoff_add_line, xcoff_process_linenos): Remove.
1097         (xcoff_initialize_fileline): Build function table.
1099 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
1101         PR other/86198
1102         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
1103         checking up to 36 bytes.
1105 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1107         * configure: Regenerated.
1109 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
1111         * configure: Regenerated.
1113 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1115         * backtrace.c: Revert last two changes.  Don't call mmap
1116         directly.
1118 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1120         * backtrace.c: Include backtrace-supported.h before checking
1121         BACKTRACE_USES_MALLOC.
1123 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1125         * backtrace.c (backtrace_full): When testing whether we can
1126         allocate memory, call mmap directly, and munmap the memory.
1128 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
1130         PR other/85161
1131         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
1132         big endian, only use 32-bit loads if endianity macros are predefined
1133         and indicate big or little endian.
1135 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1137         PR target/84148
1138         * configure: Regenerate.
1140 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
1142         PR other/82368
1143         * elf.c (SHT_PROGBITS): Undefine and define.
1145 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
1147         PR other/82368
1148         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
1149         (struct elf_ppc64_opd_data): New type.
1150         (elf_initialize_syminfo): Add opd argument, handle symbols
1151         pointing into the PowerPC64 ELFv1 .opd section.
1152         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
1153         to structure with .opd data to elf_initialize_syminfo.
1155 2018-01-31  Ian Lance Taylor  <iant@golang.org>
1157         * elf.c (elf_add): Close descriptor if we use a debugfile.
1158         * btest.c (check_open_files): New static function.
1159         (main): Call check_open_files.
1161 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1163         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
1164         desired CRC is zero.
1165         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
1167 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1169         * pecoff.c (coff_add): Only release syms_view if it is valid.
1171 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1173         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
1175 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1177         * pecoff.c (coff_add): Use coff_read4, not memcpy.
1179 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1181         PR other/68239
1182         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
1183         on the free list.
1185 2018-01-19  Tony Reix  <tony.reix@atos.net>
1187         * xcoff.c (xcoff_incl_compare): New function.
1188         (xcoff_incl_search): New function.
1189         (xcoff_process_linenos): Use bsearch to find include file.
1190         (xcoff_initialize_fileline): Sort include file information.
1192 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1194         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1195         288.
1196         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1197         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1198         (elf_zlib_default_table): Update.
1199         (elf_zlib_default_dist_table): New static array.
1200         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1201         for block type 1.
1202         * ztest.c (struct zlib_test): Add uncompressed_len.
1203         (tests): Initialize uncompressed_len field.  Add new test case.
1204         (test_samples): Use uncompressed_len field.
1206 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1208         Update copyright years.
1210 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1212         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1213         * aclocal.m4: Regenerate.
1214         * Makefile.in: Likewise.
1215         * configure: Likewise.
1217 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1219         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1220         zlib uncompress function.
1222 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1224         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1225         Read a four byte integer.
1226         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1227         boundary before ever calling elf_zlib_fetch.
1228         * ztest.c (test_large): Simplify print statements a bit.
1230 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1232         * ztest.c: #include <errno.h>.
1233         (TEST_TIMING): Don't define, don't test.
1234         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1235         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1236         (ZLIB_CLOCK_GETTIME_ARG): Define.
1237         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1238         * Makefile.am: Likewise.
1239         * configure, Makefile.in: Rebuild.
1241 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1243         PR other/67165
1244         * Makefile.am: Append the content of clock_gettime_link to
1245         ztest_LDADD.
1246         * configure.ac: Test for the case that clock_gettime is in librt.
1247         * Makefile.in: Regenerate.
1248         * configure: Likewise.
1250         PR other/67165
1251         * configure.ac: Check for clock_gettime.
1252         * config.h.in: Regenerate.
1253         * configure: Likewise.
1254         * ztest.c (average_time, test_large): Conditionalize test timing
1255         on clock_gettime availability.
1257 2017-09-29  Tony Reix  <tony.reix@atos.net>
1259         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1260         (STYP_DWARF, SSUBTYP_DW*): Define.
1261         (enum dwarf_section): Define.
1262         (struct dwsect_info): Define.
1263         (xcoff_add): Look for DWARF sections, pass them to
1264         backtrace_dwarf_add.
1266 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1268         PR other/67165
1269         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1270         (unlikely): Define.
1271         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1272         (b_elf_chdr): Define type.
1273         (enum debug_section): Add ZDEBUG_xxx values.
1274         (debug_section_names): Add names for new sections.
1275         (struct debug_section_info): Add compressed field.
1276         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1277         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1278         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1279         (HUFFMAN_SECONDARY_SHIFT): Define.
1280         (ZDEBUG_TABLE_SIZE): Define.
1281         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1282         (final_next_secondary): New static variable if
1283         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1284         (elf_zlib_inflate_table): New static function.
1285         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1286         function to produce fixed Huffman table.
1287         (elf_zlib_default_table): New static variable.
1288         (elf_zlib_inflate): New static function.
1289         (elf_zlib_verify_checksum): Likewise.
1290         (elf_zlib_inflate_and_verify): Likewise.
1291         (elf_uncompress_zdebug): Likewise.
1292         (elf_uncompress_chdr): Likewise.
1293         (backtrace_uncompress_zdebug): New extern function.
1294         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1295         sections, and uncompress them.
1296         * internal.h (backtrace_compress_zdebug): Declare.
1297         * ztest.c: New file.
1298         * configure.ac: Check for -lz and check whether the linker
1299         supports --compress-debug-sections.
1300         * Makefile.am (ztest_SOURCES): New variable.
1301         (ztest_CFLAGS, ztest_LDADD): New variables.
1302         (check_PROGRAMS): Add ztest.
1303         (ctestg_SOURCES): New variable.
1304         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1305         (ctesta_SOURCES): New variable.
1306         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1307         (check_PROGRAMS): Add ctestg and ctesta.
1308         * configure, config.h.in, Makefile.in: Rebuild.
1310 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1312         PR sanitizer/77631
1313         * configure.ac: Check for lstat and readlink.
1314         * elf.c (lstat, readlink): Provide dummy versions if real versions
1315         are not available.
1316         * configure, config.h.in: Rebuild.
1318 2017-09-21  Ian Lance Taylor  <iant@google.com>
1320         PR go/82284
1321         * elf.c (backtrace_initialize): Set pd.exe_filename.
1323 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1324             Denis Khalikov  <d.khalikov@partner.samsung.com>
1326         PR sanitizer/77631
1327         Support for external debug info.
1328         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1329         (S_ISLNK): Define if not defined.
1330         (xstrnlen): Define if strnlen is not available.
1331         (b_elf_note): Define type.
1332         (NT_GNU_BUILD_ID): Define macro.
1333         (elf_crc32, elf_crc32_file): New static functions.
1334         (elf_is_symlink, elf_readlink): New static functions.
1335         (elf_open_debugfile_by_buildid): New static function.
1336         (elf_try_debugfile): New static function.
1337         (elf_find_debugfile_by_debuglink): New static function.
1338         (elf_open_debugfile_by_debuglink): New static function.
1339         (elf_add): Add filename and debuginfo parameters.  Adjust all
1340         callers.  Look for external debug info notes, and try to fetch
1341         debug info from external file.
1342         (struct phdr_data): Add exe_filename field.
1343         (phdr_callback): Pass filename to elf_add.
1344         (backtrace_initialize): Add filename parameter.
1345         * internal.h (backtrace_initialize): Add filename parameter.
1346         * fileline.c (fileline_initialize): Pass filename to
1347         backtrace_initialize.
1348         * pecoff.c (fileline_initialize): Add unused filename parameter.
1349         * unknown.c (fileline_initialize): Likewise.
1350         * xcoff.c (fileline_initialize): Likewise.
1351         * configure.ac: Check for objcopy --add-gnu-debuglink.
1352         * Makefile.am (dtest): New test target.
1353         * configure, Makefile.in: Rebuild.
1355 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1357         PR other/81096
1358         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1359         * Makefile.in: Regenerate.
1361 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1363         PR other/81096
1364         * libbacktrace/Makefile.in
1365         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1367 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1369         PR bootstrap/81638
1370         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1372 2017-07-28  Tony Reix  <tony.reix@atos.net>
1374         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1376 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1378         * fileline.c (fileline_initialize): Print pid_t as long.
1380 2017-07-26  Tony Reix  <tony.reix@atos.net>
1382         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1383         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1384         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1385         * configure, config.h.in: Regenerate.
1387 2017-07-21  Tony Reix  <tony.reix@atos.net>
1389         * filetype.awk: Add AIX XCOFF type detection.
1390         * configure.ac: Recognize xcoff format.
1391         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1392         * fileline.c: Include <unistd.h>.
1393         (fileline_initialize): Add case for AIX procfs.
1394         * xcoff.c: New file.
1395         * configure, Makefile.in: Rebuild.
1397 2017-06-21  Richard Biener  <rguenther@suse.de>
1399         * configure.ac: Add AC_SYS_LARGEFILE.
1400         * config.h.in: Regenerate.
1401         * configure: Likewise.
1403 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1405         * elf.c (backtrace_initialize): Always set *fileline_fn.
1406         * ttest.c: New file.
1407         * btest.c: Move support functions into testlib.c.  Change calls to
1408         check to pass file name.
1409         * testlib.c: New file, copied from (part of) btest.c.
1410         * testlib.h: New file, declarations for testlib.c.
1411         * edtest.c: Use testlib.h and testlib.c.
1412         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1413         * Makefile.am (btest_SOURCES): Add testlib.c.
1414         (edtest_SOURCES): Likewise.
1415         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1416         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1417         * configure, Makefile.in: Rebuild.
1419 2017-05-19  Than McIntosh  <thanm@google.com>
1421         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1422         (read_line_header): Don't allocate dirs if dirs_count == 0.
1423         * edtest.c: New file.
1424         * edtest2.c: New file.
1425         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1426         (check_PROGRAMS): Add edtest.
1427         (edtest2_build.c, gen_edtest2_build): New targets.
1428         * Makefile.in: Rebuild.
1430 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1432         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1433         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1435 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1437         Update copyright years.
1439 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1441         * configure: Regenerate.
1443 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1445         * all: Remove meaningless trailing whitespace.
1447 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1449         PR target/71161
1450         * elf.c (phdr_callback) [__i386__]: Add
1451         __attribute__((__force_align_arg_pointer__)).
1453 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1455         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1456         avoid possible crash.
1457         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1458         missing debug info anymore.
1460 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1462         * mmap.c (MAP_FAILED): Define if not defined.
1464 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1466         Update copyright years.
1468 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1470         * configure.ac: Specify that DJGPP do not have mmap
1471         even when sys/mman.h exists.
1472         * configure: Regenerate
1474 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1476         PR libgfortran/68115
1477         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1478         * configure: Regenerate.
1479         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1480         to void.
1482 2015-09-17  Ian Lance Taylor  <iant@google.com>
1484         * posix.c (backtrace_open): Cast second argument of open() to int.
1486 2015-09-11  Ian Lance Taylor  <iant@google.com>
1488         * Makefile.am (backtrace.lo): Depend on internal.h.
1489         (sort.lo, stest.lo): Add explicit dependencies.
1490         * Makefile.in: Rebuild.
1492 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1494         * backtrace.c: #include <sys/types.h>.
1496 2015-09-08  Ian Lance Taylor  <iant@google.com>
1498         PR other/67457
1499         * backtrace.c: #include "internal.h".
1500         (struct backtrace_data): Add can_alloc field.
1501         (unwind): If can_alloc is false, don't try to get file/line
1502         information.
1503         (backtrace_full): Set can_alloc field in bdata.
1504         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1505         NULL.
1506         * mmap.c (backtrace_alloc): Likewise.
1507         * internal.h: Update comments for backtrace_alloc and
1508         backtrace_free.
1510 2015-09-08  Ian Lance Taylor  <iant@google.com>
1512         PR other/67457
1513         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1515 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1517         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1518         * configure: Regenerate.
1520 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1522         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1523         Remove setting PIC_FLAG when building as target library.
1524         * configure: Regenerate.
1526 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1528         * configure.ac: Only compile with -fPIC if the target
1529         supports it.
1530         * configure: Regenerate.
1532 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1534         * configure.ac: Set have_mmap to no on spu-*-* targets.
1535         * configure: Regenerate.
1537 2015-08-13  Ian Lance Taylor  <iant@google.com>
1539         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1540         Change all callers.
1542 2015-06-11  Martin Sebor  <msebor@redhat.com>
1544         PR sanitizer/65479
1545         * dwarf.c (struct line): Add new field idx.
1546         (line_compare): Use it.
1547         (add_line): Set it.
1548         (read_line_info): Reset it.
1550 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1552         * pecoff.c: New file.
1553         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1554         * Makefile.in: Regenerate.
1555         * filetype.awk: Detect pecoff.
1556         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1557         Add pecoff.
1558         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1559         true.
1560         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1561         * configure: Regenerate.
1562         * pecoff.c: New file.
1564 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1566         * Makefile.in: Regenerated with automake-1.11.6.
1567         * aclocal.m4: Likewise.
1568         * configure: Likewise.
1570 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1572         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1573         * configure: Regenerate.
1575 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1577         Update copyright years.
1579 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1581         PR bootstrap/63784
1582         * configure: Regenerated.
1584 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1586         * ChangeLog.jit: New.
1588 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1590         PR target/63610
1591         * configure: Regenerate.
1593 2014-10-23  Ian Lance Taylor  <iant@google.com>
1595         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1596         Fix to return void *.
1598 2014-05-08  Ian Lance Taylor  <iant@google.com>
1600         * mmap.c (backtrace_free): If freeing a large aligned block of
1601         memory, call munmap rather than holding onto it.
1602         (backtrace_vector_grow): When growing a vector, double the number
1603         of pages requested.  When releasing the old version of a grown
1604         vector, pass the correct size to backtrace_free.
1606 2014-03-07  Ian Lance Taylor  <iant@google.com>
1608         * sort.c (backtrace_qsort): Use middle element as pivot.
1610 2014-03-06  Ian Lance Taylor  <iant@google.com>
1612         * sort.c: New file.
1613         * stest.c: New file.
1614         * internal.h (backtrace_qsort): Declare.
1615         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1616         (read_line_info, read_function_entry): Likewise.
1617         (read_function_info, build_dwarf_data): Likewise.
1618         * elf.c (elf_initialize_syminfo): Likewise.
1619         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1620         (stest_SOURCES, stest_LDADD): Define.
1621         (check_PROGRAMS): Add stest.
1623 2014-02-07  Misty De Meo  <misty@brew.sh>
1625         PR target/58710
1626         * configure.ac: Use AC_LINK_IFELSE in check for
1627         _Unwind_GetIPInfo.
1628         * configure: Regenerate.
1630 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1632         Update copyright years
1634 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1636         * elf.c (ET_DYN): Undefine and define again.
1637         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1638         return early -1 without closing the descriptor.
1639         (struct phdr_data): Add exe_descriptor.
1640         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1641         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1642         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1643         call to elf_add.
1644         (backtrace_initialize): Adjust call to elf_add.  If it returns
1645         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1647 2013-12-05  Ian Lance Taylor  <iant@google.com>
1649         * alloc.c (backtrace_vector_finish): Add error_callback and data
1650         parameters.  Call backtrace_vector_release.  Return address base.
1651         * mmap.c (backtrace_vector_finish): Add error_callback and data
1652         parameters.  Return address base.
1653         * dwarf.c (read_function_info): Get new address base from
1654         backtrace_vector_finish.
1655         * internal.h (backtrace_vector_finish): Update declaration.
1657 2013-11-27  Ian Lance Taylor  <iant@google.com>
1659         * dwarf.c (find_address_ranges): New static function, broken out
1660         of build_address_map.
1661         (build_address_map): Call it.
1662         * btest.c (check): Check for missing filename or function, rather
1663         than crashing.
1664         (f3): Check that enough frames were returned.
1666 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1668         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1669         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1670         last argument.
1671         * btest.c (struct symdata): Add size field.
1672         (callback_three): Add symsize argument.  Copy it to the data->size
1673         field.
1674         (f23): Set symdata.size to 0.
1675         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1676         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1677         values.
1679         * atomic.c: Include sys/types.h.
1681 2013-11-18  Ian Lance Taylor  <iant@google.com>
1683         * configure.ac: Check for support of __atomic extensions.
1684         * internal.h: Declare or #define atomic functions for use in
1685         backtrace code.
1686         * atomic.c: New file.
1687         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1688         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1689         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1690         (backtrace_initialize): Likewise.
1691         * fileline.c (fileline_initialize): Likewise.
1692         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1693         * configure, config.h.in, Makefile.in: Rebuild.
1695 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1697         * elf.c (SHN_UNDEF): Define.
1698         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1699         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1700         (elf_add): Adjust caller.
1702         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1704 2013-11-16  Ian Lance Taylor  <iant@google.com>
1706         * backtrace.h (backtrace_create_state): Correct comment about
1707         threading.
1709 2013-11-15  Ian Lance Taylor  <iant@google.com>
1711         * backtrace.h (backtrace_syminfo): Update comment and parameter
1712         name to take any address, not just a PC value.
1713         * elf.c (STT_OBJECT): Define.
1714         (elf_nosyms): Rename parameter pc to addr.
1715         (elf_symbol_search): Rename local variable pc to addr.
1716         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1717         (elf_syminfo): Rename parameter pc to addr.
1718         * btest.c (global): New global variable.
1719         (test5): New test.
1720         (main): Call test5.
1722 2013-10-17  Ian Lance Taylor  <iant@google.com>
1724         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1725         is missing.
1727 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1729         * configure.ac: Add --enable-host-shared, setting up
1730         pre-existing PIC_FLAG variable within Makefile.am et al.
1731         * configure: Regenerate.
1733 2013-09-20  Alan Modra  <amodra@gmail.com>
1735         * configure: Regenerate.
1737 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1739         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1741 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1743         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1744         dl_iterate_phdr callbacks.
1746 2013-03-25  Ian Lance Taylor  <iant@google.com>
1748         * alloc.c: #include <sys/types.h>.
1749         * mmap.c: Likewise.
1751 2013-01-31  Ian Lance Taylor  <iant@google.com>
1753         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1754         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1756 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1758         PR other/56076
1759         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1760         attribute was not seen.
1762 2013-01-16  Ian Lance Taylor  <iant@google.com>
1764         * dwarf.c (struct unit): Add filename and abs_filename fields.
1765         (build_address_map): Set new fields when reading unit.
1766         (dwarf_lookup_pc): If we don't find an entry in the line table,
1767         just return the main file name.
1769 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1771         Update copyright years.
1773 2013-01-01  Ian Lance Taylor  <iant@google.com>
1775         PR bootstrap/54834
1776         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1777         $(MULTIBUILDTOP)/../../gcc/include.
1778         * Makefile.in: Rebuild.
1780 2013-01-01  Ian Lance Taylor  <iant@google.com>
1782         PR other/55536
1783         * mmap.c (backtrace_alloc): Don't call sync functions if not
1784         threaded.
1785         (backtrace_free): Likewise.
1787 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1789         * mmapio.c: Define MAP_FAILED if not defined.
1791 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1793         PR bootstrap/54926
1794         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1795         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1796         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1797         accepts it.
1798         * Makefile.in: Regenerated.
1799         * configure: Regenerated.
1801 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1803         PR bootstrap/54926
1804         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1805         * Makefile.in: Regenerated.
1807 2012-11-20  Ian Lance Taylor  <iant@google.com>
1809         * dwarf.c (read_attribute): Always clear val.
1811 2012-11-13  Ian Lance Taylor  <iant@google.com>
1813         PR other/55312
1814         * configure.ac: Only add -Werror if building a target library.
1815         * configure: Rebuild.
1817 2012-11-12  Ian Lance Taylor  <iant@google.com>
1818             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1819             Gerald Pfeifer  <gerald@pfeifer.com>
1821         * configure.ac: Check for getexecname.
1822         * fileline.c: #include <errno.h>.  Define getexecname if not
1823         available.
1824         (fileline_initialize): Try to find the executable in a few
1825         different ways.
1826         * print.c (error_callback): Only print the filename if it came
1827         from the backtrace state.
1828         * configure, config.h.in: Rebuild.
1830 2012-10-29  Ian Lance Taylor  <iant@google.com>
1832         * mmap.c (backtrace_vector_release): Correct last patch: add
1833         aligned, not size.
1835 2012-10-29  Ian Lance Taylor  <iant@google.com>
1837         * mmap.c (backtrace_vector_release): Make sure freed block is
1838         aligned on 8-byte boundary.
1840 2012-10-26  Ian Lance Taylor  <iant@google.com>
1842         PR other/55087
1843         * posix.c (backtrace_open): Add does_not_exist parameter.
1844         * elf.c (phdr_callback): Do not warn if shared library could not
1845         be opened.
1846         * fileline.c (fileline_initialize): Update calls to
1847         backtrace_open.
1848         * internal.h (backtrace_open): Update declaration.
1850 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
1852         PR target/55061
1853         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1854         * configure: Regenerate.
1856 2012-10-24  Ian Lance Taylor  <iant@google.com>
1858         PR target/55061
1859         * configure.ac: Check whether -funwind-tables option works.
1860         * configure: Rebuild.
1862 2012-10-11  Ian Lance Taylor  <iant@google.com>
1864         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1865         * configure: Rebuild.
1867 2012-10-10  Ian Lance Taylor  <iant@google.com>
1869         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1870         lower case.
1872 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
1874         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1876 2012-10-09  Ian Lance Taylor  <iant@google.com>
1878         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1879         (backtrace_dwarf_add): Likewise.
1881 2012-10-09  Ian Lance Taylor  <iant@google.com>
1883         Add support for tracing through shared libraries.
1884         * configure.ac: Check for link.h and dl_iterate_phdr.
1885         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
1886         ELF macros before #defining them.
1887         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1888         dl_iterate_phdr.
1889         (struct elf_syminfo_data): Add next field.
1890         (elf_initialize_syminfo): Initialize next field.
1891         (elf_add_syminfo_data): New static function.
1892         (elf_add): New static function, broken out of
1893         backtrace_initialize.  Call backtrace_dwarf_add instead of
1894         backtrace_dwarf_initialize.
1895         (struct phdr_data): Define.
1896         (phdr_callback): New static function.
1897         (backtrace_initialize): Call elf_add.
1898         * dwarf.c (struct dwarf_data): Add next and base_address fields.
1899         (add_unit_addr): Add base_address parameter.  Change all callers.
1900         (add_unit_ranges, build_address_map): Likewise.
1901         (add_line): Add ddata parameter.  Change all callers.
1902         (read_line_program, add_function_range): Likewise.
1903         (dwarf_lookup_pc): New static function, broken out of
1904         dwarf_fileline.
1905         (dwarf_fileline): Call dwarf_lookup_pc.
1906         (build_dwarf_data): New static function.
1907         (backtrace_dwarf_add): New function.
1908         (backtrace_dwarf_initialize): Remove.
1909         * internal.h (backtrace_dwarf_initialize): Don't declare.
1910         (backtrace_dwarf_add): Declare.
1911         * configure, config.h.in: Rebuild.
1913 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
1915         * btest.c (f23): Avoid uninitialized variable warning.
1917 2012-10-04  Ian Lance Taylor  <iant@google.com>
1919         * dwarf.c: If the system header files do not declare strnlen,
1920         provide our own version.
1922 2012-10-03  Ian Lance Taylor  <iant@google.com>
1924         * dwarf.c (read_uleb128): Fix overflow test.
1925         (read_sleb128): Likewise.
1926         (build_address_map): Don't change unit_buf.start.
1928 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
1930         PR other/54761
1931         * configure.ac (EXTRA_FLAGS): New.
1932         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1933         * configure, Makefile.in: Regenerate.
1935 2012-09-29  Ian Lance Taylor  <iant@google.com>
1937         PR other/54749
1938         * fileline.c (fileline_initialize): Pass errnum as -1 when
1939         reporting that we could not read executable information after a
1940         previous failure.
1942 2012-09-27  Ian Lance Taylor  <iant@google.com>
1944         PR bootstrap/54732
1945         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1946         * Makefile.am: Add dependencies for all objects.
1947         * configure, aclocal.m4, Makefile.in: Rebuild.
1949 2012-09-27  Ian Lance Taylor  <iant@google.com>
1951         PR other/54726
1952         * elf.c (backtrace_initialize): Set *fileln_fn, not
1953         state->fileln_fn.
1955 2012-09-19  Ian Lance Taylor  <iant@google.com>
1957         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1958         as a target library.
1959         * configure: Rebuild.
1961 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1962             Ian Lance Taylor  <iant@google.com>
1964         * configure.ac (GCC_HEADER_STDINT): Invoke.
1965         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1966         * btest.c: Don't include <stdint.h>.
1967         * dwarf.c: Likewise.
1968         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1970 2012-09-18  Ian Lance Taylor  <iant@google.com>
1972         PR bootstrap/54623
1973         * Makefile.am (AM_CPPFLAGS): Define.
1974         (AM_CFLAGS): Remove -I options.
1975         * Makefile.in: Rebuild.
1977 2012-09-18  Ian Lance Taylor  <iant@google.com>
1979         * posix.c (O_BINARY): Define if not defined.
1980         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
1981         HAVE_FCNTL is defined.
1982         * configure.ac: Test for the fcntl function.
1983         * configure, config.h.in: Rebuild.
1985 2012-09-18  Ian Lance Taylor  <iant@google.com>
1987         * btest.c (test1, test2, test3, test4): Add the unused attribute.
1989 2012-09-18  Ian Lance Taylor  <iant@google.com>
1991         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1993 2012-09-18  Ian Lance Taylor  <iant@google.com>
1995         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1996         * mmapio.c: Don't define _GNU_SOURCE.
1997         * configure, config.h.in: Rebuild.
1999 2012-09-18  Ian Lance Taylor  <iant@google.com>
2001         * configure.ac: Check whether strnlen is declared.
2002         * dwarf.c: Declare strnlen if not declared.
2003         * configure, config.h.in: Rebuild.
2005 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2007         * fileline.c: Include <stdlib.h>.
2008         * mmap.c: Likewise.
2010 2012-09-17  Ian Lance Taylor  <iant@google.com>
2012         PR bootstrap/54611
2013         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
2014         parameter.
2016 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
2018         PR bootstrap/54611
2019         * nounwind.c (backtrace_simple): Add state parameter.
2021 2012-09-17  Ian Lance Taylor  <iant@google.com>
2023         PR bootstrap/54609
2024         * unknown.c (unknown_fileline): Add state parameter, remove
2025         fileline_data parameter, name error_callback parameter.
2026         (backtrace_initialize): Add state parameter.
2028 2012-09-17  Ian Lance Taylor  <iant@google.com>
2030         * Initial implementation.
2032 Copyright (C) 2012-2024 Free Software Foundation, Inc.
2034 Copying and distribution of this file, with or without modification,
2035 are permitted in any medium without royalty provided the copyright
2036 notice and this notice are preserved.