1 2020-10-20 Ian Lance Taylor <iant@golang.org>
3 * internal.h (ATTRIBUTE_FALLTHROUGH): Define.
4 * elf.c (elf_zlib_inflate): Use ATTRIBUTE_FALLTHROUGH.
6 2020-09-28 Ian Lance Taylor <iant@golang.org>
9 * Makefile.am (check_DATA): Add mtest.dSYM if USE_DSYMUTIL.
10 * Makefile.in: Regenerate.
12 2020-09-28 Ian Lance Taylor <iant@golang.org>
15 * configure.ac (USE_DSYMUTIL): Define instead of HAVE_DSYMUTIL.
16 * Makefile.am: Change all uses of HAVE_DSYMUTIL to USE_DSYMUTIL.
17 * configure: Regenerate.
18 * Makefile.in: Regenerate.
20 2020-09-23 Ian Lance Taylor <iant@golang.org>
22 * dwarf.c (report_inlined_functions): Handle PC == -1 and PC ==
24 (dwarf_lookup_pc): Likewise.
26 2020-09-17 Ian Lance Taylor <iant@golang.org>
29 * fileline.c (backtrace_syminfo_to_full_callback): New function.
30 (backtrace_syminfo_to_full_error_callback): New function.
31 * elf.c (elf_nodebug): Call syminfo_fn if possible.
32 * internal.h (struct backtrace_call_full): Define.
33 (backtrace_syminfo_to_full_callback): Declare.
34 (backtrace_syminfo_to_full_error_callback): Declare.
35 * mtest.c (f3): Only check all[i] if data.index permits.
37 2020-09-16 Iain Sandoe <iain@sandoe.co.uk>
39 * macho.c (MACH_O_CPU_TYPE_PPC): New.
40 (MACH_O_CPU_TYPE_PPC64): New.
41 Add compile-tests for powerpc to the Mach-O variants.
43 2020-09-14 Ian Lance Taylor <iant@golang.org>
46 Add support for MiniDebugInfo.
47 * elf.c (struct elf_view): Define. Replace most uses of
48 backtrace_view with elf_view.
49 (elf_get_view): New static functions. Replace most calls of
50 backtrace_get_view with elf_get_view.
51 (elf_release_view): New static functions. Replace most calls of
52 backtrace_release_view with elf_release_view.
53 (elf_uncompress_failed): Rename from elf_zlib_failed. Change all
55 (LZMA_STATES, LZMA_POS_STATES, LZMA_DIST_STATES): Define.
56 (LZMA_DIST_SLOTS, LZMA_DIST_MODEL_START): Define.
57 (LZMA_DIST_MODEL_END, LZMA_FULL_DISTANCES): Define.
58 (LZMA_ALIGN_SIZE, LZMA_LEN_LOW_SYMBOLS): Define.
59 (LZMA_LEN_MID_SYMBOLS, LZMA_LEN_HIGH_SYMBOLS): Define.
60 (LZMA_LITERAL_CODERS_MAX, LZMA_LITERAL_CODER_SIZE): Define.
61 (LZMA_PROB_IS_MATCH_LEN, LZMA_PROB_IS_REP_LEN): Define.
62 (LZMA_PROB_IS_REP0_LEN, LZMA_PROB_IS_REP1_LEN): Define.
63 (LZMA_PROB_IS_REP2_LEN, LZMA_PROB_IS_REP0_LONG_LEN): Define.
64 (LZMA_PROB_DIST_SLOT_LEN, LZMA_PROB_DIST_SPECIAL_LEN): Define.
65 (LZMA_PROB_DIST_ALIGN_LEN): Define.
66 (LZMA_PROB_MATCH_LEN_CHOICE_LEN): Define.
67 (LZMA_PROB_MATCH_LEN_CHOICE2_LEN): Define.
68 (LZMA_PROB_MATCH_LEN_LOW_LEN): Define.
69 (LZMA_PROB_MATCH_LEN_MID_LEN): Define.
70 (LZMA_PROB_MATCH_LEN_HIGH_LEN): Define.
71 (LZMA_PROB_REP_LEN_CHOICE_LEN): Define.
72 (LZMA_PROB_REP_LEN_CHOICE2_LEN): Define.
73 (LZMA_PROB_REP_LEN_LOW_LEN): Define.
74 (LZMA_PROB_REP_LEN_MID_LEN): Define.
75 (LZMA_PROB_REP_LEN_HIGH_LEN): Define.
76 (LZMA_PROB_LITERAL_LEN): Define.
77 (LZMA_PROB_IS_MATCH_OFFSET, LZMA_PROB_IS_REP_OFFSET): Define.
78 (LZMA_PROB_IS_REP0_OFFSET, LZMA_PROB_IS_REP1_OFFSET): Define.
79 (LZMA_PROB_IS_REP2_OFFSET): Define.
80 (LZMA_PROB_IS_REP0_LONG_OFFSET): Define.
81 (LZMA_PROB_DIST_SLOT_OFFSET): Define.
82 (LZMA_PROB_DIST_SPECIAL_OFFSET): Define.
83 (LZMA_PROB_DIST_ALIGN_OFFSET): Define.
84 (LZMA_PROB_MATCH_LEN_CHOICE_OFFSET): Define.
85 (LZMA_PROB_MATCH_LEN_CHOICE2_OFFSET): Define.
86 (LZMA_PROB_MATCH_LEN_LOW_OFFSET): Define.
87 (LZMA_PROB_MATCH_LEN_MID_OFFSET): Define.
88 (LZMA_PROB_MATCH_LEN_HIGH_OFFSET): Define.
89 (LZMA_PROB_REP_LEN_CHOICE_OFFSET): Define.
90 (LZMA_PROB_REP_LEN_CHOICE2_OFFSET): Define.
91 (LZMA_PROB_REP_LEN_LOW_OFFSET): Define.
92 (LZMA_PROB_REP_LEN_MID_OFFSET): Define.
93 (LZMA_PROB_REP_LEN_HIGH_OFFSET): Define.
94 (LZMA_PROB_LITERAL_OFFSET): Define.
95 (LZMA_PROB_TOTAL_COUNT): Define.
96 (LZMA_IS_MATCH, LZMA_IS_REP, LZMA_IS_REP0): Define.
97 (LZMA_IS_REP1, LZMA_IS_REP2, LZMA_IS_REP0_LONG): Define.
98 (LZMA_DIST_SLOT, LZMA_DIST_SPECIAL, LZMA_DIST_ALIGN): Define.
99 (LZMA_MATCH_LEN_CHOICE, LZMA_MATCH_LEN_CHOICE2): Define.
100 (LZMA_MATCH_LEN_LOW, LZMA_MATCH_LEN_MID): Define.
101 (LZMA_MATCH_LEN_HIGH, LZMA_REP_LEN_CHOICE): Define.
102 (LZMA_REP_LEN_CHOICE2, LZMA_REP_LEN_LOW): Define.
103 (LZMA_REP_LEN_MID, LZMA_REP_LEN_HIGH, LZMA_LITERAL): Define.
104 (elf_lzma_varint): New static function.
105 (elf_lzma_range_normalize): New static function.
106 (elf_lzma_bit, elf_lzma_integer): New static functions.
107 (elf_lzma_reverse_integer): New static function.
108 (elf_lzma_len, elf_uncompress_lzma_block): New static functions.
109 (elf_uncompress_lzma): New static function.
110 (backtrace_uncompress_lzma): New function.
111 (elf_add): Add memory and memory_size parameters. Change all
112 callers. Look for .gnu_debugdata section, and, if found,
113 decompress it and use it for symbols and debug info. Permit the
114 descriptor parameter to be -1.
115 * internal.h (backtrace_uncompress_lzma): Declare.
117 * xztest.c: New file.
118 * configure.ac: Check for nm, xz, and comm programs. Check for
120 (HAVE_MINIDEBUG): Define.
121 * Makefile.am (mtest_SOURCES): Define.
122 (mtest_CFLAGS, mtest_LDADD): Define.
123 (TESTS): Add mtest_minidebug if HAVE_MINIDEBUG.
124 (%_minidebug): New pattern rule, if HAVE_MINIDEBUG.
125 (xztest_SOURCES, xztest_CFLAGS, xztest_LDADD): Define.
126 (xztest_alloc_SOURCES, xztest_alloc_CFLAGS): Define
127 (xztest_alloc_LDADD): Define.
128 (BUILDTESTS): Add mtest, xztest, xztest_alloc.
129 (CLEANFILES): Add files created by minidebug pattern.
130 (btest.lo): Correct INCDIR reference.
131 (mtest.lo, xztest.lo, ztest.lo): New targets.
132 * configure: Regenerate.
133 * config.h.in: Regenerate.
134 * Makefile.in: Regenerate.
136 2020-09-09 Ian Lance Taylor <iant@golang.org>
138 * pecoff.c (coff_initialize_syminfo): Add is_64 parameter.
139 (coff_add): Determine and pass is_64.
141 2020-09-09 Ian Lance Taylor <iant@golang.org>
143 PR libbacktrace/96973
144 * fileline.c (macho_get_executable_path): New static function.
145 (fileline_initialize): Call macho_get_executable_path.
147 2020-09-09 Ian Lance Taylor <iant@golang.org>
149 * dwarf.c (function_addrs_search): Compare against the next entry
150 low address, not the high address.
151 (unit_addrs_search): Likewise.
152 (build_address_map): Add a trailing unit_addrs.
153 (read_function_entry): Add a trailing function_addrs.
154 (read_function_info): Likewise.
155 (report_inlined_functions): Search backward for function_addrs
157 (dwarf_lookup_pc): Search backward for unit_addrs and
158 function_addrs matches.
160 2020-09-08 Ian Lance Taylor <iant@golang.org>
162 * simple.c (simple_unwind): Correct comment spelling.
164 2020-09-08 Ian Lance Taylor <iant@golang.org>
166 * macho.c (macho_add_dsym): Make space for '/' in dsym. Use
167 correct length when freeing diralc.
169 2020-09-08 Ian Lance Taylor <iant@golang.org>
171 PR libbacktrace/96973
172 * macho.c (macho_add_fat): Correctly swap 32-bit file offset.
174 2020-09-08 Ian Lance Taylor <iant@golang.org>
176 PR libbacktrace/96971
177 * filetype.awk: Only match magic number at start of line.
179 2020-08-24 Ian Lance Taylor <iant@golang.org>
181 * macho.c (MACH_O_MH_MAGIC_FAT_64): Define.
182 (MACH_O_MH_CIGAM_FAT_64): Define.
183 (struct macho_fat_arch_64): Define.
184 (macho_add_fat): Add and use is_64 parameter.
185 (macho_add): Recognize 64-bit fat files.
187 2020-07-30 H.J. Lu <hjl.tools@gmail.com>
190 * configure: Regenerated.
192 2020-07-08 Ian Lance Taylor <iant@golang.org>
194 * configure.ac: Test linker support for DWARF5
195 * configure: Regenerate
197 2020-05-29 H.J. Lu <hjl.tools@gmail.com>
200 * configure: Regenerated.
202 2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
205 * configure: Regenerated.
207 2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
209 * configure: Regenerated.
211 2020-05-13 Ian Lance Taylor <iant@golang.org>
213 * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
215 2020-05-13 Ian Lance Taylor <iant@golang.org>
218 * posix.c (backtrace_open): Treat EACCESS like ENOENT.
220 2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
222 * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS).
223 * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and
224 AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't
226 * Makefile.in: Regenerated.
227 * configure: Likewise.
229 2020-05-11 Ian Lance Taylor <iant@golang.org>
231 PR libbacktrace/95012
232 * configure.ac: Check for getpagesize declaration.
233 * mmap.c: Declare getpagesize if necessary.
234 * mmapio.c: Likewise.
235 * configure: Regenerate.
236 * config.h.in: Regenerate.
237 * Makefile.in: Regenerate.
239 2020-05-09 Roland McGrath <mcgrathr@google.com>
241 * elf.c (elf_add): Bail early if there are no section headers at all.
243 2020-05-09 Ian Lance Taylor <iant@golang.org>
245 * elf.c (elf_add): Don't free strtab if an error occurs after
246 recording symbol information.
248 2020-05-09 Ian Lance Taylor <iant@golang.org>
250 PR libbacktrace/88745
252 * filetype.awk: Recognize Mach-O files.
253 * Makefile.am (FORMAT_FILES): Add macho.c.
254 (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL.
255 (%.dSYM): New pattern target.
256 (test_macho_SOURCES, test_macho_CFLAGS): New targets.
257 (test_macho_LDADD): New target.
258 (BUILDTESTS): Add test_macho.
259 (macho.lo): Add dependencies.
260 * configure.ac: Recognize macho file type. Check for
261 mach-o/dyld.h. Don't try to run objcopy if we don't find it.
262 Look for dsymutil and define a HAVE_DSYMUTIL conditional.
263 * Makefile.in: Regenerate.
264 * configure: Regenerate.
265 * config.h.in: Regenerate.
267 2020-05-09 Ian Lance Taylor <iant@golang.org>
269 * read.c (backtrace_get_view): Support short read.
271 2020-05-09 Ian Lance Taylor <iant@golang.org>
273 * elf.c (elf_add): If debug sections are very large or far apart,
274 read them individually rather than as a single view.
276 2020-05-08 Ian Lance Taylor <iant@golang.org>
278 * fileline.c (sysctl_exec_name): New static function.
279 (sysctl_exec_name1): New macro or static function.
280 (sysctl_exec_name2): Likewise.
281 (fileline_initialize): Try sysctl_exec_name[12].
282 * configure.ac: Check for sysctl args to fetch executable name.
283 * configure: Regenerate.
284 * config.h.in: Regenerate.
286 2020-02-15 Ian Lance Taylor <iant@golang.org>
288 * ztest.c (test_large): Update file to current libgo test file.
290 2020-02-03 Ian Lance Taylor <iant@golang.org>
292 * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
293 (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
294 (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
295 (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
296 (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
297 (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
298 (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
299 (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
300 (stest_alloc_CFLAGS): Likewise.
301 * Makefile.in: Regenerate.
302 * ztest.c (error_callback_compress): Mark vdata unused.
303 (test_large): Add casts to avoid warnings.
305 2020-01-01 Jakub Jelinek <jakub@redhat.com>
307 Update copyright years.
309 2019-12-13 Ian Lance Taylor <iant@golang.org>
312 * dwarf.c (struct attr): Add val field.
313 (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
314 ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
315 (struct line_header): Add addrsize field.
316 (struct line_header_format): Define.
317 (struct unit): Add str_offsets_base, addr_base, and rnglists_base
319 (read_uint24): New static function.
320 (read_attribute): Add implicit_val parameter. Replace dwarf_str
321 and dwarf_str_size parameters with dwarf_sections parameter. Add
322 support for new DWARF 5 forms. Change all callers.
323 (resolve_string): New static function.
324 (resolve_addr_index): Likewise.
325 (read_abbrevs): Support DW_FORM_implicit_const.
326 (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
327 and ranges_is_index fields.
328 (update_pcrange): Support DWARF 5 encodings.
329 (add_high_low_range): New static function, split out of
331 (add_ranges_from_ranges): Likewise.
332 (add_ranges_from_rnglists): New static function.
333 (add_ranges): Just call new helper functions.
334 (find_address_ranges): Use resolve_string for strings, after
335 reading all attributes. Handle new DWARF 5 attributes.
336 (build_address_map): Support DWARF 5 compilation units.
337 (read_v2_paths): New static function, split out of
339 (read_lnct): New static function.
340 (read_line_header_format_entries): Likewise.
341 (read_line_header): Add ddata parameter. Support DWARF 5 line
342 headers. Call new helper functions. Change all callers.
343 (read_line_program): Use addrsize from line program header. Don't
344 special case directory index 0 for DWARF 5.
345 (read_referenced_name): Use resolve_string.
346 (read_function_entry): Handle DWARF 5 encodings. Use
348 * internal.h (enum dwarf_section): Add DEBUG_ADDR,
349 DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
350 * elf.c (dwarf_section_names): Add new section names.
351 * pecoff.c (dwarf_section_names): Likewise.
352 * xcoff.c (xcoff_add): Clear dwarf_sections before setting
354 * configure.ac: Define HAVE_DWARF5 automake conditional.
355 * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
356 (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
357 (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
358 (dwarf5_alloc_LDADD): Likewise.
359 (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
360 (CLEANFILES, clean-local): Define.
362 2019-12-08 Ian Lance Taylor <iant@golang.org>
364 * dwarf.c (struct pcrange): Define.
365 (update_pcrange, add_ranges): New static functions.
366 (add_unit_addr): Change signature to work with add_ranges. Don't
367 add base_address here.
368 (add_unit_ranges): Remove.
369 (find_address_ranges): Replace str/ranges parameters with
370 dwarf_sections. Use update_pcrange and add_ranges. Change all
372 (add_function_range): Change signature to work with add_ranges.
373 Don't add base_address here.
374 (add_function_ranges): Remove.
375 (read_function_entry): Use update_pcrange and add_ranges.
377 2019-12-04 Ian Lance Taylor <iant@golang.org>
379 * edtest.c (test1): Add noclone attribute.
381 2019-12-04 Ian Lance Taylor <iant@golang.org>
383 * internal.h (enum dwarf_section): Define.
384 (struct dwarf_sections): Define.
385 (backtrace_dwarf_add): Update declaration to replace specific
386 section parameters with dwarf_sections parameter.
387 * dwarf.c (struct dwarf_data): Replace specific section fields
388 with dwarf_sections field.
389 (read_attribute): Use dwarf_sections with altlink.
390 (build_address_map): Replace specific section parameters with
391 dwarf_sections parameter. Change all callers.
392 (read_line_info): Use dwarf_sections with ddata.
393 (read_referenced_name): Likewise.
394 (add_function_ranges): Likewise.
395 (read_function_entry): Likewise.
396 (read_function_info): Likewise.
397 (build_dwarf_data): Replace specific section parameters with
398 dwarf_sections parameter. Change all callers.
399 (backtrace_dwarf_add): Likewise.
400 * elf.c (enum debug_section): Remove.
401 (dwarf_section_names): Remove .zdebug names.
402 (elf_add): Track zsections separately. Build dwarf_sections.
403 * pecoff.c (enum debug_section): Remove.
404 (struct debug_section_info): Remove data field.
405 (coff_add): Build dwarf_sections.
406 * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx
407 references with DEBUG_xxx references.
408 (xcoff_add): Build dwarf_sections.
410 2019-09-27 Maciej W. Rozycki <macro@wdc.com>
412 * configure: Regenerate.
414 2019-09-26 Ian Lance Taylor <iant@golang.org>
416 PR libbacktrace/91908
417 * pecoff.c (backtrace_initialize): Explicitly cast unchecked
418 __sync_bool_compare_and_swap to void.
419 * xcoff.c (backtrace_initialize): Likewise.
421 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
423 * configure.ac: Remove references to spu.
424 * configure: Regenerate.
426 2019-05-24 Clement Chigot <clement.chigot@atos.net>
428 * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
430 * Makefile.in: Regenerate.
432 2019-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
434 * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
436 * configure: Regenerate.
438 2019-03-11 Ian Lance Taylor <iant@golang.org>
440 PR libbacktrace/89669
441 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
443 * Makefile.in: Regenerate.
445 2019-02-26 Tom de Vries <tdevries@suse.de>
447 * btest.c (test5): Allow global.* as minimal symbol name for global.
449 2019-02-26 Tom de Vries <tdevries@suse.de>
451 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
452 * Makefile.in: Regenerate.
454 2019-02-12 Tom de Vries <tdevries@suse.de>
456 PR libbacktrace/81983
457 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
459 2019-02-10 Tom de Vries <tdevries@suse.de>
461 * Makefile.am (BUILDTESTS): Add btest_lto.
462 * Makefile.in: Regenerate.
463 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
464 __attribute__((noclone)).
466 2019-02-08 Tom de Vries <tdevries@suse.de>
468 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
469 * print.c (backtrace_print): Same.
470 * simple.c (backtrace_simple): Same.
472 2019-02-08 Tom de Vries <tdevries@suse.de>
474 PR libbacktrace/78063
475 * dwarf.c (build_address_map): Keep all parsed units.
476 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
478 2019-01-31 Tom de Vries <tdevries@suse.de>
480 PR libbacktrace/89136
481 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
482 'debugaltlink_name_len =+ 1'.
484 2019-01-29 Tom de Vries <tdevries@suse.de>
486 * install-debuginfo-for-buildid.sh.in: New script.
487 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
488 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
489 * Makefile.in: Regenerate.
490 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
491 (READELF): Set with AC_CHECK_PROG.
492 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
493 * configure: Regenerate.
494 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
495 (elf_open_debugfile_by_buildid): ... here.
497 2019-01-29 Tom de Vries <tdevries@suse.de>
499 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
501 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
502 (check_PROGRAMS): Add BUILDTESTS.
503 * Makefile.in: Regenerate.
505 2019-01-28 Tom de Vries <tdevries@suse.de>
507 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
508 Use $< to access prerequisite.
509 * Makefile.in: Regenerate.
511 2019-01-25 Nathan Sidwell <nathan@acm.org>
513 * elf.c (elf_add): Pass "" filename to recursive call with
516 2019-01-25 Tom de Vries <tdevries@suse.de>
518 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
520 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
521 * Makefile.in: Regenerate.
523 2019-01-25 Tom de Vries <tdevries@suse.de>
525 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
526 (TESTS): Rename dtest to btest_gnudebuglink.
527 * Makefile.in: Regenerate.
529 2019-01-23 Tom de Vries <tdevries@suse.de>
531 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
532 (units_search, find_unit): Use size_t for offset.
533 (build_address_map): Use size_t for unit_offset.
535 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
537 * allocfail.c (main): Increase portability of printf statement.
539 2019-01-18 Ian Lance Taylor <iant@golang.org>
541 PR libbacktrace/88890
542 * mmapio.c (backtrace_get_view): Change size parameter to
543 uint64_t. Check that value fits in size_t.
544 * read.c (backtrace_get_view): Likewise.
545 * internal.h (backtrace_get_view): Update declaration.
546 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
548 2019-01-17 Tom de Vries <tdevries@suse.de>
550 PR libbacktrace/82857
551 * configure.ac (DWZ): Set with AC_CHECK_PROG.
552 (HAVE_DWZ): Set with AM_CONDITIONAL.
553 * configure: Regenerate.
554 * Makefile.am (TESTS): Add btest_dwz.
555 * Makefile.in: Regenerate.
557 2019-01-17 Tom de Vries <tdevries@suse.de>
559 PR libbacktrace/82857
560 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
561 (read_attribute): Handle DW_FORM_GNU_ref_alt using
562 ATTR_VAL_REF_ALT_INFO.
563 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
565 2019-01-17 Tom de Vries <tdevries@suse.de>
567 * dwarf.c (struct unit): Add low_offset and high_offset fields.
568 (struct unit_vector): New type.
569 (struct dwarf_data): Add units and units_counts fields.
570 (find_unit): New function.
571 (find_address_ranges): Add and handle unit_tag parameter.
572 (build_address_map): Add and handle units_vec parameter.
573 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
576 2019-01-17 Tom de Vries <tdevries@suse.de>
578 PR libbacktrace/82857
579 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
582 2019-01-17 Tom de Vries <tdevries@suse.de>
584 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
585 (read_attribute): Add altlink parameter. Handle missing altlink for
586 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
587 (find_address_ranges, build_address_map, build_dwarf_data): Add and
588 handle altlink parameter.
589 (read_referenced_name, read_function_entry): Add argument to
592 2019-01-17 Tom de Vries <tdevries@suse.de>
594 * dwarf.c (struct dwarf_data): Add altlink field.
595 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
596 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
597 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
598 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
599 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
600 * xcoff.c (xcoff_add): Same.
602 2019-01-17 Tom de Vries <tdevries@suse.de>
604 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
605 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
606 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
607 argument to backtrace_dwarf_add call.
608 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
609 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
610 * xcoff.c (xcoff_add): Same.
612 2019-01-17 Tom de Vries <tdevries@suse.de>
614 * elf.c (elf_add): Add and handle with_buildid_data and
615 with_buildid_size parameters. Handle .gnu_debugaltlink section.
616 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
618 2019-01-16 Tom de Vries <tdevries@suse.de>
620 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
622 (read_referenced_name): ... here, and ...
623 (read_function_entry): ... here.
625 2019-01-16 Tom de Vries <tdevries@suse.de>
627 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
629 (read_function_entry): Same. Don't allow name found via
630 DW_AT_abstract_origin or case DW_AT_specification to override linkage
633 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
637 * backtrace.h: Mechanically replace "can not" with "cannot".
639 2019-01-01 Jakub Jelinek <jakub@redhat.com>
641 Update copyright years.
643 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
645 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
647 * Makefile.in: Regenerate.
649 2018-12-28 Tom de Vries <tdevries@suse.de>
651 * dwarf.c (build_address_map): Reuse unused units.
653 2018-12-28 Tom de Vries <tdevries@suse.de>
655 * dwarf.c (build_address_map): Simplify by removing local variable
658 2018-12-28 Ian Lance Taylor <iant@golang.org>
659 Tom de Vries <tdevries@suse.de>
661 PR libbacktrace/88063
662 * dwarf.c (free_unit_addrs_vector): Remove.
663 (build_address_map): Keep track of allocated units in vector. Free
664 allocated units and corresponding abbrevs upon failure. Remove now
665 redundant call to free_unit_addrs_vector. Free addrs vector upon
666 failure. Free allocated unit vector.
668 2018-12-28 Tom de Vries <tdevries@suse.de>
670 * dwarf.c (build_address_map): Free addrs vector upon failure.
672 2018-12-14 Tom de Vries <tdevries@suse.de>
675 * allocfail.sh: Remove "set -o pipefail".
677 2018-12-12 Tom de Vries <tdevries@suse.de>
679 * Makefile.am (TESTS): Add allocfail.sh.
680 (check_PROGRAMS): Add allocfail.
681 * Makefile.in: Regenerate.
682 * instrumented_alloc.c: New file. Redefine malloc and realloc.
684 * allocfail.c: New file.
685 * allocfail.sh: New file.
687 2018-11-30 Tom de Vries <tdevries@suse.de>
689 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
690 test_xcoff_64, test_pecoff and test_unknown.
691 * Makefile.in: Regenerate.
692 * test_format.c: New file.
694 2018-11-30 Tom de Vries <tdevries@suse.de>
696 * Makefile.am : Add _with_alloc version for each test in
698 * Makefile.in: Regenerate.
700 2018-11-30 Tom de Vries <tdevries@suse.de>
702 * internal.h (backtrace_vector_free): New static inline fuction,
704 * dwarf.c (read_line_info): ... here.
706 2018-11-28 Tom de Vries <tdevries@suse.de>
708 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
711 2018-11-27 Tom de Vries <tdevries@suse.de>
713 * mmap.c (backtrace_vector_release): Same.
714 * unittest.c (test1): Add check.
716 2018-11-27 Tom de Vries <tdevries@suse.de>
718 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
720 * Makefile.am (check_PROGRAMS): Add unittest.
721 * Makefile.in: Regenerate.
722 * unittest.c: New file.
724 2018-11-22 Tom de Vries <tdevries@suse.de>
726 * dwarf.c (read_initial_length): Factor out of ...
727 (build_address_map, read_line_info): ... here.
729 2018-11-21 Tom de Vries <tdevries@suse.de>
731 * dwarf.c (read_string): Factor out of ...
732 (read_attribute, read_line_header, read_line_program): ... here.
734 2018-10-31 Joseph Myers <joseph@codesourcery.com>
737 * Makefile.am: Include multilib.am.
738 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
739 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
741 2018-10-05 Ian Lance Taylor <iant@golang.org>
743 PR libbacktrace/87529
744 * backtrace.h: Document that backtrace_create_state should be
747 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
749 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
750 * Makefile.in: Regenerate.
751 * config.h.in: Likewise.
752 * configure: Likewise.
754 2018-08-01 Tony Reix <tony.reix@atos.net>
756 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
757 (struct xcoff_func, struct xcoff_func_vector): New structs.
758 (xcoff_syminfo): Drop leading dot from symbol name.
759 (xcoff_line_compare, xcoff_line_search): Remove.
760 (xcoff_func_compare, xcoff_func_search): New static functions.
761 (xcoff_lookup_pc): Search function table.
762 (xcoff_add_line, xcoff_process_linenos): Remove.
763 (xcoff_initialize_fileline): Build function table.
765 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
768 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
769 checking up to 36 bytes.
771 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
773 * configure: Regenerated.
775 2018-04-19 Jakub Jelinek <jakub@redhat.com>
777 * configure: Regenerated.
779 2018-04-17 Ian Lance Taylor <iant@golang.org>
781 * backtrace.c: Revert last two changes. Don't call mmap
784 2018-04-17 Ian Lance Taylor <iant@golang.org>
786 * backtrace.c: Include backtrace-supported.h before checking
787 BACKTRACE_USES_MALLOC.
789 2018-04-17 Ian Lance Taylor <iant@golang.org>
791 * backtrace.c (backtrace_full): When testing whether we can
792 allocate memory, call mmap directly, and munmap the memory.
794 2018-04-04 Jakub Jelinek <jakub@redhat.com>
797 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
798 big endian, only use 32-bit loads if endianity macros are predefined
799 and indicate big or little endian.
801 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
804 * configure: Regenerate.
806 2018-02-15 Jakub Jelinek <jakub@redhat.com>
809 * elf.c (SHT_PROGBITS): Undefine and define.
811 2018-02-14 Jakub Jelinek <jakub@redhat.com>
814 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
815 (struct elf_ppc64_opd_data): New type.
816 (elf_initialize_syminfo): Add opd argument, handle symbols
817 pointing into the PowerPC64 ELFv1 .opd section.
818 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
819 to structure with .opd data to elf_initialize_syminfo.
821 2018-01-31 Ian Lance Taylor <iant@golang.org>
823 * elf.c (elf_add): Close descriptor if we use a debugfile.
824 * btest.c (check_open_files): New static function.
825 (main): Call check_open_files.
827 2018-01-25 Ian Lance Taylor <iant@golang.org>
829 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
831 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
833 2018-01-25 Ian Lance Taylor <iant@golang.org>
835 * pecoff.c (coff_add): Only release syms_view if it is valid.
837 2018-01-25 Ian Lance Taylor <iant@golang.org>
839 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
841 2018-01-24 Ian Lance Taylor <iant@golang.org>
843 * pecoff.c (coff_add): Use coff_read4, not memcpy.
845 2018-01-24 Ian Lance Taylor <iant@golang.org>
848 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
851 2018-01-19 Tony Reix <tony.reix@atos.net>
853 * xcoff.c (xcoff_incl_compare): New function.
854 (xcoff_incl_search): New function.
855 (xcoff_process_linenos): Use bsearch to find include file.
856 (xcoff_initialize_fileline): Sort include file information.
858 2018-01-16 Ian Lance Taylor <iant@golang.org>
860 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
862 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
863 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
864 (elf_zlib_default_table): Update.
865 (elf_zlib_default_dist_table): New static array.
866 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
868 * ztest.c (struct zlib_test): Add uncompressed_len.
869 (tests): Initialize uncompressed_len field. Add new test case.
870 (test_samples): Use uncompressed_len field.
872 2018-01-03 Jakub Jelinek <jakub@redhat.com>
874 Update copyright years.
876 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
878 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
879 * aclocal.m4: Regenerate.
880 * Makefile.in: Likewise.
881 * configure: Likewise.
883 2017-10-06 Ian Lance Taylor <iant@golang.org>
885 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
886 zlib uncompress function.
888 2017-10-05 Ian Lance Taylor <iant@golang.org>
890 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
891 Read a four byte integer.
892 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
893 boundary before ever calling elf_zlib_fetch.
894 * ztest.c (test_large): Simplify print statements a bit.
896 2017-10-02 Ian Lance Taylor <iant@golang.org>
898 * ztest.c: #include <errno.h>.
899 (TEST_TIMING): Don't define, don't test.
900 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
901 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
902 (ZLIB_CLOCK_GETTIME_ARG): Define.
903 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
904 * Makefile.am: Likewise.
905 * configure, Makefile.in: Rebuild.
907 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
910 * Makefile.am: Append the content of clock_gettime_link to
912 * configure.ac: Test for the case that clock_gettime is in librt.
913 * Makefile.in: Regenerate.
914 * configure: Likewise.
917 * configure.ac: Check for clock_gettime.
918 * config.h.in: Regenerate.
919 * configure: Likewise.
920 * ztest.c (average_time, test_large): Conditionalize test timing
921 on clock_gettime availability.
923 2017-09-29 Tony Reix <tony.reix@atos.net>
925 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
926 (STYP_DWARF, SSUBTYP_DW*): Define.
927 (enum dwarf_section): Define.
928 (struct dwsect_info): Define.
929 (xcoff_add): Look for DWARF sections, pass them to
932 2017-09-28 Ian Lance Taylor <iant@golang.org>
935 * elf.c (__builtin_prefetch): Define if not __GNUC__.
937 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
938 (b_elf_chdr): Define type.
939 (enum debug_section): Add ZDEBUG_xxx values.
940 (debug_section_names): Add names for new sections.
941 (struct debug_section_info): Add compressed field.
942 (elf_zlib_failed, elf_zlib_fetch): New static functions.
943 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
944 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
945 (HUFFMAN_SECONDARY_SHIFT): Define.
946 (ZDEBUG_TABLE_SIZE): Define.
947 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
948 (final_next_secondary): New static variable if
949 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
950 (elf_zlib_inflate_table): New static function.
951 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
952 function to produce fixed Huffman table.
953 (elf_zlib_default_table): New static variable.
954 (elf_zlib_inflate): New static function.
955 (elf_zlib_verify_checksum): Likewise.
956 (elf_zlib_inflate_and_verify): Likewise.
957 (elf_uncompress_zdebug): Likewise.
958 (elf_uncompress_chdr): Likewise.
959 (backtrace_uncompress_zdebug): New extern function.
960 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
961 sections, and uncompress them.
962 * internal.h (backtrace_compress_zdebug): Declare.
964 * configure.ac: Check for -lz and check whether the linker
965 supports --compress-debug-sections.
966 * Makefile.am (ztest_SOURCES): New variable.
967 (ztest_CFLAGS, ztest_LDADD): New variables.
968 (check_PROGRAMS): Add ztest.
969 (ctestg_SOURCES): New variable.
970 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
971 (ctesta_SOURCES): New variable.
972 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
973 (check_PROGRAMS): Add ctestg and ctesta.
974 * configure, config.h.in, Makefile.in: Rebuild.
976 2017-09-22 Ian Lance Taylor <iant@golang.org>
979 * configure.ac: Check for lstat and readlink.
980 * elf.c (lstat, readlink): Provide dummy versions if real versions
982 * configure, config.h.in: Rebuild.
984 2017-09-21 Ian Lance Taylor <iant@google.com>
987 * elf.c (backtrace_initialize): Set pd.exe_filename.
989 2017-09-20 Ian Lance Taylor <iant@golang.org>
990 Denis Khalikov <d.khalikov@partner.samsung.com>
993 Support for external debug info.
994 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
995 (S_ISLNK): Define if not defined.
996 (xstrnlen): Define if strnlen is not available.
997 (b_elf_note): Define type.
998 (NT_GNU_BUILD_ID): Define macro.
999 (elf_crc32, elf_crc32_file): New static functions.
1000 (elf_is_symlink, elf_readlink): New static functions.
1001 (elf_open_debugfile_by_buildid): New static function.
1002 (elf_try_debugfile): New static function.
1003 (elf_find_debugfile_by_debuglink): New static function.
1004 (elf_open_debugfile_by_debuglink): New static function.
1005 (elf_add): Add filename and debuginfo parameters. Adjust all
1006 callers. Look for external debug info notes, and try to fetch
1007 debug info from external file.
1008 (struct phdr_data): Add exe_filename field.
1009 (phdr_callback): Pass filename to elf_add.
1010 (backtrace_initialize): Add filename parameter.
1011 * internal.h (backtrace_initialize): Add filename parameter.
1012 * fileline.c (fileline_initialize): Pass filename to
1013 backtrace_initialize.
1014 * pecoff.c (fileline_initialize): Add unused filename parameter.
1015 * unknown.c (fileline_initialize): Likewise.
1016 * xcoff.c (fileline_initialize): Likewise.
1017 * configure.ac: Check for objcopy --add-gnu-debuglink.
1018 * Makefile.am (dtest): New test target.
1019 * configure, Makefile.in: Rebuild.
1021 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1024 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
1025 * Makefile.in: Regenerate.
1027 2017-09-12 Steve Ellcey <sellcey@cavium.com>
1030 * libbacktrace/Makefile.in
1031 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
1033 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
1036 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
1038 2017-07-28 Tony Reix <tony.reix@atos.net>
1040 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
1042 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1044 * fileline.c (fileline_initialize): Print pid_t as long.
1046 2017-07-26 Tony Reix <tony.reix@atos.net>
1048 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
1049 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
1050 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
1051 * configure, config.h.in: Regenerate.
1053 2017-07-21 Tony Reix <tony.reix@atos.net>
1055 * filetype.awk: Add AIX XCOFF type detection.
1056 * configure.ac: Recognize xcoff format.
1057 * Makefile.am (FORMAT_FILES): Add xcoff.c.
1058 * fileline.c: Include <unistd.h>.
1059 (fileline_initialize): Add case for AIX procfs.
1060 * xcoff.c: New file.
1061 * configure, Makefile.in: Rebuild.
1063 2017-06-21 Richard Biener <rguenther@suse.de>
1065 * configure.ac: Add AC_SYS_LARGEFILE.
1066 * config.h.in: Regenerate.
1067 * configure: Likewise.
1069 2017-06-11 Ian Lance Taylor <iant@golang.org>
1071 * elf.c (backtrace_initialize): Always set *fileline_fn.
1072 * ttest.c: New file.
1073 * btest.c: Move support functions into testlib.c. Change calls to
1074 check to pass file name.
1075 * testlib.c: New file, copied from (part of) btest.c.
1076 * testlib.h: New file, declarations for testlib.c.
1077 * edtest.c: Use testlib.h and testlib.c.
1078 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
1079 * Makefile.am (btest_SOURCES): Add testlib.c.
1080 (edtest_SOURCES): Likewise.
1081 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
1082 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
1083 * configure, Makefile.in: Rebuild.
1085 2017-05-19 Than McIntosh <thanm@google.com>
1087 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
1088 (read_line_header): Don't allocate dirs if dirs_count == 0.
1089 * edtest.c: New file.
1090 * edtest2.c: New file.
1091 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
1092 (check_PROGRAMS): Add edtest.
1093 (edtest2_build.c, gen_edtest2_build): New targets.
1094 * Makefile.in: Rebuild.
1096 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
1098 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
1099 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
1101 2017-01-01 Jakub Jelinek <jakub@redhat.com>
1103 Update copyright years.
1105 2016-11-15 Matthias Klose <doko@ubuntu.com>
1107 * configure: Regenerate.
1109 2016-09-11 Carlos Liam <carlos@aarzee.me>
1111 * all: Remove meaningless trailing whitespace.
1113 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
1116 * elf.c (phdr_callback) [__i386__]: Add
1117 __attribute__((__force_align_arg_pointer__)).
1119 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
1121 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
1122 avoid possible crash.
1123 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
1124 missing debug info anymore.
1126 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
1128 * mmap.c (MAP_FAILED): Define if not defined.
1130 2016-01-04 Jakub Jelinek <jakub@redhat.com>
1132 Update copyright years.
1134 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
1136 * configure.ac: Specify that DJGPP do not have mmap
1137 even when sys/mman.h exists.
1138 * configure: Regenerate
1140 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
1142 PR libgfortran/68115
1143 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
1144 * configure: Regenerate.
1145 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
1148 2015-09-17 Ian Lance Taylor <iant@google.com>
1150 * posix.c (backtrace_open): Cast second argument of open() to int.
1152 2015-09-11 Ian Lance Taylor <iant@google.com>
1154 * Makefile.am (backtrace.lo): Depend on internal.h.
1155 (sort.lo, stest.lo): Add explicit dependencies.
1156 * Makefile.in: Rebuild.
1158 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
1160 * backtrace.c: #include <sys/types.h>.
1162 2015-09-08 Ian Lance Taylor <iant@google.com>
1165 * backtrace.c: #include "internal.h".
1166 (struct backtrace_data): Add can_alloc field.
1167 (unwind): If can_alloc is false, don't try to get file/line
1169 (backtrace_full): Set can_alloc field in bdata.
1170 * alloc.c (backtrace_alloc): Don't call error_callback if it is
1172 * mmap.c (backtrace_alloc): Likewise.
1173 * internal.h: Update comments for backtrace_alloc and
1176 2015-09-08 Ian Lance Taylor <iant@google.com>
1179 * mmap.c (backtrace_alloc): Correct test for mmap failure.
1181 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1183 * configure.ac: For spu-*-* targets, set have_fcntl to no.
1184 * configure: Regenerate.
1186 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1188 * configure.ac: Remove [disable-shared] argument to LT_INIT.
1189 Remove setting PIC_FLAG when building as target library.
1190 * configure: Regenerate.
1192 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
1194 * configure.ac: Only compile with -fPIC if the target
1196 * configure: Regenerate.
1198 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1200 * configure.ac: Set have_mmap to no on spu-*-* targets.
1201 * configure: Regenerate.
1203 2015-08-13 Ian Lance Taylor <iant@google.com>
1205 * dwarf.c (read_function_entry): Add vec_inlined parameter.
1208 2015-06-11 Martin Sebor <msebor@redhat.com>
1211 * dwarf.c (struct line): Add new field idx.
1212 (line_compare): Use it.
1214 (read_line_info): Reset it.
1216 2015-05-29 Tristan Gingold <gingold@adacore.com>
1218 * pecoff.c: New file.
1219 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
1220 * Makefile.in: Regenerate.
1221 * filetype.awk: Detect pecoff.
1222 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
1224 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
1226 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
1227 * configure: Regenerate.
1228 * pecoff.c: New file.
1230 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1232 * Makefile.in: Regenerated with automake-1.11.6.
1233 * aclocal.m4: Likewise.
1234 * configure: Likewise.
1236 2015-01-24 Matthias Klose <doko@ubuntu.com>
1238 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1239 * configure: Regenerate.
1241 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1243 Update copyright years.
1245 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1248 * configure: Regenerated.
1250 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1252 * ChangeLog.jit: New.
1254 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1257 * configure: Regenerate.
1259 2014-10-23 Ian Lance Taylor <iant@google.com>
1261 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1262 Fix to return void *.
1264 2014-05-08 Ian Lance Taylor <iant@google.com>
1266 * mmap.c (backtrace_free): If freeing a large aligned block of
1267 memory, call munmap rather than holding onto it.
1268 (backtrace_vector_grow): When growing a vector, double the number
1269 of pages requested. When releasing the old version of a grown
1270 vector, pass the correct size to backtrace_free.
1272 2014-03-07 Ian Lance Taylor <iant@google.com>
1274 * sort.c (backtrace_qsort): Use middle element as pivot.
1276 2014-03-06 Ian Lance Taylor <iant@google.com>
1279 * stest.c: New file.
1280 * internal.h (backtrace_qsort): Declare.
1281 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1282 (read_line_info, read_function_entry): Likewise.
1283 (read_function_info, build_dwarf_data): Likewise.
1284 * elf.c (elf_initialize_syminfo): Likewise.
1285 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1286 (stest_SOURCES, stest_LDADD): Define.
1287 (check_PROGRAMS): Add stest.
1289 2014-02-07 Misty De Meo <misty@brew.sh>
1292 * configure.ac: Use AC_LINK_IFELSE in check for
1294 * configure: Regenerate.
1296 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1298 Update copyright years
1300 2013-12-06 Jakub Jelinek <jakub@redhat.com>
1302 * elf.c (ET_DYN): Undefine and define again.
1303 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1304 return early -1 without closing the descriptor.
1305 (struct phdr_data): Add exe_descriptor.
1306 (phdr_callback): If pd->exe_descriptor is not -1, for very first
1307 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1308 otherwise backtrace_close the exe_descriptor if not -1. Adjust
1310 (backtrace_initialize): Adjust call to elf_add. If it returns
1311 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1313 2013-12-05 Ian Lance Taylor <iant@google.com>
1315 * alloc.c (backtrace_vector_finish): Add error_callback and data
1316 parameters. Call backtrace_vector_release. Return address base.
1317 * mmap.c (backtrace_vector_finish): Add error_callback and data
1318 parameters. Return address base.
1319 * dwarf.c (read_function_info): Get new address base from
1320 backtrace_vector_finish.
1321 * internal.h (backtrace_vector_finish): Update declaration.
1323 2013-11-27 Ian Lance Taylor <iant@google.com>
1325 * dwarf.c (find_address_ranges): New static function, broken out
1326 of build_address_map.
1327 (build_address_map): Call it.
1328 * btest.c (check): Check for missing filename or function, rather
1330 (f3): Check that enough frames were returned.
1332 2013-11-19 Jakub Jelinek <jakub@redhat.com>
1334 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1335 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1337 * btest.c (struct symdata): Add size field.
1338 (callback_three): Add symsize argument. Copy it to the data->size
1340 (f23): Set symdata.size to 0.
1341 (test5): Likewise. If sizeof (int) > 1, lookup address of
1342 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
1345 * atomic.c: Include sys/types.h.
1347 2013-11-18 Ian Lance Taylor <iant@google.com>
1349 * configure.ac: Check for support of __atomic extensions.
1350 * internal.h: Declare or #define atomic functions for use in
1352 * atomic.c: New file.
1353 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1354 (dwarf_fileline, backtrace_dwarf_add): Likewise.
1355 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1356 (backtrace_initialize): Likewise.
1357 * fileline.c (fileline_initialize): Likewise.
1358 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1359 * configure, config.h.in, Makefile.in: Rebuild.
1361 2013-11-18 Jakub Jelinek <jakub@redhat.com>
1363 * elf.c (SHN_UNDEF): Define.
1364 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
1365 with st_shndx == SHN_UNDEF. Add base_address to address fields.
1366 (elf_add): Adjust caller.
1368 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1370 2013-11-16 Ian Lance Taylor <iant@google.com>
1372 * backtrace.h (backtrace_create_state): Correct comment about
1375 2013-11-15 Ian Lance Taylor <iant@google.com>
1377 * backtrace.h (backtrace_syminfo): Update comment and parameter
1378 name to take any address, not just a PC value.
1379 * elf.c (STT_OBJECT): Define.
1380 (elf_nosyms): Rename parameter pc to addr.
1381 (elf_symbol_search): Rename local variable pc to addr.
1382 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1383 (elf_syminfo): Rename parameter pc to addr.
1384 * btest.c (global): New global variable.
1388 2013-10-17 Ian Lance Taylor <iant@google.com>
1390 * elf.c (elf_add): Don't get the wrong offsets if a debug section
1393 2013-10-15 David Malcolm <dmalcolm@redhat.com>
1395 * configure.ac: Add --enable-host-shared, setting up
1396 pre-existing PIC_FLAG variable within Makefile.am et al.
1397 * configure: Regenerate.
1399 2013-09-20 Alan Modra <amodra@gmail.com>
1401 * configure: Regenerate.
1403 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1405 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1407 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1409 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1410 dl_iterate_phdr callbacks.
1412 2013-03-25 Ian Lance Taylor <iant@google.com>
1414 * alloc.c: #include <sys/types.h>.
1417 2013-01-31 Ian Lance Taylor <iant@google.com>
1419 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1420 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1422 2013-01-25 Jakub Jelinek <jakub@redhat.com>
1425 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1426 attribute was not seen.
1428 2013-01-16 Ian Lance Taylor <iant@google.com>
1430 * dwarf.c (struct unit): Add filename and abs_filename fields.
1431 (build_address_map): Set new fields when reading unit.
1432 (dwarf_lookup_pc): If we don't find an entry in the line table,
1433 just return the main file name.
1435 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1437 Update copyright years.
1439 2013-01-01 Ian Lance Taylor <iant@google.com>
1442 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1443 $(MULTIBUILDTOP)/../../gcc/include.
1444 * Makefile.in: Rebuild.
1446 2013-01-01 Ian Lance Taylor <iant@google.com>
1449 * mmap.c (backtrace_alloc): Don't call sync functions if not
1451 (backtrace_free): Likewise.
1453 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1455 * mmapio.c: Define MAP_FAILED if not defined.
1457 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1460 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1461 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1462 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1464 * Makefile.in: Regenerated.
1465 * configure: Regenerated.
1467 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1470 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1471 * Makefile.in: Regenerated.
1473 2012-11-20 Ian Lance Taylor <iant@google.com>
1475 * dwarf.c (read_attribute): Always clear val.
1477 2012-11-13 Ian Lance Taylor <iant@google.com>
1480 * configure.ac: Only add -Werror if building a target library.
1481 * configure: Rebuild.
1483 2012-11-12 Ian Lance Taylor <iant@google.com>
1484 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1485 Gerald Pfeifer <gerald@pfeifer.com>
1487 * configure.ac: Check for getexecname.
1488 * fileline.c: #include <errno.h>. Define getexecname if not
1490 (fileline_initialize): Try to find the executable in a few
1492 * print.c (error_callback): Only print the filename if it came
1493 from the backtrace state.
1494 * configure, config.h.in: Rebuild.
1496 2012-10-29 Ian Lance Taylor <iant@google.com>
1498 * mmap.c (backtrace_vector_release): Correct last patch: add
1501 2012-10-29 Ian Lance Taylor <iant@google.com>
1503 * mmap.c (backtrace_vector_release): Make sure freed block is
1504 aligned on 8-byte boundary.
1506 2012-10-26 Ian Lance Taylor <iant@google.com>
1509 * posix.c (backtrace_open): Add does_not_exist parameter.
1510 * elf.c (phdr_callback): Do not warn if shared library could not
1512 * fileline.c (fileline_initialize): Update calls to
1514 * internal.h (backtrace_open): Update declaration.
1516 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1519 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1520 * configure: Regenerate.
1522 2012-10-24 Ian Lance Taylor <iant@google.com>
1525 * configure.ac: Check whether -funwind-tables option works.
1526 * configure: Rebuild.
1528 2012-10-11 Ian Lance Taylor <iant@google.com>
1530 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1531 * configure: Rebuild.
1533 2012-10-10 Ian Lance Taylor <iant@google.com>
1535 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1538 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1540 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1542 2012-10-09 Ian Lance Taylor <iant@google.com>
1544 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1545 (backtrace_dwarf_add): Likewise.
1547 2012-10-09 Ian Lance Taylor <iant@google.com>
1549 Add support for tracing through shared libraries.
1550 * configure.ac: Check for link.h and dl_iterate_phdr.
1551 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1552 ELF macros before #defining them.
1553 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1555 (struct elf_syminfo_data): Add next field.
1556 (elf_initialize_syminfo): Initialize next field.
1557 (elf_add_syminfo_data): New static function.
1558 (elf_add): New static function, broken out of
1559 backtrace_initialize. Call backtrace_dwarf_add instead of
1560 backtrace_dwarf_initialize.
1561 (struct phdr_data): Define.
1562 (phdr_callback): New static function.
1563 (backtrace_initialize): Call elf_add.
1564 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1565 (add_unit_addr): Add base_address parameter. Change all callers.
1566 (add_unit_ranges, build_address_map): Likewise.
1567 (add_line): Add ddata parameter. Change all callers.
1568 (read_line_program, add_function_range): Likewise.
1569 (dwarf_lookup_pc): New static function, broken out of
1571 (dwarf_fileline): Call dwarf_lookup_pc.
1572 (build_dwarf_data): New static function.
1573 (backtrace_dwarf_add): New function.
1574 (backtrace_dwarf_initialize): Remove.
1575 * internal.h (backtrace_dwarf_initialize): Don't declare.
1576 (backtrace_dwarf_add): Declare.
1577 * configure, config.h.in: Rebuild.
1579 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1581 * btest.c (f23): Avoid uninitialized variable warning.
1583 2012-10-04 Ian Lance Taylor <iant@google.com>
1585 * dwarf.c: If the system header files do not declare strnlen,
1586 provide our own version.
1588 2012-10-03 Ian Lance Taylor <iant@google.com>
1590 * dwarf.c (read_uleb128): Fix overflow test.
1591 (read_sleb128): Likewise.
1592 (build_address_map): Don't change unit_buf.start.
1594 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1597 * configure.ac (EXTRA_FLAGS): New.
1598 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1599 * configure, Makefile.in: Regenerate.
1601 2012-09-29 Ian Lance Taylor <iant@google.com>
1604 * fileline.c (fileline_initialize): Pass errnum as -1 when
1605 reporting that we could not read executable information after a
1608 2012-09-27 Ian Lance Taylor <iant@google.com>
1611 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1612 * Makefile.am: Add dependencies for all objects.
1613 * configure, aclocal.m4, Makefile.in: Rebuild.
1615 2012-09-27 Ian Lance Taylor <iant@google.com>
1618 * elf.c (backtrace_initialize): Set *fileln_fn, not
1621 2012-09-19 Ian Lance Taylor <iant@google.com>
1623 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1624 as a target library.
1625 * configure: Rebuild.
1627 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1628 Ian Lance Taylor <iant@google.com>
1630 * configure.ac (GCC_HEADER_STDINT): Invoke.
1631 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1632 * btest.c: Don't include <stdint.h>.
1633 * dwarf.c: Likewise.
1634 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1636 2012-09-18 Ian Lance Taylor <iant@google.com>
1639 * Makefile.am (AM_CPPFLAGS): Define.
1640 (AM_CFLAGS): Remove -I options.
1641 * Makefile.in: Rebuild.
1643 2012-09-18 Ian Lance Taylor <iant@google.com>
1645 * posix.c (O_BINARY): Define if not defined.
1646 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1647 HAVE_FCNTL is defined.
1648 * configure.ac: Test for the fcntl function.
1649 * configure, config.h.in: Rebuild.
1651 2012-09-18 Ian Lance Taylor <iant@google.com>
1653 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1655 2012-09-18 Ian Lance Taylor <iant@google.com>
1657 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1659 2012-09-18 Ian Lance Taylor <iant@google.com>
1661 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1662 * mmapio.c: Don't define _GNU_SOURCE.
1663 * configure, config.h.in: Rebuild.
1665 2012-09-18 Ian Lance Taylor <iant@google.com>
1667 * configure.ac: Check whether strnlen is declared.
1668 * dwarf.c: Declare strnlen if not declared.
1669 * configure, config.h.in: Rebuild.
1671 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1673 * fileline.c: Include <stdlib.h>.
1676 2012-09-17 Ian Lance Taylor <iant@google.com>
1679 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1682 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1685 * nounwind.c (backtrace_simple): Add state parameter.
1687 2012-09-17 Ian Lance Taylor <iant@google.com>
1690 * unknown.c (unknown_fileline): Add state parameter, remove
1691 fileline_data parameter, name error_callback parameter.
1692 (backtrace_initialize): Add state parameter.
1694 2012-09-17 Ian Lance Taylor <iant@google.com>
1696 * Initial implementation.
1698 Copyright (C) 2012-2020 Free Software Foundation, Inc.
1700 Copying and distribution of this file, with or without modification,
1701 are permitted in any medium without royalty provided the copyright
1702 notice and this notice are preserved.