Remove duplicated definition in risc-v vector support.
[official-gcc.git] / libbacktrace / ChangeLog
blobc2066eb28a4b4642d32e1315adedaea0c0de119a
1 2023-03-28  Ian Lance Taylor  <iant@golang.org>
3         * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading
4         bits, not before.  Add unlikely for error case.
5         (elf_zstd_offset_table): Regenerate.
6         (elf_zstd_read_huff): Clear 13 entries in weight_mark, not 12.
7         (elf_zstd_read_literals): For a single stream adjust by
8         total_streams_size, not compressed_size.
10 2023-01-20  Ian Lance Taylor  <iant@golang.org>
12         * dwarf.c (struct function_addrs): Change low and high fields to
13         uintptr_t.
14         (struct unit_addrs): Likewise.
15         (resolve_addr_index): Change address parameter to uintptr_t*.
16         (add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
17         (add_function_range): Likewise.
18         (struct pcrange): Change lowpc and highpc fields to uintptr_t.
19         (add_low_high_range): Change add_range lowpc and highpc parameters
20         to uintptr_t.
21         (add_ranges_from_ranges): Likewise.
22         (add_ranges_from_rnglists): Likewise.
23         (add_low_high_range): Chnage lowpc and highpc variables to
24         uintpr_t.
25         (add_ranges_from_rnglists): Change some local variables to
26         uintptr_t.
27         (add_ranges_from_ranges): Change base parameter to uintptr_t.
28         (add_ranges_from_rnglists): Likewise.
29         (read_function_entry): Likewise.
30         (resolve_addr_index): Add explicit casts to uintptr_t.
31         (update_pcrange): Likewise.
32         (add_ranges_from_ranges): Likewise.
33         (add_ranges_from_rnglists): Likewise.
34         (read_function_entry): Likewise.
36 2023-01-17  Martin Liska  <mliska@suse.cz>
38         * Makefile.in: Regenerate.
40 2023-01-06  Ian Lance Taylor  <iant@golang.org>
42         PR libbacktrace/108297
43         * configure.ac: Test whether linker supports --build-id.
44         * Makefile.am: Only run --build-id tests if supported.
45         * configure, Makefile.in: Regenerate.
47 2022-12-17  Ian Lance Taylor  <iant@golang.org>
49         * elf.c (elf_fetch_backward_init): New static function.
50         (ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
51         literal size.
52         (ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
53         (elf_zstd_read_huff): Use elf_fetch_backward_init.
54         (elf_zstd_read_literals): New static function.
55         (ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
56         (struct elf_zstd_literals): Don't define.
57         (elf_zstd_literal_output): Remove static function.
58         (elf_zstd_decompress): Use elf_fetch_backward_init and
59         elf_zstd_read_literals.  Rewrite literal copying.<
61 2022-12-10  Ian Lance Taylor  <iant@golang.org>
63         * elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
64         (ZSTD_ENCODE_BASELINE_BITS): Define.
65         (ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
66         (elf_zstd_literal_length_base): New static const array.
67         (elf_zstd_match_length_base): Likewise.
68         (struct elf_zstd_fse_baseline_entry): Define.
69         (elf_zstd_make_literal_baseline_fse): New static function.
70         (elf_zstd_make_offset_baseline_fse): Likewise.
71         (elf_zstd_make_match_baseline_fse): Likewise.
72         (print_table, main): Use elf_zstd_fse_baseline_entry.
73         (elf_zstd_lit_table, elf_zstd_match_table): Likewise.
74         (elf_zstd_offset_table): Likewise.
75         (struct elf_zstd_seq_decode): Likewise.  Remove use_rle and rle
76         fields.
77         (elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
78         taking a conversion function.  Convert RLE to FSE.
79         (elf_zstd_literal_length_baseline): Remove.
80         (elf_zstd_literal_length_bits): Remove.
81         (elf_zstd_match_length_baseline): Remove.
82         (elf_zstd_match_length_bits): Remove.
83         (elf_zstd_decompress): Use elf_zstd_fse_baseline_entry.  Rewrite
84         and simplify main loop.
86 2022-12-08  Ian Lance Taylor  <iant@golang.org>
88         * configure.ac: Check for zstd library and
89         --compress-debug-sections=zstd linker option.
90         * Makefile.am (zstdtest_*): New targets.
91         (zstdtest_alloc_*, ctestzstd_*): New targets.
92         (BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
93         appropriate.
94         * elf.c (ELFCOMPRESS_ZSTD): Define.
95         (elf_fetch_bits): Rename from elf_zlib_fetch.  Update uses.
96         (elf_fetch_bits_backward): New static function.
97         (ZLIB_HUFFMAN_*): Rename from HUFFMAN_*.  Update uses.
98         (ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*.  Update uses.
99         (ZSTD_TABLE_*): Define.
100         (struct elf_zstd_fse_entry): Define.
101         (elf_zstd_read_fse): New static function.
102         (elf_zstd_build_fse): Likewise.
103         (lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
104         (match, offset, next, print_table, main): Likewise.
105         (elf_zstd_lit_table): New static const array.
106         (elf_zstd_match_table, elf_zstd_offset_table): Likewise.
107         (elf_zstd_read_huff): New static function.
108         (struct elf_zstd_seq_decode): Define.
109         (elf_zstd_unpack_seq_decode): New static function.
110         (ZSTD_LIT_*): Define.
111         (struct elf_zstd_literals): Define.
112         (elf_zstd_literal_output): New static function.
113         (ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
114         (elf_zstd_literal_length_baseline): New static const array.
115         (elf_zstd_literal_length_bits): Likewise.
116         (ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
117         (elf_zstd_match_length_baseline): New static const array.
118         (elf_zstd_match_length_bits): Likewise.
119         (elf_zstd_decompress): New static function.
120         (ZDEBUG_TABLE_SIZE): New definition.
121         (elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
122         (backtrace_uncompress_zstd): New function.
123         (elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
124         * internal.h (backtrace_uncompress_zstd): Declare.
125         * zstdtest.c: New file.
126         * configure, config.h.in, Makefile.in: Regenerate.
128 2022-10-12  Martin Liska  <mliska@suse.cz>
130         * configure: Regenerate.
132 2022-10-11  Olivier Hainque  <hainque@adacore.com>
133             Olivier Hainque  <hainque@adacore.com>
135         * configure: Regenerate.
137 2022-07-08  Ian Lance Taylor  <iant@golang.org>
139         * configure.ac: Check for sys/link.h.  Use either link.h or
140         sys/link.h when checking for dl_iterate_phdr.
141         * elf.c: Include sys/link.h if available.
142         * configure, config.h.in: Regenerate.
144 2022-07-07  Ian Lance Taylor  <iant@golang.org>
146         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
147         loop if we can't find debug info for one shared library.
149 2022-07-07  Ian Lance Taylor  <iant@golang.org>
151         * Makefile.am (MAKETESTS): New variable split out of TESTS.
152         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
153         * Makefile.in: Regenerate.
155 2022-06-27  Ian Lance Taylor  <iant@golang.org>
157         * configure.ac: Use grep instead of fgrep.
158         * configure, Makefile.in: Regenerate.
160 2022-05-28  Ian Lance Taylor  <iant@golang.org>
162         PR libbacktrace/105721
163         * README: Update.
165 2022-04-05  Ian Lance Taylor  <iant@golang.org>
167         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
168         uncompressed block.
170 2022-02-17  Ian Lance Taylor  <iant@golang.org>
172         * dwarf.c (find_address_ranges): Handle skeleton units.
173         (read_function_entry): Likewise.
175 2022-02-16  Ian Lance Taylor  <iant@golang.org>
177         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
179 2022-02-03  David Seifert  <soap@gentoo.org>
180             Jakub Jelinek  <jakub@redhat.com>
182         * configure.ac: Support --disable-werror.
183         * configure: Regenerate.
185 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
187         PR libbacktrace/103822
188         * Makefile.am: Fix newline.
189         * Makefile.in: Regenerate.
191 2021-11-12  Martin Liska  <mliska@suse.cz>
193         PR libbacktrace/103167
194         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
195         (elf_uncompress_lzma): Likewise.
196         * xztest.c (test_samples): memcpy only if v > 0.
198 2021-10-22  Martin Liska  <mliska@suse.cz>
200         PR testsuite/102742
201         * btest.c (MIN_DESCRIPTOR): New.
202         (MAX_DESCRIPTOR): Likewise.
203         (check_available_files): Likewise.
204         (check_open_files): Check only file descriptors that
205         were not available at the entry.
206         (main): Call check_available_files.
208 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
210         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
211         output with LANG=C.
213 2021-06-28  ClĂ©ment Chigot  <clement.chigot@atos.net>
215         * xcoff.c (SSUBTYP_DWRNGES): New define.
216         (xcoff_add): Use correct XCOFF DWARF section subtype
217         for DEBUG_RANGES. Remove lineoff workaround.
218         Adjust base_address.
219         (xcoff_initialize_syminfo): Adapt to new base_address.
220         (xcoff_lookup_pc): Likewise.
221         (xcoff_initialize_fileline): Likewise.
223 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
225         PR bootstrap/99703
226         * configure: Regenerated.
228 2021-03-03  Ian Lance Taylor  <iant@golang.org>
230         * dwarf.c (read_line_program): Don't special case file 0.
231         (read_function_entry): Likewise.
233 2021-03-02  Ian Lance Taylor  <iant@golang.org>
235         PR libbacktrace/98818
236         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
237         callers.
238         * backtrace.h: Update backtrace_error_callback comment.
240 2021-02-12  Ian Lance Taylor  <iant@golang.org>
242         * configure.ac: Check for objcopy --add-gnu-debuglink by using
243         objcopy --help.
244         * configure: Regenerate
246 2021-01-18  Ian Lance Taylor  <iant@golang.org>
248         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
249         * Makefile.in: Regenerate.
250         * configure: Regenerate.
252 2021-01-18  Ian Lance Taylor  <iant@golang.org>
254         PR debug/98716
255         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
256         filenames.
257         (read_line_program): Remove parameter u, change caller.  Don't
258         subtract one from dirs and filenames index.
259         (read_function_entry): Don't subtract one from filenames index.
261 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
263         * configure: Re-generate.
265 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
267         PR target/97865
268         * configure: Regenerate.
270 2020-12-02  Ian Lance Taylor  <iant@golang.org>
272         * dwarf.c (resolve_string): Use > rather than >= to check whether
273         string index extends past buffer.
274         (resolve_addr_index): Similarly for address index.
276 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
278         * configure: Regenerate.
280 2020-10-20  Ian Lance Taylor  <iant@golang.org>
282         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
283         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
285 2020-09-28  Ian Lance Taylor  <iant@golang.org>
287         PR libbacktrace/97082
288         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
289         * Makefile.in: Regenerate.
291 2020-09-28  Ian Lance Taylor  <iant@golang.org>
293         PR libbacktrace/97227
294         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
295         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
296         * configure: Regenerate.
297         * Makefile.in: Regenerate.
299 2020-09-23  Ian Lance Taylor  <iant@golang.org>
301         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
302         p->low.
303         (dwarf_lookup_pc): Likewise.
305 2020-09-17  Ian Lance Taylor  <iant@golang.org>
307         PR libbacktrace/97080
308         * fileline.c (backtrace_syminfo_to_full_callback): New function.
309         (backtrace_syminfo_to_full_error_callback): New function.
310         * elf.c (elf_nodebug): Call syminfo_fn if possible.
311         * internal.h (struct backtrace_call_full): Define.
312         (backtrace_syminfo_to_full_callback): Declare.
313         (backtrace_syminfo_to_full_error_callback): Declare.
314         * mtest.c (f3): Only check all[i] if data.index permits.
316 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
318         * macho.c (MACH_O_CPU_TYPE_PPC): New.
319         (MACH_O_CPU_TYPE_PPC64): New.
320         Add compile-tests for powerpc to the Mach-O variants.
322 2020-09-14  Ian Lance Taylor  <iant@golang.org>
324         PR libbacktrace/93608
325         Add support for MiniDebugInfo.
326         * elf.c (struct elf_view): Define.  Replace most uses of
327         backtrace_view with elf_view.
328         (elf_get_view): New static functions.  Replace most calls of
329         backtrace_get_view with elf_get_view.
330         (elf_release_view): New static functions.  Replace most calls of
331         backtrace_release_view with elf_release_view.
332         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
333         callers.
334         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
335         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
336         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
337         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
338         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
339         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
340         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
341         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
342         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
343         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
344         (LZMA_PROB_DIST_ALIGN_LEN): Define.
345         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
346         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
347         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
348         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
349         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
350         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
351         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
352         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
353         (LZMA_PROB_REP_LEN_MID_LEN): Define.
354         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
355         (LZMA_PROB_LITERAL_LEN): Define.
356         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
357         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
358         (LZMA_PROB_IS_REP2_OFFSET): Define.
359         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
360         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
361         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
362         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
363         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
364         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
365         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
366         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
367         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
368         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
369         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
370         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
371         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
372         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
373         (LZMA_PROB_LITERAL_OFFSET): Define.
374         (LZMA_PROB_TOTAL_COUNT): Define.
375         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
376         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
377         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
378         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
379         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
380         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
381         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
382         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
383         (elf_lzma_varint): New static function.
384         (elf_lzma_range_normalize): New static function.
385         (elf_lzma_bit, elf_lzma_integer): New static functions.
386         (elf_lzma_reverse_integer): New static function.
387         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
388         (elf_uncompress_lzma): New static function.
389         (backtrace_uncompress_lzma): New function.
390         (elf_add): Add memory and memory_size parameters.  Change all
391         callers.  Look for .gnu_debugdata section, and, if found,
392         decompress it and use it for symbols and debug info.  Permit the
393         descriptor parameter to be -1.
394         * internal.h (backtrace_uncompress_lzma): Declare.
395         * mtest.c: New file.
396         * xztest.c: New file.
397         * configure.ac: Check for nm, xz, and comm programs.  Check for
398         liblzma library.
399         (HAVE_MINIDEBUG): Define.
400         * Makefile.am (mtest_SOURCES): Define.
401         (mtest_CFLAGS, mtest_LDADD): Define.
402         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
403         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
404         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
405         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
406         (xztest_alloc_LDADD): Define.
407         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
408         (CLEANFILES): Add files created by minidebug pattern.
409         (btest.lo): Correct INCDIR reference.
410         (mtest.lo, xztest.lo, ztest.lo): New targets.
411         * configure: Regenerate.
412         * config.h.in: Regenerate.
413         * Makefile.in: Regenerate.
415 2020-09-09  Ian Lance Taylor  <iant@golang.org>
417         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
418         (coff_add): Determine and pass is_64.
420 2020-09-09  Ian Lance Taylor  <iant@golang.org>
422         PR libbacktrace/96973
423         * fileline.c (macho_get_executable_path): New static function.
424         (fileline_initialize): Call macho_get_executable_path.
426 2020-09-09  Ian Lance Taylor  <iant@golang.org>
428         * dwarf.c (function_addrs_search): Compare against the next entry
429         low address, not the high address.
430         (unit_addrs_search): Likewise.
431         (build_address_map): Add a trailing unit_addrs.
432         (read_function_entry): Add a trailing function_addrs.
433         (read_function_info): Likewise.
434         (report_inlined_functions): Search backward for function_addrs
435         match.
436         (dwarf_lookup_pc): Search backward for unit_addrs and
437         function_addrs matches.
439 2020-09-08  Ian Lance Taylor  <iant@golang.org>
441         * simple.c (simple_unwind): Correct comment spelling.
443 2020-09-08  Ian Lance Taylor  <iant@golang.org>
445         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
446         correct length when freeing diralc.
448 2020-09-08  Ian Lance Taylor  <iant@golang.org>
450         PR libbacktrace/96973
451         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
453 2020-09-08  Ian Lance Taylor  <iant@golang.org>
455         PR libbacktrace/96971
456         * filetype.awk: Only match magic number at start of line.
458 2020-08-24  Ian Lance Taylor  <iant@golang.org>
460         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
461         (MACH_O_MH_CIGAM_FAT_64): Define.
462         (struct macho_fat_arch_64): Define.
463         (macho_add_fat): Add and use is_64 parameter.
464         (macho_add): Recognize 64-bit fat files.
466 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
468         PR bootstrap/96202
469         * configure: Regenerated.
471 2020-07-08  Ian Lance Taylor  <iant@golang.org>
473         * configure.ac: Test linker support for DWARF5
474         * configure: Regenerate
476 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
478         PR bootstrap/95413
479         * configure: Regenerated.
481 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
483         PR bootstrap/95147
484         * configure: Regenerated.
486 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
488         * configure: Regenerated.
490 2020-05-13  Ian Lance Taylor  <iant@golang.org>
492         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
494 2020-05-13  Ian Lance Taylor  <iant@golang.org>
496         PR go/95061
497         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
499 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
501         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
502         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
503         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
504         enabled.
505         * Makefile.in: Regenerated.
506         * configure: Likewise.
508 2020-05-11  Ian Lance Taylor  <iant@golang.org>
510         PR libbacktrace/95012
511         * configure.ac: Check for getpagesize declaration.
512         * mmap.c: Declare getpagesize if necessary.
513         * mmapio.c: Likewise.
514         * configure: Regenerate.
515         * config.h.in: Regenerate.
516         * Makefile.in: Regenerate.
518 2020-05-09  Roland McGrath  <mcgrathr@google.com>
520         * elf.c (elf_add): Bail early if there are no section headers at all.
522 2020-05-09  Ian Lance Taylor  <iant@golang.org>
524         * elf.c (elf_add): Don't free strtab if an error occurs after
525         recording symbol information.
527 2020-05-09  Ian Lance Taylor  <iant@golang.org>
529         PR libbacktrace/88745
530         * macho.c: New file.
531         * filetype.awk: Recognize Mach-O files.
532         * Makefile.am (FORMAT_FILES): Add macho.c.
533         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
534         (%.dSYM): New pattern target.
535         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
536         (test_macho_LDADD): New target.
537         (BUILDTESTS): Add test_macho.
538         (macho.lo): Add dependencies.
539         * configure.ac: Recognize macho file type.  Check for
540         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
541         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
542         * Makefile.in: Regenerate.
543         * configure: Regenerate.
544         * config.h.in: Regenerate.
546 2020-05-09  Ian Lance Taylor  <iant@golang.org>
548         * read.c (backtrace_get_view): Support short read.
550 2020-05-09  Ian Lance Taylor  <iant@golang.org>
552         * elf.c (elf_add): If debug sections are very large or far apart,
553         read them individually rather than as a single view.
555 2020-05-08  Ian Lance Taylor  <iant@golang.org>
557         * fileline.c (sysctl_exec_name): New static function.
558         (sysctl_exec_name1): New macro or static function.
559         (sysctl_exec_name2): Likewise.
560         (fileline_initialize): Try sysctl_exec_name[12].
561         * configure.ac: Check for sysctl args to fetch executable name.
562         * configure: Regenerate.
563         * config.h.in: Regenerate.
565 2020-02-15  Ian Lance Taylor  <iant@golang.org>
567         * ztest.c (test_large): Update file to current libgo test file.
569 2020-02-03  Ian Lance Taylor  <iant@golang.org>
571         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
572         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
573         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
574         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
575         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
576         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
577         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
578         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
579         (stest_alloc_CFLAGS): Likewise.
580         * Makefile.in: Regenerate.
581         * ztest.c (error_callback_compress): Mark vdata unused.
582         (test_large): Add casts to avoid warnings.
584 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
586         Update copyright years.
588 2019-12-13  Ian Lance Taylor  <iant@golang.org>
590         Add DWARF 5 support.
591         * dwarf.c (struct attr): Add val field.
592         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
593         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
594         (struct line_header): Add addrsize field.
595         (struct line_header_format): Define.
596         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
597         fields.
598         (read_uint24): New static function.
599         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
600         and dwarf_str_size parameters with dwarf_sections parameter.  Add
601         support for new DWARF 5 forms.  Change all callers.
602         (resolve_string): New static function.
603         (resolve_addr_index): Likewise.
604         (read_abbrevs): Support DW_FORM_implicit_const.
605         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
606         and ranges_is_index fields.
607         (update_pcrange): Support DWARF 5 encodings.
608         (add_high_low_range): New static function, split out of
609         add_ranges.
610         (add_ranges_from_ranges): Likewise.
611         (add_ranges_from_rnglists): New static function.
612         (add_ranges): Just call new helper functions.
613         (find_address_ranges): Use resolve_string for strings, after
614         reading all attributes.  Handle new DWARF 5 attributes.
615         (build_address_map): Support DWARF 5 compilation units.
616         (read_v2_paths): New static function, split out of
617         read_line_header.
618         (read_lnct): New static function.
619         (read_line_header_format_entries): Likewise.
620         (read_line_header): Add ddata parameter.  Support DWARF 5 line
621         headers.  Call new helper functions.  Change all callers.
622         (read_line_program): Use addrsize from line program header.  Don't
623         special case directory index 0 for DWARF 5.
624         (read_referenced_name): Use resolve_string.
625         (read_function_entry): Handle DWARF 5 encodings.  Use
626         resolve_string.
627         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
628         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
629         * elf.c (dwarf_section_names): Add new section names.
630         * pecoff.c (dwarf_section_names): Likewise.
631         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
632         fields.
633         * configure.ac: Define HAVE_DWARF5 automake conditional.
634         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
635         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
636         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
637         (dwarf5_alloc_LDADD): Likewise.
638         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
639         (CLEANFILES, clean-local): Define.
641 2019-12-08  Ian Lance Taylor  <iant@golang.org>
643         * dwarf.c (struct pcrange): Define.
644         (update_pcrange, add_ranges): New static functions.
645         (add_unit_addr): Change signature to work with add_ranges.  Don't
646         add base_address here.
647         (add_unit_ranges): Remove.
648         (find_address_ranges): Replace str/ranges parameters with
649         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
650         callers.
651         (add_function_range): Change signature to work with add_ranges.
652         Don't add base_address here.
653         (add_function_ranges): Remove.
654         (read_function_entry): Use update_pcrange and add_ranges.
656 2019-12-04  Ian Lance Taylor  <iant@golang.org>
658         * edtest.c (test1): Add noclone attribute.
660 2019-12-04  Ian Lance Taylor  <iant@golang.org>
662         * internal.h (enum dwarf_section): Define.
663         (struct dwarf_sections): Define.
664         (backtrace_dwarf_add): Update declaration to replace specific
665         section parameters with dwarf_sections parameter.
666         * dwarf.c (struct dwarf_data): Replace specific section fields
667         with dwarf_sections field.
668         (read_attribute): Use dwarf_sections with altlink.
669         (build_address_map): Replace specific section parameters with
670         dwarf_sections parameter.  Change all callers.
671         (read_line_info): Use dwarf_sections with ddata.
672         (read_referenced_name): Likewise.
673         (add_function_ranges): Likewise.
674         (read_function_entry): Likewise.
675         (read_function_info): Likewise.
676         (build_dwarf_data): Replace specific section parameters with
677         dwarf_sections parameter.  Change all callers.
678         (backtrace_dwarf_add): Likewise.
679         * elf.c (enum debug_section): Remove.
680         (dwarf_section_names): Remove .zdebug names.
681         (elf_add): Track zsections separately.  Build dwarf_sections.
682         * pecoff.c (enum debug_section): Remove.
683         (struct debug_section_info): Remove data field.
684         (coff_add): Build dwarf_sections.
685         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
686         references with DEBUG_xxx references.
687         (xcoff_add): Build dwarf_sections.
689 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
691         * configure: Regenerate.
693 2019-09-26  Ian Lance Taylor  <iant@golang.org>
695         PR libbacktrace/91908
696         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
697         __sync_bool_compare_and_swap to void.
698         * xcoff.c (backtrace_initialize): Likewise.
700 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
702         * configure.ac: Remove references to spu.
703         * configure: Regenerate.
705 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
707         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
708         test_elf_64.
709         * Makefile.in: Regenerate.
711 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
713         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
714         handling.
715         * configure: Regenerate.
717 2019-03-11  Ian Lance Taylor  <iant@golang.org>
719         PR libbacktrace/89669
720         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
721         HAVE_ELF.
722         * Makefile.in: Regenerate.
724 2019-02-26  Tom de Vries  <tdevries@suse.de>
726         * btest.c (test5): Allow global.* as minimal symbol name for global.
728 2019-02-26  Tom de Vries  <tdevries@suse.de>
730         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
731         * Makefile.in: Regenerate.
733 2019-02-12  Tom de Vries  <tdevries@suse.de>
735         PR libbacktrace/81983
736         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
738 2019-02-10  Tom de Vries  <tdevries@suse.de>
740         * Makefile.am (BUILDTESTS): Add btest_lto.
741         * Makefile.in: Regenerate.
742         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
743         __attribute__((noclone)).
745 2019-02-08  Tom de Vries  <tdevries@suse.de>
747         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
748         * print.c (backtrace_print): Same.
749         * simple.c (backtrace_simple): Same.
751 2019-02-08  Tom de Vries  <tdevries@suse.de>
753         PR libbacktrace/78063
754         * dwarf.c (build_address_map): Keep all parsed units.
755         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
757 2019-01-31  Tom de Vries  <tdevries@suse.de>
759         PR libbacktrace/89136
760         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
761         'debugaltlink_name_len =+ 1'.
763 2019-01-29  Tom de Vries  <tdevries@suse.de>
765         * install-debuginfo-for-buildid.sh.in: New script.
766         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
767         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
768         * Makefile.in: Regenerate.
769         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
770         (READELF): Set with AC_CHECK_PROG.
771         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
772         * configure: Regenerate.
773         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
774         (elf_open_debugfile_by_buildid): ... here.
776 2019-01-29  Tom de Vries  <tdevries@suse.de>
778         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
779         allocfail.
780         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
781         (check_PROGRAMS): Add BUILDTESTS.
782         * Makefile.in: Regenerate.
784 2019-01-28  Tom de Vries  <tdevries@suse.de>
786         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
787         Use $< to access prerequisite.
788         * Makefile.in: Regenerate.
790 2019-01-25  Nathan Sidwell  <nathan@acm.org>
792         * elf.c (elf_add): Pass "" filename to recursive call with
793         separated debug.
795 2019-01-25  Tom de Vries  <tdevries@suse.de>
797         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
798         filename == "".
799         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
800         * Makefile.in: Regenerate.
802 2019-01-25  Tom de Vries  <tdevries@suse.de>
804         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
805         (TESTS): Rename dtest to btest_gnudebuglink.
806         * Makefile.in: Regenerate.
808 2019-01-23  Tom de Vries  <tdevries@suse.de>
810         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
811         (units_search, find_unit): Use size_t for offset.
812         (build_address_map): Use size_t for unit_offset.
814 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
816         * allocfail.c (main): Increase portability of printf statement.
818 2019-01-18  Ian Lance Taylor  <iant@golang.org>
820         PR libbacktrace/88890
821         * mmapio.c (backtrace_get_view): Change size parameter to
822         uint64_t.  Check that value fits in size_t.
823         * read.c (backtrace_get_view): Likewise.
824         * internal.h (backtrace_get_view): Update declaration.
825         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
827 2019-01-17  Tom de Vries  <tdevries@suse.de>
829         PR libbacktrace/82857
830         * configure.ac (DWZ): Set with AC_CHECK_PROG.
831         (HAVE_DWZ): Set with AM_CONDITIONAL.
832         * configure: Regenerate.
833         * Makefile.am (TESTS): Add btest_dwz.
834         * Makefile.in: Regenerate.
836 2019-01-17  Tom de Vries  <tdevries@suse.de>
838         PR libbacktrace/82857
839         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
840         (read_attribute): Handle DW_FORM_GNU_ref_alt using
841         ATTR_VAL_REF_ALT_INFO.
842         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
844 2019-01-17  Tom de Vries  <tdevries@suse.de>
846         * dwarf.c (struct unit): Add low_offset and high_offset fields.
847         (struct unit_vector): New type.
848         (struct dwarf_data): Add units and units_counts fields.
849         (find_unit): New function.
850         (find_address_ranges): Add and handle unit_tag parameter.
851         (build_address_map): Add and handle units_vec parameter.
852         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
853         units vector.
855 2019-01-17  Tom de Vries  <tdevries@suse.de>
857         PR libbacktrace/82857
858         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
859         using altlink.
861 2019-01-17  Tom de Vries  <tdevries@suse.de>
863         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
864         (read_attribute): Add altlink parameter.  Handle missing altlink for
865         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
866         (find_address_ranges, build_address_map, build_dwarf_data): Add and
867         handle altlink parameter.
868         (read_referenced_name, read_function_entry): Add argument to
869         read_attribute call.
871 2019-01-17  Tom de Vries  <tdevries@suse.de>
873         * dwarf.c (struct dwarf_data): Add altlink field.
874         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
875         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
876         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
877         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
878         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
879         * xcoff.c (xcoff_add): Same.
881 2019-01-17  Tom de Vries  <tdevries@suse.de>
883         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
884         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
885         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
886         argument to backtrace_dwarf_add call.
887         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
888         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
889         * xcoff.c (xcoff_add): Same.
891 2019-01-17  Tom de Vries  <tdevries@suse.de>
893         * elf.c (elf_add): Add and handle with_buildid_data and
894         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
895         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
897 2019-01-16  Tom de Vries  <tdevries@suse.de>
899         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
900         of ...
901         (read_referenced_name): ... here, and ...
902         (read_function_entry): ... here.
904 2019-01-16  Tom de Vries  <tdevries@suse.de>
906         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
907         name.
908         (read_function_entry): Same.  Don't allow name found via
909         DW_AT_abstract_origin or case DW_AT_specification to override linkage
910         name.
912 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
914         PR other/16615
916         * backtrace.h: Mechanically replace "can not" with "cannot".
918 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
920         Update copyright years.
922 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
924         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
925         in sed pattern.
926         * Makefile.in: Regenerate.
928 2018-12-28  Tom de Vries  <tdevries@suse.de>
930         * dwarf.c (build_address_map): Reuse unused units.
932 2018-12-28  Tom de Vries  <tdevries@suse.de>
934         * dwarf.c (build_address_map): Simplify by removing local variable
935         abbrevs.
937 2018-12-28  Ian Lance Taylor  <iant@golang.org>
938             Tom de Vries  <tdevries@suse.de>
940         PR libbacktrace/88063
941         * dwarf.c (free_unit_addrs_vector): Remove.
942         (build_address_map): Keep track of allocated units in vector.  Free
943         allocated units and corresponding abbrevs upon failure.  Remove now
944         redundant call to free_unit_addrs_vector.  Free addrs vector upon
945         failure.  Free allocated unit vector.
947 2018-12-28  Tom de Vries  <tdevries@suse.de>
949         * dwarf.c (build_address_map): Free addrs vector upon failure.
951 2018-12-14  Tom de Vries  <tdevries@suse.de>
953         PR testsuite/88491
954         * allocfail.sh: Remove "set -o pipefail".
956 2018-12-12  Tom de Vries  <tdevries@suse.de>
958         * Makefile.am (TESTS): Add allocfail.sh.
959         (check_PROGRAMS): Add allocfail.
960         * Makefile.in: Regenerate.
961         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
962         Include alloc.c.
963         * allocfail.c: New file.
964         * allocfail.sh: New file.
966 2018-11-30  Tom de Vries  <tdevries@suse.de>
968         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
969         test_xcoff_64, test_pecoff and test_unknown.
970         * Makefile.in: Regenerate.
971         * test_format.c: New file.
973 2018-11-30  Tom de Vries  <tdevries@suse.de>
975         * Makefile.am : Add _with_alloc version for each test in
976         check_PROGRAMS.
977         * Makefile.in: Regenerate.
979 2018-11-30  Tom de Vries  <tdevries@suse.de>
981         * internal.h (backtrace_vector_free): New static inline fuction,
982         factored out of ...
983         * dwarf.c (read_line_info): ... here.
985 2018-11-28  Tom de Vries  <tdevries@suse.de>
987         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
988         failure.
990 2018-11-27  Tom de Vries  <tdevries@suse.de>
992         * mmap.c (backtrace_vector_release): Same.
993         * unittest.c (test1): Add check.
995 2018-11-27  Tom de Vries  <tdevries@suse.de>
997         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
998         instead of realloc.
999         * Makefile.am (check_PROGRAMS): Add unittest.
1000         * Makefile.in: Regenerate.
1001         * unittest.c: New file.
1003 2018-11-22  Tom de Vries  <tdevries@suse.de>
1005         * dwarf.c (read_initial_length): Factor out of ...
1006         (build_address_map, read_line_info): ... here.
1008 2018-11-21  Tom de Vries  <tdevries@suse.de>
1010         * dwarf.c (read_string): Factor out of ...
1011         (read_attribute, read_line_header, read_line_program): ... here.
1013 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
1015         PR bootstrap/82856
1016         * Makefile.am: Include multilib.am.
1017         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
1018         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
1020 2018-10-05  Ian Lance Taylor  <iant@golang.org>
1022         PR libbacktrace/87529
1023         * backtrace.h: Document that backtrace_create_state should be
1024         called only once.
1026 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
1028         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
1029         * Makefile.in: Regenerate.
1030         * config.h.in: Likewise.
1031         * configure: Likewise.
1033 2018-08-01  Tony Reix  <tony.reix@atos.net>
1035         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
1036         (struct xcoff_func, struct xcoff_func_vector): New structs.
1037         (xcoff_syminfo): Drop leading dot from symbol name.
1038         (xcoff_line_compare, xcoff_line_search): Remove.
1039         (xcoff_func_compare, xcoff_func_search): New static functions.
1040         (xcoff_lookup_pc): Search function table.
1041         (xcoff_add_line, xcoff_process_linenos): Remove.
1042         (xcoff_initialize_fileline): Build function table.
1044 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
1046         PR other/86198
1047         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
1048         checking up to 36 bytes.
1050 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1052         * configure: Regenerated.
1054 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
1056         * configure: Regenerated.
1058 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1060         * backtrace.c: Revert last two changes.  Don't call mmap
1061         directly.
1063 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1065         * backtrace.c: Include backtrace-supported.h before checking
1066         BACKTRACE_USES_MALLOC.
1068 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1070         * backtrace.c (backtrace_full): When testing whether we can
1071         allocate memory, call mmap directly, and munmap the memory.
1073 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
1075         PR other/85161
1076         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
1077         big endian, only use 32-bit loads if endianity macros are predefined
1078         and indicate big or little endian.
1080 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1082         PR target/84148
1083         * configure: Regenerate.
1085 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
1087         PR other/82368
1088         * elf.c (SHT_PROGBITS): Undefine and define.
1090 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
1092         PR other/82368
1093         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
1094         (struct elf_ppc64_opd_data): New type.
1095         (elf_initialize_syminfo): Add opd argument, handle symbols
1096         pointing into the PowerPC64 ELFv1 .opd section.
1097         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
1098         to structure with .opd data to elf_initialize_syminfo.
1100 2018-01-31  Ian Lance Taylor  <iant@golang.org>
1102         * elf.c (elf_add): Close descriptor if we use a debugfile.
1103         * btest.c (check_open_files): New static function.
1104         (main): Call check_open_files.
1106 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1108         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
1109         desired CRC is zero.
1110         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
1112 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1114         * pecoff.c (coff_add): Only release syms_view if it is valid.
1116 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1118         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
1120 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1122         * pecoff.c (coff_add): Use coff_read4, not memcpy.
1124 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1126         PR other/68239
1127         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
1128         on the free list.
1130 2018-01-19  Tony Reix  <tony.reix@atos.net>
1132         * xcoff.c (xcoff_incl_compare): New function.
1133         (xcoff_incl_search): New function.
1134         (xcoff_process_linenos): Use bsearch to find include file.
1135         (xcoff_initialize_fileline): Sort include file information.
1137 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1139         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1140         288.
1141         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1142         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1143         (elf_zlib_default_table): Update.
1144         (elf_zlib_default_dist_table): New static array.
1145         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1146         for block type 1.
1147         * ztest.c (struct zlib_test): Add uncompressed_len.
1148         (tests): Initialize uncompressed_len field.  Add new test case.
1149         (test_samples): Use uncompressed_len field.
1151 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1153         Update copyright years.
1155 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1157         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1158         * aclocal.m4: Regenerate.
1159         * Makefile.in: Likewise.
1160         * configure: Likewise.
1162 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1164         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1165         zlib uncompress function.
1167 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1169         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1170         Read a four byte integer.
1171         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1172         boundary before ever calling elf_zlib_fetch.
1173         * ztest.c (test_large): Simplify print statements a bit.
1175 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1177         * ztest.c: #include <errno.h>.
1178         (TEST_TIMING): Don't define, don't test.
1179         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1180         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1181         (ZLIB_CLOCK_GETTIME_ARG): Define.
1182         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1183         * Makefile.am: Likewise.
1184         * configure, Makefile.in: Rebuild.
1186 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1188         PR other/67165
1189         * Makefile.am: Append the content of clock_gettime_link to
1190         ztest_LDADD.
1191         * configure.ac: Test for the case that clock_gettime is in librt.
1192         * Makefile.in: Regenerate.
1193         * configure: Likewise.
1195         PR other/67165
1196         * configure.ac: Check for clock_gettime.
1197         * config.h.in: Regenerate.
1198         * configure: Likewise.
1199         * ztest.c (average_time, test_large): Conditionalize test timing
1200         on clock_gettime availability.
1202 2017-09-29  Tony Reix  <tony.reix@atos.net>
1204         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1205         (STYP_DWARF, SSUBTYP_DW*): Define.
1206         (enum dwarf_section): Define.
1207         (struct dwsect_info): Define.
1208         (xcoff_add): Look for DWARF sections, pass them to
1209         backtrace_dwarf_add.
1211 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1213         PR other/67165
1214         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1215         (unlikely): Define.
1216         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1217         (b_elf_chdr): Define type.
1218         (enum debug_section): Add ZDEBUG_xxx values.
1219         (debug_section_names): Add names for new sections.
1220         (struct debug_section_info): Add compressed field.
1221         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1222         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1223         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1224         (HUFFMAN_SECONDARY_SHIFT): Define.
1225         (ZDEBUG_TABLE_SIZE): Define.
1226         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1227         (final_next_secondary): New static variable if
1228         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1229         (elf_zlib_inflate_table): New static function.
1230         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1231         function to produce fixed Huffman table.
1232         (elf_zlib_default_table): New static variable.
1233         (elf_zlib_inflate): New static function.
1234         (elf_zlib_verify_checksum): Likewise.
1235         (elf_zlib_inflate_and_verify): Likewise.
1236         (elf_uncompress_zdebug): Likewise.
1237         (elf_uncompress_chdr): Likewise.
1238         (backtrace_uncompress_zdebug): New extern function.
1239         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1240         sections, and uncompress them.
1241         * internal.h (backtrace_compress_zdebug): Declare.
1242         * ztest.c: New file.
1243         * configure.ac: Check for -lz and check whether the linker
1244         supports --compress-debug-sections.
1245         * Makefile.am (ztest_SOURCES): New variable.
1246         (ztest_CFLAGS, ztest_LDADD): New variables.
1247         (check_PROGRAMS): Add ztest.
1248         (ctestg_SOURCES): New variable.
1249         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1250         (ctesta_SOURCES): New variable.
1251         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1252         (check_PROGRAMS): Add ctestg and ctesta.
1253         * configure, config.h.in, Makefile.in: Rebuild.
1255 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1257         PR sanitizer/77631
1258         * configure.ac: Check for lstat and readlink.
1259         * elf.c (lstat, readlink): Provide dummy versions if real versions
1260         are not available.
1261         * configure, config.h.in: Rebuild.
1263 2017-09-21  Ian Lance Taylor  <iant@google.com>
1265         PR go/82284
1266         * elf.c (backtrace_initialize): Set pd.exe_filename.
1268 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1269             Denis Khalikov  <d.khalikov@partner.samsung.com>
1271         PR sanitizer/77631
1272         Support for external debug info.
1273         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1274         (S_ISLNK): Define if not defined.
1275         (xstrnlen): Define if strnlen is not available.
1276         (b_elf_note): Define type.
1277         (NT_GNU_BUILD_ID): Define macro.
1278         (elf_crc32, elf_crc32_file): New static functions.
1279         (elf_is_symlink, elf_readlink): New static functions.
1280         (elf_open_debugfile_by_buildid): New static function.
1281         (elf_try_debugfile): New static function.
1282         (elf_find_debugfile_by_debuglink): New static function.
1283         (elf_open_debugfile_by_debuglink): New static function.
1284         (elf_add): Add filename and debuginfo parameters.  Adjust all
1285         callers.  Look for external debug info notes, and try to fetch
1286         debug info from external file.
1287         (struct phdr_data): Add exe_filename field.
1288         (phdr_callback): Pass filename to elf_add.
1289         (backtrace_initialize): Add filename parameter.
1290         * internal.h (backtrace_initialize): Add filename parameter.
1291         * fileline.c (fileline_initialize): Pass filename to
1292         backtrace_initialize.
1293         * pecoff.c (fileline_initialize): Add unused filename parameter.
1294         * unknown.c (fileline_initialize): Likewise.
1295         * xcoff.c (fileline_initialize): Likewise.
1296         * configure.ac: Check for objcopy --add-gnu-debuglink.
1297         * Makefile.am (dtest): New test target.
1298         * configure, Makefile.in: Rebuild.
1300 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1302         PR other/81096
1303         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1304         * Makefile.in: Regenerate.
1306 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1308         PR other/81096
1309         * libbacktrace/Makefile.in
1310         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1312 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1314         PR bootstrap/81638
1315         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1317 2017-07-28  Tony Reix  <tony.reix@atos.net>
1319         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1321 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1323         * fileline.c (fileline_initialize): Print pid_t as long.
1325 2017-07-26  Tony Reix  <tony.reix@atos.net>
1327         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1328         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1329         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1330         * configure, config.h.in: Regenerate.
1332 2017-07-21  Tony Reix  <tony.reix@atos.net>
1334         * filetype.awk: Add AIX XCOFF type detection.
1335         * configure.ac: Recognize xcoff format.
1336         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1337         * fileline.c: Include <unistd.h>.
1338         (fileline_initialize): Add case for AIX procfs.
1339         * xcoff.c: New file.
1340         * configure, Makefile.in: Rebuild.
1342 2017-06-21  Richard Biener  <rguenther@suse.de>
1344         * configure.ac: Add AC_SYS_LARGEFILE.
1345         * config.h.in: Regenerate.
1346         * configure: Likewise.
1348 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1350         * elf.c (backtrace_initialize): Always set *fileline_fn.
1351         * ttest.c: New file.
1352         * btest.c: Move support functions into testlib.c.  Change calls to
1353         check to pass file name.
1354         * testlib.c: New file, copied from (part of) btest.c.
1355         * testlib.h: New file, declarations for testlib.c.
1356         * edtest.c: Use testlib.h and testlib.c.
1357         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1358         * Makefile.am (btest_SOURCES): Add testlib.c.
1359         (edtest_SOURCES): Likewise.
1360         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1361         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1362         * configure, Makefile.in: Rebuild.
1364 2017-05-19  Than McIntosh  <thanm@google.com>
1366         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1367         (read_line_header): Don't allocate dirs if dirs_count == 0.
1368         * edtest.c: New file.
1369         * edtest2.c: New file.
1370         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1371         (check_PROGRAMS): Add edtest.
1372         (edtest2_build.c, gen_edtest2_build): New targets.
1373         * Makefile.in: Rebuild.
1375 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1377         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1378         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1380 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1382         Update copyright years.
1384 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1386         * configure: Regenerate.
1388 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1390         * all: Remove meaningless trailing whitespace.
1392 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1394         PR target/71161
1395         * elf.c (phdr_callback) [__i386__]: Add
1396         __attribute__((__force_align_arg_pointer__)).
1398 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1400         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1401         avoid possible crash.
1402         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1403         missing debug info anymore.
1405 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1407         * mmap.c (MAP_FAILED): Define if not defined.
1409 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1411         Update copyright years.
1413 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1415         * configure.ac: Specify that DJGPP do not have mmap
1416         even when sys/mman.h exists.
1417         * configure: Regenerate
1419 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1421         PR libgfortran/68115
1422         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1423         * configure: Regenerate.
1424         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1425         to void.
1427 2015-09-17  Ian Lance Taylor  <iant@google.com>
1429         * posix.c (backtrace_open): Cast second argument of open() to int.
1431 2015-09-11  Ian Lance Taylor  <iant@google.com>
1433         * Makefile.am (backtrace.lo): Depend on internal.h.
1434         (sort.lo, stest.lo): Add explicit dependencies.
1435         * Makefile.in: Rebuild.
1437 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1439         * backtrace.c: #include <sys/types.h>.
1441 2015-09-08  Ian Lance Taylor  <iant@google.com>
1443         PR other/67457
1444         * backtrace.c: #include "internal.h".
1445         (struct backtrace_data): Add can_alloc field.
1446         (unwind): If can_alloc is false, don't try to get file/line
1447         information.
1448         (backtrace_full): Set can_alloc field in bdata.
1449         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1450         NULL.
1451         * mmap.c (backtrace_alloc): Likewise.
1452         * internal.h: Update comments for backtrace_alloc and
1453         backtrace_free.
1455 2015-09-08  Ian Lance Taylor  <iant@google.com>
1457         PR other/67457
1458         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1460 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1462         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1463         * configure: Regenerate.
1465 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1467         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1468         Remove setting PIC_FLAG when building as target library.
1469         * configure: Regenerate.
1471 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1473         * configure.ac: Only compile with -fPIC if the target
1474         supports it.
1475         * configure: Regenerate.
1477 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1479         * configure.ac: Set have_mmap to no on spu-*-* targets.
1480         * configure: Regenerate.
1482 2015-08-13  Ian Lance Taylor  <iant@google.com>
1484         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1485         Change all callers.
1487 2015-06-11  Martin Sebor  <msebor@redhat.com>
1489         PR sanitizer/65479
1490         * dwarf.c (struct line): Add new field idx.
1491         (line_compare): Use it.
1492         (add_line): Set it.
1493         (read_line_info): Reset it.
1495 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1497         * pecoff.c: New file.
1498         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1499         * Makefile.in: Regenerate.
1500         * filetype.awk: Detect pecoff.
1501         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1502         Add pecoff.
1503         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1504         true.
1505         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1506         * configure: Regenerate.
1507         * pecoff.c: New file.
1509 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1511         * Makefile.in: Regenerated with automake-1.11.6.
1512         * aclocal.m4: Likewise.
1513         * configure: Likewise.
1515 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1517         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1518         * configure: Regenerate.
1520 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1522         Update copyright years.
1524 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1526         PR bootstrap/63784
1527         * configure: Regenerated.
1529 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1531         * ChangeLog.jit: New.
1533 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1535         PR target/63610
1536         * configure: Regenerate.
1538 2014-10-23  Ian Lance Taylor  <iant@google.com>
1540         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1541         Fix to return void *.
1543 2014-05-08  Ian Lance Taylor  <iant@google.com>
1545         * mmap.c (backtrace_free): If freeing a large aligned block of
1546         memory, call munmap rather than holding onto it.
1547         (backtrace_vector_grow): When growing a vector, double the number
1548         of pages requested.  When releasing the old version of a grown
1549         vector, pass the correct size to backtrace_free.
1551 2014-03-07  Ian Lance Taylor  <iant@google.com>
1553         * sort.c (backtrace_qsort): Use middle element as pivot.
1555 2014-03-06  Ian Lance Taylor  <iant@google.com>
1557         * sort.c: New file.
1558         * stest.c: New file.
1559         * internal.h (backtrace_qsort): Declare.
1560         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1561         (read_line_info, read_function_entry): Likewise.
1562         (read_function_info, build_dwarf_data): Likewise.
1563         * elf.c (elf_initialize_syminfo): Likewise.
1564         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1565         (stest_SOURCES, stest_LDADD): Define.
1566         (check_PROGRAMS): Add stest.
1568 2014-02-07  Misty De Meo  <misty@brew.sh>
1570         PR target/58710
1571         * configure.ac: Use AC_LINK_IFELSE in check for
1572         _Unwind_GetIPInfo.
1573         * configure: Regenerate.
1575 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1577         Update copyright years
1579 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1581         * elf.c (ET_DYN): Undefine and define again.
1582         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1583         return early -1 without closing the descriptor.
1584         (struct phdr_data): Add exe_descriptor.
1585         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1586         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1587         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1588         call to elf_add.
1589         (backtrace_initialize): Adjust call to elf_add.  If it returns
1590         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1592 2013-12-05  Ian Lance Taylor  <iant@google.com>
1594         * alloc.c (backtrace_vector_finish): Add error_callback and data
1595         parameters.  Call backtrace_vector_release.  Return address base.
1596         * mmap.c (backtrace_vector_finish): Add error_callback and data
1597         parameters.  Return address base.
1598         * dwarf.c (read_function_info): Get new address base from
1599         backtrace_vector_finish.
1600         * internal.h (backtrace_vector_finish): Update declaration.
1602 2013-11-27  Ian Lance Taylor  <iant@google.com>
1604         * dwarf.c (find_address_ranges): New static function, broken out
1605         of build_address_map.
1606         (build_address_map): Call it.
1607         * btest.c (check): Check for missing filename or function, rather
1608         than crashing.
1609         (f3): Check that enough frames were returned.
1611 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1613         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1614         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1615         last argument.
1616         * btest.c (struct symdata): Add size field.
1617         (callback_three): Add symsize argument.  Copy it to the data->size
1618         field.
1619         (f23): Set symdata.size to 0.
1620         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1621         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1622         values.
1624         * atomic.c: Include sys/types.h.
1626 2013-11-18  Ian Lance Taylor  <iant@google.com>
1628         * configure.ac: Check for support of __atomic extensions.
1629         * internal.h: Declare or #define atomic functions for use in
1630         backtrace code.
1631         * atomic.c: New file.
1632         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1633         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1634         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1635         (backtrace_initialize): Likewise.
1636         * fileline.c (fileline_initialize): Likewise.
1637         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1638         * configure, config.h.in, Makefile.in: Rebuild.
1640 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1642         * elf.c (SHN_UNDEF): Define.
1643         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1644         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1645         (elf_add): Adjust caller.
1647         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1649 2013-11-16  Ian Lance Taylor  <iant@google.com>
1651         * backtrace.h (backtrace_create_state): Correct comment about
1652         threading.
1654 2013-11-15  Ian Lance Taylor  <iant@google.com>
1656         * backtrace.h (backtrace_syminfo): Update comment and parameter
1657         name to take any address, not just a PC value.
1658         * elf.c (STT_OBJECT): Define.
1659         (elf_nosyms): Rename parameter pc to addr.
1660         (elf_symbol_search): Rename local variable pc to addr.
1661         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1662         (elf_syminfo): Rename parameter pc to addr.
1663         * btest.c (global): New global variable.
1664         (test5): New test.
1665         (main): Call test5.
1667 2013-10-17  Ian Lance Taylor  <iant@google.com>
1669         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1670         is missing.
1672 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1674         * configure.ac: Add --enable-host-shared, setting up
1675         pre-existing PIC_FLAG variable within Makefile.am et al.
1676         * configure: Regenerate.
1678 2013-09-20  Alan Modra  <amodra@gmail.com>
1680         * configure: Regenerate.
1682 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1684         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1686 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1688         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1689         dl_iterate_phdr callbacks.
1691 2013-03-25  Ian Lance Taylor  <iant@google.com>
1693         * alloc.c: #include <sys/types.h>.
1694         * mmap.c: Likewise.
1696 2013-01-31  Ian Lance Taylor  <iant@google.com>
1698         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1699         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1701 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1703         PR other/56076
1704         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1705         attribute was not seen.
1707 2013-01-16  Ian Lance Taylor  <iant@google.com>
1709         * dwarf.c (struct unit): Add filename and abs_filename fields.
1710         (build_address_map): Set new fields when reading unit.
1711         (dwarf_lookup_pc): If we don't find an entry in the line table,
1712         just return the main file name.
1714 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1716         Update copyright years.
1718 2013-01-01  Ian Lance Taylor  <iant@google.com>
1720         PR bootstrap/54834
1721         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1722         $(MULTIBUILDTOP)/../../gcc/include.
1723         * Makefile.in: Rebuild.
1725 2013-01-01  Ian Lance Taylor  <iant@google.com>
1727         PR other/55536
1728         * mmap.c (backtrace_alloc): Don't call sync functions if not
1729         threaded.
1730         (backtrace_free): Likewise.
1732 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1734         * mmapio.c: Define MAP_FAILED if not defined.
1736 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1738         PR bootstrap/54926
1739         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1740         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1741         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1742         accepts it.
1743         * Makefile.in: Regenerated.
1744         * configure: Regenerated.
1746 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1748         PR bootstrap/54926
1749         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1750         * Makefile.in: Regenerated.
1752 2012-11-20  Ian Lance Taylor  <iant@google.com>
1754         * dwarf.c (read_attribute): Always clear val.
1756 2012-11-13  Ian Lance Taylor  <iant@google.com>
1758         PR other/55312
1759         * configure.ac: Only add -Werror if building a target library.
1760         * configure: Rebuild.
1762 2012-11-12  Ian Lance Taylor  <iant@google.com>
1763             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1764             Gerald Pfeifer  <gerald@pfeifer.com>
1766         * configure.ac: Check for getexecname.
1767         * fileline.c: #include <errno.h>.  Define getexecname if not
1768         available.
1769         (fileline_initialize): Try to find the executable in a few
1770         different ways.
1771         * print.c (error_callback): Only print the filename if it came
1772         from the backtrace state.
1773         * configure, config.h.in: Rebuild.
1775 2012-10-29  Ian Lance Taylor  <iant@google.com>
1777         * mmap.c (backtrace_vector_release): Correct last patch: add
1778         aligned, not size.
1780 2012-10-29  Ian Lance Taylor  <iant@google.com>
1782         * mmap.c (backtrace_vector_release): Make sure freed block is
1783         aligned on 8-byte boundary.
1785 2012-10-26  Ian Lance Taylor  <iant@google.com>
1787         PR other/55087
1788         * posix.c (backtrace_open): Add does_not_exist parameter.
1789         * elf.c (phdr_callback): Do not warn if shared library could not
1790         be opened.
1791         * fileline.c (fileline_initialize): Update calls to
1792         backtrace_open.
1793         * internal.h (backtrace_open): Update declaration.
1795 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
1797         PR target/55061
1798         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1799         * configure: Regenerate.
1801 2012-10-24  Ian Lance Taylor  <iant@google.com>
1803         PR target/55061
1804         * configure.ac: Check whether -funwind-tables option works.
1805         * configure: Rebuild.
1807 2012-10-11  Ian Lance Taylor  <iant@google.com>
1809         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1810         * configure: Rebuild.
1812 2012-10-10  Ian Lance Taylor  <iant@google.com>
1814         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1815         lower case.
1817 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
1819         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1821 2012-10-09  Ian Lance Taylor  <iant@google.com>
1823         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1824         (backtrace_dwarf_add): Likewise.
1826 2012-10-09  Ian Lance Taylor  <iant@google.com>
1828         Add support for tracing through shared libraries.
1829         * configure.ac: Check for link.h and dl_iterate_phdr.
1830         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
1831         ELF macros before #defining them.
1832         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1833         dl_iterate_phdr.
1834         (struct elf_syminfo_data): Add next field.
1835         (elf_initialize_syminfo): Initialize next field.
1836         (elf_add_syminfo_data): New static function.
1837         (elf_add): New static function, broken out of
1838         backtrace_initialize.  Call backtrace_dwarf_add instead of
1839         backtrace_dwarf_initialize.
1840         (struct phdr_data): Define.
1841         (phdr_callback): New static function.
1842         (backtrace_initialize): Call elf_add.
1843         * dwarf.c (struct dwarf_data): Add next and base_address fields.
1844         (add_unit_addr): Add base_address parameter.  Change all callers.
1845         (add_unit_ranges, build_address_map): Likewise.
1846         (add_line): Add ddata parameter.  Change all callers.
1847         (read_line_program, add_function_range): Likewise.
1848         (dwarf_lookup_pc): New static function, broken out of
1849         dwarf_fileline.
1850         (dwarf_fileline): Call dwarf_lookup_pc.
1851         (build_dwarf_data): New static function.
1852         (backtrace_dwarf_add): New function.
1853         (backtrace_dwarf_initialize): Remove.
1854         * internal.h (backtrace_dwarf_initialize): Don't declare.
1855         (backtrace_dwarf_add): Declare.
1856         * configure, config.h.in: Rebuild.
1858 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
1860         * btest.c (f23): Avoid uninitialized variable warning.
1862 2012-10-04  Ian Lance Taylor  <iant@google.com>
1864         * dwarf.c: If the system header files do not declare strnlen,
1865         provide our own version.
1867 2012-10-03  Ian Lance Taylor  <iant@google.com>
1869         * dwarf.c (read_uleb128): Fix overflow test.
1870         (read_sleb128): Likewise.
1871         (build_address_map): Don't change unit_buf.start.
1873 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
1875         PR other/54761
1876         * configure.ac (EXTRA_FLAGS): New.
1877         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1878         * configure, Makefile.in: Regenerate.
1880 2012-09-29  Ian Lance Taylor  <iant@google.com>
1882         PR other/54749
1883         * fileline.c (fileline_initialize): Pass errnum as -1 when
1884         reporting that we could not read executable information after a
1885         previous failure.
1887 2012-09-27  Ian Lance Taylor  <iant@google.com>
1889         PR bootstrap/54732
1890         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1891         * Makefile.am: Add dependencies for all objects.
1892         * configure, aclocal.m4, Makefile.in: Rebuild.
1894 2012-09-27  Ian Lance Taylor  <iant@google.com>
1896         PR other/54726
1897         * elf.c (backtrace_initialize): Set *fileln_fn, not
1898         state->fileln_fn.
1900 2012-09-19  Ian Lance Taylor  <iant@google.com>
1902         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1903         as a target library.
1904         * configure: Rebuild.
1906 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1907             Ian Lance Taylor  <iant@google.com>
1909         * configure.ac (GCC_HEADER_STDINT): Invoke.
1910         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1911         * btest.c: Don't include <stdint.h>.
1912         * dwarf.c: Likewise.
1913         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1915 2012-09-18  Ian Lance Taylor  <iant@google.com>
1917         PR bootstrap/54623
1918         * Makefile.am (AM_CPPFLAGS): Define.
1919         (AM_CFLAGS): Remove -I options.
1920         * Makefile.in: Rebuild.
1922 2012-09-18  Ian Lance Taylor  <iant@google.com>
1924         * posix.c (O_BINARY): Define if not defined.
1925         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
1926         HAVE_FCNTL is defined.
1927         * configure.ac: Test for the fcntl function.
1928         * configure, config.h.in: Rebuild.
1930 2012-09-18  Ian Lance Taylor  <iant@google.com>
1932         * btest.c (test1, test2, test3, test4): Add the unused attribute.
1934 2012-09-18  Ian Lance Taylor  <iant@google.com>
1936         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1938 2012-09-18  Ian Lance Taylor  <iant@google.com>
1940         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1941         * mmapio.c: Don't define _GNU_SOURCE.
1942         * configure, config.h.in: Rebuild.
1944 2012-09-18  Ian Lance Taylor  <iant@google.com>
1946         * configure.ac: Check whether strnlen is declared.
1947         * dwarf.c: Declare strnlen if not declared.
1948         * configure, config.h.in: Rebuild.
1950 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1952         * fileline.c: Include <stdlib.h>.
1953         * mmap.c: Likewise.
1955 2012-09-17  Ian Lance Taylor  <iant@google.com>
1957         PR bootstrap/54611
1958         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
1959         parameter.
1961 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
1963         PR bootstrap/54611
1964         * nounwind.c (backtrace_simple): Add state parameter.
1966 2012-09-17  Ian Lance Taylor  <iant@google.com>
1968         PR bootstrap/54609
1969         * unknown.c (unknown_fileline): Add state parameter, remove
1970         fileline_data parameter, name error_callback parameter.
1971         (backtrace_initialize): Add state parameter.
1973 2012-09-17  Ian Lance Taylor  <iant@google.com>
1975         * Initial implementation.
1977 Copyright (C) 2012-2023 Free Software Foundation, Inc.
1979 Copying and distribution of this file, with or without modification,
1980 are permitted in any medium without royalty provided the copyright
1981 notice and this notice are preserved.