Fix wrong code generated by unroll-and-jam pass
[official-gcc.git] / libbacktrace / ChangeLog
blob291ba2ddf4dc22294220d0053ba59411df4c8322
1 2022-07-08  Ian Lance Taylor  <iant@golang.org>
3         * configure.ac: Check for sys/link.h.  Use either link.h or
4         sys/link.h when checking for dl_iterate_phdr.
5         * elf.c: Include sys/link.h if available.
6         * configure, config.h.in: Regenerate.
8 2022-07-07  Ian Lance Taylor  <iant@golang.org>
10         * macho.c (backtrace_initialize) [HAVE_MACH_O_DYLD_H]: Don't exit
11         loop if we can't find debug info for one shared library.
13 2022-07-07  Ian Lance Taylor  <iant@golang.org>
15         * Makefile.am (MAKETESTS): New variable split out of TESTS.
16         (CLEANFILES): Replace TESTS with BUILDTESTS and MAKETESTS.
17         * Makefile.in: Regenerate.
19 2022-06-27  Ian Lance Taylor  <iant@golang.org>
21         * configure.ac: Use grep instead of fgrep.
22         * configure, Makefile.in: Regenerate.
24 2022-05-28  Ian Lance Taylor  <iant@golang.org>
26         PR libbacktrace/105721
27         * README: Update.
29 2022-04-05  Ian Lance Taylor  <iant@golang.org>
31         * elf.c (elf_zlib_inflate): Don't skip initial aligned byte in
32         uncompressed block.
34 2022-02-17  Ian Lance Taylor  <iant@golang.org>
36         * dwarf.c (find_address_ranges): Handle skeleton units.
37         (read_function_entry): Likewise.
39 2022-02-16  Ian Lance Taylor  <iant@golang.org>
41         * dwarf.c (build_address_map): Initialize DWARF 5 fields of unit.
43 2022-02-03  David Seifert  <soap@gentoo.org>
44             Jakub Jelinek  <jakub@redhat.com>
46         * configure.ac: Support --disable-werror.
47         * configure: Regenerate.
49 2021-12-28  Francois-Xavier Coudert  <fxcoudert@gmail.com>
51         PR libbacktrace/103822
52         * Makefile.am: Fix newline.
53         * Makefile.in: Regenerate.
55 2021-11-12  Martin Liska  <mliska@suse.cz>
57         PR libbacktrace/103167
58         * elf.c (elf_uncompress_lzma_block): Cast to unsigned int.
59         (elf_uncompress_lzma): Likewise.
60         * xztest.c (test_samples): memcpy only if v > 0.
62 2021-10-22  Martin Liska  <mliska@suse.cz>
64         PR testsuite/102742
65         * btest.c (MIN_DESCRIPTOR): New.
66         (MAX_DESCRIPTOR): Likewise.
67         (check_available_files): Likewise.
68         (check_open_files): Check only file descriptors that
69         were not available at the entry.
70         (main): Call check_available_files.
72 2021-08-13  Sergei Trofimovich  <siarheit@google.com>
74         * install-debuginfo-for-buildid.sh.in: Force non-localized readelf
75         output with LANG=C.
77 2021-06-28  ClĂ©ment Chigot  <clement.chigot@atos.net>
79         * xcoff.c (SSUBTYP_DWRNGES): New define.
80         (xcoff_add): Use correct XCOFF DWARF section subtype
81         for DEBUG_RANGES. Remove lineoff workaround.
82         Adjust base_address.
83         (xcoff_initialize_syminfo): Adapt to new base_address.
84         (xcoff_lookup_pc): Likewise.
85         (xcoff_initialize_fileline): Likewise.
87 2021-05-03  H.J. Lu  <hjl.tools@gmail.com>
89         PR bootstrap/99703
90         * configure: Regenerated.
92 2021-03-03  Ian Lance Taylor  <iant@golang.org>
94         * dwarf.c (read_line_program): Don't special case file 0.
95         (read_function_entry): Likewise.
97 2021-03-02  Ian Lance Taylor  <iant@golang.org>
99         PR libbacktrace/98818
100         * dwarf.c (dwarf_buf_error): Add errnum parameter.  Change all
101         callers.
102         * backtrace.h: Update backtrace_error_callback comment.
104 2021-02-12  Ian Lance Taylor  <iant@golang.org>
106         * configure.ac: Check for objcopy --add-gnu-debuglink by using
107         objcopy --help.
108         * configure: Regenerate
110 2021-01-18  Ian Lance Taylor  <iant@golang.org>
112         * Makefile.am (%_dwz): If dwz fails, use uncompressed debug info.
113         * Makefile.in: Regenerate.
114         * configure: Regenerate.
116 2021-01-18  Ian Lance Taylor  <iant@golang.org>
118         PR debug/98716
119         * dwarf.c (read_v2_paths): Allocate zero entry for dirs and
120         filenames.
121         (read_line_program): Remove parameter u, change caller.  Don't
122         subtract one from dirs and filenames index.
123         (read_function_entry): Don't subtract one from filenames index.
125 2021-01-05  Samuel Thibault  <samuel.thibault@ens-lyon.org>
127         * configure: Re-generate.
129 2020-12-05  Iain Sandoe  <iain@sandoe.co.uk>
131         PR target/97865
132         * configure: Regenerate.
134 2020-12-02  Ian Lance Taylor  <iant@golang.org>
136         * dwarf.c (resolve_string): Use > rather than >= to check whether
137         string index extends past buffer.
138         (resolve_addr_index): Similarly for address index.
140 2020-11-29  John David Anglin  <danglin@gcc.gnu.org>
142         * configure: Regenerate.
144 2020-10-20  Ian Lance Taylor  <iant@golang.org>
146         * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
147         * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
149 2020-09-28  Ian Lance Taylor  <iant@golang.org>
151         PR libbacktrace/97082
152         * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
153         * Makefile.in: Regenerate.
155 2020-09-28  Ian Lance Taylor  <iant@golang.org>
157         PR libbacktrace/97227
158         * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
159         * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
160         * configure: Regenerate.
161         * Makefile.in: Regenerate.
163 2020-09-23  Ian Lance Taylor  <iant@golang.org>
165         * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
166         p->low.
167         (dwarf_lookup_pc): Likewise.
169 2020-09-17  Ian Lance Taylor  <iant@golang.org>
171         PR libbacktrace/97080
172         * fileline.c (backtrace_syminfo_to_full_callback): New function.
173         (backtrace_syminfo_to_full_error_callback): New function.
174         * elf.c (elf_nodebug): Call syminfo_fn if possible.
175         * internal.h (struct backtrace_call_full): Define.
176         (backtrace_syminfo_to_full_callback): Declare.
177         (backtrace_syminfo_to_full_error_callback): Declare.
178         * mtest.c (f3): Only check all[i] if data.index permits.
180 2020-09-16  Iain Sandoe  <iain@sandoe.co.uk>
182         * macho.c (MACH_O_CPU_TYPE_PPC): New.
183         (MACH_O_CPU_TYPE_PPC64): New.
184         Add compile-tests for powerpc to the Mach-O variants.
186 2020-09-14  Ian Lance Taylor  <iant@golang.org>
188         PR libbacktrace/93608
189         Add support for MiniDebugInfo.
190         * elf.c (struct elf_view): Define.  Replace most uses of
191         backtrace_view with elf_view.
192         (elf_get_view): New static functions.  Replace most calls of
193         backtrace_get_view with elf_get_view.
194         (elf_release_view): New static functions.  Replace most calls of
195         backtrace_release_view with elf_release_view.
196         (elf_uncompress_failed): Rename from elf_zlib_failed.  Change all
197         callers.
198         (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
199         (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
200         (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
201         (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
202         (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
203         (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
204         (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
205         (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
206         (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
207         (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
208         (LZMA_PROB_DIST_ALIGN_LEN): Define.
209         (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
210         (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
211         (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
212         (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
213         (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
214         (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
215         (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
216         (LZMA_PROB_REP_LEN_LOW_LEN): Define.
217         (LZMA_PROB_REP_LEN_MID_LEN): Define.
218         (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
219         (LZMA_PROB_LITERAL_LEN): Define.
220         (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
221         (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
222         (LZMA_PROB_IS_REP2_OFFSET): Define.
223         (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
224         (LZMA_PROB_DIST_SLOT_OFFSET): Define.
225         (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
226         (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
227         (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
228         (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
229         (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
230         (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
231         (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
232         (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
233         (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
234         (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
235         (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
236         (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
237         (LZMA_PROB_LITERAL_OFFSET): Define.
238         (LZMA_PROB_TOTAL_COUNT): Define.
239         (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
240         (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
241         (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
242         (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
243         (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
244         (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
245         (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
246         (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
247         (elf_lzma_varint): New static function.
248         (elf_lzma_range_normalize): New static function.
249         (elf_lzma_bit, elf_lzma_integer): New static functions.
250         (elf_lzma_reverse_integer): New static function.
251         (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
252         (elf_uncompress_lzma): New static function.
253         (backtrace_uncompress_lzma): New function.
254         (elf_add): Add memory and memory_size parameters.  Change all
255         callers.  Look for .gnu_debugdata section, and, if found,
256         decompress it and use it for symbols and debug info.  Permit the
257         descriptor parameter to be -1.
258         * internal.h (backtrace_uncompress_lzma): Declare.
259         * mtest.c: New file.
260         * xztest.c: New file.
261         * configure.ac: Check for nm, xz, and comm programs.  Check for
262         liblzma library.
263         (HAVE_MINIDEBUG): Define.
264         * Makefile.am (mtest_SOURCES): Define.
265         (mtest_CFLAGS, mtest_LDADD): Define.
266         (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
267         (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
268         (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
269         (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
270         (xztest_alloc_LDADD): Define.
271         (BUILDTESTS): Add mtest, xztest, xztest_alloc.
272         (CLEANFILES): Add files created by minidebug pattern.
273         (btest.lo): Correct INCDIR reference.
274         (mtest.lo, xztest.lo, ztest.lo): New targets.
275         * configure: Regenerate.
276         * config.h.in: Regenerate.
277         * Makefile.in: Regenerate.
279 2020-09-09  Ian Lance Taylor  <iant@golang.org>
281         * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
282         (coff_add): Determine and pass is_64.
284 2020-09-09  Ian Lance Taylor  <iant@golang.org>
286         PR libbacktrace/96973
287         * fileline.c (macho_get_executable_path): New static function.
288         (fileline_initialize): Call macho_get_executable_path.
290 2020-09-09  Ian Lance Taylor  <iant@golang.org>
292         * dwarf.c (function_addrs_search): Compare against the next entry
293         low address, not the high address.
294         (unit_addrs_search): Likewise.
295         (build_address_map): Add a trailing unit_addrs.
296         (read_function_entry): Add a trailing function_addrs.
297         (read_function_info): Likewise.
298         (report_inlined_functions): Search backward for function_addrs
299         match.
300         (dwarf_lookup_pc): Search backward for unit_addrs and
301         function_addrs matches.
303 2020-09-08  Ian Lance Taylor  <iant@golang.org>
305         * simple.c (simple_unwind): Correct comment spelling.
307 2020-09-08  Ian Lance Taylor  <iant@golang.org>
309         * macho.c (macho_add_dsym): Make space for '/' in dsym.  Use
310         correct length when freeing diralc.
312 2020-09-08  Ian Lance Taylor  <iant@golang.org>
314         PR libbacktrace/96973
315         * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
317 2020-09-08  Ian Lance Taylor  <iant@golang.org>
319         PR libbacktrace/96971
320         * filetype.awk: Only match magic number at start of line.
322 2020-08-24  Ian Lance Taylor  <iant@golang.org>
324         * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
325         (MACH_O_MH_CIGAM_FAT_64): Define.
326         (struct macho_fat_arch_64): Define.
327         (macho_add_fat): Add and use is_64 parameter.
328         (macho_add): Recognize 64-bit fat files.
330 2020-07-30  H.J. Lu  <hjl.tools@gmail.com>
332         PR bootstrap/96202
333         * configure: Regenerated.
335 2020-07-08  Ian Lance Taylor  <iant@golang.org>
337         * configure.ac: Test linker support for DWARF5
338         * configure: Regenerate
340 2020-05-29  H.J. Lu  <hjl.tools@gmail.com>
342         PR bootstrap/95413
343         * configure: Regenerated.
345 2020-05-15  H.J. Lu  <hongjiu.lu@intel.com>
347         PR bootstrap/95147
348         * configure: Regenerated.
350 2020-05-14  H.J. Lu  <hongjiu.lu@intel.com>
352         * configure: Regenerated.
354 2020-05-13  Ian Lance Taylor  <iant@golang.org>
356         * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
358 2020-05-13  Ian Lance Taylor  <iant@golang.org>
360         PR go/95061
361         * posix.c (backtrace_open): Treat EACCESS like ENOENT.
363 2020-05-12  H.J. Lu  <hongjiu.lu@intel.com>
365         * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
366         * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
367         AC_SUBST(CET_HOST_FLAGS).  Clear CET_HOST_FLAGS if jit isn't
368         enabled.
369         * Makefile.in: Regenerated.
370         * configure: Likewise.
372 2020-05-11  Ian Lance Taylor  <iant@golang.org>
374         PR libbacktrace/95012
375         * configure.ac: Check for getpagesize declaration.
376         * mmap.c: Declare getpagesize if necessary.
377         * mmapio.c: Likewise.
378         * configure: Regenerate.
379         * config.h.in: Regenerate.
380         * Makefile.in: Regenerate.
382 2020-05-09  Roland McGrath  <mcgrathr@google.com>
384         * elf.c (elf_add): Bail early if there are no section headers at all.
386 2020-05-09  Ian Lance Taylor  <iant@golang.org>
388         * elf.c (elf_add): Don't free strtab if an error occurs after
389         recording symbol information.
391 2020-05-09  Ian Lance Taylor  <iant@golang.org>
393         PR libbacktrace/88745
394         * macho.c: New file.
395         * filetype.awk: Recognize Mach-O files.
396         * Makefile.am (FORMAT_FILES): Add macho.c.
397         (check_DATA): New variable.  Set to .dSYM if HAVE_DSYMUTIL.
398         (%.dSYM): New pattern target.
399         (test_macho_SOURCES, test_macho_CFLAGS): New targets.
400         (test_macho_LDADD): New target.
401         (BUILDTESTS): Add test_macho.
402         (macho.lo): Add dependencies.
403         * configure.ac: Recognize macho file type.  Check for
404         mach-o/dyld.h.  Don't try to run objcopy if we don't find it.
405         Look for dsymutil and define a HAVE_DSYMUTIL conditional.
406         * Makefile.in: Regenerate.
407         * configure: Regenerate.
408         * config.h.in: Regenerate.
410 2020-05-09  Ian Lance Taylor  <iant@golang.org>
412         * read.c (backtrace_get_view): Support short read.
414 2020-05-09  Ian Lance Taylor  <iant@golang.org>
416         * elf.c (elf_add): If debug sections are very large or far apart,
417         read them individually rather than as a single view.
419 2020-05-08  Ian Lance Taylor  <iant@golang.org>
421         * fileline.c (sysctl_exec_name): New static function.
422         (sysctl_exec_name1): New macro or static function.
423         (sysctl_exec_name2): Likewise.
424         (fileline_initialize): Try sysctl_exec_name[12].
425         * configure.ac: Check for sysctl args to fetch executable name.
426         * configure: Regenerate.
427         * config.h.in: Regenerate.
429 2020-02-15  Ian Lance Taylor  <iant@golang.org>
431         * ztest.c (test_large): Update file to current libgo test file.
433 2020-02-03  Ian Lance Taylor  <iant@golang.org>
435         * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
436         (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
437         (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
438         (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
439         (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
440         (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
441         (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
442         (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
443         (stest_alloc_CFLAGS): Likewise.
444         * Makefile.in: Regenerate.
445         * ztest.c (error_callback_compress): Mark vdata unused.
446         (test_large): Add casts to avoid warnings.
448 2020-01-01  Jakub Jelinek  <jakub@redhat.com>
450         Update copyright years.
452 2019-12-13  Ian Lance Taylor  <iant@golang.org>
454         Add DWARF 5 support.
455         * dwarf.c (struct attr): Add val field.
456         (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
457         ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
458         (struct line_header): Add addrsize field.
459         (struct line_header_format): Define.
460         (struct unit): Add str_offsets_base, addr_base, and rnglists_base
461         fields.
462         (read_uint24): New static function.
463         (read_attribute): Add implicit_val parameter.  Replace dwarf_str
464         and dwarf_str_size parameters with dwarf_sections parameter.  Add
465         support for new DWARF 5 forms.  Change all callers.
466         (resolve_string): New static function.
467         (resolve_addr_index): Likewise.
468         (read_abbrevs): Support DW_FORM_implicit_const.
469         (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
470         and ranges_is_index fields.
471         (update_pcrange): Support DWARF 5 encodings.
472         (add_high_low_range): New static function, split out of
473         add_ranges.
474         (add_ranges_from_ranges): Likewise.
475         (add_ranges_from_rnglists): New static function.
476         (add_ranges): Just call new helper functions.
477         (find_address_ranges): Use resolve_string for strings, after
478         reading all attributes.  Handle new DWARF 5 attributes.
479         (build_address_map): Support DWARF 5 compilation units.
480         (read_v2_paths): New static function, split out of
481         read_line_header.
482         (read_lnct): New static function.
483         (read_line_header_format_entries): Likewise.
484         (read_line_header): Add ddata parameter.  Support DWARF 5 line
485         headers.  Call new helper functions.  Change all callers.
486         (read_line_program): Use addrsize from line program header.  Don't
487         special case directory index 0 for DWARF 5.
488         (read_referenced_name): Use resolve_string.
489         (read_function_entry): Handle DWARF 5 encodings.  Use
490         resolve_string.
491         * internal.h (enum dwarf_section): Add DEBUG_ADDR,
492         DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
493         * elf.c (dwarf_section_names): Add new section names.
494         * pecoff.c (dwarf_section_names): Likewise.
495         * xcoff.c (xcoff_add): Clear dwarf_sections before setting
496         fields.
497         * configure.ac: Define HAVE_DWARF5 automake conditional.
498         * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
499         (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
500         (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
501         (dwarf5_alloc_LDADD): Likewise.
502         (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
503         (CLEANFILES, clean-local): Define.
505 2019-12-08  Ian Lance Taylor  <iant@golang.org>
507         * dwarf.c (struct pcrange): Define.
508         (update_pcrange, add_ranges): New static functions.
509         (add_unit_addr): Change signature to work with add_ranges.  Don't
510         add base_address here.
511         (add_unit_ranges): Remove.
512         (find_address_ranges): Replace str/ranges parameters with
513         dwarf_sections.  Use update_pcrange and add_ranges.  Change all
514         callers.
515         (add_function_range): Change signature to work with add_ranges.
516         Don't add base_address here.
517         (add_function_ranges): Remove.
518         (read_function_entry): Use update_pcrange and add_ranges.
520 2019-12-04  Ian Lance Taylor  <iant@golang.org>
522         * edtest.c (test1): Add noclone attribute.
524 2019-12-04  Ian Lance Taylor  <iant@golang.org>
526         * internal.h (enum dwarf_section): Define.
527         (struct dwarf_sections): Define.
528         (backtrace_dwarf_add): Update declaration to replace specific
529         section parameters with dwarf_sections parameter.
530         * dwarf.c (struct dwarf_data): Replace specific section fields
531         with dwarf_sections field.
532         (read_attribute): Use dwarf_sections with altlink.
533         (build_address_map): Replace specific section parameters with
534         dwarf_sections parameter.  Change all callers.
535         (read_line_info): Use dwarf_sections with ddata.
536         (read_referenced_name): Likewise.
537         (add_function_ranges): Likewise.
538         (read_function_entry): Likewise.
539         (read_function_info): Likewise.
540         (build_dwarf_data): Replace specific section parameters with
541         dwarf_sections parameter.  Change all callers.
542         (backtrace_dwarf_add): Likewise.
543         * elf.c (enum debug_section): Remove.
544         (dwarf_section_names): Remove .zdebug names.
545         (elf_add): Track zsections separately.  Build dwarf_sections.
546         * pecoff.c (enum debug_section): Remove.
547         (struct debug_section_info): Remove data field.
548         (coff_add): Build dwarf_sections.
549         * xcoff.c (enum dwarf_section): Remove.  Replace DWSECT_xxx
550         references with DEBUG_xxx references.
551         (xcoff_add): Build dwarf_sections.
553 2019-09-27  Maciej W. Rozycki  <macro@wdc.com>
555         * configure: Regenerate.
557 2019-09-26  Ian Lance Taylor  <iant@golang.org>
559         PR libbacktrace/91908
560         * pecoff.c (backtrace_initialize): Explicitly cast unchecked
561         __sync_bool_compare_and_swap to void.
562         * xcoff.c (backtrace_initialize): Likewise.
564 2019-09-03  Ulrich Weigand  <uweigand@de.ibm.com>
566         * configure.ac: Remove references to spu.
567         * configure: Regenerate.
569 2019-05-24  Clement Chigot  <clement.chigot@atos.net>
571         * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
572         test_elf_64.
573         * Makefile.in: Regenerate.
575 2019-05-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
577         * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
578         handling.
579         * configure: Regenerate.
581 2019-03-11  Ian Lance Taylor  <iant@golang.org>
583         PR libbacktrace/89669
584         * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
585         HAVE_ELF.
586         * Makefile.in: Regenerate.
588 2019-02-26  Tom de Vries  <tdevries@suse.de>
590         * btest.c (test5): Allow global.* as minimal symbol name for global.
592 2019-02-26  Tom de Vries  <tdevries@suse.de>
594         * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
595         * Makefile.in: Regenerate.
597 2019-02-12  Tom de Vries  <tdevries@suse.de>
599         PR libbacktrace/81983
600         * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
602 2019-02-10  Tom de Vries  <tdevries@suse.de>
604         * Makefile.am (BUILDTESTS): Add btest_lto.
605         * Makefile.in: Regenerate.
606         * btest.c (test1, f2, f3, test3, f22, f23): Declare with
607         __attribute__((noclone)).
609 2019-02-08  Tom de Vries  <tdevries@suse.de>
611         * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
612         * print.c (backtrace_print): Same.
613         * simple.c (backtrace_simple): Same.
615 2019-02-08  Tom de Vries  <tdevries@suse.de>
617         PR libbacktrace/78063
618         * dwarf.c (build_address_map): Keep all parsed units.
619         (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
621 2019-01-31  Tom de Vries  <tdevries@suse.de>
623         PR libbacktrace/89136
624         * elf.c (elf_add): Read build-id if with_buildid_data.  Fix
625         'debugaltlink_name_len =+ 1'.
627 2019-01-29  Tom de Vries  <tdevries@suse.de>
629         * install-debuginfo-for-buildid.sh.in: New script.
630         * Makefile.am (check_PROGRAMS): Add b2test and b3test.
631         (TESTS): Add b2test_buildid and b3test_dwz_buildid.
632         * Makefile.in: Regenerate.
633         * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
634         (READELF): Set with AC_CHECK_PROG.
635         (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
636         * configure: Regenerate.
637         * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
638         (elf_open_debugfile_by_buildid): ... here.
640 2019-01-29  Tom de Vries  <tdevries@suse.de>
642         * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
643         allocfail.
644         (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
645         (check_PROGRAMS): Add BUILDTESTS.
646         * Makefile.in: Regenerate.
648 2019-01-28  Tom de Vries  <tdevries@suse.de>
650         * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
651         Use $< to access prerequisite.
652         * Makefile.in: Regenerate.
654 2019-01-25  Nathan Sidwell  <nathan@acm.org>
656         * elf.c (elf_add): Pass "" filename to recursive call with
657         separated debug.
659 2019-01-25  Tom de Vries  <tdevries@suse.de>
661         * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
662         filename == "".
663         * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
664         * Makefile.in: Regenerate.
666 2019-01-25  Tom de Vries  <tdevries@suse.de>
668         * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
669         (TESTS): Rename dtest to btest_gnudebuglink.
670         * Makefile.in: Regenerate.
672 2019-01-23  Tom de Vries  <tdevries@suse.de>
674         * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
675         (units_search, find_unit): Use size_t for offset.
676         (build_address_map): Use size_t for unit_offset.
678 2019-01-20  Gerald Pfeifer  <gerald@pfeifer.com>
680         * allocfail.c (main): Increase portability of printf statement.
682 2019-01-18  Ian Lance Taylor  <iant@golang.org>
684         PR libbacktrace/88890
685         * mmapio.c (backtrace_get_view): Change size parameter to
686         uint64_t.  Check that value fits in size_t.
687         * read.c (backtrace_get_view): Likewise.
688         * internal.h (backtrace_get_view): Update declaration.
689         * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
691 2019-01-17  Tom de Vries  <tdevries@suse.de>
693         PR libbacktrace/82857
694         * configure.ac (DWZ): Set with AC_CHECK_PROG.
695         (HAVE_DWZ): Set with AM_CONDITIONAL.
696         * configure: Regenerate.
697         * Makefile.am (TESTS): Add btest_dwz.
698         * Makefile.in: Regenerate.
700 2019-01-17  Tom de Vries  <tdevries@suse.de>
702         PR libbacktrace/82857
703         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
704         (read_attribute): Handle DW_FORM_GNU_ref_alt using
705         ATTR_VAL_REF_ALT_INFO.
706         (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
708 2019-01-17  Tom de Vries  <tdevries@suse.de>
710         * dwarf.c (struct unit): Add low_offset and high_offset fields.
711         (struct unit_vector): New type.
712         (struct dwarf_data): Add units and units_counts fields.
713         (find_unit): New function.
714         (find_address_ranges): Add and handle unit_tag parameter.
715         (build_address_map): Add and handle units_vec parameter.
716         (build_dwarf_data): Pass units_vec to build_address_map.  Store resulting
717         units vector.
719 2019-01-17  Tom de Vries  <tdevries@suse.de>
721         PR libbacktrace/82857
722         * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
723         using altlink.
725 2019-01-17  Tom de Vries  <tdevries@suse.de>
727         * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
728         (read_attribute): Add altlink parameter.  Handle missing altlink for
729         DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
730         (find_address_ranges, build_address_map, build_dwarf_data): Add and
731         handle altlink parameter.
732         (read_referenced_name, read_function_entry): Add argument to
733         read_attribute call.
735 2019-01-17  Tom de Vries  <tdevries@suse.de>
737         * dwarf.c (struct dwarf_data): Add altlink field.
738         (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
739         * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
740         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
741         * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
742         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
743         * xcoff.c (xcoff_add): Same.
745 2019-01-17  Tom de Vries  <tdevries@suse.de>
747         * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
748         * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
749         * elf.c (elf_add): Add and handle fileline_entry parameter.  Add
750         argument to backtrace_dwarf_add call.
751         (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
752         * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
753         * xcoff.c (xcoff_add): Same.
755 2019-01-17  Tom de Vries  <tdevries@suse.de>
757         * elf.c (elf_add): Add and handle with_buildid_data and
758         with_buildid_size parameters.  Handle .gnu_debugaltlink section.
759         (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
761 2019-01-16  Tom de Vries  <tdevries@suse.de>
763         * dwarf.c (read_referenced_name_from_attr): New function.  Factor out
764         of ...
765         (read_referenced_name): ... here, and ...
766         (read_function_entry): ... here.
768 2019-01-16  Tom de Vries  <tdevries@suse.de>
770         * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
771         name.
772         (read_function_entry): Same.  Don't allow name found via
773         DW_AT_abstract_origin or case DW_AT_specification to override linkage
774         name.
776 2019-01-09  Sandra Loosemore  <sandra@codesourcery.com>
778         PR other/16615
780         * backtrace.h: Mechanically replace "can not" with "cannot".
782 2019-01-01  Jakub Jelinek  <jakub@redhat.com>
784         Update copyright years.
786 2018-12-29  Gerald Pfeifer  <gerald@pfeifer.com>
788         * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
789         in sed pattern.
790         * Makefile.in: Regenerate.
792 2018-12-28  Tom de Vries  <tdevries@suse.de>
794         * dwarf.c (build_address_map): Reuse unused units.
796 2018-12-28  Tom de Vries  <tdevries@suse.de>
798         * dwarf.c (build_address_map): Simplify by removing local variable
799         abbrevs.
801 2018-12-28  Ian Lance Taylor  <iant@golang.org>
802             Tom de Vries  <tdevries@suse.de>
804         PR libbacktrace/88063
805         * dwarf.c (free_unit_addrs_vector): Remove.
806         (build_address_map): Keep track of allocated units in vector.  Free
807         allocated units and corresponding abbrevs upon failure.  Remove now
808         redundant call to free_unit_addrs_vector.  Free addrs vector upon
809         failure.  Free allocated unit vector.
811 2018-12-28  Tom de Vries  <tdevries@suse.de>
813         * dwarf.c (build_address_map): Free addrs vector upon failure.
815 2018-12-14  Tom de Vries  <tdevries@suse.de>
817         PR testsuite/88491
818         * allocfail.sh: Remove "set -o pipefail".
820 2018-12-12  Tom de Vries  <tdevries@suse.de>
822         * Makefile.am (TESTS): Add allocfail.sh.
823         (check_PROGRAMS): Add allocfail.
824         * Makefile.in: Regenerate.
825         * instrumented_alloc.c: New file.  Redefine malloc and realloc.
826         Include alloc.c.
827         * allocfail.c: New file.
828         * allocfail.sh: New file.
830 2018-11-30  Tom de Vries  <tdevries@suse.de>
832         * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
833         test_xcoff_64, test_pecoff and test_unknown.
834         * Makefile.in: Regenerate.
835         * test_format.c: New file.
837 2018-11-30  Tom de Vries  <tdevries@suse.de>
839         * Makefile.am : Add _with_alloc version for each test in
840         check_PROGRAMS.
841         * Makefile.in: Regenerate.
843 2018-11-30  Tom de Vries  <tdevries@suse.de>
845         * internal.h (backtrace_vector_free): New static inline fuction,
846         factored out of ...
847         * dwarf.c (read_line_info): ... here.
849 2018-11-28  Tom de Vries  <tdevries@suse.de>
851         * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
852         failure.
854 2018-11-27  Tom de Vries  <tdevries@suse.de>
856         * mmap.c (backtrace_vector_release): Same.
857         * unittest.c (test1): Add check.
859 2018-11-27  Tom de Vries  <tdevries@suse.de>
861         * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
862         instead of realloc.
863         * Makefile.am (check_PROGRAMS): Add unittest.
864         * Makefile.in: Regenerate.
865         * unittest.c: New file.
867 2018-11-22  Tom de Vries  <tdevries@suse.de>
869         * dwarf.c (read_initial_length): Factor out of ...
870         (build_address_map, read_line_info): ... here.
872 2018-11-21  Tom de Vries  <tdevries@suse.de>
874         * dwarf.c (read_string): Factor out of ...
875         (read_attribute, read_line_header, read_line_program): ... here.
877 2018-10-31  Joseph Myers  <joseph@codesourcery.com>
879         PR bootstrap/82856
880         * Makefile.am: Include multilib.am.
881         * configure.ac: Remove AC_PREREQ.  Use AC_LANG_SOURCE.
882         * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
884 2018-10-05  Ian Lance Taylor  <iant@golang.org>
886         PR libbacktrace/87529
887         * backtrace.h: Document that backtrace_create_state should be
888         called only once.
890 2018-08-05 Iain Buclaw  <ibuclaw@gdcproject.org>
892         * configure.ac: Move define of HAVE_ZLIB into check for -lz.
893         * Makefile.in: Regenerate.
894         * config.h.in: Likewise.
895         * configure: Likewise.
897 2018-08-01  Tony Reix  <tony.reix@atos.net>
899         * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
900         (struct xcoff_func, struct xcoff_func_vector): New structs.
901         (xcoff_syminfo): Drop leading dot from symbol name.
902         (xcoff_line_compare, xcoff_line_search): Remove.
903         (xcoff_func_compare, xcoff_func_search): New static functions.
904         (xcoff_lookup_pc): Search function table.
905         (xcoff_add_line, xcoff_process_linenos): Remove.
906         (xcoff_initialize_fileline): Build function table.
908 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
910         PR other/86198
911         * elf.c (elf_add): Increase ".note.gnu.build-id" section size
912         checking up to 36 bytes.
914 2018-04-24  H.J. Lu  <hongjiu.lu@intel.com>
916         * configure: Regenerated.
918 2018-04-19  Jakub Jelinek  <jakub@redhat.com>
920         * configure: Regenerated.
922 2018-04-17  Ian Lance Taylor  <iant@golang.org>
924         * backtrace.c: Revert last two changes.  Don't call mmap
925         directly.
927 2018-04-17  Ian Lance Taylor  <iant@golang.org>
929         * backtrace.c: Include backtrace-supported.h before checking
930         BACKTRACE_USES_MALLOC.
932 2018-04-17  Ian Lance Taylor  <iant@golang.org>
934         * backtrace.c (backtrace_full): When testing whether we can
935         allocate memory, call mmap directly, and munmap the memory.
937 2018-04-04  Jakub Jelinek  <jakub@redhat.com>
939         PR other/85161
940         * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
941         big endian, only use 32-bit loads if endianity macros are predefined
942         and indicate big or little endian.
944 2018-02-14  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
946         PR target/84148
947         * configure: Regenerate.
949 2018-02-15  Jakub Jelinek  <jakub@redhat.com>
951         PR other/82368
952         * elf.c (SHT_PROGBITS): Undefine and define.
954 2018-02-14  Jakub Jelinek  <jakub@redhat.com>
956         PR other/82368
957         * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
958         (struct elf_ppc64_opd_data): New type.
959         (elf_initialize_syminfo): Add opd argument, handle symbols
960         pointing into the PowerPC64 ELFv1 .opd section.
961         (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
962         to structure with .opd data to elf_initialize_syminfo.
964 2018-01-31  Ian Lance Taylor  <iant@golang.org>
966         * elf.c (elf_add): Close descriptor if we use a debugfile.
967         * btest.c (check_open_files): New static function.
968         (main): Call check_open_files.
970 2018-01-25  Ian Lance Taylor  <iant@golang.org>
972         * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
973         desired CRC is zero.
974         (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
976 2018-01-25  Ian Lance Taylor  <iant@golang.org>
978         * pecoff.c (coff_add): Only release syms_view if it is valid.
980 2018-01-25  Ian Lance Taylor  <iant@golang.org>
982         * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
984 2018-01-24  Ian Lance Taylor  <iant@golang.org>
986         * pecoff.c (coff_add): Use coff_read4, not memcpy.
988 2018-01-24  Ian Lance Taylor  <iant@golang.org>
990         PR other/68239
991         * mmap.c (backtrace_free_locked): Don't put more than 16 entries
992         on the free list.
994 2018-01-19  Tony Reix  <tony.reix@atos.net>
996         * xcoff.c (xcoff_incl_compare): New function.
997         (xcoff_incl_search): New function.
998         (xcoff_process_linenos): Use bsearch to find include file.
999         (xcoff_initialize_fileline): Sort include file information.
1001 2018-01-16  Ian Lance Taylor  <iant@golang.org>
1003         * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
1004         288.
1005         (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
1006         elf_zlib_inflate_table.  Generate elf_zlib_default_dist_table.
1007         (elf_zlib_default_table): Update.
1008         (elf_zlib_default_dist_table): New static array.
1009         (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
1010         for block type 1.
1011         * ztest.c (struct zlib_test): Add uncompressed_len.
1012         (tests): Initialize uncompressed_len field.  Add new test case.
1013         (test_samples): Use uncompressed_len field.
1015 2018-01-03  Jakub Jelinek  <jakub@redhat.com>
1017         Update copyright years.
1019 2017-11-17  Igor Tsimbalist  <igor.v.tsimbalist@intel.com>
1021         * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
1022         * aclocal.m4: Regenerate.
1023         * Makefile.in: Likewise.
1024         * configure: Likewise.
1026 2017-10-06  Ian Lance Taylor  <iant@golang.org>
1028         * ztest.c (test_large): Pass unsigned long *, not size_t *, to
1029         zlib uncompress function.
1031 2017-10-05  Ian Lance Taylor  <iant@golang.org>
1033         * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
1034         Read a four byte integer.
1035         (elf_zlib_inflate): Change val to uint64_t.  Align pin to a 32-bit
1036         boundary before ever calling elf_zlib_fetch.
1037         * ztest.c (test_large): Simplify print statements a bit.
1039 2017-10-02  Ian Lance Taylor  <iant@golang.org>
1041         * ztest.c: #include <errno.h>.
1042         (TEST_TIMING): Don't define, don't test.
1043         (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
1044         (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
1045         (ZLIB_CLOCK_GETTIME_ARG): Define.
1046         * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
1047         * Makefile.am: Likewise.
1048         * configure, Makefile.in: Rebuild.
1050 2017-10-02  Thomas Schwinge  <thomas@codesourcery.com>
1052         PR other/67165
1053         * Makefile.am: Append the content of clock_gettime_link to
1054         ztest_LDADD.
1055         * configure.ac: Test for the case that clock_gettime is in librt.
1056         * Makefile.in: Regenerate.
1057         * configure: Likewise.
1059         PR other/67165
1060         * configure.ac: Check for clock_gettime.
1061         * config.h.in: Regenerate.
1062         * configure: Likewise.
1063         * ztest.c (average_time, test_large): Conditionalize test timing
1064         on clock_gettime availability.
1066 2017-09-29  Tony Reix  <tony.reix@atos.net>
1068         * xcoff.c: Initial support for DWARF debug sections in XCOFF.
1069         (STYP_DWARF, SSUBTYP_DW*): Define.
1070         (enum dwarf_section): Define.
1071         (struct dwsect_info): Define.
1072         (xcoff_add): Look for DWARF sections, pass them to
1073         backtrace_dwarf_add.
1075 2017-09-28  Ian Lance Taylor  <iant@golang.org>
1077         PR other/67165
1078         * elf.c (__builtin_prefetch): Define if not __GNUC__.
1079         (unlikely): Define.
1080         (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
1081         (b_elf_chdr): Define type.
1082         (enum debug_section): Add ZDEBUG_xxx values.
1083         (debug_section_names): Add names for new sections.
1084         (struct debug_section_info): Add compressed field.
1085         (elf_zlib_failed, elf_zlib_fetch): New static functions.
1086         (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
1087         (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
1088         (HUFFMAN_SECONDARY_SHIFT): Define.
1089         (ZDEBUG_TABLE_SIZE): Define.
1090         (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
1091         (final_next_secondary): New static variable if
1092         BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
1093         (elf_zlib_inflate_table): New static function.
1094         (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
1095         function to produce fixed Huffman table.
1096         (elf_zlib_default_table): New static variable.
1097         (elf_zlib_inflate): New static function.
1098         (elf_zlib_verify_checksum): Likewise.
1099         (elf_zlib_inflate_and_verify): Likewise.
1100         (elf_uncompress_zdebug): Likewise.
1101         (elf_uncompress_chdr): Likewise.
1102         (backtrace_uncompress_zdebug): New extern function.
1103         (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
1104         sections, and uncompress them.
1105         * internal.h (backtrace_compress_zdebug): Declare.
1106         * ztest.c: New file.
1107         * configure.ac: Check for -lz and check whether the linker
1108         supports --compress-debug-sections.
1109         * Makefile.am (ztest_SOURCES): New variable.
1110         (ztest_CFLAGS, ztest_LDADD): New variables.
1111         (check_PROGRAMS): Add ztest.
1112         (ctestg_SOURCES): New variable.
1113         (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
1114         (ctesta_SOURCES): New variable.
1115         (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
1116         (check_PROGRAMS): Add ctestg and ctesta.
1117         * configure, config.h.in, Makefile.in: Rebuild.
1119 2017-09-22  Ian Lance Taylor  <iant@golang.org>
1121         PR sanitizer/77631
1122         * configure.ac: Check for lstat and readlink.
1123         * elf.c (lstat, readlink): Provide dummy versions if real versions
1124         are not available.
1125         * configure, config.h.in: Rebuild.
1127 2017-09-21  Ian Lance Taylor  <iant@google.com>
1129         PR go/82284
1130         * elf.c (backtrace_initialize): Set pd.exe_filename.
1132 2017-09-20  Ian Lance Taylor  <iant@golang.org>
1133             Denis Khalikov  <d.khalikov@partner.samsung.com>
1135         PR sanitizer/77631
1136         Support for external debug info.
1137         * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
1138         (S_ISLNK): Define if not defined.
1139         (xstrnlen): Define if strnlen is not available.
1140         (b_elf_note): Define type.
1141         (NT_GNU_BUILD_ID): Define macro.
1142         (elf_crc32, elf_crc32_file): New static functions.
1143         (elf_is_symlink, elf_readlink): New static functions.
1144         (elf_open_debugfile_by_buildid): New static function.
1145         (elf_try_debugfile): New static function.
1146         (elf_find_debugfile_by_debuglink): New static function.
1147         (elf_open_debugfile_by_debuglink): New static function.
1148         (elf_add): Add filename and debuginfo parameters.  Adjust all
1149         callers.  Look for external debug info notes, and try to fetch
1150         debug info from external file.
1151         (struct phdr_data): Add exe_filename field.
1152         (phdr_callback): Pass filename to elf_add.
1153         (backtrace_initialize): Add filename parameter.
1154         * internal.h (backtrace_initialize): Add filename parameter.
1155         * fileline.c (fileline_initialize): Pass filename to
1156         backtrace_initialize.
1157         * pecoff.c (fileline_initialize): Add unused filename parameter.
1158         * unknown.c (fileline_initialize): Likewise.
1159         * xcoff.c (fileline_initialize): Likewise.
1160         * configure.ac: Check for objcopy --add-gnu-debuglink.
1161         * Makefile.am (dtest): New test target.
1162         * configure, Makefile.in: Rebuild.
1164 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1166         PR other/81096
1167         * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1168         * Makefile.in: Regenerate.
1170 2017-09-12  Steve Ellcey  <sellcey@cavium.com>
1172         PR other/81096
1173         * libbacktrace/Makefile.in
1174         (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1176 2017-08-02  David Edelsohn  <dje.gcc@gmail.com>
1178         PR bootstrap/81638
1179         * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1181 2017-07-28  Tony Reix  <tony.reix@atos.net>
1183         * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1185 2017-07-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1187         * fileline.c (fileline_initialize): Print pid_t as long.
1189 2017-07-26  Tony Reix  <tony.reix@atos.net>
1191         * configure.ac: Check for XCOFF32/XCOFF64.  Check for loadquery.
1192         * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1193         * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1194         * configure, config.h.in: Regenerate.
1196 2017-07-21  Tony Reix  <tony.reix@atos.net>
1198         * filetype.awk: Add AIX XCOFF type detection.
1199         * configure.ac: Recognize xcoff format.
1200         * Makefile.am (FORMAT_FILES): Add xcoff.c.
1201         * fileline.c: Include <unistd.h>.
1202         (fileline_initialize): Add case for AIX procfs.
1203         * xcoff.c: New file.
1204         * configure, Makefile.in: Rebuild.
1206 2017-06-21  Richard Biener  <rguenther@suse.de>
1208         * configure.ac: Add AC_SYS_LARGEFILE.
1209         * config.h.in: Regenerate.
1210         * configure: Likewise.
1212 2017-06-11  Ian Lance Taylor  <iant@golang.org>
1214         * elf.c (backtrace_initialize): Always set *fileline_fn.
1215         * ttest.c: New file.
1216         * btest.c: Move support functions into testlib.c.  Change calls to
1217         check to pass file name.
1218         * testlib.c: New file, copied from (part of) btest.c.
1219         * testlib.h: New file, declarations for testlib.c.
1220         * edtest.c: Use testlib.h and testlib.c.
1221         * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1222         * Makefile.am (btest_SOURCES): Add testlib.c.
1223         (edtest_SOURCES): Likewise.
1224         (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1225         (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1226         * configure, Makefile.in: Rebuild.
1228 2017-05-19  Than McIntosh  <thanm@google.com>
1230         * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1231         (read_line_header): Don't allocate dirs if dirs_count == 0.
1232         * edtest.c: New file.
1233         * edtest2.c: New file.
1234         * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1235         (check_PROGRAMS): Add edtest.
1236         (edtest2_build.c, gen_edtest2_build): New targets.
1237         * Makefile.in: Rebuild.
1239 2017-03-08  Sam Thursfield  <sam.thursfield@codethink.co.uk>
1241         * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1242         to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1244 2017-01-01  Jakub Jelinek  <jakub@redhat.com>
1246         Update copyright years.
1248 2016-11-15  Matthias Klose  <doko@ubuntu.com>
1250         * configure: Regenerate.
1252 2016-09-11  Carlos Liam  <carlos@aarzee.me>
1254         * all: Remove meaningless trailing whitespace.
1256 2016-05-18  Uros Bizjak  <ubizjak@gmail.com>
1258         PR target/71161
1259         * elf.c (phdr_callback) [__i386__]: Add
1260         __attribute__((__force_align_arg_pointer__)).
1262 2016-03-02  Maxim Ostapenko  <m.ostapenko@partner.samsung.com>
1264         * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1265         avoid possible crash.
1266         (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1267         missing debug info anymore.
1269 2016-02-06  John David Anglin  <danglin@gcc.gnu.org>
1271         * mmap.c (MAP_FAILED): Define if not defined.
1273 2016-01-04  Jakub Jelinek  <jakub@redhat.com>
1275         Update copyright years.
1277 2015-12-18  Andris Pavenis  <andris.pavenis@iki.fi>
1279         * configure.ac: Specify that DJGPP do not have mmap
1280         even when sys/mman.h exists.
1281         * configure: Regenerate
1283 2015-12-09  John David Anglin  <danglin@gcc.gnu.org>
1285         PR libgfortran/68115
1286         * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1287         * configure: Regenerate.
1288         * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1289         to void.
1291 2015-09-17  Ian Lance Taylor  <iant@google.com>
1293         * posix.c (backtrace_open): Cast second argument of open() to int.
1295 2015-09-11  Ian Lance Taylor  <iant@google.com>
1297         * Makefile.am (backtrace.lo): Depend on internal.h.
1298         (sort.lo, stest.lo): Add explicit dependencies.
1299         * Makefile.in: Rebuild.
1301 2015-09-09  Hans-Peter Nilsson  <hp@axis.com>
1303         * backtrace.c: #include <sys/types.h>.
1305 2015-09-08  Ian Lance Taylor  <iant@google.com>
1307         PR other/67457
1308         * backtrace.c: #include "internal.h".
1309         (struct backtrace_data): Add can_alloc field.
1310         (unwind): If can_alloc is false, don't try to get file/line
1311         information.
1312         (backtrace_full): Set can_alloc field in bdata.
1313         * alloc.c (backtrace_alloc): Don't call error_callback if it is
1314         NULL.
1315         * mmap.c (backtrace_alloc): Likewise.
1316         * internal.h: Update comments for backtrace_alloc and
1317         backtrace_free.
1319 2015-09-08  Ian Lance Taylor  <iant@google.com>
1321         PR other/67457
1322         * mmap.c (backtrace_alloc): Correct test for mmap failure.
1324 2015-08-31  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1326         * configure.ac: For spu-*-* targets, set have_fcntl to no.
1327         * configure: Regenerate.
1329 2015-08-27  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1331         * configure.ac: Remove [disable-shared] argument to LT_INIT.
1332         Remove setting PIC_FLAG when building as target library.
1333         * configure: Regenerate.
1335 2015-08-26  Hans-Peter Nilsson  <hp@axis.com>
1337         * configure.ac: Only compile with -fPIC if the target
1338         supports it.
1339         * configure: Regenerate.
1341 2015-08-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
1343         * configure.ac: Set have_mmap to no on spu-*-* targets.
1344         * configure: Regenerate.
1346 2015-08-13  Ian Lance Taylor  <iant@google.com>
1348         * dwarf.c (read_function_entry): Add vec_inlined parameter.
1349         Change all callers.
1351 2015-06-11  Martin Sebor  <msebor@redhat.com>
1353         PR sanitizer/65479
1354         * dwarf.c (struct line): Add new field idx.
1355         (line_compare): Use it.
1356         (add_line): Set it.
1357         (read_line_info): Reset it.
1359 2015-05-29  Tristan Gingold  <gingold@adacore.com>
1361         * pecoff.c: New file.
1362         * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1363         * Makefile.in: Regenerate.
1364         * filetype.awk: Detect pecoff.
1365         * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1366         Add pecoff.
1367         * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1368         true.
1369         * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1370         * configure: Regenerate.
1371         * pecoff.c: New file.
1373 2015-05-13  Michael Haubenwallner  <michael.haubenwallner@ssi-schaefer.com>
1375         * Makefile.in: Regenerated with automake-1.11.6.
1376         * aclocal.m4: Likewise.
1377         * configure: Likewise.
1379 2015-01-24  Matthias Klose  <doko@ubuntu.com>
1381         * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1382         * configure: Regenerate.
1384 2015-01-05  Jakub Jelinek  <jakub@redhat.com>
1386         Update copyright years.
1388 2014-11-21  H.J. Lu  <hongjiu.lu@intel.com>
1390         PR bootstrap/63784
1391         * configure: Regenerated.
1393 2014-11-11  David Malcolm  <dmalcolm@redhat.com>
1395         * ChangeLog.jit: New.
1397 2014-11-11  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1399         PR target/63610
1400         * configure: Regenerate.
1402 2014-10-23  Ian Lance Taylor  <iant@google.com>
1404         * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1405         Fix to return void *.
1407 2014-05-08  Ian Lance Taylor  <iant@google.com>
1409         * mmap.c (backtrace_free): If freeing a large aligned block of
1410         memory, call munmap rather than holding onto it.
1411         (backtrace_vector_grow): When growing a vector, double the number
1412         of pages requested.  When releasing the old version of a grown
1413         vector, pass the correct size to backtrace_free.
1415 2014-03-07  Ian Lance Taylor  <iant@google.com>
1417         * sort.c (backtrace_qsort): Use middle element as pivot.
1419 2014-03-06  Ian Lance Taylor  <iant@google.com>
1421         * sort.c: New file.
1422         * stest.c: New file.
1423         * internal.h (backtrace_qsort): Declare.
1424         * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1425         (read_line_info, read_function_entry): Likewise.
1426         (read_function_info, build_dwarf_data): Likewise.
1427         * elf.c (elf_initialize_syminfo): Likewise.
1428         * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1429         (stest_SOURCES, stest_LDADD): Define.
1430         (check_PROGRAMS): Add stest.
1432 2014-02-07  Misty De Meo  <misty@brew.sh>
1434         PR target/58710
1435         * configure.ac: Use AC_LINK_IFELSE in check for
1436         _Unwind_GetIPInfo.
1437         * configure: Regenerate.
1439 2014-01-02  Richard Sandiford  <rdsandiford@googlemail.com>
1441         Update copyright years
1443 2013-12-06  Jakub Jelinek  <jakub@redhat.com>
1445         * elf.c (ET_DYN): Undefine and define again.
1446         (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1447         return early -1 without closing the descriptor.
1448         (struct phdr_data): Add exe_descriptor.
1449         (phdr_callback): If pd->exe_descriptor is not -1, for very first
1450         call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1451         otherwise backtrace_close the exe_descriptor if not -1.  Adjust
1452         call to elf_add.
1453         (backtrace_initialize): Adjust call to elf_add.  If it returns
1454         -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1456 2013-12-05  Ian Lance Taylor  <iant@google.com>
1458         * alloc.c (backtrace_vector_finish): Add error_callback and data
1459         parameters.  Call backtrace_vector_release.  Return address base.
1460         * mmap.c (backtrace_vector_finish): Add error_callback and data
1461         parameters.  Return address base.
1462         * dwarf.c (read_function_info): Get new address base from
1463         backtrace_vector_finish.
1464         * internal.h (backtrace_vector_finish): Update declaration.
1466 2013-11-27  Ian Lance Taylor  <iant@google.com>
1468         * dwarf.c (find_address_ranges): New static function, broken out
1469         of build_address_map.
1470         (build_address_map): Call it.
1471         * btest.c (check): Check for missing filename or function, rather
1472         than crashing.
1473         (f3): Check that enough frames were returned.
1475 2013-11-19  Jakub Jelinek  <jakub@redhat.com>
1477         * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1478         * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1479         last argument.
1480         * btest.c (struct symdata): Add size field.
1481         (callback_three): Add symsize argument.  Copy it to the data->size
1482         field.
1483         (f23): Set symdata.size to 0.
1484         (test5): Likewise.  If sizeof (int) > 1, lookup address of
1485         ((uintptr_t) &global) + 1.  Verify symdata.val and symdata.size
1486         values.
1488         * atomic.c: Include sys/types.h.
1490 2013-11-18  Ian Lance Taylor  <iant@google.com>
1492         * configure.ac: Check for support of __atomic extensions.
1493         * internal.h: Declare or #define atomic functions for use in
1494         backtrace code.
1495         * atomic.c: New file.
1496         * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1497         (dwarf_fileline, backtrace_dwarf_add): Likewise.
1498         * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1499         (backtrace_initialize): Likewise.
1500         * fileline.c (fileline_initialize): Likewise.
1501         * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1502         * configure, config.h.in, Makefile.in: Rebuild.
1504 2013-11-18  Jakub Jelinek  <jakub@redhat.com>
1506         * elf.c (SHN_UNDEF): Define.
1507         (elf_initialize_syminfo): Add base_address argument.  Ignore symbols
1508         with st_shndx == SHN_UNDEF.  Add base_address to address fields.
1509         (elf_add): Adjust caller.
1511         * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1513 2013-11-16  Ian Lance Taylor  <iant@google.com>
1515         * backtrace.h (backtrace_create_state): Correct comment about
1516         threading.
1518 2013-11-15  Ian Lance Taylor  <iant@google.com>
1520         * backtrace.h (backtrace_syminfo): Update comment and parameter
1521         name to take any address, not just a PC value.
1522         * elf.c (STT_OBJECT): Define.
1523         (elf_nosyms): Rename parameter pc to addr.
1524         (elf_symbol_search): Rename local variable pc to addr.
1525         (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1526         (elf_syminfo): Rename parameter pc to addr.
1527         * btest.c (global): New global variable.
1528         (test5): New test.
1529         (main): Call test5.
1531 2013-10-17  Ian Lance Taylor  <iant@google.com>
1533         * elf.c (elf_add): Don't get the wrong offsets if a debug section
1534         is missing.
1536 2013-10-15  David Malcolm  <dmalcolm@redhat.com>
1538         * configure.ac: Add --enable-host-shared, setting up
1539         pre-existing PIC_FLAG variable within Makefile.am et al.
1540         * configure: Regenerate.
1542 2013-09-20  Alan Modra  <amodra@gmail.com>
1544         * configure: Regenerate.
1546 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1548         * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1550 2013-07-23  Alexander Monakov  <amonakov@ispras.ru>
1552         * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1553         dl_iterate_phdr callbacks.
1555 2013-03-25  Ian Lance Taylor  <iant@google.com>
1557         * alloc.c: #include <sys/types.h>.
1558         * mmap.c: Likewise.
1560 2013-01-31  Ian Lance Taylor  <iant@google.com>
1562         * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1563         (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1565 2013-01-25  Jakub Jelinek  <jakub@redhat.com>
1567         PR other/56076
1568         * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1569         attribute was not seen.
1571 2013-01-16  Ian Lance Taylor  <iant@google.com>
1573         * dwarf.c (struct unit): Add filename and abs_filename fields.
1574         (build_address_map): Set new fields when reading unit.
1575         (dwarf_lookup_pc): If we don't find an entry in the line table,
1576         just return the main file name.
1578 2013-01-14  Richard Sandiford  <rdsandiford@googlemail.com>
1580         Update copyright years.
1582 2013-01-01  Ian Lance Taylor  <iant@google.com>
1584         PR bootstrap/54834
1585         * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1586         $(MULTIBUILDTOP)/../../gcc/include.
1587         * Makefile.in: Rebuild.
1589 2013-01-01  Ian Lance Taylor  <iant@google.com>
1591         PR other/55536
1592         * mmap.c (backtrace_alloc): Don't call sync functions if not
1593         threaded.
1594         (backtrace_free): Likewise.
1596 2012-12-12  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1598         * mmapio.c: Define MAP_FAILED if not defined.
1600 2012-12-11  Jakub Jelinek  <jakub@redhat.com>
1602         PR bootstrap/54926
1603         * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1604         * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1605         to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1606         accepts it.
1607         * Makefile.in: Regenerated.
1608         * configure: Regenerated.
1610 2012-12-07  Jakub Jelinek  <jakub@redhat.com>
1612         PR bootstrap/54926
1613         * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1614         * Makefile.in: Regenerated.
1616 2012-11-20  Ian Lance Taylor  <iant@google.com>
1618         * dwarf.c (read_attribute): Always clear val.
1620 2012-11-13  Ian Lance Taylor  <iant@google.com>
1622         PR other/55312
1623         * configure.ac: Only add -Werror if building a target library.
1624         * configure: Rebuild.
1626 2012-11-12  Ian Lance Taylor  <iant@google.com>
1627             Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1628             Gerald Pfeifer  <gerald@pfeifer.com>
1630         * configure.ac: Check for getexecname.
1631         * fileline.c: #include <errno.h>.  Define getexecname if not
1632         available.
1633         (fileline_initialize): Try to find the executable in a few
1634         different ways.
1635         * print.c (error_callback): Only print the filename if it came
1636         from the backtrace state.
1637         * configure, config.h.in: Rebuild.
1639 2012-10-29  Ian Lance Taylor  <iant@google.com>
1641         * mmap.c (backtrace_vector_release): Correct last patch: add
1642         aligned, not size.
1644 2012-10-29  Ian Lance Taylor  <iant@google.com>
1646         * mmap.c (backtrace_vector_release): Make sure freed block is
1647         aligned on 8-byte boundary.
1649 2012-10-26  Ian Lance Taylor  <iant@google.com>
1651         PR other/55087
1652         * posix.c (backtrace_open): Add does_not_exist parameter.
1653         * elf.c (phdr_callback): Do not warn if shared library could not
1654         be opened.
1655         * fileline.c (fileline_initialize): Update calls to
1656         backtrace_open.
1657         * internal.h (backtrace_open): Update declaration.
1659 2012-10-26  Jack Howarth  <howarth@bromo.med.uc.edu>
1661         PR target/55061
1662         * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1663         * configure: Regenerate.
1665 2012-10-24  Ian Lance Taylor  <iant@google.com>
1667         PR target/55061
1668         * configure.ac: Check whether -funwind-tables option works.
1669         * configure: Rebuild.
1671 2012-10-11  Ian Lance Taylor  <iant@google.com>
1673         * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1674         * configure: Rebuild.
1676 2012-10-10  Ian Lance Taylor  <iant@google.com>
1678         * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1679         lower case.
1681 2012-10-10  Hans-Peter Nilsson  <hp@bitrange.com>
1683         * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1685 2012-10-09  Ian Lance Taylor  <iant@google.com>
1687         * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1688         (backtrace_dwarf_add): Likewise.
1690 2012-10-09  Ian Lance Taylor  <iant@google.com>
1692         Add support for tracing through shared libraries.
1693         * configure.ac: Check for link.h and dl_iterate_phdr.
1694         * elf.c: #include <link.h> if system has dl_iterate_phdr.  #undef
1695         ELF macros before #defining them.
1696         (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1697         dl_iterate_phdr.
1698         (struct elf_syminfo_data): Add next field.
1699         (elf_initialize_syminfo): Initialize next field.
1700         (elf_add_syminfo_data): New static function.
1701         (elf_add): New static function, broken out of
1702         backtrace_initialize.  Call backtrace_dwarf_add instead of
1703         backtrace_dwarf_initialize.
1704         (struct phdr_data): Define.
1705         (phdr_callback): New static function.
1706         (backtrace_initialize): Call elf_add.
1707         * dwarf.c (struct dwarf_data): Add next and base_address fields.
1708         (add_unit_addr): Add base_address parameter.  Change all callers.
1709         (add_unit_ranges, build_address_map): Likewise.
1710         (add_line): Add ddata parameter.  Change all callers.
1711         (read_line_program, add_function_range): Likewise.
1712         (dwarf_lookup_pc): New static function, broken out of
1713         dwarf_fileline.
1714         (dwarf_fileline): Call dwarf_lookup_pc.
1715         (build_dwarf_data): New static function.
1716         (backtrace_dwarf_add): New function.
1717         (backtrace_dwarf_initialize): Remove.
1718         * internal.h (backtrace_dwarf_initialize): Don't declare.
1719         (backtrace_dwarf_add): Declare.
1720         * configure, config.h.in: Rebuild.
1722 2012-10-04  Gerald Pfeifer  <gerald@pfeifer.com>
1724         * btest.c (f23): Avoid uninitialized variable warning.
1726 2012-10-04  Ian Lance Taylor  <iant@google.com>
1728         * dwarf.c: If the system header files do not declare strnlen,
1729         provide our own version.
1731 2012-10-03  Ian Lance Taylor  <iant@google.com>
1733         * dwarf.c (read_uleb128): Fix overflow test.
1734         (read_sleb128): Likewise.
1735         (build_address_map): Don't change unit_buf.start.
1737 2012-10-02  Uros Bizjak  <ubizjak@gmail.com>
1739         PR other/54761
1740         * configure.ac (EXTRA_FLAGS): New.
1741         * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1742         * configure, Makefile.in: Regenerate.
1744 2012-09-29  Ian Lance Taylor  <iant@google.com>
1746         PR other/54749
1747         * fileline.c (fileline_initialize): Pass errnum as -1 when
1748         reporting that we could not read executable information after a
1749         previous failure.
1751 2012-09-27  Ian Lance Taylor  <iant@google.com>
1753         PR bootstrap/54732
1754         * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1755         * Makefile.am: Add dependencies for all objects.
1756         * configure, aclocal.m4, Makefile.in: Rebuild.
1758 2012-09-27  Ian Lance Taylor  <iant@google.com>
1760         PR other/54726
1761         * elf.c (backtrace_initialize): Set *fileln_fn, not
1762         state->fileln_fn.
1764 2012-09-19  Ian Lance Taylor  <iant@google.com>
1766         * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1767         as a target library.
1768         * configure: Rebuild.
1770 2012-09-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1771             Ian Lance Taylor  <iant@google.com>
1773         * configure.ac (GCC_HEADER_STDINT): Invoke.
1774         * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1775         * btest.c: Don't include <stdint.h>.
1776         * dwarf.c: Likewise.
1777         * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1779 2012-09-18  Ian Lance Taylor  <iant@google.com>
1781         PR bootstrap/54623
1782         * Makefile.am (AM_CPPFLAGS): Define.
1783         (AM_CFLAGS): Remove -I options.
1784         * Makefile.in: Rebuild.
1786 2012-09-18  Ian Lance Taylor  <iant@google.com>
1788         * posix.c (O_BINARY): Define if not defined.
1789         (backtrace_open): Pass O_BINARY to open.  Only call fcntl if
1790         HAVE_FCNTL is defined.
1791         * configure.ac: Test for the fcntl function.
1792         * configure, config.h.in: Rebuild.
1794 2012-09-18  Ian Lance Taylor  <iant@google.com>
1796         * btest.c (test1, test2, test3, test4): Add the unused attribute.
1798 2012-09-18  Ian Lance Taylor  <iant@google.com>
1800         * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1802 2012-09-18  Ian Lance Taylor  <iant@google.com>
1804         * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1805         * mmapio.c: Don't define _GNU_SOURCE.
1806         * configure, config.h.in: Rebuild.
1808 2012-09-18  Ian Lance Taylor  <iant@google.com>
1810         * configure.ac: Check whether strnlen is declared.
1811         * dwarf.c: Declare strnlen if not declared.
1812         * configure, config.h.in: Rebuild.
1814 2012-09-18  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1816         * fileline.c: Include <stdlib.h>.
1817         * mmap.c: Likewise.
1819 2012-09-17  Ian Lance Taylor  <iant@google.com>
1821         PR bootstrap/54611
1822         * nounwind.c (backtrace_full): Rename from backtrace.  Add state
1823         parameter.
1825 2012-09-17  Gerald Pfeifer  <gerald@pfeifer.com>
1827         PR bootstrap/54611
1828         * nounwind.c (backtrace_simple): Add state parameter.
1830 2012-09-17  Ian Lance Taylor  <iant@google.com>
1832         PR bootstrap/54609
1833         * unknown.c (unknown_fileline): Add state parameter, remove
1834         fileline_data parameter, name error_callback parameter.
1835         (backtrace_initialize): Add state parameter.
1837 2012-09-17  Ian Lance Taylor  <iant@google.com>
1839         * Initial implementation.
1841 Copyright (C) 2012-2022 Free Software Foundation, Inc.
1843 Copying and distribution of this file, with or without modification,
1844 are permitted in any medium without royalty provided the copyright
1845 notice and this notice are preserved.