libstdc++: Remove unused alias template in std::optional
[official-gcc.git] / libbacktrace / ChangeLog
blob7568d45aae4c7ac08c8cee913ae983ff896ee1f7
1 2024-08-05  Ian Lance Taylor  <iant@golang.org>
3         * configure.ac (ACX_PROG_CC_WARNING_OPTS): Add -Wpointer-arith.
4         * pecoff.c (coff_add): Cast void pointers.
5         * xcoff.c (xcoff_add): Likewise.
6         * configure: Regenerate.
8 2024-07-30  Ian Lance Taylor  <iant@golang.org>
10         * pecoff.c (LDR_DLL_NOTIFICATION): Put function modifier
11         inside parentheses.
12         (LDR_REGISTER_FUNCTION): Likewise.
14 2024-07-18  Ian Lance Taylor  <iant@golang.org>
16         * internal.h: Use __has_attribute to check for fallthrough
17         attribute.
18         * elf.c (elf_zstd_decompress): Use ATTRIBUTE_FALLTHROUGH rather
19         than a FALLTHROUGH comment.
21 2024-07-18  Ian Lance Taylor  <iant@golang.org>
23         * print.c (print_syminfo_callback): Add cast to avoid warning.
25 2024-07-18  Ian Lance Taylor  <iant@golang.org>
27         * print.c (print_syminfo_callback): New static function.
28         (print_callback): Call backtrace_syminfo if there is no function
29         or file name.
31 2024-07-18  Ian Lance Taylor  <iant@golang.org>
33         * README: Add notes about dl_iterate_phdr.
35 2024-07-17  Ian Lance Taylor  <iant@golang.org>
37         * xcoff.c (struct xcoff_fileline_data): Change base_address field
38         to struct libbacktrace_base_address.
39         (xcoff_initialize_syminfo): Change base_address to struct
40         libbacktrace_base_address.  Use libbacktrace_add_base.
41         (xcoff_initialize_fileline): Likewise.
42         (xcoff_lookup_pc): Use libbacktrace_add_base.
43         (xcoff_add): Change base_address to struct
44         libbacktrace_base_address.
45         (xcoff_armem_add, xcoff_add_shared_libs): Likewise.
46         (backtrace_initialize): Likewise.
47         * Makefile.am (xcoff.lo): Remove unused target.
48         (xcoff_32.lo, xcoff_64.lo): New targets.
49         * Makefile.in: Regenerate.
51 2024-07-16  Ian Lance Taylor  <iant@golang.org>
53         * internal.h: If FDPIC, #include <link.h> and/or <sys/link.h>.
54         (libbacktrace_using_fdpic): Define.
55         (struct libbacktrace_base_address): Define.
56         (libbacktrace_add_base): Define.
57         (backtrace_dwarf_add): Change base_address to struct
58         libbacktrace_base_address.
59         * dwarf.c (struct dwarf_data): Change base_address to struct
60         libbacktrace_base_address.
61         (add_ranges, find_address_ranges, build_ddress_map): Likewise.
62         (build_dwarf_data, build_dwarf_add): Likewise.
63         (add_low_high_range): Change base_address to struct
64         libbacktrace_base_address.  Use libbacktrace_add_base.
65         (add_ranges_from_ranges, add_ranges_from_rnglists): Likewise.
66         (add_line): Use libbacktrace_add_base.
67         * elf.c (elf_initialize_syminfo): Change base_address to struct
68         libbacktrace_base_address.  Use libbacktrace_add_base.
69         (elf_add): Change base_address to struct
70         libbacktrace_base_address.
71         (phdr_callback): Likewise.  Initialize base_address.m.
72         (backtrace_initialize): If using FDPIC, don't call elf_add with
73         main executable; always use dl_iterate_phdr.
74         * macho.c (macho_add_symtab): Change base_address to struct
75         libbacktrace_base_address.  Use libbacktrace_add_base.
76         (macho_syminfo): Change base_address to struct
77         libbacktrace_base_address.
78         (macho_add_fat, macho_add_dsym, macho_add): Likewise.
79         (backtrace_initialize): Likewise.  Initialize base_address.m.
80         * pecoff.c (coff_initialize_syminfo): Change base_address to
81         struct libbacktrace_base_address.  Use libbacktrace_add_base.
82         (coff_add): Change base_address to struct
83         libbacktrace_base_address.  Initialize base_address.m.
85 2024-07-12  Ian Lance Taylor  <iant@golang.org>
87         * elf.c (elf_add): Don't use .gnu_debugdata if we are already
88         reading a debuginfo file.
89         * Makefile.am (m2test_*): New test targets.
90         (CHECK_PROGRAMS): Add m2test.
91         (MAKETESTS): Add m2test_minidebug2.
92         (%_minidebug2): New pattern.
93         (CLEANFILES): Remove minidebug2 files.
94         * Makefile.in: Regenerate.
96 2024-07-12  Ian Lance Taylor  <iant@golang.org>
98         * btest.c (test5): Don't fail if symbol size is 0.
99         * mtest.c (test5): Likewise.
101 2024-07-12  Ian Lance Taylor  <iant@golang.org>
103         * macho.c (MACH_O_N_EXT): Don't define.
104         (MACH_O_N_UNDF): Define.
105         (macho_defined_symbol): Don't discard N_EXT symbols.  Do
106         discard N_UNDF symbols.
108 2024-07-11  Ian Lance Taylor  <iant@golang.org>
110         * btest.c (test1, test3): Add optnone attribute.
111         * edtest.c (test1): Likewise.
112         * mtest.c (test1, test3): Likewise.
113         * configure.ac: Use -Wno-attributes and -Wno-unknown-attributes.
114         * configure: Regenerate.
116 2024-07-11  Ian Lance Taylor  <iant@golang.org>
118         * elf.c (elf_nodebug): Suggest -g.
119         * macho.c (macho_nodebug): Suggest -g and dsymutil.
120         * pecoff.c (coff_nodebug): Suggest -g.
122 2024-07-11  Ian Lance Taylor  <iant@golang.org>
124         * dwarf.c: Remove trailing whitespace.
125         * macho.c: Likewise.
127 2024-06-16  Ian Lance Taylor  <iant@golang.org>
129         * elf.c (elf_fetch_bits_backward) Don't fail if no bits are
130         available.
132 2024-05-03  Ian Lance Taylor  <iant@golang.org>
134         * pecoff.c (struct dll_notification_data): Define.
135         (LDR_DLL_NOTIFICATION): New typedef.
136         (LDR_REGISTER_FUNCTION): New typedef.
137         (struct dll_notification_context): Define.
138         (dll_notification): New static function.
139         (backtrace_initialize): Register DLL notification.
141 2024-04-28  Ian Lance Taylor  <iant@golang.org>
143         * configure.ac: Checked for tlhelp32.h
144         * pecoff.c: Include <tlhelp32.h> if available.
145         (backtrace_initialize): Use tlhelp32 api for a snapshot to
146         detect loaded modules.
147         (coff_add): New argument for the module handle of the file,
148         to get the base address.
149         * configure, config.h.in: Regenerate.
151 2024-04-23  Ian Lance Taylor  <iant@golang.org>
153         * configure.ac: Test --compress-debug-sections=zlib-gnu and
154         --compress-debug-sections=zlib-gabi separately, setting new
155         automake conditionals.
156         * Makefile.am (ctestg, ctestg_alloc): Only build if
157         HAVE_COMPRESSED_DEBUG_ZLIB_GNU.
158         (ctesta, ctesta_alloc): Only build if
159         HAVE_COMPRESSED_DEBUG_ZLIB_GABI.
160         (ctestzstd_alloc): New test if HAVE_COMPRESSED_DEBUG_ZSTD.
161         * configure, Makefile.in: Regenerate.
163 2024-03-08  Ian Lance Taylor  <iant@golang.org>
165         * elf.c (elf_uncompress_chdr): Don't assume compressed section is
166         aligned.
168 2024-03-02  Ian Lance Taylor  <iant@golang.org>
170         * Makefile.am (libbacktrace_testing_ldflags): Define.
171         (*_LDFLAGS): Add $(libbacktrace_testing_ldflags) for test
172         programs.
173         * Makefile.in: Regenerate
175 2024-03-02  Ian Lance Taylor  <iant@golang.org>
177         * elf.c (elf_uncompress_lzma_block): Skip all header padding bytes
178         and verify that they are zero.
180 2024-03-02  Ian Lance Taylor  <iant@golang.org>
182         PR libbacktrace/114201
183         * elf.c (elf_add): Add caller_opd parameter.  Change all callers.
184         Release opd data after all recursive calls.
186 2024-03-01  Ian Lance Taylor  <iant@golang.org>
188         * elf.c (elf_add): Add the symbol table from a debuginfo file.
189         * Makefile.am (MAKETESTS): Add buildidfull and gnudebuglinkfull
190         variants of buildid and gnudebuglink tests.
191         (%_gnudebuglinkfull, %_buildidfull): New patterns.
192         * Makefile.in: Regenerate.
194 2023-11-30  Ian Lance Taylor  <iant@golang.org>
196         * pecoff.c: Include <windows.h> if available.
197         (coff_add): On Windows call GetModuleHandle to get base address.
199 2023-11-29  Ian Lance Taylor  <iant@golang.org>
201         * fileline.c: Include <windows.h> if available.
202         (windows_get_executable_path): New static function.
203         (fileline_initialize): Call windows_get_executable_path.
204         * configure.ac: Checked for windows.h
205         * configure: Regenerate.
206         * config.h.in: Regenerate.
208 2023-10-22  Iain Sandoe  <iain@sandoe.co.uk>
210         * configure: Regenerate.
211         * configure.ac: Handle Darwin rpaths.
213 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
215         * configure: Regenerate.
217 2023-08-07  Alexander von Gluck IV  <kallisti5@unixzen.com>
219         * configure: Regenerate.
221 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
223         * configure: Regenerate.
225 2023-08-07  Nick Alcock  <nick.alcock@oracle.com>
227         * configure: Regenerate.
229 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
231         * configure: Regenerate.
233 2023-08-07  H.J. Lu  <hjl.tools@gmail.com>
235         * configure: Regenerate.
237 2023-08-03  Richard Biener  <rguenther@suse.de>
239         * zstdtest.c (test_samples): Properly compute the allocation
240         size for the uncompressed data.
242 2023-07-31  Ian Lance Taylor  <iant@golang.org>
244         * configure.ac: Check for _pgmptr declaration.
245         * fileline.c (fileline_initialize): Check for _pgmfptr before
246         /proc/self/exec.
247         * configure, config.h.in: Regenerate.
249 2023-03-28  Ian Lance Taylor  <iant@golang.org>
251         * elf.c (elf_zstd_read_fse): Call elf_fetch_bits after reading
252         bits, not before.  Add unlikely for error case.
253         (elf_zstd_offset_table): Regenerate.
254         (elf_zstd_read_huff): Clear 13 entries in weight_mark, not 12.
255         (elf_zstd_read_literals): For a single stream adjust by
256         total_streams_size, not compressed_size.
258 2023-01-20  Ian Lance Taylor  <iant@golang.org>
260         * dwarf.c (struct function_addrs): Change low and high fields to
261         uintptr_t.
262         (struct unit_addrs): Likewise.
263         (resolve_addr_index): Change address parameter to uintptr_t*.
264         (add_unit_addr): Change lowpc and highpc parameters to uintptr_t.
265         (add_function_range): Likewise.
266         (struct pcrange): Change lowpc and highpc fields to uintptr_t.
267         (add_low_high_range): Change add_range lowpc and highpc parameters
268         to uintptr_t.
269         (add_ranges_from_ranges): Likewise.
270         (add_ranges_from_rnglists): Likewise.
271         (add_low_high_range): Chnage lowpc and highpc variables to
272         uintpr_t.
273         (add_ranges_from_rnglists): Change some local variables to
274         uintptr_t.
275         (add_ranges_from_ranges): Change base parameter to uintptr_t.
276         (add_ranges_from_rnglists): Likewise.
277         (read_function_entry): Likewise.
278         (resolve_addr_index): Add explicit casts to uintptr_t.
279         (update_pcrange): Likewise.
280         (add_ranges_from_ranges): Likewise.
281         (add_ranges_from_rnglists): Likewise.
282         (read_function_entry): Likewise.
284 2023-01-17  Martin Liska  <mliska@suse.cz>
286         * Makefile.in: Regenerate.
288 2023-01-06  Ian Lance Taylor  <iant@golang.org>
290         PR libbacktrace/108297
291         * configure.ac: Test whether linker supports --build-id.
292         * Makefile.am: Only run --build-id tests if supported.
293         * configure, Makefile.in: Regenerate.
295 2022-12-17  Ian Lance Taylor  <iant@golang.org>
297         * elf.c (elf_fetch_backward_init): New static function.
298         (ZSTD_TABLE_SIZE): Use huffman scratch space size rather than
299         literal size.
300         (ZSTD_TABLE_WORK_LIT_SIZE): Don't define.
301         (elf_zstd_read_huff): Use elf_fetch_backward_init.
302         (elf_zstd_read_literals): New static function.
303         (ZSTD_LIT_RAW, ZSTD_LIT_RLE, ZSTD_LIT_HUFF): Don't define.
304         (struct elf_zstd_literals): Don't define.
305         (elf_zstd_literal_output): Remove static function.
306         (elf_zstd_decompress): Use elf_fetch_backward_init and
307         elf_zstd_read_literals.  Rewrite literal copying.<
309 2022-12-10  Ian Lance Taylor  <iant@golang.org>
311         * elf.c (ZSTD_TABLE_*): Use elf_zstd_fse_baseline_entry.
312         (ZSTD_ENCODE_BASELINE_BITS): Define.
313         (ZSTD_DECODE_BASELINE, ZSTD_DECODE_BASEBITS): Define.
314         (elf_zstd_literal_length_base): New static const array.
315         (elf_zstd_match_length_base): Likewise.
316         (struct elf_zstd_fse_baseline_entry): Define.
317         (elf_zstd_make_literal_baseline_fse): New static function.
318         (elf_zstd_make_offset_baseline_fse): Likewise.
319         (elf_zstd_make_match_baseline_fse): Likewise.
320         (print_table, main): Use elf_zstd_fse_baseline_entry.
321         (elf_zstd_lit_table, elf_zstd_match_table): Likewise.
322         (elf_zstd_offset_table): Likewise.
323         (struct elf_zstd_seq_decode): Likewise.  Remove use_rle and rle
324         fields.
325         (elf_zstd_unpack_seq_decode): Use elf_zstd_fse_baseline_entry,
326         taking a conversion function.  Convert RLE to FSE.
327         (elf_zstd_literal_length_baseline): Remove.
328         (elf_zstd_literal_length_bits): Remove.
329         (elf_zstd_match_length_baseline): Remove.
330         (elf_zstd_match_length_bits): Remove.
331         (elf_zstd_decompress): Use elf_zstd_fse_baseline_entry.  Rewrite
332         and simplify main loop.
334 2022-12-08  Ian Lance Taylor  <iant@golang.org>
336         * configure.ac: Check for zstd library and
337         --compress-debug-sections=zstd linker option.
338         * Makefile.am (zstdtest_*): New targets.
339         (zstdtest_alloc_*, ctestzstd_*): New targets.
340         (BUILDTESTS): Add zstdtest, zstdtest_alloc, ctestzstd as
341         appropriate.
342         * elf.c (ELFCOMPRESS_ZSTD): Define.
343         (elf_fetch_bits): Rename from elf_zlib_fetch.  Update uses.
344         (elf_fetch_bits_backward): New static function.
345         (ZLIB_HUFFMAN_*): Rename from HUFFMAN_*.  Update uses.
346         (ZLIB_TABLE_*): Rename from ZDEBUG_TABLE_*.  Update uses.
347         (ZSTD_TABLE_*): Define.
348         (struct elf_zstd_fse_entry): Define.
349         (elf_zstd_read_fse): New static function.
350         (elf_zstd_build_fse): Likewise.
351         (lit): Define if BACKTRACE_GENERATE_ZSTD_FSE_TABLES.
352         (match, offset, next, print_table, main): Likewise.
353         (elf_zstd_lit_table): New static const array.
354         (elf_zstd_match_table, elf_zstd_offset_table): Likewise.
355         (elf_zstd_read_huff): New static function.
356         (struct elf_zstd_seq_decode): Define.
357         (elf_zstd_unpack_seq_decode): New static function.
358         (ZSTD_LIT_*): Define.
359         (struct elf_zstd_literals): Define.
360         (elf_zstd_literal_output): New static function.
361         (ZSTD_LITERAL_LENGTH_BASELINE_OFFSET): Define.
362         (elf_zstd_literal_length_baseline): New static const array.
363         (elf_zstd_literal_length_bits): Likewise.
364         (ZSTD_MATCH_LENGTH_BASELINE_OFFSET): Define.
365         (elf_zstd_match_length_baseline): New static const array.
366         (elf_zstd_match_length_bits): Likewise.
367         (elf_zstd_decompress): New static function.
368         (ZDEBUG_TABLE_SIZE): New definition.
369         (elf_uncompress_chdr): Support ELF_COMPRESS_ZSTD.
370         (backtrace_uncompress_zstd): New function.
371         (elf_add): Use ZLIB_TABLE_SIZE for zlib-gnu sections.
372         * internal.h (backtrace_uncompress_zstd): Declare.
373         * zstdtest.c: New file.
374         * configure, config.h.in, Makefile.in: Regenerate.
376 2022-10-12  Martin Liska  <mliska@suse.cz>
378         * configure: Regenerate.
380 2022-10-11  Olivier Hainque  <hainque@adacore.com>
381             Olivier Hainque  <hainque@adacore.com>
383         * configure: Regenerate.
385 2022-07-08  Ian Lance Taylor  <iant@golang.org>
387         * configure.ac: Check for sys/link.h.  Use either link.h or
388         sys/link.h when checking for dl_iterate_phdr.
389         * elf.c: Include sys/link.h if available.
390         * configure, config.h.in: Regenerate.
392 2022-07-07  Ian Lance Taylor  <iant@golang.org>
394         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
395         loop if we can't find debug info for one shared library.
397 2022-07-07  Ian Lance Taylor  <iant@golang.org>
399         * Makefile.am (MAKETESTS): New variable split out of TESTS.
400         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
401         * Makefile.in: Regenerate.
403 2022-06-27  Ian Lance Taylor  <iant@golang.org>
405         * configure.ac: Use grep instead of fgrep.
406         * configure, Makefile.in: Regenerate.
408 2022-05-28  Ian Lance Taylor  <iant@golang.org>
410         PR libbacktrace/105721
411         * README: Update.
413 2022-04-05  Ian Lance Taylor  <iant@golang.org>
415         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
416         uncompressed block.
418 2022-02-17  Ian Lance Taylor  <iant@golang.org>
420         * dwarf.c (find_address_ranges): Handle skeleton units.
421         (read_function_entry): Likewise.
423 2022-02-16  Ian Lance Taylor  <iant@golang.org>
425         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
427 2022-02-03  David Seifert  <soap@gentoo.org>
428             Jakub Jelinek  <jakub@redhat.com>
430         * configure.ac: Support --disable-werror.
431         * configure: Regenerate.
433 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
435         PR libbacktrace/103822
436         * Makefile.am: Fix newline.
437         * Makefile.in: Regenerate.
439 2021-11-12  Martin Liska  <mliska@suse.cz>
441         PR libbacktrace/103167
442         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
443         (elf_uncompress_lzma): Likewise.
444         * xztest.c (test_samples): memcpy only if v > 0.
446 2021-10-22  Martin Liska  <mliska@suse.cz>
448         PR testsuite/102742
449         * btest.c (MIN_DESCRIPTOR): New.
450         (MAX_DESCRIPTOR): Likewise.
451         (check_available_files): Likewise.
452         (check_open_files): Check only file descriptors that
453         were not available at the entry.
454         (main): Call check_available_files.
456 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
458         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
459         output with LANG=C.
461 2021-06-28  Clément Chigot  <clement.chigot@atos.net>
463         * xcoff.c (SSUBTYP_DWRNGES): New define.
464         (xcoff_add): Use correct XCOFF DWARF section subtype
465         for DEBUG_RANGES. Remove lineoff workaround.
466         Adjust base_address.
467         (xcoff_initialize_syminfo): Adapt to new base_address.
468         (xcoff_lookup_pc): Likewise.
469         (xcoff_initialize_fileline): Likewise.
471 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
473         PR bootstrap/99703
474         * configure: Regenerated.
476 2021-03-03  Ian Lance Taylor  <iant@golang.org>
478         * dwarf.c (read_line_program): Don't special case file 0.
479         (read_function_entry): Likewise.
481 2021-03-02  Ian Lance Taylor  <iant@golang.org>
483         PR libbacktrace/98818
484         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
485         callers.
486         * backtrace.h: Update backtrace_error_callback comment.
488 2021-02-12  Ian Lance Taylor  <iant@golang.org>
490         * configure.ac: Check for objcopy --add-gnu-debuglink by using
491         objcopy --help.
492         * configure: Regenerate
494 2021-01-18  Ian Lance Taylor  <iant@golang.org>
496         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
497         * Makefile.in: Regenerate.
498         * configure: Regenerate.
500 2021-01-18  Ian Lance Taylor  <iant@golang.org>
502         PR debug/98716
503         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
504         filenames.
505         (read_line_program): Remove parameter u, change caller.  Don't
506         subtract one from dirs and filenames index.
507         (read_function_entry): Don't subtract one from filenames index.
509 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
511         * configure: Re-generate.
513 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
515         PR target/97865
516         * configure: Regenerate.
518 2020-12-02  Ian Lance Taylor  <iant@golang.org>
520         * dwarf.c (resolve_string): Use > rather than >= to check whether
521         string index extends past buffer.
522         (resolve_addr_index): Similarly for address index.
524 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
526         * configure: Regenerate.
528 2020-10-20  Ian Lance Taylor  <iant@golang.org>
530         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
531         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
533 2020-09-28  Ian Lance Taylor  <iant@golang.org>
535         PR libbacktrace/97082
536         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
537         * Makefile.in: Regenerate.
539 2020-09-28  Ian Lance Taylor  <iant@golang.org>
541         PR libbacktrace/97227
542         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
543         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
544         * configure: Regenerate.
545         * Makefile.in: Regenerate.
547 2020-09-23  Ian Lance Taylor  <iant@golang.org>
549         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
550         p->low.
551         (dwarf_lookup_pc): Likewise.
553 2020-09-17  Ian Lance Taylor  <iant@golang.org>
555         PR libbacktrace/97080
556         * fileline.c (backtrace_syminfo_to_full_callback): New function.
557         (backtrace_syminfo_to_full_error_callback): New function.
558         * elf.c (elf_nodebug): Call syminfo_fn if possible.
559         * internal.h (struct backtrace_call_full): Define.
560         (backtrace_syminfo_to_full_callback): Declare.
561         (backtrace_syminfo_to_full_error_callback): Declare.
562         * mtest.c (f3): Only check all[i] if data.index permits.
564 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
566         * macho.c (MACH_O_CPU_TYPE_PPC): New.
567         (MACH_O_CPU_TYPE_PPC64): New.
568         Add compile-tests for powerpc to the Mach-O variants.
570 2020-09-14  Ian Lance Taylor  <iant@golang.org>
572         PR libbacktrace/93608
573         Add support for MiniDebugInfo.
574         * elf.c (struct elf_view): Define.  Replace most uses of
575         backtrace_view with elf_view.
576         (elf_get_view): New static functions.  Replace most calls of
577         backtrace_get_view with elf_get_view.
578         (elf_release_view): New static functions.  Replace most calls of
579         backtrace_release_view with elf_release_view.
580         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
581         callers.
582         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
583         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
584         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
585         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
586         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
587         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
588         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
589         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
590         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
591         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
592         (LZMA_PROB_DIST_ALIGN_LEN): Define.
593         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
594         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
595         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
596         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
597         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
598         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
599         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
600         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
601         (LZMA_PROB_REP_LEN_MID_LEN): Define.
602         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
603         (LZMA_PROB_LITERAL_LEN): Define.
604         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
605         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
606         (LZMA_PROB_IS_REP2_OFFSET): Define.
607         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
608         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
609         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
610         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
611         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
612         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
613         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
614         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
615         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
616         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
617         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
618         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
619         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
620         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
621         (LZMA_PROB_LITERAL_OFFSET): Define.
622         (LZMA_PROB_TOTAL_COUNT): Define.
623         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
624         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
625         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
626         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
627         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
628         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
629         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
630         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
631         (elf_lzma_varint): New static function.
632         (elf_lzma_range_normalize): New static function.
633         (elf_lzma_bit, elf_lzma_integer): New static functions.
634         (elf_lzma_reverse_integer): New static function.
635         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
636         (elf_uncompress_lzma): New static function.
637         (backtrace_uncompress_lzma): New function.
638         (elf_add): Add memory and memory_size parameters.  Change all
639         callers.  Look for .gnu_debugdata section, and, if found,
640         decompress it and use it for symbols and debug info.  Permit the
641         descriptor parameter to be -1.
642         * internal.h (backtrace_uncompress_lzma): Declare.
643         * mtest.c: New file.
644         * xztest.c: New file.
645         * configure.ac: Check for nm, xz, and comm programs.  Check for
646         liblzma library.
647         (HAVE_MINIDEBUG): Define.
648         * Makefile.am (mtest_SOURCES): Define.
649         (mtest_CFLAGS, mtest_LDADD): Define.
650         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
651         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
652         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
653         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
654         (xztest_alloc_LDADD): Define.
655         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
656         (CLEANFILES): Add files created by minidebug pattern.
657         (btest.lo): Correct INCDIR reference.
658         (mtest.lo, xztest.lo, ztest.lo): New targets.
659         * configure: Regenerate.
660         * config.h.in: Regenerate.
661         * Makefile.in: Regenerate.
663 2020-09-09  Ian Lance Taylor  <iant@golang.org>
665         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
666         (coff_add): Determine and pass is_64.
668 2020-09-09  Ian Lance Taylor  <iant@golang.org>
670         PR libbacktrace/96973
671         * fileline.c (macho_get_executable_path): New static function.
672         (fileline_initialize): Call macho_get_executable_path.
674 2020-09-09  Ian Lance Taylor  <iant@golang.org>
676         * dwarf.c (function_addrs_search): Compare against the next entry
677         low address, not the high address.
678         (unit_addrs_search): Likewise.
679         (build_address_map): Add a trailing unit_addrs.
680         (read_function_entry): Add a trailing function_addrs.
681         (read_function_info): Likewise.
682         (report_inlined_functions): Search backward for function_addrs
683         match.
684         (dwarf_lookup_pc): Search backward for unit_addrs and
685         function_addrs matches.
687 2020-09-08  Ian Lance Taylor  <iant@golang.org>
689         * simple.c (simple_unwind): Correct comment spelling.
691 2020-09-08  Ian Lance Taylor  <iant@golang.org>
693         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
694         correct length when freeing diralc.
696 2020-09-08  Ian Lance Taylor  <iant@golang.org>
698         PR libbacktrace/96973
699         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
701 2020-09-08  Ian Lance Taylor  <iant@golang.org>
703         PR libbacktrace/96971
704         * filetype.awk: Only match magic number at start of line.
706 2020-08-24  Ian Lance Taylor  <iant@golang.org>
708         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
709         (MACH_O_MH_CIGAM_FAT_64): Define.
710         (struct macho_fat_arch_64): Define.
711         (macho_add_fat): Add and use is_64 parameter.
712         (macho_add): Recognize 64-bit fat files.
714 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
716         PR bootstrap/96202
717         * configure: Regenerated.
719 2020-07-08  Ian Lance Taylor  <iant@golang.org>
721         * configure.ac: Test linker support for DWARF5
722         * configure: Regenerate
724 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
726         PR bootstrap/95413
727         * configure: Regenerated.
729 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
731         PR bootstrap/95147
732         * configure: Regenerated.
734 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
736         * configure: Regenerated.
738 2020-05-13  Ian Lance Taylor  <iant@golang.org>
740         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
742 2020-05-13  Ian Lance Taylor  <iant@golang.org>
744         PR go/95061
745         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
747 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
749         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
750         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
751         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
752         enabled.
753         * Makefile.in: Regenerated.
754         * configure: Likewise.
756 2020-05-11  Ian Lance Taylor  <iant@golang.org>
758         PR libbacktrace/95012
759         * configure.ac: Check for getpagesize declaration.
760         * mmap.c: Declare getpagesize if necessary.
761         * mmapio.c: Likewise.
762         * configure: Regenerate.
763         * config.h.in: Regenerate.
764         * Makefile.in: Regenerate.
766 2020-05-09  Roland McGrath  <mcgrathr@google.com>
768         * elf.c (elf_add): Bail early if there are no section headers at all.
770 2020-05-09  Ian Lance Taylor  <iant@golang.org>
772         * elf.c (elf_add): Don't free strtab if an error occurs after
773         recording symbol information.
775 2020-05-09  Ian Lance Taylor  <iant@golang.org>
777         PR libbacktrace/88745
778         * macho.c: New file.
779         * filetype.awk: Recognize Mach-O files.
780         * Makefile.am (FORMAT_FILES): Add macho.c.
781         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
782         (%.dSYM): New pattern target.
783         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
784         (test_macho_LDADD): New target.
785         (BUILDTESTS): Add test_macho.
786         (macho.lo): Add dependencies.
787         * configure.ac: Recognize macho file type.  Check for
788         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
789         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
790         * Makefile.in: Regenerate.
791         * configure: Regenerate.
792         * config.h.in: Regenerate.
794 2020-05-09  Ian Lance Taylor  <iant@golang.org>
796         * read.c (backtrace_get_view): Support short read.
798 2020-05-09  Ian Lance Taylor  <iant@golang.org>
800         * elf.c (elf_add): If debug sections are very large or far apart,
801         read them individually rather than as a single view.
803 2020-05-08  Ian Lance Taylor  <iant@golang.org>
805         * fileline.c (sysctl_exec_name): New static function.
806         (sysctl_exec_name1): New macro or static function.
807         (sysctl_exec_name2): Likewise.
808         (fileline_initialize): Try sysctl_exec_name[12].
809         * configure.ac: Check for sysctl args to fetch executable name.
810         * configure: Regenerate.
811         * config.h.in: Regenerate.
813 2020-02-15  Ian Lance Taylor  <iant@golang.org>
815         * ztest.c (test_large): Update file to current libgo test file.
817 2020-02-03  Ian Lance Taylor  <iant@golang.org>
819         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
820         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
821         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
822         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
823         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
824         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
825         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
826         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
827         (stest_alloc_CFLAGS): Likewise.
828         * Makefile.in: Regenerate.
829         * ztest.c (error_callback_compress): Mark vdata unused.
830         (test_large): Add casts to avoid warnings.
832 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
834         Update copyright years.
836 2019-12-13  Ian Lance Taylor  <iant@golang.org>
838         Add DWARF 5 support.
839         * dwarf.c (struct attr): Add val field.
840         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
841         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
842         (struct line_header): Add addrsize field.
843         (struct line_header_format): Define.
844         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
845         fields.
846         (read_uint24): New static function.
847         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
848         and dwarf_str_size parameters with dwarf_sections parameter.  Add
849         support for new DWARF 5 forms.  Change all callers.
850         (resolve_string): New static function.
851         (resolve_addr_index): Likewise.
852         (read_abbrevs): Support DW_FORM_implicit_const.
853         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
854         and ranges_is_index fields.
855         (update_pcrange): Support DWARF 5 encodings.
856         (add_high_low_range): New static function, split out of
857         add_ranges.
858         (add_ranges_from_ranges): Likewise.
859         (add_ranges_from_rnglists): New static function.
860         (add_ranges): Just call new helper functions.
861         (find_address_ranges): Use resolve_string for strings, after
862         reading all attributes.  Handle new DWARF 5 attributes.
863         (build_address_map): Support DWARF 5 compilation units.
864         (read_v2_paths): New static function, split out of
865         read_line_header.
866         (read_lnct): New static function.
867         (read_line_header_format_entries): Likewise.
868         (read_line_header): Add ddata parameter.  Support DWARF 5 line
869         headers.  Call new helper functions.  Change all callers.
870         (read_line_program): Use addrsize from line program header.  Don't
871         special case directory index 0 for DWARF 5.
872         (read_referenced_name): Use resolve_string.
873         (read_function_entry): Handle DWARF 5 encodings.  Use
874         resolve_string.
875         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
876         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
877         * elf.c (dwarf_section_names): Add new section names.
878         * pecoff.c (dwarf_section_names): Likewise.
879         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
880         fields.
881         * configure.ac: Define HAVE_DWARF5 automake conditional.
882         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
883         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
884         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
885         (dwarf5_alloc_LDADD): Likewise.
886         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
887         (CLEANFILES, clean-local): Define.
889 2019-12-08  Ian Lance Taylor  <iant@golang.org>
891         * dwarf.c (struct pcrange): Define.
892         (update_pcrange, add_ranges): New static functions.
893         (add_unit_addr): Change signature to work with add_ranges.  Don't
894         add base_address here.
895         (add_unit_ranges): Remove.
896         (find_address_ranges): Replace str/ranges parameters with
897         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
898         callers.
899         (add_function_range): Change signature to work with add_ranges.
900         Don't add base_address here.
901         (add_function_ranges): Remove.
902         (read_function_entry): Use update_pcrange and add_ranges.
904 2019-12-04  Ian Lance Taylor  <iant@golang.org>
906         * edtest.c (test1): Add noclone attribute.
908 2019-12-04  Ian Lance Taylor  <iant@golang.org>
910         * internal.h (enum dwarf_section): Define.
911         (struct dwarf_sections): Define.
912         (backtrace_dwarf_add): Update declaration to replace specific
913         section parameters with dwarf_sections parameter.
914         * dwarf.c (struct dwarf_data): Replace specific section fields
915         with dwarf_sections field.
916         (read_attribute): Use dwarf_sections with altlink.
917         (build_address_map): Replace specific section parameters with
918         dwarf_sections parameter.  Change all callers.
919         (read_line_info): Use dwarf_sections with ddata.
920         (read_referenced_name): Likewise.
921         (add_function_ranges): Likewise.
922         (read_function_entry): Likewise.
923         (read_function_info): Likewise.
924         (build_dwarf_data): Replace specific section parameters with
925         dwarf_sections parameter.  Change all callers.
926         (backtrace_dwarf_add): Likewise.
927         * elf.c (enum debug_section): Remove.
928         (dwarf_section_names): Remove .zdebug names.
929         (elf_add): Track zsections separately.  Build dwarf_sections.
930         * pecoff.c (enum debug_section): Remove.
931         (struct debug_section_info): Remove data field.
932         (coff_add): Build dwarf_sections.
933         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
934         references with DEBUG_xxx references.
935         (xcoff_add): Build dwarf_sections.
937 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
939         * configure: Regenerate.
941 2019-09-26  Ian Lance Taylor  <iant@golang.org>
943         PR libbacktrace/91908
944         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
945         __sync_bool_compare_and_swap to void.
946         * xcoff.c (backtrace_initialize): Likewise.
948 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
950         * configure.ac: Remove references to spu.
951         * configure: Regenerate.
953 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
955         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
956         test_elf_64.
957         * Makefile.in: Regenerate.
959 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
961         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
962         handling.
963         * configure: Regenerate.
965 2019-03-11  Ian Lance Taylor  <iant@golang.org>
967         PR libbacktrace/89669
968         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
969         HAVE_ELF.
970         * Makefile.in: Regenerate.
972 2019-02-26  Tom de Vries  <tdevries@suse.de>
974         * btest.c (test5): Allow global.* as minimal symbol name for global.
976 2019-02-26  Tom de Vries  <tdevries@suse.de>
978         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
979         * Makefile.in: Regenerate.
981 2019-02-12  Tom de Vries  <tdevries@suse.de>
983         PR libbacktrace/81983
984         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
986 2019-02-10  Tom de Vries  <tdevries@suse.de>
988         * Makefile.am (BUILDTESTS): Add btest_lto.
989         * Makefile.in: Regenerate.
990         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
991         __attribute__((noclone)).
993 2019-02-08  Tom de Vries  <tdevries@suse.de>
995         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
996         * print.c (backtrace_print): Same.
997         * simple.c (backtrace_simple): Same.
999 2019-02-08  Tom de Vries  <tdevries@suse.de>
1001         PR libbacktrace/78063
1002         * dwarf.c (build_address_map): Keep all parsed units.
1003         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
1005 2019-01-31  Tom de Vries  <tdevries@suse.de>
1007         PR libbacktrace/89136
1008         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
1009         'debugaltlink_name_len =+ 1'.
1011 2019-01-29  Tom de Vries  <tdevries@suse.de>
1013         * install-debuginfo-for-buildid.sh.in: New script.
1014         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
1015         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
1016         * Makefile.in: Regenerate.
1017         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
1018         (READELF): Set with AC_CHECK_PROG.
1019         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
1020         * configure: Regenerate.
1021         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
1022         (elf_open_debugfile_by_buildid): ... here.
1024 2019-01-29  Tom de Vries  <tdevries@suse.de>
1026         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
1027         allocfail.
1028         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
1029         (check_PROGRAMS): Add BUILDTESTS.
1030         * Makefile.in: Regenerate.
1032 2019-01-28  Tom de Vries  <tdevries@suse.de>
1034         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
1035         Use $< to access prerequisite.
1036         * Makefile.in: Regenerate.
1038 2019-01-25  Nathan Sidwell  <nathan@acm.org>
1040         * elf.c (elf_add): Pass "" filename to recursive call with
1041         separated debug.
1043 2019-01-25  Tom de Vries  <tdevries@suse.de>
1045         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
1046         filename == "".
1047         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
1048         * Makefile.in: Regenerate.
1050 2019-01-25  Tom de Vries  <tdevries@suse.de>
1052         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
1053         (TESTS): Rename dtest to btest_gnudebuglink.
1054         * Makefile.in: Regenerate.
1056 2019-01-23  Tom de Vries  <tdevries@suse.de>
1058         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
1059         (units_search, find_unit): Use size_t for offset.
1060         (build_address_map): Use size_t for unit_offset.
1062 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
1064         * allocfail.c (main): Increase portability of printf statement.
1066 2019-01-18  Ian Lance Taylor  <iant@golang.org>
1068         PR libbacktrace/88890
1069         * mmapio.c (backtrace_get_view): Change size parameter to
1070         uint64_t.  Check that value fits in size_t.
1071         * read.c (backtrace_get_view): Likewise.
1072         * internal.h (backtrace_get_view): Update declaration.
1073         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
1075 2019-01-17  Tom de Vries  <tdevries@suse.de>
1077         PR libbacktrace/82857
1078         * configure.ac (DWZ): Set with AC_CHECK_PROG.
1079         (HAVE_DWZ): Set with AM_CONDITIONAL.
1080         * configure: Regenerate.
1081         * Makefile.am (TESTS): Add btest_dwz.
1082         * Makefile.in: Regenerate.
1084 2019-01-17  Tom de Vries  <tdevries@suse.de>
1086         PR libbacktrace/82857
1087         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
1088         (read_attribute): Handle DW_FORM_GNU_ref_alt using
1089         ATTR_VAL_REF_ALT_INFO.
1090         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
1092 2019-01-17  Tom de Vries  <tdevries@suse.de>
1094         * dwarf.c (struct unit): Add low_offset and high_offset fields.
1095         (struct unit_vector): New type.
1096         (struct dwarf_data): Add units and units_counts fields.
1097         (find_unit): New function.
1098         (find_address_ranges): Add and handle unit_tag parameter.
1099         (build_address_map): Add and handle units_vec parameter.
1100         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
1101         units vector.
1103 2019-01-17  Tom de Vries  <tdevries@suse.de>
1105         PR libbacktrace/82857
1106         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
1107         using altlink.
1109 2019-01-17  Tom de Vries  <tdevries@suse.de>
1111         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
1112         (read_attribute): Add altlink parameter.  Handle missing altlink for
1113         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
1114         (find_address_ranges, build_address_map, build_dwarf_data): Add and
1115         handle altlink parameter.
1116         (read_referenced_name, read_function_entry): Add argument to
1117         read_attribute call.
1119 2019-01-17  Tom de Vries  <tdevries@suse.de>
1121         * dwarf.c (struct dwarf_data): Add altlink field.
1122         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
1123         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
1124         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
1125         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
1126         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
1127         * xcoff.c (xcoff_add): Same.
1129 2019-01-17  Tom de Vries  <tdevries@suse.de>
1131         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
1132         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
1133         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
1134         argument to backtrace_dwarf_add call.
1135         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
1136         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
1137         * xcoff.c (xcoff_add): Same.
1139 2019-01-17  Tom de Vries  <tdevries@suse.de>
1141         * elf.c (elf_add): Add and handle with_buildid_data and
1142         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
1143         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
1145 2019-01-16  Tom de Vries  <tdevries@suse.de>
1147         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
1148         of ...
1149         (read_referenced_name): ... here, and ...
1150         (read_function_entry): ... here.
1152 2019-01-16  Tom de Vries  <tdevries@suse.de>
1154         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
1155         name.
1156         (read_function_entry): Same.  Don't allow name found via
1157         DW_AT_abstract_origin or case DW_AT_specification to override linkage
1158         name.
1160 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
1162         PR other/16615
1164         * backtrace.h: Mechanically replace "can not" with "cannot".
1166 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
1168         Update copyright years.
1170 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
1172         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
1173         in sed pattern.
1174         * Makefile.in: Regenerate.
1176 2018-12-28  Tom de Vries  <tdevries@suse.de>
1178         * dwarf.c (build_address_map): Reuse unused units.
1180 2018-12-28  Tom de Vries  <tdevries@suse.de>
1182         * dwarf.c (build_address_map): Simplify by removing local variable
1183         abbrevs.
1185 2018-12-28  Ian Lance Taylor  <iant@golang.org>
1186             Tom de Vries  <tdevries@suse.de>
1188         PR libbacktrace/88063
1189         * dwarf.c (free_unit_addrs_vector): Remove.
1190         (build_address_map): Keep track of allocated units in vector.  Free
1191         allocated units and corresponding abbrevs upon failure.  Remove now
1192         redundant call to free_unit_addrs_vector.  Free addrs vector upon
1193         failure.  Free allocated unit vector.
1195 2018-12-28  Tom de Vries  <tdevries@suse.de>
1197         * dwarf.c (build_address_map): Free addrs vector upon failure.
1199 2018-12-14  Tom de Vries  <tdevries@suse.de>
1201         PR testsuite/88491
1202         * allocfail.sh: Remove "set -o pipefail".
1204 2018-12-12  Tom de Vries  <tdevries@suse.de>
1206         * Makefile.am (TESTS): Add allocfail.sh.
1207         (check_PROGRAMS): Add allocfail.
1208         * Makefile.in: Regenerate.
1209         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
1210         Include alloc.c.
1211         * allocfail.c: New file.
1212         * allocfail.sh: New file.
1214 2018-11-30  Tom de Vries  <tdevries@suse.de>
1216         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
1217         test_xcoff_64, test_pecoff and test_unknown.
1218         * Makefile.in: Regenerate.
1219         * test_format.c: New file.
1221 2018-11-30  Tom de Vries  <tdevries@suse.de>
1223         * Makefile.am : Add _with_alloc version for each test in
1224         check_PROGRAMS.
1225         * Makefile.in: Regenerate.
1227 2018-11-30  Tom de Vries  <tdevries@suse.de>
1229         * internal.h (backtrace_vector_free): New static inline fuction,
1230         factored out of ...
1231         * dwarf.c (read_line_info): ... here.
1233 2018-11-28  Tom de Vries  <tdevries@suse.de>
1235         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
1236         failure.
1238 2018-11-27  Tom de Vries  <tdevries@suse.de>
1240         * mmap.c (backtrace_vector_release): Same.
1241         * unittest.c (test1): Add check.
1243 2018-11-27  Tom de Vries  <tdevries@suse.de>
1245         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
1246         instead of realloc.
1247         * Makefile.am (check_PROGRAMS): Add unittest.
1248         * Makefile.in: Regenerate.
1249         * unittest.c: New file.
1251 2018-11-22  Tom de Vries  <tdevries@suse.de>
1253         * dwarf.c (read_initial_length): Factor out of ...
1254         (build_address_map, read_line_info): ... here.
1256 2018-11-21  Tom de Vries  <tdevries@suse.de>
1258         * dwarf.c (read_string): Factor out of ...
1259         (read_attribute, read_line_header, read_line_program): ... here.
1261 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
1263         PR bootstrap/82856
1264         * Makefile.am: Include multilib.am.
1265         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
1266         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
1268 2018-10-05  Ian Lance Taylor  <iant@golang.org>
1270         PR libbacktrace/87529
1271         * backtrace.h: Document that backtrace_create_state should be
1272         called only once.
1274 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
1276         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
1277         * Makefile.in: Regenerate.
1278         * config.h.in: Likewise.
1279         * configure: Likewise.
1281 2018-08-01  Tony Reix  <tony.reix@atos.net>
1283         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
1284         (struct xcoff_func, struct xcoff_func_vector): New structs.
1285         (xcoff_syminfo): Drop leading dot from symbol name.
1286         (xcoff_line_compare, xcoff_line_search): Remove.
1287         (xcoff_func_compare, xcoff_func_search): New static functions.
1288         (xcoff_lookup_pc): Search function table.
1289         (xcoff_add_line, xcoff_process_linenos): Remove.
1290         (xcoff_initialize_fileline): Build function table.
1292 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
1294         PR other/86198
1295         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
1296         checking up to 36 bytes.
1298 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
1300         * configure: Regenerated.
1302 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
1304         * configure: Regenerated.
1306 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1308         * backtrace.c: Revert last two changes.  Don't call mmap
1309         directly.
1311 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1313         * backtrace.c: Include backtrace-supported.h before checking
1314         BACKTRACE_USES_MALLOC.
1316 2018-04-17  Ian Lance Taylor  <iant@golang.org>
1318         * backtrace.c (backtrace_full): When testing whether we can
1319         allocate memory, call mmap directly, and munmap the memory.
1321 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
1323         PR other/85161
1324         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
1325         big endian, only use 32-bit loads if endianity macros are predefined
1326         and indicate big or little endian.
1328 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1330         PR target/84148
1331         * configure: Regenerate.
1333 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
1335         PR other/82368
1336         * elf.c (SHT_PROGBITS): Undefine and define.
1338 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
1340         PR other/82368
1341         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
1342         (struct elf_ppc64_opd_data): New type.
1343         (elf_initialize_syminfo): Add opd argument, handle symbols
1344         pointing into the PowerPC64 ELFv1 .opd section.
1345         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
1346         to structure with .opd data to elf_initialize_syminfo.
1348 2018-01-31  Ian Lance Taylor  <iant@golang.org>
1350         * elf.c (elf_add): Close descriptor if we use a debugfile.
1351         * btest.c (check_open_files): New static function.
1352         (main): Call check_open_files.
1354 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1356         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
1357         desired CRC is zero.
1358         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
1360 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1362         * pecoff.c (coff_add): Only release syms_view if it is valid.
1364 2018-01-25  Ian Lance Taylor  <iant@golang.org>
1366         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
1368 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1370         * pecoff.c (coff_add): Use coff_read4, not memcpy.
1372 2018-01-24  Ian Lance Taylor  <iant@golang.org>
1374         PR other/68239
1375         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
1376         on the free list.
1378 2018-01-19  Tony Reix  <tony.reix@atos.net>
1380         * xcoff.c (xcoff_incl_compare): New function.
1381         (xcoff_incl_search): New function.
1382         (xcoff_process_linenos): Use bsearch to find include file.
1383         (xcoff_initialize_fileline): Sort include file information.
1385 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1387         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1388         288.
1389         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1390         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1391         (elf_zlib_default_table): Update.
1392         (elf_zlib_default_dist_table): New static array.
1393         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1394         for block type 1.
1395         * ztest.c (struct zlib_test): Add uncompressed_len.
1396         (tests): Initialize uncompressed_len field.  Add new test case.
1397         (test_samples): Use uncompressed_len field.
1399 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1401         Update copyright years.
1403 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1405         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1406         * aclocal.m4: Regenerate.
1407         * Makefile.in: Likewise.
1408         * configure: Likewise.
1410 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1412         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1413         zlib uncompress function.
1415 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1417         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1418         Read a four byte integer.
1419         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1420         boundary before ever calling elf_zlib_fetch.
1421         * ztest.c (test_large): Simplify print statements a bit.
1423 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1425         * ztest.c: #include <errno.h>.
1426         (TEST_TIMING): Don't define, don't test.
1427         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1428         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1429         (ZLIB_CLOCK_GETTIME_ARG): Define.
1430         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1431         * Makefile.am: Likewise.
1432         * configure, Makefile.in: Rebuild.
1434 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1436         PR other/67165
1437         * Makefile.am: Append the content of clock_gettime_link to
1438         ztest_LDADD.
1439         * configure.ac: Test for the case that clock_gettime is in librt.
1440         * Makefile.in: Regenerate.
1441         * configure: Likewise.
1443         PR other/67165
1444         * configure.ac: Check for clock_gettime.
1445         * config.h.in: Regenerate.
1446         * configure: Likewise.
1447         * ztest.c (average_time, test_large): Conditionalize test timing
1448         on clock_gettime availability.
1450 2017-09-29  Tony Reix  <tony.reix@atos.net>
1452         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1453         (STYP_DWARF, SSUBTYP_DW*): Define.
1454         (enum dwarf_section): Define.
1455         (struct dwsect_info): Define.
1456         (xcoff_add): Look for DWARF sections, pass them to
1457         backtrace_dwarf_add.
1459 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1461         PR other/67165
1462         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1463         (unlikely): Define.
1464         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1465         (b_elf_chdr): Define type.
1466         (enum debug_section): Add ZDEBUG_xxx values.
1467         (debug_section_names): Add names for new sections.
1468         (struct debug_section_info): Add compressed field.
1469         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1470         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1471         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1472         (HUFFMAN_SECONDARY_SHIFT): Define.
1473         (ZDEBUG_TABLE_SIZE): Define.
1474         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1475         (final_next_secondary): New static variable if
1476         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1477         (elf_zlib_inflate_table): New static function.
1478         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1479         function to produce fixed Huffman table.
1480         (elf_zlib_default_table): New static variable.
1481         (elf_zlib_inflate): New static function.
1482         (elf_zlib_verify_checksum): Likewise.
1483         (elf_zlib_inflate_and_verify): Likewise.
1484         (elf_uncompress_zdebug): Likewise.
1485         (elf_uncompress_chdr): Likewise.
1486         (backtrace_uncompress_zdebug): New extern function.
1487         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1488         sections, and uncompress them.
1489         * internal.h (backtrace_compress_zdebug): Declare.
1490         * ztest.c: New file.
1491         * configure.ac: Check for -lz and check whether the linker
1492         supports --compress-debug-sections.
1493         * Makefile.am (ztest_SOURCES): New variable.
1494         (ztest_CFLAGS, ztest_LDADD): New variables.
1495         (check_PROGRAMS): Add ztest.
1496         (ctestg_SOURCES): New variable.
1497         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1498         (ctesta_SOURCES): New variable.
1499         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1500         (check_PROGRAMS): Add ctestg and ctesta.
1501         * configure, config.h.in, Makefile.in: Rebuild.
1503 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1505         PR sanitizer/77631
1506         * configure.ac: Check for lstat and readlink.
1507         * elf.c (lstat, readlink): Provide dummy versions if real versions
1508         are not available.
1509         * configure, config.h.in: Rebuild.
1511 2017-09-21  Ian Lance Taylor  <iant@google.com>
1513         PR go/82284
1514         * elf.c (backtrace_initialize): Set pd.exe_filename.
1516 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1517             Denis Khalikov  <d.khalikov@partner.samsung.com>
1519         PR sanitizer/77631
1520         Support for external debug info.
1521         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1522         (S_ISLNK): Define if not defined.
1523         (xstrnlen): Define if strnlen is not available.
1524         (b_elf_note): Define type.
1525         (NT_GNU_BUILD_ID): Define macro.
1526         (elf_crc32, elf_crc32_file): New static functions.
1527         (elf_is_symlink, elf_readlink): New static functions.
1528         (elf_open_debugfile_by_buildid): New static function.
1529         (elf_try_debugfile): New static function.
1530         (elf_find_debugfile_by_debuglink): New static function.
1531         (elf_open_debugfile_by_debuglink): New static function.
1532         (elf_add): Add filename and debuginfo parameters.  Adjust all
1533         callers.  Look for external debug info notes, and try to fetch
1534         debug info from external file.
1535         (struct phdr_data): Add exe_filename field.
1536         (phdr_callback): Pass filename to elf_add.
1537         (backtrace_initialize): Add filename parameter.
1538         * internal.h (backtrace_initialize): Add filename parameter.
1539         * fileline.c (fileline_initialize): Pass filename to
1540         backtrace_initialize.
1541         * pecoff.c (fileline_initialize): Add unused filename parameter.
1542         * unknown.c (fileline_initialize): Likewise.
1543         * xcoff.c (fileline_initialize): Likewise.
1544         * configure.ac: Check for objcopy --add-gnu-debuglink.
1545         * Makefile.am (dtest): New test target.
1546         * configure, Makefile.in: Rebuild.
1548 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1550         PR other/81096
1551         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1552         * Makefile.in: Regenerate.
1554 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1556         PR other/81096
1557         * libbacktrace/Makefile.in
1558         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1560 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1562         PR bootstrap/81638
1563         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1565 2017-07-28  Tony Reix  <tony.reix@atos.net>
1567         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1569 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1571         * fileline.c (fileline_initialize): Print pid_t as long.
1573 2017-07-26  Tony Reix  <tony.reix@atos.net>
1575         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1576         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1577         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1578         * configure, config.h.in: Regenerate.
1580 2017-07-21  Tony Reix  <tony.reix@atos.net>
1582         * filetype.awk: Add AIX XCOFF type detection.
1583         * configure.ac: Recognize xcoff format.
1584         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1585         * fileline.c: Include <unistd.h>.
1586         (fileline_initialize): Add case for AIX procfs.
1587         * xcoff.c: New file.
1588         * configure, Makefile.in: Rebuild.
1590 2017-06-21  Richard Biener  <rguenther@suse.de>
1592         * configure.ac: Add AC_SYS_LARGEFILE.
1593         * config.h.in: Regenerate.
1594         * configure: Likewise.
1596 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1598         * elf.c (backtrace_initialize): Always set *fileline_fn.
1599         * ttest.c: New file.
1600         * btest.c: Move support functions into testlib.c.  Change calls to
1601         check to pass file name.
1602         * testlib.c: New file, copied from (part of) btest.c.
1603         * testlib.h: New file, declarations for testlib.c.
1604         * edtest.c: Use testlib.h and testlib.c.
1605         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1606         * Makefile.am (btest_SOURCES): Add testlib.c.
1607         (edtest_SOURCES): Likewise.
1608         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1609         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1610         * configure, Makefile.in: Rebuild.
1612 2017-05-19  Than McIntosh  <thanm@google.com>
1614         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1615         (read_line_header): Don't allocate dirs if dirs_count == 0.
1616         * edtest.c: New file.
1617         * edtest2.c: New file.
1618         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1619         (check_PROGRAMS): Add edtest.
1620         (edtest2_build.c, gen_edtest2_build): New targets.
1621         * Makefile.in: Rebuild.
1623 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1625         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1626         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1628 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1630         Update copyright years.
1632 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1634         * configure: Regenerate.
1636 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1638         * all: Remove meaningless trailing whitespace.
1640 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1642         PR target/71161
1643         * elf.c (phdr_callback) [__i386__]: Add
1644         __attribute__((__force_align_arg_pointer__)).
1646 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1648         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1649         avoid possible crash.
1650         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1651         missing debug info anymore.
1653 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1655         * mmap.c (MAP_FAILED): Define if not defined.
1657 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1659         Update copyright years.
1661 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1663         * configure.ac: Specify that DJGPP do not have mmap
1664         even when sys/mman.h exists.
1665         * configure: Regenerate
1667 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1669         PR libgfortran/68115
1670         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1671         * configure: Regenerate.
1672         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1673         to void.
1675 2015-09-17  Ian Lance Taylor  <iant@google.com>
1677         * posix.c (backtrace_open): Cast second argument of open() to int.
1679 2015-09-11  Ian Lance Taylor  <iant@google.com>
1681         * Makefile.am (backtrace.lo): Depend on internal.h.
1682         (sort.lo, stest.lo): Add explicit dependencies.
1683         * Makefile.in: Rebuild.
1685 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1687         * backtrace.c: #include <sys/types.h>.
1689 2015-09-08  Ian Lance Taylor  <iant@google.com>
1691         PR other/67457
1692         * backtrace.c: #include "internal.h".
1693         (struct backtrace_data): Add can_alloc field.
1694         (unwind): If can_alloc is false, don't try to get file/line
1695         information.
1696         (backtrace_full): Set can_alloc field in bdata.
1697         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1698         NULL.
1699         * mmap.c (backtrace_alloc): Likewise.
1700         * internal.h: Update comments for backtrace_alloc and
1701         backtrace_free.
1703 2015-09-08  Ian Lance Taylor  <iant@google.com>
1705         PR other/67457
1706         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1708 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1710         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1711         * configure: Regenerate.
1713 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1715         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1716         Remove setting PIC_FLAG when building as target library.
1717         * configure: Regenerate.
1719 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1721         * configure.ac: Only compile with -fPIC if the target
1722         supports it.
1723         * configure: Regenerate.
1725 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1727         * configure.ac: Set have_mmap to no on spu-*-* targets.
1728         * configure: Regenerate.
1730 2015-08-13  Ian Lance Taylor  <iant@google.com>
1732         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1733         Change all callers.
1735 2015-06-11  Martin Sebor  <msebor@redhat.com>
1737         PR sanitizer/65479
1738         * dwarf.c (struct line): Add new field idx.
1739         (line_compare): Use it.
1740         (add_line): Set it.
1741         (read_line_info): Reset it.
1743 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1745         * pecoff.c: New file.
1746         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1747         * Makefile.in: Regenerate.
1748         * filetype.awk: Detect pecoff.
1749         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1750         Add pecoff.
1751         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1752         true.
1753         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1754         * configure: Regenerate.
1755         * pecoff.c: New file.
1757 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1759         * Makefile.in: Regenerated with automake-1.11.6.
1760         * aclocal.m4: Likewise.
1761         * configure: Likewise.
1763 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1765         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1766         * configure: Regenerate.
1768 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1770         Update copyright years.
1772 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1774         PR bootstrap/63784
1775         * configure: Regenerated.
1777 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1779         * ChangeLog.jit: New.
1781 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1783         PR target/63610
1784         * configure: Regenerate.
1786 2014-10-23  Ian Lance Taylor  <iant@google.com>
1788         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1789         Fix to return void *.
1791 2014-05-08  Ian Lance Taylor  <iant@google.com>
1793         * mmap.c (backtrace_free): If freeing a large aligned block of
1794         memory, call munmap rather than holding onto it.
1795         (backtrace_vector_grow): When growing a vector, double the number
1796         of pages requested.  When releasing the old version of a grown
1797         vector, pass the correct size to backtrace_free.
1799 2014-03-07  Ian Lance Taylor  <iant@google.com>
1801         * sort.c (backtrace_qsort): Use middle element as pivot.
1803 2014-03-06  Ian Lance Taylor  <iant@google.com>
1805         * sort.c: New file.
1806         * stest.c: New file.
1807         * internal.h (backtrace_qsort): Declare.
1808         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1809         (read_line_info, read_function_entry): Likewise.
1810         (read_function_info, build_dwarf_data): Likewise.
1811         * elf.c (elf_initialize_syminfo): Likewise.
1812         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1813         (stest_SOURCES, stest_LDADD): Define.
1814         (check_PROGRAMS): Add stest.
1816 2014-02-07  Misty De Meo  <misty@brew.sh>
1818         PR target/58710
1819         * configure.ac: Use AC_LINK_IFELSE in check for
1820         _Unwind_GetIPInfo.
1821         * configure: Regenerate.
1823 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1825         Update copyright years
1827 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1829         * elf.c (ET_DYN): Undefine and define again.
1830         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1831         return early -1 without closing the descriptor.
1832         (struct phdr_data): Add exe_descriptor.
1833         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1834         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1835         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1836         call to elf_add.
1837         (backtrace_initialize): Adjust call to elf_add.  If it returns
1838         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1840 2013-12-05  Ian Lance Taylor  <iant@google.com>
1842         * alloc.c (backtrace_vector_finish): Add error_callback and data
1843         parameters.  Call backtrace_vector_release.  Return address base.
1844         * mmap.c (backtrace_vector_finish): Add error_callback and data
1845         parameters.  Return address base.
1846         * dwarf.c (read_function_info): Get new address base from
1847         backtrace_vector_finish.
1848         * internal.h (backtrace_vector_finish): Update declaration.
1850 2013-11-27  Ian Lance Taylor  <iant@google.com>
1852         * dwarf.c (find_address_ranges): New static function, broken out
1853         of build_address_map.
1854         (build_address_map): Call it.
1855         * btest.c (check): Check for missing filename or function, rather
1856         than crashing.
1857         (f3): Check that enough frames were returned.
1859 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1861         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1862         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1863         last argument.
1864         * btest.c (struct symdata): Add size field.
1865         (callback_three): Add symsize argument.  Copy it to the data->size
1866         field.
1867         (f23): Set symdata.size to 0.
1868         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1869         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1870         values.
1872         * atomic.c: Include sys/types.h.
1874 2013-11-18  Ian Lance Taylor  <iant@google.com>
1876         * configure.ac: Check for support of __atomic extensions.
1877         * internal.h: Declare or #define atomic functions for use in
1878         backtrace code.
1879         * atomic.c: New file.
1880         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1881         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1882         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1883         (backtrace_initialize): Likewise.
1884         * fileline.c (fileline_initialize): Likewise.
1885         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1886         * configure, config.h.in, Makefile.in: Rebuild.
1888 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1890         * elf.c (SHN_UNDEF): Define.
1891         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1892         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1893         (elf_add): Adjust caller.
1895         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1897 2013-11-16  Ian Lance Taylor  <iant@google.com>
1899         * backtrace.h (backtrace_create_state): Correct comment about
1900         threading.
1902 2013-11-15  Ian Lance Taylor  <iant@google.com>
1904         * backtrace.h (backtrace_syminfo): Update comment and parameter
1905         name to take any address, not just a PC value.
1906         * elf.c (STT_OBJECT): Define.
1907         (elf_nosyms): Rename parameter pc to addr.
1908         (elf_symbol_search): Rename local variable pc to addr.
1909         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1910         (elf_syminfo): Rename parameter pc to addr.
1911         * btest.c (global): New global variable.
1912         (test5): New test.
1913         (main): Call test5.
1915 2013-10-17  Ian Lance Taylor  <iant@google.com>
1917         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1918         is missing.
1920 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1922         * configure.ac: Add --enable-host-shared, setting up
1923         pre-existing PIC_FLAG variable within Makefile.am et al.
1924         * configure: Regenerate.
1926 2013-09-20  Alan Modra  <amodra@gmail.com>
1928         * configure: Regenerate.
1930 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1932         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1934 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1936         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1937         dl_iterate_phdr callbacks.
1939 2013-03-25  Ian Lance Taylor  <iant@google.com>
1941         * alloc.c: #include <sys/types.h>.
1942         * mmap.c: Likewise.
1944 2013-01-31  Ian Lance Taylor  <iant@google.com>
1946         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1947         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1949 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1951         PR other/56076
1952         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1953         attribute was not seen.
1955 2013-01-16  Ian Lance Taylor  <iant@google.com>
1957         * dwarf.c (struct unit): Add filename and abs_filename fields.
1958         (build_address_map): Set new fields when reading unit.
1959         (dwarf_lookup_pc): If we don't find an entry in the line table,
1960         just return the main file name.
1962 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1964         Update copyright years.
1966 2013-01-01  Ian Lance Taylor  <iant@google.com>
1968         PR bootstrap/54834
1969         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1970         $(MULTIBUILDTOP)/../../gcc/include.
1971         * Makefile.in: Rebuild.
1973 2013-01-01  Ian Lance Taylor  <iant@google.com>
1975         PR other/55536
1976         * mmap.c (backtrace_alloc): Don't call sync functions if not
1977         threaded.
1978         (backtrace_free): Likewise.
1980 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1982         * mmapio.c: Define MAP_FAILED if not defined.
1984 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1986         PR bootstrap/54926
1987         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1988         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1989         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1990         accepts it.
1991         * Makefile.in: Regenerated.
1992         * configure: Regenerated.
1994 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1996         PR bootstrap/54926
1997         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1998         * Makefile.in: Regenerated.
2000 2012-11-20  Ian Lance Taylor  <iant@google.com>
2002         * dwarf.c (read_attribute): Always clear val.
2004 2012-11-13  Ian Lance Taylor  <iant@google.com>
2006         PR other/55312
2007         * configure.ac: Only add -Werror if building a target library.
2008         * configure: Rebuild.
2010 2012-11-12  Ian Lance Taylor  <iant@google.com>
2011             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2012             Gerald Pfeifer  <gerald@pfeifer.com>
2014         * configure.ac: Check for getexecname.
2015         * fileline.c: #include <errno.h>.  Define getexecname if not
2016         available.
2017         (fileline_initialize): Try to find the executable in a few
2018         different ways.
2019         * print.c (error_callback): Only print the filename if it came
2020         from the backtrace state.
2021         * configure, config.h.in: Rebuild.
2023 2012-10-29  Ian Lance Taylor  <iant@google.com>
2025         * mmap.c (backtrace_vector_release): Correct last patch: add
2026         aligned, not size.
2028 2012-10-29  Ian Lance Taylor  <iant@google.com>
2030         * mmap.c (backtrace_vector_release): Make sure freed block is
2031         aligned on 8-byte boundary.
2033 2012-10-26  Ian Lance Taylor  <iant@google.com>
2035         PR other/55087
2036         * posix.c (backtrace_open): Add does_not_exist parameter.
2037         * elf.c (phdr_callback): Do not warn if shared library could not
2038         be opened.
2039         * fileline.c (fileline_initialize): Update calls to
2040         backtrace_open.
2041         * internal.h (backtrace_open): Update declaration.
2043 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
2045         PR target/55061
2046         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
2047         * configure: Regenerate.
2049 2012-10-24  Ian Lance Taylor  <iant@google.com>
2051         PR target/55061
2052         * configure.ac: Check whether -funwind-tables option works.
2053         * configure: Rebuild.
2055 2012-10-11  Ian Lance Taylor  <iant@google.com>
2057         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
2058         * configure: Rebuild.
2060 2012-10-10  Ian Lance Taylor  <iant@google.com>
2062         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
2063         lower case.
2065 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
2067         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
2069 2012-10-09  Ian Lance Taylor  <iant@google.com>
2071         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
2072         (backtrace_dwarf_add): Likewise.
2074 2012-10-09  Ian Lance Taylor  <iant@google.com>
2076         Add support for tracing through shared libraries.
2077         * configure.ac: Check for link.h and dl_iterate_phdr.
2078         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
2079         ELF macros before #defining them.
2080         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
2081         dl_iterate_phdr.
2082         (struct elf_syminfo_data): Add next field.
2083         (elf_initialize_syminfo): Initialize next field.
2084         (elf_add_syminfo_data): New static function.
2085         (elf_add): New static function, broken out of
2086         backtrace_initialize.  Call backtrace_dwarf_add instead of
2087         backtrace_dwarf_initialize.
2088         (struct phdr_data): Define.
2089         (phdr_callback): New static function.
2090         (backtrace_initialize): Call elf_add.
2091         * dwarf.c (struct dwarf_data): Add next and base_address fields.
2092         (add_unit_addr): Add base_address parameter.  Change all callers.
2093         (add_unit_ranges, build_address_map): Likewise.
2094         (add_line): Add ddata parameter.  Change all callers.
2095         (read_line_program, add_function_range): Likewise.
2096         (dwarf_lookup_pc): New static function, broken out of
2097         dwarf_fileline.
2098         (dwarf_fileline): Call dwarf_lookup_pc.
2099         (build_dwarf_data): New static function.
2100         (backtrace_dwarf_add): New function.
2101         (backtrace_dwarf_initialize): Remove.
2102         * internal.h (backtrace_dwarf_initialize): Don't declare.
2103         (backtrace_dwarf_add): Declare.
2104         * configure, config.h.in: Rebuild.
2106 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
2108         * btest.c (f23): Avoid uninitialized variable warning.
2110 2012-10-04  Ian Lance Taylor  <iant@google.com>
2112         * dwarf.c: If the system header files do not declare strnlen,
2113         provide our own version.
2115 2012-10-03  Ian Lance Taylor  <iant@google.com>
2117         * dwarf.c (read_uleb128): Fix overflow test.
2118         (read_sleb128): Likewise.
2119         (build_address_map): Don't change unit_buf.start.
2121 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
2123         PR other/54761
2124         * configure.ac (EXTRA_FLAGS): New.
2125         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
2126         * configure, Makefile.in: Regenerate.
2128 2012-09-29  Ian Lance Taylor  <iant@google.com>
2130         PR other/54749
2131         * fileline.c (fileline_initialize): Pass errnum as -1 when
2132         reporting that we could not read executable information after a
2133         previous failure.
2135 2012-09-27  Ian Lance Taylor  <iant@google.com>
2137         PR bootstrap/54732
2138         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
2139         * Makefile.am: Add dependencies for all objects.
2140         * configure, aclocal.m4, Makefile.in: Rebuild.
2142 2012-09-27  Ian Lance Taylor  <iant@google.com>
2144         PR other/54726
2145         * elf.c (backtrace_initialize): Set *fileln_fn, not
2146         state->fileln_fn.
2148 2012-09-19  Ian Lance Taylor  <iant@google.com>
2150         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
2151         as a target library.
2152         * configure: Rebuild.
2154 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2155             Ian Lance Taylor  <iant@google.com>
2157         * configure.ac (GCC_HEADER_STDINT): Invoke.
2158         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
2159         * btest.c: Don't include <stdint.h>.
2160         * dwarf.c: Likewise.
2161         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
2163 2012-09-18  Ian Lance Taylor  <iant@google.com>
2165         PR bootstrap/54623
2166         * Makefile.am (AM_CPPFLAGS): Define.
2167         (AM_CFLAGS): Remove -I options.
2168         * Makefile.in: Rebuild.
2170 2012-09-18  Ian Lance Taylor  <iant@google.com>
2172         * posix.c (O_BINARY): Define if not defined.
2173         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
2174         HAVE_FCNTL is defined.
2175         * configure.ac: Test for the fcntl function.
2176         * configure, config.h.in: Rebuild.
2178 2012-09-18  Ian Lance Taylor  <iant@google.com>
2180         * btest.c (test1, test2, test3, test4): Add the unused attribute.
2182 2012-09-18  Ian Lance Taylor  <iant@google.com>
2184         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
2186 2012-09-18  Ian Lance Taylor  <iant@google.com>
2188         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
2189         * mmapio.c: Don't define _GNU_SOURCE.
2190         * configure, config.h.in: Rebuild.
2192 2012-09-18  Ian Lance Taylor  <iant@google.com>
2194         * configure.ac: Check whether strnlen is declared.
2195         * dwarf.c: Declare strnlen if not declared.
2196         * configure, config.h.in: Rebuild.
2198 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
2200         * fileline.c: Include <stdlib.h>.
2201         * mmap.c: Likewise.
2203 2012-09-17  Ian Lance Taylor  <iant@google.com>
2205         PR bootstrap/54611
2206         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
2207         parameter.
2209 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
2211         PR bootstrap/54611
2212         * nounwind.c (backtrace_simple): Add state parameter.
2214 2012-09-17  Ian Lance Taylor  <iant@google.com>
2216         PR bootstrap/54609
2217         * unknown.c (unknown_fileline): Add state parameter, remove
2218         fileline_data parameter, name error_callback parameter.
2219         (backtrace_initialize): Add state parameter.
2221 2012-09-17  Ian Lance Taylor  <iant@google.com>
2223         * Initial implementation.
2225 Copyright (C) 2012-2024 Free Software Foundation, Inc.
2227 Copying and distribution of this file, with or without modification,
2228 are permitted in any medium without royalty provided the copyright
2229 notice and this notice are preserved.