Control flow redundancy hardening
[official-gcc.git] / libbacktrace / ChangeLog
blob11395da6ea06fde00adc82223f0750453d2b7d73
1 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
3         * configure: Regenerate.
5 2023-08-07  Alexander von Gluck IV  <kallisti5@unixzen.com>
7         * configure: Regenerate.
9 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
11         * configure: Regenerate.
13 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
15         * configure: Regenerate.
17 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
19         * configure: Regenerate.
21 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
23         * configure: Regenerate.
25 2023-08-03  Richard Biener  <rguenther@suse.de>
27         * zstdtest.c (test_samples): Properly compute the allocation
28         size for the uncompressed data.
30 2023-07-31  Ian Lance Taylor  <iant@golang.org>
32         * configure.ac: Check for _pgmptr declaration.
33         * fileline.c (fileline_initialize): Check for _pgmfptr before
34         /proc/self/exec.
35         * configure, config.h.in: Regenerate.
37 2023-03-28  Ian Lance Taylor  <iant@golang.org>
39         * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading
40         bits, not before.  Add unlikely for error case.
41         (elf_zstd_offset_table): Regenerate.
42         (elf_zstd_read_huff): Clear 13 entries in weight_mark, not 12.
43         (elf_zstd_read_literals): For a single stream adjust by
44         total_streams_size, not compressed_size.
46 2023-01-20  Ian Lance Taylor  <iant@golang.org>
48         * dwarf.c (struct function_addrs): Change low and high fields to
49         uintptr_t.
50         (struct unit_addrs): Likewise.
51         (resolve_addr_index): Change address parameter to uintptr_t*.
52         (add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
53         (add_function_range): Likewise.
54         (struct pcrange): Change lowpc and highpc fields to uintptr_t.
55         (add_low_high_range): Change add_range lowpc and highpc parameters
56         to uintptr_t.
57         (add_ranges_from_ranges): Likewise.
58         (add_ranges_from_rnglists): Likewise.
59         (add_low_high_range): Chnage lowpc and highpc variables to
60         uintpr_t.
61         (add_ranges_from_rnglists): Change some local variables to
62         uintptr_t.
63         (add_ranges_from_ranges): Change base parameter to uintptr_t.
64         (add_ranges_from_rnglists): Likewise.
65         (read_function_entry): Likewise.
66         (resolve_addr_index): Add explicit casts to uintptr_t.
67         (update_pcrange): Likewise.
68         (add_ranges_from_ranges): Likewise.
69         (add_ranges_from_rnglists): Likewise.
70         (read_function_entry): Likewise.
72 2023-01-17  Martin Liska  <mliska@suse.cz>
74         * Makefile.in: Regenerate.
76 2023-01-06  Ian Lance Taylor  <iant@golang.org>
78         PR libbacktrace/108297
79         * configure.ac: Test whether linker supports --build-id.
80         * Makefile.am: Only run --build-id tests if supported.
81         * configure, Makefile.in: Regenerate.
83 2022-12-17  Ian Lance Taylor  <iant@golang.org>
85         * elf.c (elf_fetch_backward_init): New static function.
86         (ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
87         literal size.
88         (ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
89         (elf_zstd_read_huff): Use elf_fetch_backward_init.
90         (elf_zstd_read_literals): New static function.
91         (ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
92         (struct elf_zstd_literals): Don't define.
93         (elf_zstd_literal_output): Remove static function.
94         (elf_zstd_decompress): Use elf_fetch_backward_init and
95         elf_zstd_read_literals.  Rewrite literal copying.<
97 2022-12-10  Ian Lance Taylor  <iant@golang.org>
99         * elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
100         (ZSTD_ENCODE_BASELINE_BITS): Define.
101         (ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
102         (elf_zstd_literal_length_base): New static const array.
103         (elf_zstd_match_length_base): Likewise.
104         (struct elf_zstd_fse_baseline_entry): Define.
105         (elf_zstd_make_literal_baseline_fse): New static function.
106         (elf_zstd_make_offset_baseline_fse): Likewise.
107         (elf_zstd_make_match_baseline_fse): Likewise.
108         (print_table, main): Use elf_zstd_fse_baseline_entry.
109         (elf_zstd_lit_table, elf_zstd_match_table): Likewise.
110         (elf_zstd_offset_table): Likewise.
111         (struct elf_zstd_seq_decode): Likewise.  Remove use_rle and rle
112         fields.
113         (elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
114         taking a conversion function.  Convert RLE to FSE.
115         (elf_zstd_literal_length_baseline): Remove.
116         (elf_zstd_literal_length_bits): Remove.
117         (elf_zstd_match_length_baseline): Remove.
118         (elf_zstd_match_length_bits): Remove.
119         (elf_zstd_decompress): Use elf_zstd_fse_baseline_entry.  Rewrite
120         and simplify main loop.
122 2022-12-08  Ian Lance Taylor  <iant@golang.org>
124         * configure.ac: Check for zstd library and
125         --compress-debug-sections=zstd linker option.
126         * Makefile.am (zstdtest_*): New targets.
127         (zstdtest_alloc_*, ctestzstd_*): New targets.
128         (BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
129         appropriate.
130         * elf.c (ELFCOMPRESS_ZSTD): Define.
131         (elf_fetch_bits): Rename from elf_zlib_fetch.  Update uses.
132         (elf_fetch_bits_backward): New static function.
133         (ZLIB_HUFFMAN_*): Rename from HUFFMAN_*.  Update uses.
134         (ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*.  Update uses.
135         (ZSTD_TABLE_*): Define.
136         (struct elf_zstd_fse_entry): Define.
137         (elf_zstd_read_fse): New static function.
138         (elf_zstd_build_fse): Likewise.
139         (lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
140         (match, offset, next, print_table, main): Likewise.
141         (elf_zstd_lit_table): New static const array.
142         (elf_zstd_match_table, elf_zstd_offset_table): Likewise.
143         (elf_zstd_read_huff): New static function.
144         (struct elf_zstd_seq_decode): Define.
145         (elf_zstd_unpack_seq_decode): New static function.
146         (ZSTD_LIT_*): Define.
147         (struct elf_zstd_literals): Define.
148         (elf_zstd_literal_output): New static function.
149         (ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
150         (elf_zstd_literal_length_baseline): New static const array.
151         (elf_zstd_literal_length_bits): Likewise.
152         (ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
153         (elf_zstd_match_length_baseline): New static const array.
154         (elf_zstd_match_length_bits): Likewise.
155         (elf_zstd_decompress): New static function.
156         (ZDEBUG_TABLE_SIZE): New definition.
157         (elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
158         (backtrace_uncompress_zstd): New function.
159         (elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
160         * internal.h (backtrace_uncompress_zstd): Declare.
161         * zstdtest.c: New file.
162         * configure, config.h.in, Makefile.in: Regenerate.
164 2022-10-12  Martin Liska  <mliska@suse.cz>
166         * configure: Regenerate.
168 2022-10-11  Olivier Hainque  <hainque@adacore.com>
169             Olivier Hainque  <hainque@adacore.com>
171         * configure: Regenerate.
173 2022-07-08  Ian Lance Taylor  <iant@golang.org>
175         * configure.ac: Check for sys/link.h.  Use either link.h or
176         sys/link.h when checking for dl_iterate_phdr.
177         * elf.c: Include sys/link.h if available.
178         * configure, config.h.in: Regenerate.
180 2022-07-07  Ian Lance Taylor  <iant@golang.org>
182         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
183         loop if we can't find debug info for one shared library.
185 2022-07-07  Ian Lance Taylor  <iant@golang.org>
187         * Makefile.am (MAKETESTS): New variable split out of TESTS.
188         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
189         * Makefile.in: Regenerate.
191 2022-06-27  Ian Lance Taylor  <iant@golang.org>
193         * configure.ac: Use grep instead of fgrep.
194         * configure, Makefile.in: Regenerate.
196 2022-05-28  Ian Lance Taylor  <iant@golang.org>
198         PR libbacktrace/105721
199         * README: Update.
201 2022-04-05  Ian Lance Taylor  <iant@golang.org>
203         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
204         uncompressed block.
206 2022-02-17  Ian Lance Taylor  <iant@golang.org>
208         * dwarf.c (find_address_ranges): Handle skeleton units.
209         (read_function_entry): Likewise.
211 2022-02-16  Ian Lance Taylor  <iant@golang.org>
213         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
215 2022-02-03  David Seifert  <soap@gentoo.org>
216             Jakub Jelinek  <jakub@redhat.com>
218         * configure.ac: Support --disable-werror.
219         * configure: Regenerate.
221 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
223         PR libbacktrace/103822
224         * Makefile.am: Fix newline.
225         * Makefile.in: Regenerate.
227 2021-11-12  Martin Liska  <mliska@suse.cz>
229         PR libbacktrace/103167
230         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
231         (elf_uncompress_lzma): Likewise.
232         * xztest.c (test_samples): memcpy only if v > 0.
234 2021-10-22  Martin Liska  <mliska@suse.cz>
236         PR testsuite/102742
237         * btest.c (MIN_DESCRIPTOR): New.
238         (MAX_DESCRIPTOR): Likewise.
239         (check_available_files): Likewise.
240         (check_open_files): Check only file descriptors that
241         were not available at the entry.
242         (main): Call check_available_files.
244 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
246         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
247         output with LANG=C.
249 2021-06-28  ClĂ©ment Chigot  <clement.chigot@atos.net>
251         * xcoff.c (SSUBTYP_DWRNGES): New define.
252         (xcoff_add): Use correct XCOFF DWARF section subtype
253         for DEBUG_RANGES. Remove lineoff workaround.
254         Adjust base_address.
255         (xcoff_initialize_syminfo): Adapt to new base_address.
256         (xcoff_lookup_pc): Likewise.
257         (xcoff_initialize_fileline): Likewise.
259 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
261         PR bootstrap/99703
262         * configure: Regenerated.
264 2021-03-03  Ian Lance Taylor  <iant@golang.org>
266         * dwarf.c (read_line_program): Don't special case file 0.
267         (read_function_entry): Likewise.
269 2021-03-02  Ian Lance Taylor  <iant@golang.org>
271         PR libbacktrace/98818
272         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
273         callers.
274         * backtrace.h: Update backtrace_error_callback comment.
276 2021-02-12  Ian Lance Taylor  <iant@golang.org>
278         * configure.ac: Check for objcopy --add-gnu-debuglink by using
279         objcopy --help.
280         * configure: Regenerate
282 2021-01-18  Ian Lance Taylor  <iant@golang.org>
284         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
285         * Makefile.in: Regenerate.
286         * configure: Regenerate.
288 2021-01-18  Ian Lance Taylor  <iant@golang.org>
290         PR debug/98716
291         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
292         filenames.
293         (read_line_program): Remove parameter u, change caller.  Don't
294         subtract one from dirs and filenames index.
295         (read_function_entry): Don't subtract one from filenames index.
297 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
299         * configure: Re-generate.
301 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
303         PR target/97865
304         * configure: Regenerate.
306 2020-12-02  Ian Lance Taylor  <iant@golang.org>
308         * dwarf.c (resolve_string): Use > rather than >= to check whether
309         string index extends past buffer.
310         (resolve_addr_index): Similarly for address index.
312 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
314         * configure: Regenerate.
316 2020-10-20  Ian Lance Taylor  <iant@golang.org>
318         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
319         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
321 2020-09-28  Ian Lance Taylor  <iant@golang.org>
323         PR libbacktrace/97082
324         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
325         * Makefile.in: Regenerate.
327 2020-09-28  Ian Lance Taylor  <iant@golang.org>
329         PR libbacktrace/97227
330         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
331         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
332         * configure: Regenerate.
333         * Makefile.in: Regenerate.
335 2020-09-23  Ian Lance Taylor  <iant@golang.org>
337         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
338         p->low.
339         (dwarf_lookup_pc): Likewise.
341 2020-09-17  Ian Lance Taylor  <iant@golang.org>
343         PR libbacktrace/97080
344         * fileline.c (backtrace_syminfo_to_full_callback): New function.
345         (backtrace_syminfo_to_full_error_callback): New function.
346         * elf.c (elf_nodebug): Call syminfo_fn if possible.
347         * internal.h (struct backtrace_call_full): Define.
348         (backtrace_syminfo_to_full_callback): Declare.
349         (backtrace_syminfo_to_full_error_callback): Declare.
350         * mtest.c (f3): Only check all[i] if data.index permits.
352 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
354         * macho.c (MACH_O_CPU_TYPE_PPC): New.
355         (MACH_O_CPU_TYPE_PPC64): New.
356         Add compile-tests for powerpc to the Mach-O variants.
358 2020-09-14  Ian Lance Taylor  <iant@golang.org>
360         PR libbacktrace/93608
361         Add support for MiniDebugInfo.
362         * elf.c (struct elf_view): Define.  Replace most uses of
363         backtrace_view with elf_view.
364         (elf_get_view): New static functions.  Replace most calls of
365         backtrace_get_view with elf_get_view.
366         (elf_release_view): New static functions.  Replace most calls of
367         backtrace_release_view with elf_release_view.
368         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
369         callers.
370         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
371         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
372         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
373         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
374         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
375         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
376         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
377         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
378         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
379         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
380         (LZMA_PROB_DIST_ALIGN_LEN): Define.
381         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
382         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
383         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
384         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
385         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
386         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
387         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
388         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
389         (LZMA_PROB_REP_LEN_MID_LEN): Define.
390         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
391         (LZMA_PROB_LITERAL_LEN): Define.
392         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
393         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
394         (LZMA_PROB_IS_REP2_OFFSET): Define.
395         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
396         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
397         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
398         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
399         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
400         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
401         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
402         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
403         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
404         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
405         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
406         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
407         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
408         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
409         (LZMA_PROB_LITERAL_OFFSET): Define.
410         (LZMA_PROB_TOTAL_COUNT): Define.
411         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
412         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
413         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
414         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
415         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
416         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
417         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
418         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
419         (elf_lzma_varint): New static function.
420         (elf_lzma_range_normalize): New static function.
421         (elf_lzma_bit, elf_lzma_integer): New static functions.
422         (elf_lzma_reverse_integer): New static function.
423         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
424         (elf_uncompress_lzma): New static function.
425         (backtrace_uncompress_lzma): New function.
426         (elf_add): Add memory and memory_size parameters.  Change all
427         callers.  Look for .gnu_debugdata section, and, if found,
428         decompress it and use it for symbols and debug info.  Permit the
429         descriptor parameter to be -1.
430         * internal.h (backtrace_uncompress_lzma): Declare.
431         * mtest.c: New file.
432         * xztest.c: New file.
433         * configure.ac: Check for nm, xz, and comm programs.  Check for
434         liblzma library.
435         (HAVE_MINIDEBUG): Define.
436         * Makefile.am (mtest_SOURCES): Define.
437         (mtest_CFLAGS, mtest_LDADD): Define.
438         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
439         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
440         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
441         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
442         (xztest_alloc_LDADD): Define.
443         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
444         (CLEANFILES): Add files created by minidebug pattern.
445         (btest.lo): Correct INCDIR reference.
446         (mtest.lo, xztest.lo, ztest.lo): New targets.
447         * configure: Regenerate.
448         * config.h.in: Regenerate.
449         * Makefile.in: Regenerate.
451 2020-09-09  Ian Lance Taylor  <iant@golang.org>
453         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
454         (coff_add): Determine and pass is_64.
456 2020-09-09  Ian Lance Taylor  <iant@golang.org>
458         PR libbacktrace/96973
459         * fileline.c (macho_get_executable_path): New static function.
460         (fileline_initialize): Call macho_get_executable_path.
462 2020-09-09  Ian Lance Taylor  <iant@golang.org>
464         * dwarf.c (function_addrs_search): Compare against the next entry
465         low address, not the high address.
466         (unit_addrs_search): Likewise.
467         (build_address_map): Add a trailing unit_addrs.
468         (read_function_entry): Add a trailing function_addrs.
469         (read_function_info): Likewise.
470         (report_inlined_functions): Search backward for function_addrs
471         match.
472         (dwarf_lookup_pc): Search backward for unit_addrs and
473         function_addrs matches.
475 2020-09-08  Ian Lance Taylor  <iant@golang.org>
477         * simple.c (simple_unwind): Correct comment spelling.
479 2020-09-08  Ian Lance Taylor  <iant@golang.org>
481         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
482         correct length when freeing diralc.
484 2020-09-08  Ian Lance Taylor  <iant@golang.org>
486         PR libbacktrace/96973
487         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
489 2020-09-08  Ian Lance Taylor  <iant@golang.org>
491         PR libbacktrace/96971
492         * filetype.awk: Only match magic number at start of line.
494 2020-08-24  Ian Lance Taylor  <iant@golang.org>
496         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
497         (MACH_O_MH_CIGAM_FAT_64): Define.
498         (struct macho_fat_arch_64): Define.
499         (macho_add_fat): Add and use is_64 parameter.
500         (macho_add): Recognize 64-bit fat files.
502 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
504         PR bootstrap/96202
505         * configure: Regenerated.
507 2020-07-08  Ian Lance Taylor  <iant@golang.org>
509         * configure.ac: Test linker support for DWARF5
510         * configure: Regenerate
512 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
514         PR bootstrap/95413
515         * configure: Regenerated.
517 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
519         PR bootstrap/95147
520         * configure: Regenerated.
522 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
524         * configure: Regenerated.
526 2020-05-13  Ian Lance Taylor  <iant@golang.org>
528         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
530 2020-05-13  Ian Lance Taylor  <iant@golang.org>
532         PR go/95061
533         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
535 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
537         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
538         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
539         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
540         enabled.
541         * Makefile.in: Regenerated.
542         * configure: Likewise.
544 2020-05-11  Ian Lance Taylor  <iant@golang.org>
546         PR libbacktrace/95012
547         * configure.ac: Check for getpagesize declaration.
548         * mmap.c: Declare getpagesize if necessary.
549         * mmapio.c: Likewise.
550         * configure: Regenerate.
551         * config.h.in: Regenerate.
552         * Makefile.in: Regenerate.
554 2020-05-09  Roland McGrath  <mcgrathr@google.com>
556         * elf.c (elf_add): Bail early if there are no section headers at all.
558 2020-05-09  Ian Lance Taylor  <iant@golang.org>
560         * elf.c (elf_add): Don't free strtab if an error occurs after
561         recording symbol information.
563 2020-05-09  Ian Lance Taylor  <iant@golang.org>
565         PR libbacktrace/88745
566         * macho.c: New file.
567         * filetype.awk: Recognize Mach-O files.
568         * Makefile.am (FORMAT_FILES): Add macho.c.
569         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
570         (%.dSYM): New pattern target.
571         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
572         (test_macho_LDADD): New target.
573         (BUILDTESTS): Add test_macho.
574         (macho.lo): Add dependencies.
575         * configure.ac: Recognize macho file type.  Check for
576         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
577         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
578         * Makefile.in: Regenerate.
579         * configure: Regenerate.
580         * config.h.in: Regenerate.
582 2020-05-09  Ian Lance Taylor  <iant@golang.org>
584         * read.c (backtrace_get_view): Support short read.
586 2020-05-09  Ian Lance Taylor  <iant@golang.org>
588         * elf.c (elf_add): If debug sections are very large or far apart,
589         read them individually rather than as a single view.
591 2020-05-08  Ian Lance Taylor  <iant@golang.org>
593         * fileline.c (sysctl_exec_name): New static function.
594         (sysctl_exec_name1): New macro or static function.
595         (sysctl_exec_name2): Likewise.
596         (fileline_initialize): Try sysctl_exec_name[12].
597         * configure.ac: Check for sysctl args to fetch executable name.
598         * configure: Regenerate.
599         * config.h.in: Regenerate.
601 2020-02-15  Ian Lance Taylor  <iant@golang.org>
603         * ztest.c (test_large): Update file to current libgo test file.
605 2020-02-03  Ian Lance Taylor  <iant@golang.org>
607         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
608         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
609         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
610         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
611         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
612         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
613         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
614         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
615         (stest_alloc_CFLAGS): Likewise.
616         * Makefile.in: Regenerate.
617         * ztest.c (error_callback_compress): Mark vdata unused.
618         (test_large): Add casts to avoid warnings.
620 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
622         Update copyright years.
624 2019-12-13  Ian Lance Taylor  <iant@golang.org>
626         Add DWARF 5 support.
627         * dwarf.c (struct attr): Add val field.
628         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
629         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
630         (struct line_header): Add addrsize field.
631         (struct line_header_format): Define.
632         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
633         fields.
634         (read_uint24): New static function.
635         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
636         and dwarf_str_size parameters with dwarf_sections parameter.  Add
637         support for new DWARF 5 forms.  Change all callers.
638         (resolve_string): New static function.
639         (resolve_addr_index): Likewise.
640         (read_abbrevs): Support DW_FORM_implicit_const.
641         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
642         and ranges_is_index fields.
643         (update_pcrange): Support DWARF 5 encodings.
644         (add_high_low_range): New static function, split out of
645         add_ranges.
646         (add_ranges_from_ranges): Likewise.
647         (add_ranges_from_rnglists): New static function.
648         (add_ranges): Just call new helper functions.
649         (find_address_ranges): Use resolve_string for strings, after
650         reading all attributes.  Handle new DWARF 5 attributes.
651         (build_address_map): Support DWARF 5 compilation units.
652         (read_v2_paths): New static function, split out of
653         read_line_header.
654         (read_lnct): New static function.
655         (read_line_header_format_entries): Likewise.
656         (read_line_header): Add ddata parameter.  Support DWARF 5 line
657         headers.  Call new helper functions.  Change all callers.
658         (read_line_program): Use addrsize from line program header.  Don't
659         special case directory index 0 for DWARF 5.
660         (read_referenced_name): Use resolve_string.
661         (read_function_entry): Handle DWARF 5 encodings.  Use
662         resolve_string.
663         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
664         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
665         * elf.c (dwarf_section_names): Add new section names.
666         * pecoff.c (dwarf_section_names): Likewise.
667         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
668         fields.
669         * configure.ac: Define HAVE_DWARF5 automake conditional.
670         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
671         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
672         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
673         (dwarf5_alloc_LDADD): Likewise.
674         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
675         (CLEANFILES, clean-local): Define.
677 2019-12-08  Ian Lance Taylor  <iant@golang.org>
679         * dwarf.c (struct pcrange): Define.
680         (update_pcrange, add_ranges): New static functions.
681         (add_unit_addr): Change signature to work with add_ranges.  Don't
682         add base_address here.
683         (add_unit_ranges): Remove.
684         (find_address_ranges): Replace str/ranges parameters with
685         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
686         callers.
687         (add_function_range): Change signature to work with add_ranges.
688         Don't add base_address here.
689         (add_function_ranges): Remove.
690         (read_function_entry): Use update_pcrange and add_ranges.
692 2019-12-04  Ian Lance Taylor  <iant@golang.org>
694         * edtest.c (test1): Add noclone attribute.
696 2019-12-04  Ian Lance Taylor  <iant@golang.org>
698         * internal.h (enum dwarf_section): Define.
699         (struct dwarf_sections): Define.
700         (backtrace_dwarf_add): Update declaration to replace specific
701         section parameters with dwarf_sections parameter.
702         * dwarf.c (struct dwarf_data): Replace specific section fields
703         with dwarf_sections field.
704         (read_attribute): Use dwarf_sections with altlink.
705         (build_address_map): Replace specific section parameters with
706         dwarf_sections parameter.  Change all callers.
707         (read_line_info): Use dwarf_sections with ddata.
708         (read_referenced_name): Likewise.
709         (add_function_ranges): Likewise.
710         (read_function_entry): Likewise.
711         (read_function_info): Likewise.
712         (build_dwarf_data): Replace specific section parameters with
713         dwarf_sections parameter.  Change all callers.
714         (backtrace_dwarf_add): Likewise.
715         * elf.c (enum debug_section): Remove.
716         (dwarf_section_names): Remove .zdebug names.
717         (elf_add): Track zsections separately.  Build dwarf_sections.
718         * pecoff.c (enum debug_section): Remove.
719         (struct debug_section_info): Remove data field.
720         (coff_add): Build dwarf_sections.
721         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
722         references with DEBUG_xxx references.
723         (xcoff_add): Build dwarf_sections.
725 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
727         * configure: Regenerate.
729 2019-09-26  Ian Lance Taylor  <iant@golang.org>
731         PR libbacktrace/91908
732         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
733         __sync_bool_compare_and_swap to void.
734         * xcoff.c (backtrace_initialize): Likewise.
736 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
738         * configure.ac: Remove references to spu.
739         * configure: Regenerate.
741 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
743         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
744         test_elf_64.
745         * Makefile.in: Regenerate.
747 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
749         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
750         handling.
751         * configure: Regenerate.
753 2019-03-11  Ian Lance Taylor  <iant@golang.org>
755         PR libbacktrace/89669
756         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
757         HAVE_ELF.
758         * Makefile.in: Regenerate.
760 2019-02-26  Tom de Vries  <tdevries@suse.de>
762         * btest.c (test5): Allow global.* as minimal symbol name for global.
764 2019-02-26  Tom de Vries  <tdevries@suse.de>
766         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
767         * Makefile.in: Regenerate.
769 2019-02-12  Tom de Vries  <tdevries@suse.de>
771         PR libbacktrace/81983
772         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
774 2019-02-10  Tom de Vries  <tdevries@suse.de>
776         * Makefile.am (BUILDTESTS): Add btest_lto.
777         * Makefile.in: Regenerate.
778         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
779         __attribute__((noclone)).
781 2019-02-08  Tom de Vries  <tdevries@suse.de>
783         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
784         * print.c (backtrace_print): Same.
785         * simple.c (backtrace_simple): Same.
787 2019-02-08  Tom de Vries  <tdevries@suse.de>
789         PR libbacktrace/78063
790         * dwarf.c (build_address_map): Keep all parsed units.
791         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
793 2019-01-31  Tom de Vries  <tdevries@suse.de>
795         PR libbacktrace/89136
796         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
797         'debugaltlink_name_len =+ 1'.
799 2019-01-29  Tom de Vries  <tdevries@suse.de>
801         * install-debuginfo-for-buildid.sh.in: New script.
802         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
803         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
804         * Makefile.in: Regenerate.
805         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
806         (READELF): Set with AC_CHECK_PROG.
807         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
808         * configure: Regenerate.
809         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
810         (elf_open_debugfile_by_buildid): ... here.
812 2019-01-29  Tom de Vries  <tdevries@suse.de>
814         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
815         allocfail.
816         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
817         (check_PROGRAMS): Add BUILDTESTS.
818         * Makefile.in: Regenerate.
820 2019-01-28  Tom de Vries  <tdevries@suse.de>
822         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
823         Use $< to access prerequisite.
824         * Makefile.in: Regenerate.
826 2019-01-25  Nathan Sidwell  <nathan@acm.org>
828         * elf.c (elf_add): Pass "" filename to recursive call with
829         separated debug.
831 2019-01-25  Tom de Vries  <tdevries@suse.de>
833         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
834         filename == "".
835         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
836         * Makefile.in: Regenerate.
838 2019-01-25  Tom de Vries  <tdevries@suse.de>
840         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
841         (TESTS): Rename dtest to btest_gnudebuglink.
842         * Makefile.in: Regenerate.
844 2019-01-23  Tom de Vries  <tdevries@suse.de>
846         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
847         (units_search, find_unit): Use size_t for offset.
848         (build_address_map): Use size_t for unit_offset.
850 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
852         * allocfail.c (main): Increase portability of printf statement.
854 2019-01-18  Ian Lance Taylor  <iant@golang.org>
856         PR libbacktrace/88890
857         * mmapio.c (backtrace_get_view): Change size parameter to
858         uint64_t.  Check that value fits in size_t.
859         * read.c (backtrace_get_view): Likewise.
860         * internal.h (backtrace_get_view): Update declaration.
861         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
863 2019-01-17  Tom de Vries  <tdevries@suse.de>
865         PR libbacktrace/82857
866         * configure.ac (DWZ): Set with AC_CHECK_PROG.
867         (HAVE_DWZ): Set with AM_CONDITIONAL.
868         * configure: Regenerate.
869         * Makefile.am (TESTS): Add btest_dwz.
870         * Makefile.in: Regenerate.
872 2019-01-17  Tom de Vries  <tdevries@suse.de>
874         PR libbacktrace/82857
875         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
876         (read_attribute): Handle DW_FORM_GNU_ref_alt using
877         ATTR_VAL_REF_ALT_INFO.
878         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
880 2019-01-17  Tom de Vries  <tdevries@suse.de>
882         * dwarf.c (struct unit): Add low_offset and high_offset fields.
883         (struct unit_vector): New type.
884         (struct dwarf_data): Add units and units_counts fields.
885         (find_unit): New function.
886         (find_address_ranges): Add and handle unit_tag parameter.
887         (build_address_map): Add and handle units_vec parameter.
888         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
889         units vector.
891 2019-01-17  Tom de Vries  <tdevries@suse.de>
893         PR libbacktrace/82857
894         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
895         using altlink.
897 2019-01-17  Tom de Vries  <tdevries@suse.de>
899         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
900         (read_attribute): Add altlink parameter.  Handle missing altlink for
901         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
902         (find_address_ranges, build_address_map, build_dwarf_data): Add and
903         handle altlink parameter.
904         (read_referenced_name, read_function_entry): Add argument to
905         read_attribute call.
907 2019-01-17  Tom de Vries  <tdevries@suse.de>
909         * dwarf.c (struct dwarf_data): Add altlink field.
910         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
911         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
912         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
913         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
914         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
915         * xcoff.c (xcoff_add): Same.
917 2019-01-17  Tom de Vries  <tdevries@suse.de>
919         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
920         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
921         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
922         argument to backtrace_dwarf_add call.
923         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
924         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
925         * xcoff.c (xcoff_add): Same.
927 2019-01-17  Tom de Vries  <tdevries@suse.de>
929         * elf.c (elf_add): Add and handle with_buildid_data and
930         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
931         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
933 2019-01-16  Tom de Vries  <tdevries@suse.de>
935         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
936         of ...
937         (read_referenced_name): ... here, and ...
938         (read_function_entry): ... here.
940 2019-01-16  Tom de Vries  <tdevries@suse.de>
942         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
943         name.
944         (read_function_entry): Same.  Don't allow name found via
945         DW_AT_abstract_origin or case DW_AT_specification to override linkage
946         name.
948 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
950         PR other/16615
952         * backtrace.h: Mechanically replace "can not" with "cannot".
954 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
956         Update copyright years.
958 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
960         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
961         in sed pattern.
962         * Makefile.in: Regenerate.
964 2018-12-28  Tom de Vries  <tdevries@suse.de>
966         * dwarf.c (build_address_map): Reuse unused units.
968 2018-12-28  Tom de Vries  <tdevries@suse.de>
970         * dwarf.c (build_address_map): Simplify by removing local variable
971         abbrevs.
973 2018-12-28  Ian Lance Taylor  <iant@golang.org>
974             Tom de Vries  <tdevries@suse.de>
976         PR libbacktrace/88063
977         * dwarf.c (free_unit_addrs_vector): Remove.
978         (build_address_map): Keep track of allocated units in vector.  Free
979         allocated units and corresponding abbrevs upon failure.  Remove now
980         redundant call to free_unit_addrs_vector.  Free addrs vector upon
981         failure.  Free allocated unit vector.
983 2018-12-28  Tom de Vries  <tdevries@suse.de>
985         * dwarf.c (build_address_map): Free addrs vector upon failure.
987 2018-12-14  Tom de Vries  <tdevries@suse.de>
989         PR testsuite/88491
990         * allocfail.sh: Remove "set -o pipefail".
992 2018-12-12  Tom de Vries  <tdevries@suse.de>
994         * Makefile.am (TESTS): Add allocfail.sh.
995         (check_PROGRAMS): Add allocfail.
996         * Makefile.in: Regenerate.
997         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
998         Include alloc.c.
999         * allocfail.c: New file.
1000         * allocfail.sh: New file.
1002 2018-11-30  Tom de Vries  <tdevries@suse.de>
1004         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
1005         test_xcoff_64, test_pecoff and test_unknown.
1006         * Makefile.in: Regenerate.
1007         * test_format.c: New file.
1009 2018-11-30  Tom de Vries  <tdevries@suse.de>
1011         * Makefile.am : Add _with_alloc version for each test in
1012         check_PROGRAMS.
1013         * Makefile.in: Regenerate.
1015 2018-11-30  Tom de Vries  <tdevries@suse.de>
1017         * internal.h (backtrace_vector_free): New static inline fuction,
1018         factored out of ...
1019         * dwarf.c (read_line_info): ... here.
1021 2018-11-28  Tom de Vries  <tdevries@suse.de>
1023         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
1024         failure.
1026 2018-11-27  Tom de Vries  <tdevries@suse.de>
1028         * mmap.c (backtrace_vector_release): Same.
1029         * unittest.c (test1): Add check.
1031 2018-11-27  Tom de Vries  <tdevries@suse.de>
1033         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
1034         instead of realloc.
1035         * Makefile.am (check_PROGRAMS): Add unittest.
1036         * Makefile.in: Regenerate.
1037         * unittest.c: New file.
1039 2018-11-22  Tom de Vries  <tdevries@suse.de>
1041         * dwarf.c (read_initial_length): Factor out of ...
1042         (build_address_map, read_line_info): ... here.
1044 2018-11-21  Tom de Vries  <tdevries@suse.de>
1046         * dwarf.c (read_string): Factor out of ...
1047         (read_attribute, read_line_header, read_line_program): ... here.
1049 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
1051         PR bootstrap/82856
1052         * Makefile.am: Include multilib.am.
1053         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
1054         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
1056 2018-10-05  Ian Lance Taylor  <iant@golang.org>
1058         PR libbacktrace/87529
1059         * backtrace.h: Document that backtrace_create_state should be
1060         called only once.
1062 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
1064         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
1065         * Makefile.in: Regenerate.
1066         * config.h.in: Likewise.
1067         * configure: Likewise.
1069 2018-08-01  Tony Reix  <tony.reix@atos.net>
1071         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
1072         (struct xcoff_func, struct xcoff_func_vector): New structs.
1073         (xcoff_syminfo): Drop leading dot from symbol name.
1074         (xcoff_line_compare, xcoff_line_search): Remove.
1075         (xcoff_func_compare, xcoff_func_search): New static functions.
1076         (xcoff_lookup_pc): Search function table.
1077         (xcoff_add_line, xcoff_process_linenos): Remove.
1078         (xcoff_initialize_fileline): Build function table.
1080 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
1082         PR other/86198
1083         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
1084         checking up to 36 bytes.
1086 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1088         * configure: Regenerated.
1090 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
1092         * configure: Regenerated.
1094 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1096         * backtrace.c: Revert last two changes.  Don't call mmap
1097         directly.
1099 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1101         * backtrace.c: Include backtrace-supported.h before checking
1102         BACKTRACE_USES_MALLOC.
1104 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1106         * backtrace.c (backtrace_full): When testing whether we can
1107         allocate memory, call mmap directly, and munmap the memory.
1109 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
1111         PR other/85161
1112         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
1113         big endian, only use 32-bit loads if endianity macros are predefined
1114         and indicate big or little endian.
1116 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1118         PR target/84148
1119         * configure: Regenerate.
1121 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
1123         PR other/82368
1124         * elf.c (SHT_PROGBITS): Undefine and define.
1126 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
1128         PR other/82368
1129         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
1130         (struct elf_ppc64_opd_data): New type.
1131         (elf_initialize_syminfo): Add opd argument, handle symbols
1132         pointing into the PowerPC64 ELFv1 .opd section.
1133         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
1134         to structure with .opd data to elf_initialize_syminfo.
1136 2018-01-31  Ian Lance Taylor  <iant@golang.org>
1138         * elf.c (elf_add): Close descriptor if we use a debugfile.
1139         * btest.c (check_open_files): New static function.
1140         (main): Call check_open_files.
1142 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1144         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
1145         desired CRC is zero.
1146         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
1148 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1150         * pecoff.c (coff_add): Only release syms_view if it is valid.
1152 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1154         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
1156 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1158         * pecoff.c (coff_add): Use coff_read4, not memcpy.
1160 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1162         PR other/68239
1163         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
1164         on the free list.
1166 2018-01-19  Tony Reix  <tony.reix@atos.net>
1168         * xcoff.c (xcoff_incl_compare): New function.
1169         (xcoff_incl_search): New function.
1170         (xcoff_process_linenos): Use bsearch to find include file.
1171         (xcoff_initialize_fileline): Sort include file information.
1173 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1175         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1176         288.
1177         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1178         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1179         (elf_zlib_default_table): Update.
1180         (elf_zlib_default_dist_table): New static array.
1181         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1182         for block type 1.
1183         * ztest.c (struct zlib_test): Add uncompressed_len.
1184         (tests): Initialize uncompressed_len field.  Add new test case.
1185         (test_samples): Use uncompressed_len field.
1187 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1189         Update copyright years.
1191 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1193         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1194         * aclocal.m4: Regenerate.
1195         * Makefile.in: Likewise.
1196         * configure: Likewise.
1198 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1200         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1201         zlib uncompress function.
1203 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1205         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1206         Read a four byte integer.
1207         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1208         boundary before ever calling elf_zlib_fetch.
1209         * ztest.c (test_large): Simplify print statements a bit.
1211 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1213         * ztest.c: #include <errno.h>.
1214         (TEST_TIMING): Don't define, don't test.
1215         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1216         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1217         (ZLIB_CLOCK_GETTIME_ARG): Define.
1218         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1219         * Makefile.am: Likewise.
1220         * configure, Makefile.in: Rebuild.
1222 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1224         PR other/67165
1225         * Makefile.am: Append the content of clock_gettime_link to
1226         ztest_LDADD.
1227         * configure.ac: Test for the case that clock_gettime is in librt.
1228         * Makefile.in: Regenerate.
1229         * configure: Likewise.
1231         PR other/67165
1232         * configure.ac: Check for clock_gettime.
1233         * config.h.in: Regenerate.
1234         * configure: Likewise.
1235         * ztest.c (average_time, test_large): Conditionalize test timing
1236         on clock_gettime availability.
1238 2017-09-29  Tony Reix  <tony.reix@atos.net>
1240         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1241         (STYP_DWARF, SSUBTYP_DW*): Define.
1242         (enum dwarf_section): Define.
1243         (struct dwsect_info): Define.
1244         (xcoff_add): Look for DWARF sections, pass them to
1245         backtrace_dwarf_add.
1247 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1249         PR other/67165
1250         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1251         (unlikely): Define.
1252         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1253         (b_elf_chdr): Define type.
1254         (enum debug_section): Add ZDEBUG_xxx values.
1255         (debug_section_names): Add names for new sections.
1256         (struct debug_section_info): Add compressed field.
1257         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1258         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1259         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1260         (HUFFMAN_SECONDARY_SHIFT): Define.
1261         (ZDEBUG_TABLE_SIZE): Define.
1262         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1263         (final_next_secondary): New static variable if
1264         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1265         (elf_zlib_inflate_table): New static function.
1266         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1267         function to produce fixed Huffman table.
1268         (elf_zlib_default_table): New static variable.
1269         (elf_zlib_inflate): New static function.
1270         (elf_zlib_verify_checksum): Likewise.
1271         (elf_zlib_inflate_and_verify): Likewise.
1272         (elf_uncompress_zdebug): Likewise.
1273         (elf_uncompress_chdr): Likewise.
1274         (backtrace_uncompress_zdebug): New extern function.
1275         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1276         sections, and uncompress them.
1277         * internal.h (backtrace_compress_zdebug): Declare.
1278         * ztest.c: New file.
1279         * configure.ac: Check for -lz and check whether the linker
1280         supports --compress-debug-sections.
1281         * Makefile.am (ztest_SOURCES): New variable.
1282         (ztest_CFLAGS, ztest_LDADD): New variables.
1283         (check_PROGRAMS): Add ztest.
1284         (ctestg_SOURCES): New variable.
1285         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1286         (ctesta_SOURCES): New variable.
1287         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1288         (check_PROGRAMS): Add ctestg and ctesta.
1289         * configure, config.h.in, Makefile.in: Rebuild.
1291 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1293         PR sanitizer/77631
1294         * configure.ac: Check for lstat and readlink.
1295         * elf.c (lstat, readlink): Provide dummy versions if real versions
1296         are not available.
1297         * configure, config.h.in: Rebuild.
1299 2017-09-21  Ian Lance Taylor  <iant@google.com>
1301         PR go/82284
1302         * elf.c (backtrace_initialize): Set pd.exe_filename.
1304 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1305             Denis Khalikov  <d.khalikov@partner.samsung.com>
1307         PR sanitizer/77631
1308         Support for external debug info.
1309         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1310         (S_ISLNK): Define if not defined.
1311         (xstrnlen): Define if strnlen is not available.
1312         (b_elf_note): Define type.
1313         (NT_GNU_BUILD_ID): Define macro.
1314         (elf_crc32, elf_crc32_file): New static functions.
1315         (elf_is_symlink, elf_readlink): New static functions.
1316         (elf_open_debugfile_by_buildid): New static function.
1317         (elf_try_debugfile): New static function.
1318         (elf_find_debugfile_by_debuglink): New static function.
1319         (elf_open_debugfile_by_debuglink): New static function.
1320         (elf_add): Add filename and debuginfo parameters.  Adjust all
1321         callers.  Look for external debug info notes, and try to fetch
1322         debug info from external file.
1323         (struct phdr_data): Add exe_filename field.
1324         (phdr_callback): Pass filename to elf_add.
1325         (backtrace_initialize): Add filename parameter.
1326         * internal.h (backtrace_initialize): Add filename parameter.
1327         * fileline.c (fileline_initialize): Pass filename to
1328         backtrace_initialize.
1329         * pecoff.c (fileline_initialize): Add unused filename parameter.
1330         * unknown.c (fileline_initialize): Likewise.
1331         * xcoff.c (fileline_initialize): Likewise.
1332         * configure.ac: Check for objcopy --add-gnu-debuglink.
1333         * Makefile.am (dtest): New test target.
1334         * configure, Makefile.in: Rebuild.
1336 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1338         PR other/81096
1339         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1340         * Makefile.in: Regenerate.
1342 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1344         PR other/81096
1345         * libbacktrace/Makefile.in
1346         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1348 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1350         PR bootstrap/81638
1351         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1353 2017-07-28  Tony Reix  <tony.reix@atos.net>
1355         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1357 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1359         * fileline.c (fileline_initialize): Print pid_t as long.
1361 2017-07-26  Tony Reix  <tony.reix@atos.net>
1363         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1364         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1365         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1366         * configure, config.h.in: Regenerate.
1368 2017-07-21  Tony Reix  <tony.reix@atos.net>
1370         * filetype.awk: Add AIX XCOFF type detection.
1371         * configure.ac: Recognize xcoff format.
1372         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1373         * fileline.c: Include <unistd.h>.
1374         (fileline_initialize): Add case for AIX procfs.
1375         * xcoff.c: New file.
1376         * configure, Makefile.in: Rebuild.
1378 2017-06-21  Richard Biener  <rguenther@suse.de>
1380         * configure.ac: Add AC_SYS_LARGEFILE.
1381         * config.h.in: Regenerate.
1382         * configure: Likewise.
1384 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1386         * elf.c (backtrace_initialize): Always set *fileline_fn.
1387         * ttest.c: New file.
1388         * btest.c: Move support functions into testlib.c.  Change calls to
1389         check to pass file name.
1390         * testlib.c: New file, copied from (part of) btest.c.
1391         * testlib.h: New file, declarations for testlib.c.
1392         * edtest.c: Use testlib.h and testlib.c.
1393         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1394         * Makefile.am (btest_SOURCES): Add testlib.c.
1395         (edtest_SOURCES): Likewise.
1396         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1397         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1398         * configure, Makefile.in: Rebuild.
1400 2017-05-19  Than McIntosh  <thanm@google.com>
1402         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1403         (read_line_header): Don't allocate dirs if dirs_count == 0.
1404         * edtest.c: New file.
1405         * edtest2.c: New file.
1406         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1407         (check_PROGRAMS): Add edtest.
1408         (edtest2_build.c, gen_edtest2_build): New targets.
1409         * Makefile.in: Rebuild.
1411 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1413         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1414         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1416 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1418         Update copyright years.
1420 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1422         * configure: Regenerate.
1424 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1426         * all: Remove meaningless trailing whitespace.
1428 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1430         PR target/71161
1431         * elf.c (phdr_callback) [__i386__]: Add
1432         __attribute__((__force_align_arg_pointer__)).
1434 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1436         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1437         avoid possible crash.
1438         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1439         missing debug info anymore.
1441 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1443         * mmap.c (MAP_FAILED): Define if not defined.
1445 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1447         Update copyright years.
1449 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1451         * configure.ac: Specify that DJGPP do not have mmap
1452         even when sys/mman.h exists.
1453         * configure: Regenerate
1455 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1457         PR libgfortran/68115
1458         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1459         * configure: Regenerate.
1460         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1461         to void.
1463 2015-09-17  Ian Lance Taylor  <iant@google.com>
1465         * posix.c (backtrace_open): Cast second argument of open() to int.
1467 2015-09-11  Ian Lance Taylor  <iant@google.com>
1469         * Makefile.am (backtrace.lo): Depend on internal.h.
1470         (sort.lo, stest.lo): Add explicit dependencies.
1471         * Makefile.in: Rebuild.
1473 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1475         * backtrace.c: #include <sys/types.h>.
1477 2015-09-08  Ian Lance Taylor  <iant@google.com>
1479         PR other/67457
1480         * backtrace.c: #include "internal.h".
1481         (struct backtrace_data): Add can_alloc field.
1482         (unwind): If can_alloc is false, don't try to get file/line
1483         information.
1484         (backtrace_full): Set can_alloc field in bdata.
1485         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1486         NULL.
1487         * mmap.c (backtrace_alloc): Likewise.
1488         * internal.h: Update comments for backtrace_alloc and
1489         backtrace_free.
1491 2015-09-08  Ian Lance Taylor  <iant@google.com>
1493         PR other/67457
1494         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1496 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1498         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1499         * configure: Regenerate.
1501 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1503         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1504         Remove setting PIC_FLAG when building as target library.
1505         * configure: Regenerate.
1507 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1509         * configure.ac: Only compile with -fPIC if the target
1510         supports it.
1511         * configure: Regenerate.
1513 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1515         * configure.ac: Set have_mmap to no on spu-*-* targets.
1516         * configure: Regenerate.
1518 2015-08-13  Ian Lance Taylor  <iant@google.com>
1520         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1521         Change all callers.
1523 2015-06-11  Martin Sebor  <msebor@redhat.com>
1525         PR sanitizer/65479
1526         * dwarf.c (struct line): Add new field idx.
1527         (line_compare): Use it.
1528         (add_line): Set it.
1529         (read_line_info): Reset it.
1531 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1533         * pecoff.c: New file.
1534         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1535         * Makefile.in: Regenerate.
1536         * filetype.awk: Detect pecoff.
1537         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1538         Add pecoff.
1539         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1540         true.
1541         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1542         * configure: Regenerate.
1543         * pecoff.c: New file.
1545 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1547         * Makefile.in: Regenerated with automake-1.11.6.
1548         * aclocal.m4: Likewise.
1549         * configure: Likewise.
1551 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1553         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1554         * configure: Regenerate.
1556 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1558         Update copyright years.
1560 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1562         PR bootstrap/63784
1563         * configure: Regenerated.
1565 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1567         * ChangeLog.jit: New.
1569 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1571         PR target/63610
1572         * configure: Regenerate.
1574 2014-10-23  Ian Lance Taylor  <iant@google.com>
1576         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1577         Fix to return void *.
1579 2014-05-08  Ian Lance Taylor  <iant@google.com>
1581         * mmap.c (backtrace_free): If freeing a large aligned block of
1582         memory, call munmap rather than holding onto it.
1583         (backtrace_vector_grow): When growing a vector, double the number
1584         of pages requested.  When releasing the old version of a grown
1585         vector, pass the correct size to backtrace_free.
1587 2014-03-07  Ian Lance Taylor  <iant@google.com>
1589         * sort.c (backtrace_qsort): Use middle element as pivot.
1591 2014-03-06  Ian Lance Taylor  <iant@google.com>
1593         * sort.c: New file.
1594         * stest.c: New file.
1595         * internal.h (backtrace_qsort): Declare.
1596         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1597         (read_line_info, read_function_entry): Likewise.
1598         (read_function_info, build_dwarf_data): Likewise.
1599         * elf.c (elf_initialize_syminfo): Likewise.
1600         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1601         (stest_SOURCES, stest_LDADD): Define.
1602         (check_PROGRAMS): Add stest.
1604 2014-02-07  Misty De Meo  <misty@brew.sh>
1606         PR target/58710
1607         * configure.ac: Use AC_LINK_IFELSE in check for
1608         _Unwind_GetIPInfo.
1609         * configure: Regenerate.
1611 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1613         Update copyright years
1615 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1617         * elf.c (ET_DYN): Undefine and define again.
1618         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1619         return early -1 without closing the descriptor.
1620         (struct phdr_data): Add exe_descriptor.
1621         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1622         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1623         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1624         call to elf_add.
1625         (backtrace_initialize): Adjust call to elf_add.  If it returns
1626         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1628 2013-12-05  Ian Lance Taylor  <iant@google.com>
1630         * alloc.c (backtrace_vector_finish): Add error_callback and data
1631         parameters.  Call backtrace_vector_release.  Return address base.
1632         * mmap.c (backtrace_vector_finish): Add error_callback and data
1633         parameters.  Return address base.
1634         * dwarf.c (read_function_info): Get new address base from
1635         backtrace_vector_finish.
1636         * internal.h (backtrace_vector_finish): Update declaration.
1638 2013-11-27  Ian Lance Taylor  <iant@google.com>
1640         * dwarf.c (find_address_ranges): New static function, broken out
1641         of build_address_map.
1642         (build_address_map): Call it.
1643         * btest.c (check): Check for missing filename or function, rather
1644         than crashing.
1645         (f3): Check that enough frames were returned.
1647 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1649         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1650         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1651         last argument.
1652         * btest.c (struct symdata): Add size field.
1653         (callback_three): Add symsize argument.  Copy it to the data->size
1654         field.
1655         (f23): Set symdata.size to 0.
1656         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1657         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1658         values.
1660         * atomic.c: Include sys/types.h.
1662 2013-11-18  Ian Lance Taylor  <iant@google.com>
1664         * configure.ac: Check for support of __atomic extensions.
1665         * internal.h: Declare or #define atomic functions for use in
1666         backtrace code.
1667         * atomic.c: New file.
1668         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1669         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1670         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1671         (backtrace_initialize): Likewise.
1672         * fileline.c (fileline_initialize): Likewise.
1673         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1674         * configure, config.h.in, Makefile.in: Rebuild.
1676 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1678         * elf.c (SHN_UNDEF): Define.
1679         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1680         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1681         (elf_add): Adjust caller.
1683         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1685 2013-11-16  Ian Lance Taylor  <iant@google.com>
1687         * backtrace.h (backtrace_create_state): Correct comment about
1688         threading.
1690 2013-11-15  Ian Lance Taylor  <iant@google.com>
1692         * backtrace.h (backtrace_syminfo): Update comment and parameter
1693         name to take any address, not just a PC value.
1694         * elf.c (STT_OBJECT): Define.
1695         (elf_nosyms): Rename parameter pc to addr.
1696         (elf_symbol_search): Rename local variable pc to addr.
1697         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1698         (elf_syminfo): Rename parameter pc to addr.
1699         * btest.c (global): New global variable.
1700         (test5): New test.
1701         (main): Call test5.
1703 2013-10-17  Ian Lance Taylor  <iant@google.com>
1705         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1706         is missing.
1708 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1710         * configure.ac: Add --enable-host-shared, setting up
1711         pre-existing PIC_FLAG variable within Makefile.am et al.
1712         * configure: Regenerate.
1714 2013-09-20  Alan Modra  <amodra@gmail.com>
1716         * configure: Regenerate.
1718 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1720         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1722 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1724         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1725         dl_iterate_phdr callbacks.
1727 2013-03-25  Ian Lance Taylor  <iant@google.com>
1729         * alloc.c: #include <sys/types.h>.
1730         * mmap.c: Likewise.
1732 2013-01-31  Ian Lance Taylor  <iant@google.com>
1734         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1735         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1737 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1739         PR other/56076
1740         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1741         attribute was not seen.
1743 2013-01-16  Ian Lance Taylor  <iant@google.com>
1745         * dwarf.c (struct unit): Add filename and abs_filename fields.
1746         (build_address_map): Set new fields when reading unit.
1747         (dwarf_lookup_pc): If we don't find an entry in the line table,
1748         just return the main file name.
1750 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1752         Update copyright years.
1754 2013-01-01  Ian Lance Taylor  <iant@google.com>
1756         PR bootstrap/54834
1757         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1758         $(MULTIBUILDTOP)/../../gcc/include.
1759         * Makefile.in: Rebuild.
1761 2013-01-01  Ian Lance Taylor  <iant@google.com>
1763         PR other/55536
1764         * mmap.c (backtrace_alloc): Don't call sync functions if not
1765         threaded.
1766         (backtrace_free): Likewise.
1768 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1770         * mmapio.c: Define MAP_FAILED if not defined.
1772 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1774         PR bootstrap/54926
1775         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1776         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1777         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1778         accepts it.
1779         * Makefile.in: Regenerated.
1780         * configure: Regenerated.
1782 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1784         PR bootstrap/54926
1785         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1786         * Makefile.in: Regenerated.
1788 2012-11-20  Ian Lance Taylor  <iant@google.com>
1790         * dwarf.c (read_attribute): Always clear val.
1792 2012-11-13  Ian Lance Taylor  <iant@google.com>
1794         PR other/55312
1795         * configure.ac: Only add -Werror if building a target library.
1796         * configure: Rebuild.
1798 2012-11-12  Ian Lance Taylor  <iant@google.com>
1799             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1800             Gerald Pfeifer  <gerald@pfeifer.com>
1802         * configure.ac: Check for getexecname.
1803         * fileline.c: #include <errno.h>.  Define getexecname if not
1804         available.
1805         (fileline_initialize): Try to find the executable in a few
1806         different ways.
1807         * print.c (error_callback): Only print the filename if it came
1808         from the backtrace state.
1809         * configure, config.h.in: Rebuild.
1811 2012-10-29  Ian Lance Taylor  <iant@google.com>
1813         * mmap.c (backtrace_vector_release): Correct last patch: add
1814         aligned, not size.
1816 2012-10-29  Ian Lance Taylor  <iant@google.com>
1818         * mmap.c (backtrace_vector_release): Make sure freed block is
1819         aligned on 8-byte boundary.
1821 2012-10-26  Ian Lance Taylor  <iant@google.com>
1823         PR other/55087
1824         * posix.c (backtrace_open): Add does_not_exist parameter.
1825         * elf.c (phdr_callback): Do not warn if shared library could not
1826         be opened.
1827         * fileline.c (fileline_initialize): Update calls to
1828         backtrace_open.
1829         * internal.h (backtrace_open): Update declaration.
1831 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
1833         PR target/55061
1834         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1835         * configure: Regenerate.
1837 2012-10-24  Ian Lance Taylor  <iant@google.com>
1839         PR target/55061
1840         * configure.ac: Check whether -funwind-tables option works.
1841         * configure: Rebuild.
1843 2012-10-11  Ian Lance Taylor  <iant@google.com>
1845         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1846         * configure: Rebuild.
1848 2012-10-10  Ian Lance Taylor  <iant@google.com>
1850         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1851         lower case.
1853 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
1855         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1857 2012-10-09  Ian Lance Taylor  <iant@google.com>
1859         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1860         (backtrace_dwarf_add): Likewise.
1862 2012-10-09  Ian Lance Taylor  <iant@google.com>
1864         Add support for tracing through shared libraries.
1865         * configure.ac: Check for link.h and dl_iterate_phdr.
1866         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
1867         ELF macros before #defining them.
1868         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1869         dl_iterate_phdr.
1870         (struct elf_syminfo_data): Add next field.
1871         (elf_initialize_syminfo): Initialize next field.
1872         (elf_add_syminfo_data): New static function.
1873         (elf_add): New static function, broken out of
1874         backtrace_initialize.  Call backtrace_dwarf_add instead of
1875         backtrace_dwarf_initialize.
1876         (struct phdr_data): Define.
1877         (phdr_callback): New static function.
1878         (backtrace_initialize): Call elf_add.
1879         * dwarf.c (struct dwarf_data): Add next and base_address fields.
1880         (add_unit_addr): Add base_address parameter.  Change all callers.
1881         (add_unit_ranges, build_address_map): Likewise.
1882         (add_line): Add ddata parameter.  Change all callers.
1883         (read_line_program, add_function_range): Likewise.
1884         (dwarf_lookup_pc): New static function, broken out of
1885         dwarf_fileline.
1886         (dwarf_fileline): Call dwarf_lookup_pc.
1887         (build_dwarf_data): New static function.
1888         (backtrace_dwarf_add): New function.
1889         (backtrace_dwarf_initialize): Remove.
1890         * internal.h (backtrace_dwarf_initialize): Don't declare.
1891         (backtrace_dwarf_add): Declare.
1892         * configure, config.h.in: Rebuild.
1894 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
1896         * btest.c (f23): Avoid uninitialized variable warning.
1898 2012-10-04  Ian Lance Taylor  <iant@google.com>
1900         * dwarf.c: If the system header files do not declare strnlen,
1901         provide our own version.
1903 2012-10-03  Ian Lance Taylor  <iant@google.com>
1905         * dwarf.c (read_uleb128): Fix overflow test.
1906         (read_sleb128): Likewise.
1907         (build_address_map): Don't change unit_buf.start.
1909 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
1911         PR other/54761
1912         * configure.ac (EXTRA_FLAGS): New.
1913         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1914         * configure, Makefile.in: Regenerate.
1916 2012-09-29  Ian Lance Taylor  <iant@google.com>
1918         PR other/54749
1919         * fileline.c (fileline_initialize): Pass errnum as -1 when
1920         reporting that we could not read executable information after a
1921         previous failure.
1923 2012-09-27  Ian Lance Taylor  <iant@google.com>
1925         PR bootstrap/54732
1926         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1927         * Makefile.am: Add dependencies for all objects.
1928         * configure, aclocal.m4, Makefile.in: Rebuild.
1930 2012-09-27  Ian Lance Taylor  <iant@google.com>
1932         PR other/54726
1933         * elf.c (backtrace_initialize): Set *fileln_fn, not
1934         state->fileln_fn.
1936 2012-09-19  Ian Lance Taylor  <iant@google.com>
1938         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1939         as a target library.
1940         * configure: Rebuild.
1942 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1943             Ian Lance Taylor  <iant@google.com>
1945         * configure.ac (GCC_HEADER_STDINT): Invoke.
1946         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1947         * btest.c: Don't include <stdint.h>.
1948         * dwarf.c: Likewise.
1949         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1951 2012-09-18  Ian Lance Taylor  <iant@google.com>
1953         PR bootstrap/54623
1954         * Makefile.am (AM_CPPFLAGS): Define.
1955         (AM_CFLAGS): Remove -I options.
1956         * Makefile.in: Rebuild.
1958 2012-09-18  Ian Lance Taylor  <iant@google.com>
1960         * posix.c (O_BINARY): Define if not defined.
1961         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
1962         HAVE_FCNTL is defined.
1963         * configure.ac: Test for the fcntl function.
1964         * configure, config.h.in: Rebuild.
1966 2012-09-18  Ian Lance Taylor  <iant@google.com>
1968         * btest.c (test1, test2, test3, test4): Add the unused attribute.
1970 2012-09-18  Ian Lance Taylor  <iant@google.com>
1972         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1974 2012-09-18  Ian Lance Taylor  <iant@google.com>
1976         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1977         * mmapio.c: Don't define _GNU_SOURCE.
1978         * configure, config.h.in: Rebuild.
1980 2012-09-18  Ian Lance Taylor  <iant@google.com>
1982         * configure.ac: Check whether strnlen is declared.
1983         * dwarf.c: Declare strnlen if not declared.
1984         * configure, config.h.in: Rebuild.
1986 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1988         * fileline.c: Include <stdlib.h>.
1989         * mmap.c: Likewise.
1991 2012-09-17  Ian Lance Taylor  <iant@google.com>
1993         PR bootstrap/54611
1994         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
1995         parameter.
1997 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
1999         PR bootstrap/54611
2000         * nounwind.c (backtrace_simple): Add state parameter.
2002 2012-09-17  Ian Lance Taylor  <iant@google.com>
2004         PR bootstrap/54609
2005         * unknown.c (unknown_fileline): Add state parameter, remove
2006         fileline_data parameter, name error_callback parameter.
2007         (backtrace_initialize): Add state parameter.
2009 2012-09-17  Ian Lance Taylor  <iant@google.com>
2011         * Initial implementation.
2013 Copyright (C) 2012-2023 Free Software Foundation, Inc.
2015 Copying and distribution of this file, with or without modification,
2016 are permitted in any medium without royalty provided the copyright
2017 notice and this notice are preserved.