gccrs: Add new check for contains_associated_types
[official-gcc.git] / libbacktrace / ChangeLog
blob73740ec3679314058e88b7517d1b9567c782304d
1 2023-01-20  Ian Lance Taylor  <iant@golang.org>
3         * dwarf.c (struct function_addrs): Change low and high fields to
4         uintptr_t.
5         (struct unit_addrs): Likewise.
6         (resolve_addr_index): Change address parameter to uintptr_t*.
7         (add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
8         (add_function_range): Likewise.
9         (struct pcrange): Change lowpc and highpc fields to uintptr_t.
10         (add_low_high_range): Change add_range lowpc and highpc parameters
11         to uintptr_t.
12         (add_ranges_from_ranges): Likewise.
13         (add_ranges_from_rnglists): Likewise.
14         (add_low_high_range): Chnage lowpc and highpc variables to
15         uintpr_t.
16         (add_ranges_from_rnglists): Change some local variables to
17         uintptr_t.
18         (add_ranges_from_ranges): Change base parameter to uintptr_t.
19         (add_ranges_from_rnglists): Likewise.
20         (read_function_entry): Likewise.
21         (resolve_addr_index): Add explicit casts to uintptr_t.
22         (update_pcrange): Likewise.
23         (add_ranges_from_ranges): Likewise.
24         (add_ranges_from_rnglists): Likewise.
25         (read_function_entry): Likewise.
27 2023-01-17  Martin Liska  <mliska@suse.cz>
29         * Makefile.in: Regenerate.
31 2023-01-06  Ian Lance Taylor  <iant@golang.org>
33         PR libbacktrace/108297
34         * configure.ac: Test whether linker supports --build-id.
35         * Makefile.am: Only run --build-id tests if supported.
36         * configure, Makefile.in: Regenerate.
38 2022-12-17  Ian Lance Taylor  <iant@golang.org>
40         * elf.c (elf_fetch_backward_init): New static function.
41         (ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
42         literal size.
43         (ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
44         (elf_zstd_read_huff): Use elf_fetch_backward_init.
45         (elf_zstd_read_literals): New static function.
46         (ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
47         (struct elf_zstd_literals): Don't define.
48         (elf_zstd_literal_output): Remove static function.
49         (elf_zstd_decompress): Use elf_fetch_backward_init and
50         elf_zstd_read_literals.  Rewrite literal copying.<
52 2022-12-10  Ian Lance Taylor  <iant@golang.org>
54         * elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
55         (ZSTD_ENCODE_BASELINE_BITS): Define.
56         (ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
57         (elf_zstd_literal_length_base): New static const array.
58         (elf_zstd_match_length_base): Likewise.
59         (struct elf_zstd_fse_baseline_entry): Define.
60         (elf_zstd_make_literal_baseline_fse): New static function.
61         (elf_zstd_make_offset_baseline_fse): Likewise.
62         (elf_zstd_make_match_baseline_fse): Likewise.
63         (print_table, main): Use elf_zstd_fse_baseline_entry.
64         (elf_zstd_lit_table, elf_zstd_match_table): Likewise.
65         (elf_zstd_offset_table): Likewise.
66         (struct elf_zstd_seq_decode): Likewise.  Remove use_rle and rle
67         fields.
68         (elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
69         taking a conversion function.  Convert RLE to FSE.
70         (elf_zstd_literal_length_baseline): Remove.
71         (elf_zstd_literal_length_bits): Remove.
72         (elf_zstd_match_length_baseline): Remove.
73         (elf_zstd_match_length_bits): Remove.
74         (elf_zstd_decompress): Use elf_zstd_fse_baseline_entry.  Rewrite
75         and simplify main loop.
77 2022-12-08  Ian Lance Taylor  <iant@golang.org>
79         * configure.ac: Check for zstd library and
80         --compress-debug-sections=zstd linker option.
81         * Makefile.am (zstdtest_*): New targets.
82         (zstdtest_alloc_*, ctestzstd_*): New targets.
83         (BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
84         appropriate.
85         * elf.c (ELFCOMPRESS_ZSTD): Define.
86         (elf_fetch_bits): Rename from elf_zlib_fetch.  Update uses.
87         (elf_fetch_bits_backward): New static function.
88         (ZLIB_HUFFMAN_*): Rename from HUFFMAN_*.  Update uses.
89         (ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*.  Update uses.
90         (ZSTD_TABLE_*): Define.
91         (struct elf_zstd_fse_entry): Define.
92         (elf_zstd_read_fse): New static function.
93         (elf_zstd_build_fse): Likewise.
94         (lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
95         (match, offset, next, print_table, main): Likewise.
96         (elf_zstd_lit_table): New static const array.
97         (elf_zstd_match_table, elf_zstd_offset_table): Likewise.
98         (elf_zstd_read_huff): New static function.
99         (struct elf_zstd_seq_decode): Define.
100         (elf_zstd_unpack_seq_decode): New static function.
101         (ZSTD_LIT_*): Define.
102         (struct elf_zstd_literals): Define.
103         (elf_zstd_literal_output): New static function.
104         (ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
105         (elf_zstd_literal_length_baseline): New static const array.
106         (elf_zstd_literal_length_bits): Likewise.
107         (ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
108         (elf_zstd_match_length_baseline): New static const array.
109         (elf_zstd_match_length_bits): Likewise.
110         (elf_zstd_decompress): New static function.
111         (ZDEBUG_TABLE_SIZE): New definition.
112         (elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
113         (backtrace_uncompress_zstd): New function.
114         (elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
115         * internal.h (backtrace_uncompress_zstd): Declare.
116         * zstdtest.c: New file.
117         * configure, config.h.in, Makefile.in: Regenerate.
119 2022-10-12  Martin Liska  <mliska@suse.cz>
121         * configure: Regenerate.
123 2022-10-11  Olivier Hainque  <hainque@adacore.com>
124             Olivier Hainque  <hainque@adacore.com>
126         * configure: Regenerate.
128 2022-07-08  Ian Lance Taylor  <iant@golang.org>
130         * configure.ac: Check for sys/link.h.  Use either link.h or
131         sys/link.h when checking for dl_iterate_phdr.
132         * elf.c: Include sys/link.h if available.
133         * configure, config.h.in: Regenerate.
135 2022-07-07  Ian Lance Taylor  <iant@golang.org>
137         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
138         loop if we can't find debug info for one shared library.
140 2022-07-07  Ian Lance Taylor  <iant@golang.org>
142         * Makefile.am (MAKETESTS): New variable split out of TESTS.
143         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
144         * Makefile.in: Regenerate.
146 2022-06-27  Ian Lance Taylor  <iant@golang.org>
148         * configure.ac: Use grep instead of fgrep.
149         * configure, Makefile.in: Regenerate.
151 2022-05-28  Ian Lance Taylor  <iant@golang.org>
153         PR libbacktrace/105721
154         * README: Update.
156 2022-04-05  Ian Lance Taylor  <iant@golang.org>
158         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
159         uncompressed block.
161 2022-02-17  Ian Lance Taylor  <iant@golang.org>
163         * dwarf.c (find_address_ranges): Handle skeleton units.
164         (read_function_entry): Likewise.
166 2022-02-16  Ian Lance Taylor  <iant@golang.org>
168         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
170 2022-02-03  David Seifert  <soap@gentoo.org>
171             Jakub Jelinek  <jakub@redhat.com>
173         * configure.ac: Support --disable-werror.
174         * configure: Regenerate.
176 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
178         PR libbacktrace/103822
179         * Makefile.am: Fix newline.
180         * Makefile.in: Regenerate.
182 2021-11-12  Martin Liska  <mliska@suse.cz>
184         PR libbacktrace/103167
185         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
186         (elf_uncompress_lzma): Likewise.
187         * xztest.c (test_samples): memcpy only if v > 0.
189 2021-10-22  Martin Liska  <mliska@suse.cz>
191         PR testsuite/102742
192         * btest.c (MIN_DESCRIPTOR): New.
193         (MAX_DESCRIPTOR): Likewise.
194         (check_available_files): Likewise.
195         (check_open_files): Check only file descriptors that
196         were not available at the entry.
197         (main): Call check_available_files.
199 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
201         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
202         output with LANG=C.
204 2021-06-28  ClĂ©ment Chigot  <clement.chigot@atos.net>
206         * xcoff.c (SSUBTYP_DWRNGES): New define.
207         (xcoff_add): Use correct XCOFF DWARF section subtype
208         for DEBUG_RANGES. Remove lineoff workaround.
209         Adjust base_address.
210         (xcoff_initialize_syminfo): Adapt to new base_address.
211         (xcoff_lookup_pc): Likewise.
212         (xcoff_initialize_fileline): Likewise.
214 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
216         PR bootstrap/99703
217         * configure: Regenerated.
219 2021-03-03  Ian Lance Taylor  <iant@golang.org>
221         * dwarf.c (read_line_program): Don't special case file 0.
222         (read_function_entry): Likewise.
224 2021-03-02  Ian Lance Taylor  <iant@golang.org>
226         PR libbacktrace/98818
227         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
228         callers.
229         * backtrace.h: Update backtrace_error_callback comment.
231 2021-02-12  Ian Lance Taylor  <iant@golang.org>
233         * configure.ac: Check for objcopy --add-gnu-debuglink by using
234         objcopy --help.
235         * configure: Regenerate
237 2021-01-18  Ian Lance Taylor  <iant@golang.org>
239         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
240         * Makefile.in: Regenerate.
241         * configure: Regenerate.
243 2021-01-18  Ian Lance Taylor  <iant@golang.org>
245         PR debug/98716
246         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
247         filenames.
248         (read_line_program): Remove parameter u, change caller.  Don't
249         subtract one from dirs and filenames index.
250         (read_function_entry): Don't subtract one from filenames index.
252 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
254         * configure: Re-generate.
256 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
258         PR target/97865
259         * configure: Regenerate.
261 2020-12-02  Ian Lance Taylor  <iant@golang.org>
263         * dwarf.c (resolve_string): Use > rather than >= to check whether
264         string index extends past buffer.
265         (resolve_addr_index): Similarly for address index.
267 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
269         * configure: Regenerate.
271 2020-10-20  Ian Lance Taylor  <iant@golang.org>
273         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
274         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
276 2020-09-28  Ian Lance Taylor  <iant@golang.org>
278         PR libbacktrace/97082
279         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
280         * Makefile.in: Regenerate.
282 2020-09-28  Ian Lance Taylor  <iant@golang.org>
284         PR libbacktrace/97227
285         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
286         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
287         * configure: Regenerate.
288         * Makefile.in: Regenerate.
290 2020-09-23  Ian Lance Taylor  <iant@golang.org>
292         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
293         p->low.
294         (dwarf_lookup_pc): Likewise.
296 2020-09-17  Ian Lance Taylor  <iant@golang.org>
298         PR libbacktrace/97080
299         * fileline.c (backtrace_syminfo_to_full_callback): New function.
300         (backtrace_syminfo_to_full_error_callback): New function.
301         * elf.c (elf_nodebug): Call syminfo_fn if possible.
302         * internal.h (struct backtrace_call_full): Define.
303         (backtrace_syminfo_to_full_callback): Declare.
304         (backtrace_syminfo_to_full_error_callback): Declare.
305         * mtest.c (f3): Only check all[i] if data.index permits.
307 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
309         * macho.c (MACH_O_CPU_TYPE_PPC): New.
310         (MACH_O_CPU_TYPE_PPC64): New.
311         Add compile-tests for powerpc to the Mach-O variants.
313 2020-09-14  Ian Lance Taylor  <iant@golang.org>
315         PR libbacktrace/93608
316         Add support for MiniDebugInfo.
317         * elf.c (struct elf_view): Define.  Replace most uses of
318         backtrace_view with elf_view.
319         (elf_get_view): New static functions.  Replace most calls of
320         backtrace_get_view with elf_get_view.
321         (elf_release_view): New static functions.  Replace most calls of
322         backtrace_release_view with elf_release_view.
323         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
324         callers.
325         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
326         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
327         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
328         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
329         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
330         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
331         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
332         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
333         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
334         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
335         (LZMA_PROB_DIST_ALIGN_LEN): Define.
336         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
337         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
338         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
339         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
340         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
341         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
342         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
343         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
344         (LZMA_PROB_REP_LEN_MID_LEN): Define.
345         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
346         (LZMA_PROB_LITERAL_LEN): Define.
347         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
348         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
349         (LZMA_PROB_IS_REP2_OFFSET): Define.
350         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
351         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
352         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
353         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
354         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
355         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
356         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
357         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
358         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
359         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
360         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
361         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
362         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
363         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
364         (LZMA_PROB_LITERAL_OFFSET): Define.
365         (LZMA_PROB_TOTAL_COUNT): Define.
366         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
367         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
368         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
369         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
370         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
371         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
372         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
373         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
374         (elf_lzma_varint): New static function.
375         (elf_lzma_range_normalize): New static function.
376         (elf_lzma_bit, elf_lzma_integer): New static functions.
377         (elf_lzma_reverse_integer): New static function.
378         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
379         (elf_uncompress_lzma): New static function.
380         (backtrace_uncompress_lzma): New function.
381         (elf_add): Add memory and memory_size parameters.  Change all
382         callers.  Look for .gnu_debugdata section, and, if found,
383         decompress it and use it for symbols and debug info.  Permit the
384         descriptor parameter to be -1.
385         * internal.h (backtrace_uncompress_lzma): Declare.
386         * mtest.c: New file.
387         * xztest.c: New file.
388         * configure.ac: Check for nm, xz, and comm programs.  Check for
389         liblzma library.
390         (HAVE_MINIDEBUG): Define.
391         * Makefile.am (mtest_SOURCES): Define.
392         (mtest_CFLAGS, mtest_LDADD): Define.
393         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
394         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
395         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
396         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
397         (xztest_alloc_LDADD): Define.
398         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
399         (CLEANFILES): Add files created by minidebug pattern.
400         (btest.lo): Correct INCDIR reference.
401         (mtest.lo, xztest.lo, ztest.lo): New targets.
402         * configure: Regenerate.
403         * config.h.in: Regenerate.
404         * Makefile.in: Regenerate.
406 2020-09-09  Ian Lance Taylor  <iant@golang.org>
408         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
409         (coff_add): Determine and pass is_64.
411 2020-09-09  Ian Lance Taylor  <iant@golang.org>
413         PR libbacktrace/96973
414         * fileline.c (macho_get_executable_path): New static function.
415         (fileline_initialize): Call macho_get_executable_path.
417 2020-09-09  Ian Lance Taylor  <iant@golang.org>
419         * dwarf.c (function_addrs_search): Compare against the next entry
420         low address, not the high address.
421         (unit_addrs_search): Likewise.
422         (build_address_map): Add a trailing unit_addrs.
423         (read_function_entry): Add a trailing function_addrs.
424         (read_function_info): Likewise.
425         (report_inlined_functions): Search backward for function_addrs
426         match.
427         (dwarf_lookup_pc): Search backward for unit_addrs and
428         function_addrs matches.
430 2020-09-08  Ian Lance Taylor  <iant@golang.org>
432         * simple.c (simple_unwind): Correct comment spelling.
434 2020-09-08  Ian Lance Taylor  <iant@golang.org>
436         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
437         correct length when freeing diralc.
439 2020-09-08  Ian Lance Taylor  <iant@golang.org>
441         PR libbacktrace/96973
442         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
444 2020-09-08  Ian Lance Taylor  <iant@golang.org>
446         PR libbacktrace/96971
447         * filetype.awk: Only match magic number at start of line.
449 2020-08-24  Ian Lance Taylor  <iant@golang.org>
451         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
452         (MACH_O_MH_CIGAM_FAT_64): Define.
453         (struct macho_fat_arch_64): Define.
454         (macho_add_fat): Add and use is_64 parameter.
455         (macho_add): Recognize 64-bit fat files.
457 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
459         PR bootstrap/96202
460         * configure: Regenerated.
462 2020-07-08  Ian Lance Taylor  <iant@golang.org>
464         * configure.ac: Test linker support for DWARF5
465         * configure: Regenerate
467 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
469         PR bootstrap/95413
470         * configure: Regenerated.
472 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
474         PR bootstrap/95147
475         * configure: Regenerated.
477 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
479         * configure: Regenerated.
481 2020-05-13  Ian Lance Taylor  <iant@golang.org>
483         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
485 2020-05-13  Ian Lance Taylor  <iant@golang.org>
487         PR go/95061
488         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
490 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
492         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
493         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
494         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
495         enabled.
496         * Makefile.in: Regenerated.
497         * configure: Likewise.
499 2020-05-11  Ian Lance Taylor  <iant@golang.org>
501         PR libbacktrace/95012
502         * configure.ac: Check for getpagesize declaration.
503         * mmap.c: Declare getpagesize if necessary.
504         * mmapio.c: Likewise.
505         * configure: Regenerate.
506         * config.h.in: Regenerate.
507         * Makefile.in: Regenerate.
509 2020-05-09  Roland McGrath  <mcgrathr@google.com>
511         * elf.c (elf_add): Bail early if there are no section headers at all.
513 2020-05-09  Ian Lance Taylor  <iant@golang.org>
515         * elf.c (elf_add): Don't free strtab if an error occurs after
516         recording symbol information.
518 2020-05-09  Ian Lance Taylor  <iant@golang.org>
520         PR libbacktrace/88745
521         * macho.c: New file.
522         * filetype.awk: Recognize Mach-O files.
523         * Makefile.am (FORMAT_FILES): Add macho.c.
524         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
525         (%.dSYM): New pattern target.
526         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
527         (test_macho_LDADD): New target.
528         (BUILDTESTS): Add test_macho.
529         (macho.lo): Add dependencies.
530         * configure.ac: Recognize macho file type.  Check for
531         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
532         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
533         * Makefile.in: Regenerate.
534         * configure: Regenerate.
535         * config.h.in: Regenerate.
537 2020-05-09  Ian Lance Taylor  <iant@golang.org>
539         * read.c (backtrace_get_view): Support short read.
541 2020-05-09  Ian Lance Taylor  <iant@golang.org>
543         * elf.c (elf_add): If debug sections are very large or far apart,
544         read them individually rather than as a single view.
546 2020-05-08  Ian Lance Taylor  <iant@golang.org>
548         * fileline.c (sysctl_exec_name): New static function.
549         (sysctl_exec_name1): New macro or static function.
550         (sysctl_exec_name2): Likewise.
551         (fileline_initialize): Try sysctl_exec_name[12].
552         * configure.ac: Check for sysctl args to fetch executable name.
553         * configure: Regenerate.
554         * config.h.in: Regenerate.
556 2020-02-15  Ian Lance Taylor  <iant@golang.org>
558         * ztest.c (test_large): Update file to current libgo test file.
560 2020-02-03  Ian Lance Taylor  <iant@golang.org>
562         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
563         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
564         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
565         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
566         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
567         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
568         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
569         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
570         (stest_alloc_CFLAGS): Likewise.
571         * Makefile.in: Regenerate.
572         * ztest.c (error_callback_compress): Mark vdata unused.
573         (test_large): Add casts to avoid warnings.
575 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
577         Update copyright years.
579 2019-12-13  Ian Lance Taylor  <iant@golang.org>
581         Add DWARF 5 support.
582         * dwarf.c (struct attr): Add val field.
583         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
584         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
585         (struct line_header): Add addrsize field.
586         (struct line_header_format): Define.
587         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
588         fields.
589         (read_uint24): New static function.
590         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
591         and dwarf_str_size parameters with dwarf_sections parameter.  Add
592         support for new DWARF 5 forms.  Change all callers.
593         (resolve_string): New static function.
594         (resolve_addr_index): Likewise.
595         (read_abbrevs): Support DW_FORM_implicit_const.
596         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
597         and ranges_is_index fields.
598         (update_pcrange): Support DWARF 5 encodings.
599         (add_high_low_range): New static function, split out of
600         add_ranges.
601         (add_ranges_from_ranges): Likewise.
602         (add_ranges_from_rnglists): New static function.
603         (add_ranges): Just call new helper functions.
604         (find_address_ranges): Use resolve_string for strings, after
605         reading all attributes.  Handle new DWARF 5 attributes.
606         (build_address_map): Support DWARF 5 compilation units.
607         (read_v2_paths): New static function, split out of
608         read_line_header.
609         (read_lnct): New static function.
610         (read_line_header_format_entries): Likewise.
611         (read_line_header): Add ddata parameter.  Support DWARF 5 line
612         headers.  Call new helper functions.  Change all callers.
613         (read_line_program): Use addrsize from line program header.  Don't
614         special case directory index 0 for DWARF 5.
615         (read_referenced_name): Use resolve_string.
616         (read_function_entry): Handle DWARF 5 encodings.  Use
617         resolve_string.
618         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
619         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
620         * elf.c (dwarf_section_names): Add new section names.
621         * pecoff.c (dwarf_section_names): Likewise.
622         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
623         fields.
624         * configure.ac: Define HAVE_DWARF5 automake conditional.
625         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
626         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
627         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
628         (dwarf5_alloc_LDADD): Likewise.
629         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
630         (CLEANFILES, clean-local): Define.
632 2019-12-08  Ian Lance Taylor  <iant@golang.org>
634         * dwarf.c (struct pcrange): Define.
635         (update_pcrange, add_ranges): New static functions.
636         (add_unit_addr): Change signature to work with add_ranges.  Don't
637         add base_address here.
638         (add_unit_ranges): Remove.
639         (find_address_ranges): Replace str/ranges parameters with
640         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
641         callers.
642         (add_function_range): Change signature to work with add_ranges.
643         Don't add base_address here.
644         (add_function_ranges): Remove.
645         (read_function_entry): Use update_pcrange and add_ranges.
647 2019-12-04  Ian Lance Taylor  <iant@golang.org>
649         * edtest.c (test1): Add noclone attribute.
651 2019-12-04  Ian Lance Taylor  <iant@golang.org>
653         * internal.h (enum dwarf_section): Define.
654         (struct dwarf_sections): Define.
655         (backtrace_dwarf_add): Update declaration to replace specific
656         section parameters with dwarf_sections parameter.
657         * dwarf.c (struct dwarf_data): Replace specific section fields
658         with dwarf_sections field.
659         (read_attribute): Use dwarf_sections with altlink.
660         (build_address_map): Replace specific section parameters with
661         dwarf_sections parameter.  Change all callers.
662         (read_line_info): Use dwarf_sections with ddata.
663         (read_referenced_name): Likewise.
664         (add_function_ranges): Likewise.
665         (read_function_entry): Likewise.
666         (read_function_info): Likewise.
667         (build_dwarf_data): Replace specific section parameters with
668         dwarf_sections parameter.  Change all callers.
669         (backtrace_dwarf_add): Likewise.
670         * elf.c (enum debug_section): Remove.
671         (dwarf_section_names): Remove .zdebug names.
672         (elf_add): Track zsections separately.  Build dwarf_sections.
673         * pecoff.c (enum debug_section): Remove.
674         (struct debug_section_info): Remove data field.
675         (coff_add): Build dwarf_sections.
676         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
677         references with DEBUG_xxx references.
678         (xcoff_add): Build dwarf_sections.
680 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
682         * configure: Regenerate.
684 2019-09-26  Ian Lance Taylor  <iant@golang.org>
686         PR libbacktrace/91908
687         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
688         __sync_bool_compare_and_swap to void.
689         * xcoff.c (backtrace_initialize): Likewise.
691 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
693         * configure.ac: Remove references to spu.
694         * configure: Regenerate.
696 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
698         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
699         test_elf_64.
700         * Makefile.in: Regenerate.
702 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
704         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
705         handling.
706         * configure: Regenerate.
708 2019-03-11  Ian Lance Taylor  <iant@golang.org>
710         PR libbacktrace/89669
711         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
712         HAVE_ELF.
713         * Makefile.in: Regenerate.
715 2019-02-26  Tom de Vries  <tdevries@suse.de>
717         * btest.c (test5): Allow global.* as minimal symbol name for global.
719 2019-02-26  Tom de Vries  <tdevries@suse.de>
721         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
722         * Makefile.in: Regenerate.
724 2019-02-12  Tom de Vries  <tdevries@suse.de>
726         PR libbacktrace/81983
727         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
729 2019-02-10  Tom de Vries  <tdevries@suse.de>
731         * Makefile.am (BUILDTESTS): Add btest_lto.
732         * Makefile.in: Regenerate.
733         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
734         __attribute__((noclone)).
736 2019-02-08  Tom de Vries  <tdevries@suse.de>
738         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
739         * print.c (backtrace_print): Same.
740         * simple.c (backtrace_simple): Same.
742 2019-02-08  Tom de Vries  <tdevries@suse.de>
744         PR libbacktrace/78063
745         * dwarf.c (build_address_map): Keep all parsed units.
746         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
748 2019-01-31  Tom de Vries  <tdevries@suse.de>
750         PR libbacktrace/89136
751         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
752         'debugaltlink_name_len =+ 1'.
754 2019-01-29  Tom de Vries  <tdevries@suse.de>
756         * install-debuginfo-for-buildid.sh.in: New script.
757         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
758         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
759         * Makefile.in: Regenerate.
760         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
761         (READELF): Set with AC_CHECK_PROG.
762         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
763         * configure: Regenerate.
764         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
765         (elf_open_debugfile_by_buildid): ... here.
767 2019-01-29  Tom de Vries  <tdevries@suse.de>
769         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
770         allocfail.
771         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
772         (check_PROGRAMS): Add BUILDTESTS.
773         * Makefile.in: Regenerate.
775 2019-01-28  Tom de Vries  <tdevries@suse.de>
777         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
778         Use $< to access prerequisite.
779         * Makefile.in: Regenerate.
781 2019-01-25  Nathan Sidwell  <nathan@acm.org>
783         * elf.c (elf_add): Pass "" filename to recursive call with
784         separated debug.
786 2019-01-25  Tom de Vries  <tdevries@suse.de>
788         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
789         filename == "".
790         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
791         * Makefile.in: Regenerate.
793 2019-01-25  Tom de Vries  <tdevries@suse.de>
795         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
796         (TESTS): Rename dtest to btest_gnudebuglink.
797         * Makefile.in: Regenerate.
799 2019-01-23  Tom de Vries  <tdevries@suse.de>
801         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
802         (units_search, find_unit): Use size_t for offset.
803         (build_address_map): Use size_t for unit_offset.
805 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
807         * allocfail.c (main): Increase portability of printf statement.
809 2019-01-18  Ian Lance Taylor  <iant@golang.org>
811         PR libbacktrace/88890
812         * mmapio.c (backtrace_get_view): Change size parameter to
813         uint64_t.  Check that value fits in size_t.
814         * read.c (backtrace_get_view): Likewise.
815         * internal.h (backtrace_get_view): Update declaration.
816         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
818 2019-01-17  Tom de Vries  <tdevries@suse.de>
820         PR libbacktrace/82857
821         * configure.ac (DWZ): Set with AC_CHECK_PROG.
822         (HAVE_DWZ): Set with AM_CONDITIONAL.
823         * configure: Regenerate.
824         * Makefile.am (TESTS): Add btest_dwz.
825         * Makefile.in: Regenerate.
827 2019-01-17  Tom de Vries  <tdevries@suse.de>
829         PR libbacktrace/82857
830         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
831         (read_attribute): Handle DW_FORM_GNU_ref_alt using
832         ATTR_VAL_REF_ALT_INFO.
833         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
835 2019-01-17  Tom de Vries  <tdevries@suse.de>
837         * dwarf.c (struct unit): Add low_offset and high_offset fields.
838         (struct unit_vector): New type.
839         (struct dwarf_data): Add units and units_counts fields.
840         (find_unit): New function.
841         (find_address_ranges): Add and handle unit_tag parameter.
842         (build_address_map): Add and handle units_vec parameter.
843         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
844         units vector.
846 2019-01-17  Tom de Vries  <tdevries@suse.de>
848         PR libbacktrace/82857
849         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
850         using altlink.
852 2019-01-17  Tom de Vries  <tdevries@suse.de>
854         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
855         (read_attribute): Add altlink parameter.  Handle missing altlink for
856         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
857         (find_address_ranges, build_address_map, build_dwarf_data): Add and
858         handle altlink parameter.
859         (read_referenced_name, read_function_entry): Add argument to
860         read_attribute call.
862 2019-01-17  Tom de Vries  <tdevries@suse.de>
864         * dwarf.c (struct dwarf_data): Add altlink field.
865         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
866         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
867         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
868         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
869         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
870         * xcoff.c (xcoff_add): Same.
872 2019-01-17  Tom de Vries  <tdevries@suse.de>
874         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
875         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
876         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
877         argument to backtrace_dwarf_add call.
878         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
879         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
880         * xcoff.c (xcoff_add): Same.
882 2019-01-17  Tom de Vries  <tdevries@suse.de>
884         * elf.c (elf_add): Add and handle with_buildid_data and
885         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
886         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
888 2019-01-16  Tom de Vries  <tdevries@suse.de>
890         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
891         of ...
892         (read_referenced_name): ... here, and ...
893         (read_function_entry): ... here.
895 2019-01-16  Tom de Vries  <tdevries@suse.de>
897         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
898         name.
899         (read_function_entry): Same.  Don't allow name found via
900         DW_AT_abstract_origin or case DW_AT_specification to override linkage
901         name.
903 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
905         PR other/16615
907         * backtrace.h: Mechanically replace "can not" with "cannot".
909 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
911         Update copyright years.
913 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
915         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
916         in sed pattern.
917         * Makefile.in: Regenerate.
919 2018-12-28  Tom de Vries  <tdevries@suse.de>
921         * dwarf.c (build_address_map): Reuse unused units.
923 2018-12-28  Tom de Vries  <tdevries@suse.de>
925         * dwarf.c (build_address_map): Simplify by removing local variable
926         abbrevs.
928 2018-12-28  Ian Lance Taylor  <iant@golang.org>
929             Tom de Vries  <tdevries@suse.de>
931         PR libbacktrace/88063
932         * dwarf.c (free_unit_addrs_vector): Remove.
933         (build_address_map): Keep track of allocated units in vector.  Free
934         allocated units and corresponding abbrevs upon failure.  Remove now
935         redundant call to free_unit_addrs_vector.  Free addrs vector upon
936         failure.  Free allocated unit vector.
938 2018-12-28  Tom de Vries  <tdevries@suse.de>
940         * dwarf.c (build_address_map): Free addrs vector upon failure.
942 2018-12-14  Tom de Vries  <tdevries@suse.de>
944         PR testsuite/88491
945         * allocfail.sh: Remove "set -o pipefail".
947 2018-12-12  Tom de Vries  <tdevries@suse.de>
949         * Makefile.am (TESTS): Add allocfail.sh.
950         (check_PROGRAMS): Add allocfail.
951         * Makefile.in: Regenerate.
952         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
953         Include alloc.c.
954         * allocfail.c: New file.
955         * allocfail.sh: New file.
957 2018-11-30  Tom de Vries  <tdevries@suse.de>
959         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
960         test_xcoff_64, test_pecoff and test_unknown.
961         * Makefile.in: Regenerate.
962         * test_format.c: New file.
964 2018-11-30  Tom de Vries  <tdevries@suse.de>
966         * Makefile.am : Add _with_alloc version for each test in
967         check_PROGRAMS.
968         * Makefile.in: Regenerate.
970 2018-11-30  Tom de Vries  <tdevries@suse.de>
972         * internal.h (backtrace_vector_free): New static inline fuction,
973         factored out of ...
974         * dwarf.c (read_line_info): ... here.
976 2018-11-28  Tom de Vries  <tdevries@suse.de>
978         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
979         failure.
981 2018-11-27  Tom de Vries  <tdevries@suse.de>
983         * mmap.c (backtrace_vector_release): Same.
984         * unittest.c (test1): Add check.
986 2018-11-27  Tom de Vries  <tdevries@suse.de>
988         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
989         instead of realloc.
990         * Makefile.am (check_PROGRAMS): Add unittest.
991         * Makefile.in: Regenerate.
992         * unittest.c: New file.
994 2018-11-22  Tom de Vries  <tdevries@suse.de>
996         * dwarf.c (read_initial_length): Factor out of ...
997         (build_address_map, read_line_info): ... here.
999 2018-11-21  Tom de Vries  <tdevries@suse.de>
1001         * dwarf.c (read_string): Factor out of ...
1002         (read_attribute, read_line_header, read_line_program): ... here.
1004 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
1006         PR bootstrap/82856
1007         * Makefile.am: Include multilib.am.
1008         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
1009         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
1011 2018-10-05  Ian Lance Taylor  <iant@golang.org>
1013         PR libbacktrace/87529
1014         * backtrace.h: Document that backtrace_create_state should be
1015         called only once.
1017 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
1019         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
1020         * Makefile.in: Regenerate.
1021         * config.h.in: Likewise.
1022         * configure: Likewise.
1024 2018-08-01  Tony Reix  <tony.reix@atos.net>
1026         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
1027         (struct xcoff_func, struct xcoff_func_vector): New structs.
1028         (xcoff_syminfo): Drop leading dot from symbol name.
1029         (xcoff_line_compare, xcoff_line_search): Remove.
1030         (xcoff_func_compare, xcoff_func_search): New static functions.
1031         (xcoff_lookup_pc): Search function table.
1032         (xcoff_add_line, xcoff_process_linenos): Remove.
1033         (xcoff_initialize_fileline): Build function table.
1035 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
1037         PR other/86198
1038         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
1039         checking up to 36 bytes.
1041 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1043         * configure: Regenerated.
1045 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
1047         * configure: Regenerated.
1049 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1051         * backtrace.c: Revert last two changes.  Don't call mmap
1052         directly.
1054 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1056         * backtrace.c: Include backtrace-supported.h before checking
1057         BACKTRACE_USES_MALLOC.
1059 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1061         * backtrace.c (backtrace_full): When testing whether we can
1062         allocate memory, call mmap directly, and munmap the memory.
1064 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
1066         PR other/85161
1067         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
1068         big endian, only use 32-bit loads if endianity macros are predefined
1069         and indicate big or little endian.
1071 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1073         PR target/84148
1074         * configure: Regenerate.
1076 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
1078         PR other/82368
1079         * elf.c (SHT_PROGBITS): Undefine and define.
1081 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
1083         PR other/82368
1084         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
1085         (struct elf_ppc64_opd_data): New type.
1086         (elf_initialize_syminfo): Add opd argument, handle symbols
1087         pointing into the PowerPC64 ELFv1 .opd section.
1088         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
1089         to structure with .opd data to elf_initialize_syminfo.
1091 2018-01-31  Ian Lance Taylor  <iant@golang.org>
1093         * elf.c (elf_add): Close descriptor if we use a debugfile.
1094         * btest.c (check_open_files): New static function.
1095         (main): Call check_open_files.
1097 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1099         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
1100         desired CRC is zero.
1101         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
1103 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1105         * pecoff.c (coff_add): Only release syms_view if it is valid.
1107 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1109         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
1111 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1113         * pecoff.c (coff_add): Use coff_read4, not memcpy.
1115 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1117         PR other/68239
1118         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
1119         on the free list.
1121 2018-01-19  Tony Reix  <tony.reix@atos.net>
1123         * xcoff.c (xcoff_incl_compare): New function.
1124         (xcoff_incl_search): New function.
1125         (xcoff_process_linenos): Use bsearch to find include file.
1126         (xcoff_initialize_fileline): Sort include file information.
1128 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1130         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1131         288.
1132         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1133         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1134         (elf_zlib_default_table): Update.
1135         (elf_zlib_default_dist_table): New static array.
1136         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1137         for block type 1.
1138         * ztest.c (struct zlib_test): Add uncompressed_len.
1139         (tests): Initialize uncompressed_len field.  Add new test case.
1140         (test_samples): Use uncompressed_len field.
1142 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1144         Update copyright years.
1146 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1148         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1149         * aclocal.m4: Regenerate.
1150         * Makefile.in: Likewise.
1151         * configure: Likewise.
1153 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1155         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1156         zlib uncompress function.
1158 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1160         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1161         Read a four byte integer.
1162         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1163         boundary before ever calling elf_zlib_fetch.
1164         * ztest.c (test_large): Simplify print statements a bit.
1166 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1168         * ztest.c: #include <errno.h>.
1169         (TEST_TIMING): Don't define, don't test.
1170         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1171         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1172         (ZLIB_CLOCK_GETTIME_ARG): Define.
1173         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1174         * Makefile.am: Likewise.
1175         * configure, Makefile.in: Rebuild.
1177 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1179         PR other/67165
1180         * Makefile.am: Append the content of clock_gettime_link to
1181         ztest_LDADD.
1182         * configure.ac: Test for the case that clock_gettime is in librt.
1183         * Makefile.in: Regenerate.
1184         * configure: Likewise.
1186         PR other/67165
1187         * configure.ac: Check for clock_gettime.
1188         * config.h.in: Regenerate.
1189         * configure: Likewise.
1190         * ztest.c (average_time, test_large): Conditionalize test timing
1191         on clock_gettime availability.
1193 2017-09-29  Tony Reix  <tony.reix@atos.net>
1195         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1196         (STYP_DWARF, SSUBTYP_DW*): Define.
1197         (enum dwarf_section): Define.
1198         (struct dwsect_info): Define.
1199         (xcoff_add): Look for DWARF sections, pass them to
1200         backtrace_dwarf_add.
1202 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1204         PR other/67165
1205         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1206         (unlikely): Define.
1207         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1208         (b_elf_chdr): Define type.
1209         (enum debug_section): Add ZDEBUG_xxx values.
1210         (debug_section_names): Add names for new sections.
1211         (struct debug_section_info): Add compressed field.
1212         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1213         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1214         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1215         (HUFFMAN_SECONDARY_SHIFT): Define.
1216         (ZDEBUG_TABLE_SIZE): Define.
1217         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1218         (final_next_secondary): New static variable if
1219         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1220         (elf_zlib_inflate_table): New static function.
1221         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1222         function to produce fixed Huffman table.
1223         (elf_zlib_default_table): New static variable.
1224         (elf_zlib_inflate): New static function.
1225         (elf_zlib_verify_checksum): Likewise.
1226         (elf_zlib_inflate_and_verify): Likewise.
1227         (elf_uncompress_zdebug): Likewise.
1228         (elf_uncompress_chdr): Likewise.
1229         (backtrace_uncompress_zdebug): New extern function.
1230         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1231         sections, and uncompress them.
1232         * internal.h (backtrace_compress_zdebug): Declare.
1233         * ztest.c: New file.
1234         * configure.ac: Check for -lz and check whether the linker
1235         supports --compress-debug-sections.
1236         * Makefile.am (ztest_SOURCES): New variable.
1237         (ztest_CFLAGS, ztest_LDADD): New variables.
1238         (check_PROGRAMS): Add ztest.
1239         (ctestg_SOURCES): New variable.
1240         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1241         (ctesta_SOURCES): New variable.
1242         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1243         (check_PROGRAMS): Add ctestg and ctesta.
1244         * configure, config.h.in, Makefile.in: Rebuild.
1246 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1248         PR sanitizer/77631
1249         * configure.ac: Check for lstat and readlink.
1250         * elf.c (lstat, readlink): Provide dummy versions if real versions
1251         are not available.
1252         * configure, config.h.in: Rebuild.
1254 2017-09-21  Ian Lance Taylor  <iant@google.com>
1256         PR go/82284
1257         * elf.c (backtrace_initialize): Set pd.exe_filename.
1259 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1260             Denis Khalikov  <d.khalikov@partner.samsung.com>
1262         PR sanitizer/77631
1263         Support for external debug info.
1264         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1265         (S_ISLNK): Define if not defined.
1266         (xstrnlen): Define if strnlen is not available.
1267         (b_elf_note): Define type.
1268         (NT_GNU_BUILD_ID): Define macro.
1269         (elf_crc32, elf_crc32_file): New static functions.
1270         (elf_is_symlink, elf_readlink): New static functions.
1271         (elf_open_debugfile_by_buildid): New static function.
1272         (elf_try_debugfile): New static function.
1273         (elf_find_debugfile_by_debuglink): New static function.
1274         (elf_open_debugfile_by_debuglink): New static function.
1275         (elf_add): Add filename and debuginfo parameters.  Adjust all
1276         callers.  Look for external debug info notes, and try to fetch
1277         debug info from external file.
1278         (struct phdr_data): Add exe_filename field.
1279         (phdr_callback): Pass filename to elf_add.
1280         (backtrace_initialize): Add filename parameter.
1281         * internal.h (backtrace_initialize): Add filename parameter.
1282         * fileline.c (fileline_initialize): Pass filename to
1283         backtrace_initialize.
1284         * pecoff.c (fileline_initialize): Add unused filename parameter.
1285         * unknown.c (fileline_initialize): Likewise.
1286         * xcoff.c (fileline_initialize): Likewise.
1287         * configure.ac: Check for objcopy --add-gnu-debuglink.
1288         * Makefile.am (dtest): New test target.
1289         * configure, Makefile.in: Rebuild.
1291 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1293         PR other/81096
1294         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1295         * Makefile.in: Regenerate.
1297 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1299         PR other/81096
1300         * libbacktrace/Makefile.in
1301         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1303 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1305         PR bootstrap/81638
1306         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1308 2017-07-28  Tony Reix  <tony.reix@atos.net>
1310         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1312 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1314         * fileline.c (fileline_initialize): Print pid_t as long.
1316 2017-07-26  Tony Reix  <tony.reix@atos.net>
1318         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1319         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1320         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1321         * configure, config.h.in: Regenerate.
1323 2017-07-21  Tony Reix  <tony.reix@atos.net>
1325         * filetype.awk: Add AIX XCOFF type detection.
1326         * configure.ac: Recognize xcoff format.
1327         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1328         * fileline.c: Include <unistd.h>.
1329         (fileline_initialize): Add case for AIX procfs.
1330         * xcoff.c: New file.
1331         * configure, Makefile.in: Rebuild.
1333 2017-06-21  Richard Biener  <rguenther@suse.de>
1335         * configure.ac: Add AC_SYS_LARGEFILE.
1336         * config.h.in: Regenerate.
1337         * configure: Likewise.
1339 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1341         * elf.c (backtrace_initialize): Always set *fileline_fn.
1342         * ttest.c: New file.
1343         * btest.c: Move support functions into testlib.c.  Change calls to
1344         check to pass file name.
1345         * testlib.c: New file, copied from (part of) btest.c.
1346         * testlib.h: New file, declarations for testlib.c.
1347         * edtest.c: Use testlib.h and testlib.c.
1348         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1349         * Makefile.am (btest_SOURCES): Add testlib.c.
1350         (edtest_SOURCES): Likewise.
1351         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1352         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1353         * configure, Makefile.in: Rebuild.
1355 2017-05-19  Than McIntosh  <thanm@google.com>
1357         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1358         (read_line_header): Don't allocate dirs if dirs_count == 0.
1359         * edtest.c: New file.
1360         * edtest2.c: New file.
1361         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1362         (check_PROGRAMS): Add edtest.
1363         (edtest2_build.c, gen_edtest2_build): New targets.
1364         * Makefile.in: Rebuild.
1366 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1368         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1369         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1371 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1373         Update copyright years.
1375 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1377         * configure: Regenerate.
1379 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1381         * all: Remove meaningless trailing whitespace.
1383 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1385         PR target/71161
1386         * elf.c (phdr_callback) [__i386__]: Add
1387         __attribute__((__force_align_arg_pointer__)).
1389 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1391         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1392         avoid possible crash.
1393         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1394         missing debug info anymore.
1396 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1398         * mmap.c (MAP_FAILED): Define if not defined.
1400 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1402         Update copyright years.
1404 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1406         * configure.ac: Specify that DJGPP do not have mmap
1407         even when sys/mman.h exists.
1408         * configure: Regenerate
1410 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1412         PR libgfortran/68115
1413         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1414         * configure: Regenerate.
1415         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1416         to void.
1418 2015-09-17  Ian Lance Taylor  <iant@google.com>
1420         * posix.c (backtrace_open): Cast second argument of open() to int.
1422 2015-09-11  Ian Lance Taylor  <iant@google.com>
1424         * Makefile.am (backtrace.lo): Depend on internal.h.
1425         (sort.lo, stest.lo): Add explicit dependencies.
1426         * Makefile.in: Rebuild.
1428 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1430         * backtrace.c: #include <sys/types.h>.
1432 2015-09-08  Ian Lance Taylor  <iant@google.com>
1434         PR other/67457
1435         * backtrace.c: #include "internal.h".
1436         (struct backtrace_data): Add can_alloc field.
1437         (unwind): If can_alloc is false, don't try to get file/line
1438         information.
1439         (backtrace_full): Set can_alloc field in bdata.
1440         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1441         NULL.
1442         * mmap.c (backtrace_alloc): Likewise.
1443         * internal.h: Update comments for backtrace_alloc and
1444         backtrace_free.
1446 2015-09-08  Ian Lance Taylor  <iant@google.com>
1448         PR other/67457
1449         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1451 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1453         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1454         * configure: Regenerate.
1456 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1458         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1459         Remove setting PIC_FLAG when building as target library.
1460         * configure: Regenerate.
1462 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1464         * configure.ac: Only compile with -fPIC if the target
1465         supports it.
1466         * configure: Regenerate.
1468 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1470         * configure.ac: Set have_mmap to no on spu-*-* targets.
1471         * configure: Regenerate.
1473 2015-08-13  Ian Lance Taylor  <iant@google.com>
1475         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1476         Change all callers.
1478 2015-06-11  Martin Sebor  <msebor@redhat.com>
1480         PR sanitizer/65479
1481         * dwarf.c (struct line): Add new field idx.
1482         (line_compare): Use it.
1483         (add_line): Set it.
1484         (read_line_info): Reset it.
1486 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1488         * pecoff.c: New file.
1489         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1490         * Makefile.in: Regenerate.
1491         * filetype.awk: Detect pecoff.
1492         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1493         Add pecoff.
1494         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1495         true.
1496         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1497         * configure: Regenerate.
1498         * pecoff.c: New file.
1500 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1502         * Makefile.in: Regenerated with automake-1.11.6.
1503         * aclocal.m4: Likewise.
1504         * configure: Likewise.
1506 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1508         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1509         * configure: Regenerate.
1511 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1513         Update copyright years.
1515 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1517         PR bootstrap/63784
1518         * configure: Regenerated.
1520 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1522         * ChangeLog.jit: New.
1524 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1526         PR target/63610
1527         * configure: Regenerate.
1529 2014-10-23  Ian Lance Taylor  <iant@google.com>
1531         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1532         Fix to return void *.
1534 2014-05-08  Ian Lance Taylor  <iant@google.com>
1536         * mmap.c (backtrace_free): If freeing a large aligned block of
1537         memory, call munmap rather than holding onto it.
1538         (backtrace_vector_grow): When growing a vector, double the number
1539         of pages requested.  When releasing the old version of a grown
1540         vector, pass the correct size to backtrace_free.
1542 2014-03-07  Ian Lance Taylor  <iant@google.com>
1544         * sort.c (backtrace_qsort): Use middle element as pivot.
1546 2014-03-06  Ian Lance Taylor  <iant@google.com>
1548         * sort.c: New file.
1549         * stest.c: New file.
1550         * internal.h (backtrace_qsort): Declare.
1551         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1552         (read_line_info, read_function_entry): Likewise.
1553         (read_function_info, build_dwarf_data): Likewise.
1554         * elf.c (elf_initialize_syminfo): Likewise.
1555         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1556         (stest_SOURCES, stest_LDADD): Define.
1557         (check_PROGRAMS): Add stest.
1559 2014-02-07  Misty De Meo  <misty@brew.sh>
1561         PR target/58710
1562         * configure.ac: Use AC_LINK_IFELSE in check for
1563         _Unwind_GetIPInfo.
1564         * configure: Regenerate.
1566 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1568         Update copyright years
1570 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1572         * elf.c (ET_DYN): Undefine and define again.
1573         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1574         return early -1 without closing the descriptor.
1575         (struct phdr_data): Add exe_descriptor.
1576         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1577         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1578         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1579         call to elf_add.
1580         (backtrace_initialize): Adjust call to elf_add.  If it returns
1581         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1583 2013-12-05  Ian Lance Taylor  <iant@google.com>
1585         * alloc.c (backtrace_vector_finish): Add error_callback and data
1586         parameters.  Call backtrace_vector_release.  Return address base.
1587         * mmap.c (backtrace_vector_finish): Add error_callback and data
1588         parameters.  Return address base.
1589         * dwarf.c (read_function_info): Get new address base from
1590         backtrace_vector_finish.
1591         * internal.h (backtrace_vector_finish): Update declaration.
1593 2013-11-27  Ian Lance Taylor  <iant@google.com>
1595         * dwarf.c (find_address_ranges): New static function, broken out
1596         of build_address_map.
1597         (build_address_map): Call it.
1598         * btest.c (check): Check for missing filename or function, rather
1599         than crashing.
1600         (f3): Check that enough frames were returned.
1602 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1604         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1605         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1606         last argument.
1607         * btest.c (struct symdata): Add size field.
1608         (callback_three): Add symsize argument.  Copy it to the data->size
1609         field.
1610         (f23): Set symdata.size to 0.
1611         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1612         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1613         values.
1615         * atomic.c: Include sys/types.h.
1617 2013-11-18  Ian Lance Taylor  <iant@google.com>
1619         * configure.ac: Check for support of __atomic extensions.
1620         * internal.h: Declare or #define atomic functions for use in
1621         backtrace code.
1622         * atomic.c: New file.
1623         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1624         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1625         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1626         (backtrace_initialize): Likewise.
1627         * fileline.c (fileline_initialize): Likewise.
1628         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1629         * configure, config.h.in, Makefile.in: Rebuild.
1631 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1633         * elf.c (SHN_UNDEF): Define.
1634         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1635         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1636         (elf_add): Adjust caller.
1638         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1640 2013-11-16  Ian Lance Taylor  <iant@google.com>
1642         * backtrace.h (backtrace_create_state): Correct comment about
1643         threading.
1645 2013-11-15  Ian Lance Taylor  <iant@google.com>
1647         * backtrace.h (backtrace_syminfo): Update comment and parameter
1648         name to take any address, not just a PC value.
1649         * elf.c (STT_OBJECT): Define.
1650         (elf_nosyms): Rename parameter pc to addr.
1651         (elf_symbol_search): Rename local variable pc to addr.
1652         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1653         (elf_syminfo): Rename parameter pc to addr.
1654         * btest.c (global): New global variable.
1655         (test5): New test.
1656         (main): Call test5.
1658 2013-10-17  Ian Lance Taylor  <iant@google.com>
1660         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1661         is missing.
1663 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1665         * configure.ac: Add --enable-host-shared, setting up
1666         pre-existing PIC_FLAG variable within Makefile.am et al.
1667         * configure: Regenerate.
1669 2013-09-20  Alan Modra  <amodra@gmail.com>
1671         * configure: Regenerate.
1673 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1675         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1677 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1679         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1680         dl_iterate_phdr callbacks.
1682 2013-03-25  Ian Lance Taylor  <iant@google.com>
1684         * alloc.c: #include <sys/types.h>.
1685         * mmap.c: Likewise.
1687 2013-01-31  Ian Lance Taylor  <iant@google.com>
1689         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1690         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1692 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1694         PR other/56076
1695         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1696         attribute was not seen.
1698 2013-01-16  Ian Lance Taylor  <iant@google.com>
1700         * dwarf.c (struct unit): Add filename and abs_filename fields.
1701         (build_address_map): Set new fields when reading unit.
1702         (dwarf_lookup_pc): If we don't find an entry in the line table,
1703         just return the main file name.
1705 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1707         Update copyright years.
1709 2013-01-01  Ian Lance Taylor  <iant@google.com>
1711         PR bootstrap/54834
1712         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1713         $(MULTIBUILDTOP)/../../gcc/include.
1714         * Makefile.in: Rebuild.
1716 2013-01-01  Ian Lance Taylor  <iant@google.com>
1718         PR other/55536
1719         * mmap.c (backtrace_alloc): Don't call sync functions if not
1720         threaded.
1721         (backtrace_free): Likewise.
1723 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1725         * mmapio.c: Define MAP_FAILED if not defined.
1727 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1729         PR bootstrap/54926
1730         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1731         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1732         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1733         accepts it.
1734         * Makefile.in: Regenerated.
1735         * configure: Regenerated.
1737 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1739         PR bootstrap/54926
1740         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1741         * Makefile.in: Regenerated.
1743 2012-11-20  Ian Lance Taylor  <iant@google.com>
1745         * dwarf.c (read_attribute): Always clear val.
1747 2012-11-13  Ian Lance Taylor  <iant@google.com>
1749         PR other/55312
1750         * configure.ac: Only add -Werror if building a target library.
1751         * configure: Rebuild.
1753 2012-11-12  Ian Lance Taylor  <iant@google.com>
1754             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1755             Gerald Pfeifer  <gerald@pfeifer.com>
1757         * configure.ac: Check for getexecname.
1758         * fileline.c: #include <errno.h>.  Define getexecname if not
1759         available.
1760         (fileline_initialize): Try to find the executable in a few
1761         different ways.
1762         * print.c (error_callback): Only print the filename if it came
1763         from the backtrace state.
1764         * configure, config.h.in: Rebuild.
1766 2012-10-29  Ian Lance Taylor  <iant@google.com>
1768         * mmap.c (backtrace_vector_release): Correct last patch: add
1769         aligned, not size.
1771 2012-10-29  Ian Lance Taylor  <iant@google.com>
1773         * mmap.c (backtrace_vector_release): Make sure freed block is
1774         aligned on 8-byte boundary.
1776 2012-10-26  Ian Lance Taylor  <iant@google.com>
1778         PR other/55087
1779         * posix.c (backtrace_open): Add does_not_exist parameter.
1780         * elf.c (phdr_callback): Do not warn if shared library could not
1781         be opened.
1782         * fileline.c (fileline_initialize): Update calls to
1783         backtrace_open.
1784         * internal.h (backtrace_open): Update declaration.
1786 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
1788         PR target/55061
1789         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1790         * configure: Regenerate.
1792 2012-10-24  Ian Lance Taylor  <iant@google.com>
1794         PR target/55061
1795         * configure.ac: Check whether -funwind-tables option works.
1796         * configure: Rebuild.
1798 2012-10-11  Ian Lance Taylor  <iant@google.com>
1800         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1801         * configure: Rebuild.
1803 2012-10-10  Ian Lance Taylor  <iant@google.com>
1805         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1806         lower case.
1808 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
1810         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1812 2012-10-09  Ian Lance Taylor  <iant@google.com>
1814         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1815         (backtrace_dwarf_add): Likewise.
1817 2012-10-09  Ian Lance Taylor  <iant@google.com>
1819         Add support for tracing through shared libraries.
1820         * configure.ac: Check for link.h and dl_iterate_phdr.
1821         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
1822         ELF macros before #defining them.
1823         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1824         dl_iterate_phdr.
1825         (struct elf_syminfo_data): Add next field.
1826         (elf_initialize_syminfo): Initialize next field.
1827         (elf_add_syminfo_data): New static function.
1828         (elf_add): New static function, broken out of
1829         backtrace_initialize.  Call backtrace_dwarf_add instead of
1830         backtrace_dwarf_initialize.
1831         (struct phdr_data): Define.
1832         (phdr_callback): New static function.
1833         (backtrace_initialize): Call elf_add.
1834         * dwarf.c (struct dwarf_data): Add next and base_address fields.
1835         (add_unit_addr): Add base_address parameter.  Change all callers.
1836         (add_unit_ranges, build_address_map): Likewise.
1837         (add_line): Add ddata parameter.  Change all callers.
1838         (read_line_program, add_function_range): Likewise.
1839         (dwarf_lookup_pc): New static function, broken out of
1840         dwarf_fileline.
1841         (dwarf_fileline): Call dwarf_lookup_pc.
1842         (build_dwarf_data): New static function.
1843         (backtrace_dwarf_add): New function.
1844         (backtrace_dwarf_initialize): Remove.
1845         * internal.h (backtrace_dwarf_initialize): Don't declare.
1846         (backtrace_dwarf_add): Declare.
1847         * configure, config.h.in: Rebuild.
1849 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
1851         * btest.c (f23): Avoid uninitialized variable warning.
1853 2012-10-04  Ian Lance Taylor  <iant@google.com>
1855         * dwarf.c: If the system header files do not declare strnlen,
1856         provide our own version.
1858 2012-10-03  Ian Lance Taylor  <iant@google.com>
1860         * dwarf.c (read_uleb128): Fix overflow test.
1861         (read_sleb128): Likewise.
1862         (build_address_map): Don't change unit_buf.start.
1864 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
1866         PR other/54761
1867         * configure.ac (EXTRA_FLAGS): New.
1868         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1869         * configure, Makefile.in: Regenerate.
1871 2012-09-29  Ian Lance Taylor  <iant@google.com>
1873         PR other/54749
1874         * fileline.c (fileline_initialize): Pass errnum as -1 when
1875         reporting that we could not read executable information after a
1876         previous failure.
1878 2012-09-27  Ian Lance Taylor  <iant@google.com>
1880         PR bootstrap/54732
1881         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1882         * Makefile.am: Add dependencies for all objects.
1883         * configure, aclocal.m4, Makefile.in: Rebuild.
1885 2012-09-27  Ian Lance Taylor  <iant@google.com>
1887         PR other/54726
1888         * elf.c (backtrace_initialize): Set *fileln_fn, not
1889         state->fileln_fn.
1891 2012-09-19  Ian Lance Taylor  <iant@google.com>
1893         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1894         as a target library.
1895         * configure: Rebuild.
1897 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1898             Ian Lance Taylor  <iant@google.com>
1900         * configure.ac (GCC_HEADER_STDINT): Invoke.
1901         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1902         * btest.c: Don't include <stdint.h>.
1903         * dwarf.c: Likewise.
1904         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1906 2012-09-18  Ian Lance Taylor  <iant@google.com>
1908         PR bootstrap/54623
1909         * Makefile.am (AM_CPPFLAGS): Define.
1910         (AM_CFLAGS): Remove -I options.
1911         * Makefile.in: Rebuild.
1913 2012-09-18  Ian Lance Taylor  <iant@google.com>
1915         * posix.c (O_BINARY): Define if not defined.
1916         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
1917         HAVE_FCNTL is defined.
1918         * configure.ac: Test for the fcntl function.
1919         * configure, config.h.in: Rebuild.
1921 2012-09-18  Ian Lance Taylor  <iant@google.com>
1923         * btest.c (test1, test2, test3, test4): Add the unused attribute.
1925 2012-09-18  Ian Lance Taylor  <iant@google.com>
1927         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1929 2012-09-18  Ian Lance Taylor  <iant@google.com>
1931         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1932         * mmapio.c: Don't define _GNU_SOURCE.
1933         * configure, config.h.in: Rebuild.
1935 2012-09-18  Ian Lance Taylor  <iant@google.com>
1937         * configure.ac: Check whether strnlen is declared.
1938         * dwarf.c: Declare strnlen if not declared.
1939         * configure, config.h.in: Rebuild.
1941 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1943         * fileline.c: Include <stdlib.h>.
1944         * mmap.c: Likewise.
1946 2012-09-17  Ian Lance Taylor  <iant@google.com>
1948         PR bootstrap/54611
1949         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
1950         parameter.
1952 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
1954         PR bootstrap/54611
1955         * nounwind.c (backtrace_simple): Add state parameter.
1957 2012-09-17  Ian Lance Taylor  <iant@google.com>
1959         PR bootstrap/54609
1960         * unknown.c (unknown_fileline): Add state parameter, remove
1961         fileline_data parameter, name error_callback parameter.
1962         (backtrace_initialize): Add state parameter.
1964 2012-09-17  Ian Lance Taylor  <iant@google.com>
1966         * Initial implementation.
1968 Copyright (C) 2012-2023 Free Software Foundation, Inc.
1970 Copying and distribution of this file, with or without modification,
1971 are permitted in any medium without royalty provided the copyright
1972 notice and this notice are preserved.