libbacktrace: declare getpagesize if necessary
[gcc.git] / libbacktrace / ChangeLog
1 2020-05-11 Ian Lance Taylor <iant@golang.org>
2
3 PR libbacktrace/95012
4 * configure.ac: Check for getpagesize declaration.
5 * mmap.c: Declare getpagesize if necessary.
6 * mmapio.c: Likewise.
7 * configure: Regenerate.
8 * config.h.in: Regenerate.
9 * Makefile.in: Regenerate.
10
11 2020-05-09 Roland McGrath <mcgrathr@google.com>
12
13 * elf.c (elf_add): Bail early if there are no section headers at all.
14
15 2020-05-09 Ian Lance Taylor <iant@golang.org>
16
17 * elf.c (elf_add): Don't free strtab if an error occurs after
18 recording symbol information.
19
20 2020-05-09 Ian Lance Taylor <iant@golang.org>
21
22 PR libbacktrace/88745
23 * macho.c: New file.
24 * filetype.awk: Recognize Mach-O files.
25 * Makefile.am (FORMAT_FILES): Add macho.c.
26 (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL.
27 (%.dSYM): New pattern target.
28 (test_macho_SOURCES, test_macho_CFLAGS): New targets.
29 (test_macho_LDADD): New target.
30 (BUILDTESTS): Add test_macho.
31 (macho.lo): Add dependencies.
32 * configure.ac: Recognize macho file type. Check for
33 mach-o/dyld.h. Don't try to run objcopy if we don't find it.
34 Look for dsymutil and define a HAVE_DSYMUTIL conditional.
35 * Makefile.in: Regenerate.
36 * configure: Regenerate.
37 * config.h.in: Regenerate.
38
39 2020-05-09 Ian Lance Taylor <iant@golang.org>
40
41 * read.c (backtrace_get_view): Support short read.
42
43 2020-05-09 Ian Lance Taylor <iant@golang.org>
44
45 * elf.c (elf_add): If debug sections are very large or far apart,
46 read them individually rather than as a single view.
47
48 2020-05-08 Ian Lance Taylor <iant@golang.org>
49
50 * fileline.c (sysctl_exec_name): New static function.
51 (sysctl_exec_name1): New macro or static function.
52 (sysctl_exec_name2): Likewise.
53 (fileline_initialize): Try sysctl_exec_name[12].
54 * configure.ac: Check for sysctl args to fetch executable name.
55 * configure: Regenerate.
56 * config.h.in: Regenerate.
57
58 2020-02-15 Ian Lance Taylor <iant@golang.org>
59
60 * ztest.c (test_large): Update file to current libgo test file.
61
62 2020-02-03 Ian Lance Taylor <iant@golang.org>
63
64 * Makefile.am (libbacktrace_TEST_CFLAGS): Define.
65 (test_elf32_CFLAGS): Use $(libbacktrace_test_CFLAGS).
66 (test_elf_64_CFLAGS, test_xcoff_32_CFLAGS): Likewise.
67 (test_xcoff_64_CFLAGS, test_pecoff_CFLAGS): Likewise.
68 (test_unknown_CFLAGS, unittest_CFLAGS): Likewise.
69 (unittest_alloc_CFLAGS, allocfail_CFLAGS): Likewise.
70 (b2test_CFLAGS, b3test_CFLAGS, btest_CFLAGS): Likewise.
71 (btest_lto_CFLAGS, btest_alloc_CFLAGS, stest_CFLAGS): Likewise.
72 (stest_alloc_CFLAGS): Likewise.
73 * Makefile.in: Regenerate.
74 * ztest.c (error_callback_compress): Mark vdata unused.
75 (test_large): Add casts to avoid warnings.
76
77 2020-01-01 Jakub Jelinek <jakub@redhat.com>
78
79 Update copyright years.
80
81 2019-12-13 Ian Lance Taylor <iant@golang.org>
82
83 Add DWARF 5 support.
84 * dwarf.c (struct attr): Add val field.
85 (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX,
86 ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX.
87 (struct line_header): Add addrsize field.
88 (struct line_header_format): Define.
89 (struct unit): Add str_offsets_base, addr_base, and rnglists_base
90 fields.
91 (read_uint24): New static function.
92 (read_attribute): Add implicit_val parameter. Replace dwarf_str
93 and dwarf_str_size parameters with dwarf_sections parameter. Add
94 support for new DWARF 5 forms. Change all callers.
95 (resolve_string): New static function.
96 (resolve_addr_index): Likewise.
97 (read_abbrevs): Support DW_FORM_implicit_const.
98 (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index,
99 and ranges_is_index fields.
100 (update_pcrange): Support DWARF 5 encodings.
101 (add_high_low_range): New static function, split out of
102 add_ranges.
103 (add_ranges_from_ranges): Likewise.
104 (add_ranges_from_rnglists): New static function.
105 (add_ranges): Just call new helper functions.
106 (find_address_ranges): Use resolve_string for strings, after
107 reading all attributes. Handle new DWARF 5 attributes.
108 (build_address_map): Support DWARF 5 compilation units.
109 (read_v2_paths): New static function, split out of
110 read_line_header.
111 (read_lnct): New static function.
112 (read_line_header_format_entries): Likewise.
113 (read_line_header): Add ddata parameter. Support DWARF 5 line
114 headers. Call new helper functions. Change all callers.
115 (read_line_program): Use addrsize from line program header. Don't
116 special case directory index 0 for DWARF 5.
117 (read_referenced_name): Use resolve_string.
118 (read_function_entry): Handle DWARF 5 encodings. Use
119 resolve_string.
120 * internal.h (enum dwarf_section): Add DEBUG_ADDR,
121 DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS.
122 * elf.c (dwarf_section_names): Add new section names.
123 * pecoff.c (dwarf_section_names): Likewise.
124 * xcoff.c (xcoff_add): Clear dwarf_sections before setting
125 fields.
126 * configure.ac: Define HAVE_DWARF5 automake conditional.
127 * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5.
128 (dwarf5_CFLAGS, dwarf5_LDADD): Likewise.
129 (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise.
130 (dwarf5_alloc_LDADD): Likewise.
131 (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5.
132 (CLEANFILES, clean-local): Define.
133
134 2019-12-08 Ian Lance Taylor <iant@golang.org>
135
136 * dwarf.c (struct pcrange): Define.
137 (update_pcrange, add_ranges): New static functions.
138 (add_unit_addr): Change signature to work with add_ranges. Don't
139 add base_address here.
140 (add_unit_ranges): Remove.
141 (find_address_ranges): Replace str/ranges parameters with
142 dwarf_sections. Use update_pcrange and add_ranges. Change all
143 callers.
144 (add_function_range): Change signature to work with add_ranges.
145 Don't add base_address here.
146 (add_function_ranges): Remove.
147 (read_function_entry): Use update_pcrange and add_ranges.
148
149 2019-12-04 Ian Lance Taylor <iant@golang.org>
150
151 * edtest.c (test1): Add noclone attribute.
152
153 2019-12-04 Ian Lance Taylor <iant@golang.org>
154
155 * internal.h (enum dwarf_section): Define.
156 (struct dwarf_sections): Define.
157 (backtrace_dwarf_add): Update declaration to replace specific
158 section parameters with dwarf_sections parameter.
159 * dwarf.c (struct dwarf_data): Replace specific section fields
160 with dwarf_sections field.
161 (read_attribute): Use dwarf_sections with altlink.
162 (build_address_map): Replace specific section parameters with
163 dwarf_sections parameter. Change all callers.
164 (read_line_info): Use dwarf_sections with ddata.
165 (read_referenced_name): Likewise.
166 (add_function_ranges): Likewise.
167 (read_function_entry): Likewise.
168 (read_function_info): Likewise.
169 (build_dwarf_data): Replace specific section parameters with
170 dwarf_sections parameter. Change all callers.
171 (backtrace_dwarf_add): Likewise.
172 * elf.c (enum debug_section): Remove.
173 (dwarf_section_names): Remove .zdebug names.
174 (elf_add): Track zsections separately. Build dwarf_sections.
175 * pecoff.c (enum debug_section): Remove.
176 (struct debug_section_info): Remove data field.
177 (coff_add): Build dwarf_sections.
178 * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx
179 references with DEBUG_xxx references.
180 (xcoff_add): Build dwarf_sections.
181
182 2019-09-27 Maciej W. Rozycki <macro@wdc.com>
183
184 * configure: Regenerate.
185
186 2019-09-26 Ian Lance Taylor <iant@golang.org>
187
188 PR libbacktrace/91908
189 * pecoff.c (backtrace_initialize): Explicitly cast unchecked
190 __sync_bool_compare_and_swap to void.
191 * xcoff.c (backtrace_initialize): Likewise.
192
193 2019-09-03 Ulrich Weigand <uweigand@de.ibm.com>
194
195 * configure.ac: Remove references to spu.
196 * configure: Regenerate.
197
198 2019-05-24 Clement Chigot <clement.chigot@atos.net>
199
200 * Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and
201 test_elf_64.
202 * Makefile.in: Regenerate.
203
204 2019-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
205
206 * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10*
207 handling.
208 * configure: Regenerate.
209
210 2019-03-11 Ian Lance Taylor <iant@golang.org>
211
212 PR libbacktrace/89669
213 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if
214 HAVE_ELF.
215 * Makefile.in: Regenerate.
216
217 2019-02-26 Tom de Vries <tdevries@suse.de>
218
219 * btest.c (test5): Allow global.* as minimal symbol name for global.
220
221 2019-02-26 Tom de Vries <tdevries@suse.de>
222
223 * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ.
224 * Makefile.in: Regenerate.
225
226 2019-02-12 Tom de Vries <tdevries@suse.de>
227
228 PR libbacktrace/81983
229 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0.
230
231 2019-02-10 Tom de Vries <tdevries@suse.de>
232
233 * Makefile.am (BUILDTESTS): Add btest_lto.
234 * Makefile.in: Regenerate.
235 * btest.c (test1, f2, f3, test3, f22, f23): Declare with
236 __attribute__((noclone)).
237
238 2019-02-08 Tom de Vries <tdevries@suse.de>
239
240 * backtrace.c (backtrace_full): Declare with __attribute__((noinline)).
241 * print.c (backtrace_print): Same.
242 * simple.c (backtrace_simple): Same.
243
244 2019-02-08 Tom de Vries <tdevries@suse.de>
245
246 PR libbacktrace/78063
247 * dwarf.c (build_address_map): Keep all parsed units.
248 (read_referenced_name_from_attr): Handle DW_FORM_ref_addr.
249
250 2019-01-31 Tom de Vries <tdevries@suse.de>
251
252 PR libbacktrace/89136
253 * elf.c (elf_add): Read build-id if with_buildid_data. Fix
254 'debugaltlink_name_len =+ 1'.
255
256 2019-01-29 Tom de Vries <tdevries@suse.de>
257
258 * install-debuginfo-for-buildid.sh.in: New script.
259 * Makefile.am (check_PROGRAMS): Add b2test and b3test.
260 (TESTS): Add b2test_buildid and b3test_dwz_buildid.
261 * Makefile.in: Regenerate.
262 * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL.
263 (READELF): Set with AC_CHECK_PROG.
264 (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES.
265 * configure: Regenerate.
266 * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ...
267 (elf_open_debugfile_by_buildid): ... here.
268
269 2019-01-29 Tom de Vries <tdevries@suse.de>
270
271 * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for
272 allocfail.
273 (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS.
274 (check_PROGRAMS): Add BUILDTESTS.
275 * Makefile.in: Regenerate.
276
277 2019-01-28 Tom de Vries <tdevries@suse.de>
278
279 * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
280 Use $< to access prerequisite.
281 * Makefile.in: Regenerate.
282
283 2019-01-25 Nathan Sidwell <nathan@acm.org>
284
285 * elf.c (elf_add): Pass "" filename to recursive call with
286 separated debug.
287
288 2019-01-25 Tom de Vries <tdevries@suse.de>
289
290 * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with
291 filename == "".
292 * Makefile.am (TESTS): Add btest_dwz_gnudebuglink.
293 * Makefile.in: Regenerate.
294
295 2019-01-25 Tom de Vries <tdevries@suse.de>
296
297 * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule.
298 (TESTS): Rename dtest to btest_gnudebuglink.
299 * Makefile.in: Regenerate.
300
301 2019-01-23 Tom de Vries <tdevries@suse.de>
302
303 * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields.
304 (units_search, find_unit): Use size_t for offset.
305 (build_address_map): Use size_t for unit_offset.
306
307 2019-01-20 Gerald Pfeifer <gerald@pfeifer.com>
308
309 * allocfail.c (main): Increase portability of printf statement.
310
311 2019-01-18 Ian Lance Taylor <iant@golang.org>
312
313 PR libbacktrace/88890
314 * mmapio.c (backtrace_get_view): Change size parameter to
315 uint64_t. Check that value fits in size_t.
316 * read.c (backtrace_get_view): Likewise.
317 * internal.h (backtrace_get_view): Update declaration.
318 * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view.
319
320 2019-01-17 Tom de Vries <tdevries@suse.de>
321
322 PR libbacktrace/82857
323 * configure.ac (DWZ): Set with AC_CHECK_PROG.
324 (HAVE_DWZ): Set with AM_CONDITIONAL.
325 * configure: Regenerate.
326 * Makefile.am (TESTS): Add btest_dwz.
327 * Makefile.in: Regenerate.
328
329 2019-01-17 Tom de Vries <tdevries@suse.de>
330
331 PR libbacktrace/82857
332 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO.
333 (read_attribute): Handle DW_FORM_GNU_ref_alt using
334 ATTR_VAL_REF_ALT_INFO.
335 (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt.
336
337 2019-01-17 Tom de Vries <tdevries@suse.de>
338
339 * dwarf.c (struct unit): Add low_offset and high_offset fields.
340 (struct unit_vector): New type.
341 (struct dwarf_data): Add units and units_counts fields.
342 (find_unit): New function.
343 (find_address_ranges): Add and handle unit_tag parameter.
344 (build_address_map): Add and handle units_vec parameter.
345 (build_dwarf_data): Pass units_vec to build_address_map. Store resulting
346 units vector.
347
348 2019-01-17 Tom de Vries <tdevries@suse.de>
349
350 PR libbacktrace/82857
351 * dwarf.c (read_attribute): Handle DW_FORM_GNU_strp_alt
352 using altlink.
353
354 2019-01-17 Tom de Vries <tdevries@suse.de>
355
356 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
357 (read_attribute): Add altlink parameter. Handle missing altlink for
358 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
359 (find_address_ranges, build_address_map, build_dwarf_data): Add and
360 handle altlink parameter.
361 (read_referenced_name, read_function_entry): Add argument to
362 read_attribute call.
363
364 2019-01-17 Tom de Vries <tdevries@suse.de>
365
366 * dwarf.c (struct dwarf_data): Add altlink field.
367 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
368 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
369 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
370 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
371 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
372 * xcoff.c (xcoff_add): Same.
373
374 2019-01-17 Tom de Vries <tdevries@suse.de>
375
376 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
377 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
378 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
379 argument to backtrace_dwarf_add call.
380 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
381 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
382 * xcoff.c (xcoff_add): Same.
383
384 2019-01-17 Tom de Vries <tdevries@suse.de>
385
386 * elf.c (elf_add): Add and handle with_buildid_data and
387 with_buildid_size parameters. Handle .gnu_debugaltlink section.
388 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
389
390 2019-01-16 Tom de Vries <tdevries@suse.de>
391
392 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
393 of ...
394 (read_referenced_name): ... here, and ...
395 (read_function_entry): ... here.
396
397 2019-01-16 Tom de Vries <tdevries@suse.de>
398
399 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
400 name.
401 (read_function_entry): Same. Don't allow name found via
402 DW_AT_abstract_origin or case DW_AT_specification to override linkage
403 name.
404
405 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
406
407 PR other/16615
408
409 * backtrace.h: Mechanically replace "can not" with "cannot".
410
411 2019-01-01 Jakub Jelinek <jakub@redhat.com>
412
413 Update copyright years.
414
415 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
416
417 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
418 in sed pattern.
419 * Makefile.in: Regenerate.
420
421 2018-12-28 Tom de Vries <tdevries@suse.de>
422
423 * dwarf.c (build_address_map): Reuse unused units.
424
425 2018-12-28 Tom de Vries <tdevries@suse.de>
426
427 * dwarf.c (build_address_map): Simplify by removing local variable
428 abbrevs.
429
430 2018-12-28 Ian Lance Taylor <iant@golang.org>
431 Tom de Vries <tdevries@suse.de>
432
433 PR libbacktrace/88063
434 * dwarf.c (free_unit_addrs_vector): Remove.
435 (build_address_map): Keep track of allocated units in vector. Free
436 allocated units and corresponding abbrevs upon failure. Remove now
437 redundant call to free_unit_addrs_vector. Free addrs vector upon
438 failure. Free allocated unit vector.
439
440 2018-12-28 Tom de Vries <tdevries@suse.de>
441
442 * dwarf.c (build_address_map): Free addrs vector upon failure.
443
444 2018-12-14 Tom de Vries <tdevries@suse.de>
445
446 PR testsuite/88491
447 * allocfail.sh: Remove "set -o pipefail".
448
449 2018-12-12 Tom de Vries <tdevries@suse.de>
450
451 * Makefile.am (TESTS): Add allocfail.sh.
452 (check_PROGRAMS): Add allocfail.
453 * Makefile.in: Regenerate.
454 * instrumented_alloc.c: New file. Redefine malloc and realloc.
455 Include alloc.c.
456 * allocfail.c: New file.
457 * allocfail.sh: New file.
458
459 2018-11-30 Tom de Vries <tdevries@suse.de>
460
461 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
462 test_xcoff_64, test_pecoff and test_unknown.
463 * Makefile.in: Regenerate.
464 * test_format.c: New file.
465
466 2018-11-30 Tom de Vries <tdevries@suse.de>
467
468 * Makefile.am : Add _with_alloc version for each test in
469 check_PROGRAMS.
470 * Makefile.in: Regenerate.
471
472 2018-11-30 Tom de Vries <tdevries@suse.de>
473
474 * internal.h (backtrace_vector_free): New static inline fuction,
475 factored out of ...
476 * dwarf.c (read_line_info): ... here.
477
478 2018-11-28 Tom de Vries <tdevries@suse.de>
479
480 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
481 failure.
482
483 2018-11-27 Tom de Vries <tdevries@suse.de>
484
485 * mmap.c (backtrace_vector_release): Same.
486 * unittest.c (test1): Add check.
487
488 2018-11-27 Tom de Vries <tdevries@suse.de>
489
490 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
491 instead of realloc.
492 * Makefile.am (check_PROGRAMS): Add unittest.
493 * Makefile.in: Regenerate.
494 * unittest.c: New file.
495
496 2018-11-22 Tom de Vries <tdevries@suse.de>
497
498 * dwarf.c (read_initial_length): Factor out of ...
499 (build_address_map, read_line_info): ... here.
500
501 2018-11-21 Tom de Vries <tdevries@suse.de>
502
503 * dwarf.c (read_string): Factor out of ...
504 (read_attribute, read_line_header, read_line_program): ... here.
505
506 2018-10-31 Joseph Myers <joseph@codesourcery.com>
507
508 PR bootstrap/82856
509 * Makefile.am: Include multilib.am.
510 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
511 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
512
513 2018-10-05 Ian Lance Taylor <iant@golang.org>
514
515 PR libbacktrace/87529
516 * backtrace.h: Document that backtrace_create_state should be
517 called only once.
518
519 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
520
521 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
522 * Makefile.in: Regenerate.
523 * config.h.in: Likewise.
524 * configure: Likewise.
525
526 2018-08-01 Tony Reix <tony.reix@atos.net>
527
528 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
529 (struct xcoff_func, struct xcoff_func_vector): New structs.
530 (xcoff_syminfo): Drop leading dot from symbol name.
531 (xcoff_line_compare, xcoff_line_search): Remove.
532 (xcoff_func_compare, xcoff_func_search): New static functions.
533 (xcoff_lookup_pc): Search function table.
534 (xcoff_add_line, xcoff_process_linenos): Remove.
535 (xcoff_initialize_fileline): Build function table.
536
537 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
538
539 PR other/86198
540 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
541 checking up to 36 bytes.
542
543 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
544
545 * configure: Regenerated.
546
547 2018-04-19 Jakub Jelinek <jakub@redhat.com>
548
549 * configure: Regenerated.
550
551 2018-04-17 Ian Lance Taylor <iant@golang.org>
552
553 * backtrace.c: Revert last two changes. Don't call mmap
554 directly.
555
556 2018-04-17 Ian Lance Taylor <iant@golang.org>
557
558 * backtrace.c: Include backtrace-supported.h before checking
559 BACKTRACE_USES_MALLOC.
560
561 2018-04-17 Ian Lance Taylor <iant@golang.org>
562
563 * backtrace.c (backtrace_full): When testing whether we can
564 allocate memory, call mmap directly, and munmap the memory.
565
566 2018-04-04 Jakub Jelinek <jakub@redhat.com>
567
568 PR other/85161
569 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
570 big endian, only use 32-bit loads if endianity macros are predefined
571 and indicate big or little endian.
572
573 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
574
575 PR target/84148
576 * configure: Regenerate.
577
578 2018-02-15 Jakub Jelinek <jakub@redhat.com>
579
580 PR other/82368
581 * elf.c (SHT_PROGBITS): Undefine and define.
582
583 2018-02-14 Jakub Jelinek <jakub@redhat.com>
584
585 PR other/82368
586 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
587 (struct elf_ppc64_opd_data): New type.
588 (elf_initialize_syminfo): Add opd argument, handle symbols
589 pointing into the PowerPC64 ELFv1 .opd section.
590 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
591 to structure with .opd data to elf_initialize_syminfo.
592
593 2018-01-31 Ian Lance Taylor <iant@golang.org>
594
595 * elf.c (elf_add): Close descriptor if we use a debugfile.
596 * btest.c (check_open_files): New static function.
597 (main): Call check_open_files.
598
599 2018-01-25 Ian Lance Taylor <iant@golang.org>
600
601 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
602 desired CRC is zero.
603 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
604
605 2018-01-25 Ian Lance Taylor <iant@golang.org>
606
607 * pecoff.c (coff_add): Only release syms_view if it is valid.
608
609 2018-01-25 Ian Lance Taylor <iant@golang.org>
610
611 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
612
613 2018-01-24 Ian Lance Taylor <iant@golang.org>
614
615 * pecoff.c (coff_add): Use coff_read4, not memcpy.
616
617 2018-01-24 Ian Lance Taylor <iant@golang.org>
618
619 PR other/68239
620 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
621 on the free list.
622
623 2018-01-19 Tony Reix <tony.reix@atos.net>
624
625 * xcoff.c (xcoff_incl_compare): New function.
626 (xcoff_incl_search): New function.
627 (xcoff_process_linenos): Use bsearch to find include file.
628 (xcoff_initialize_fileline): Sort include file information.
629
630 2018-01-16 Ian Lance Taylor <iant@golang.org>
631
632 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
633 288.
634 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
635 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
636 (elf_zlib_default_table): Update.
637 (elf_zlib_default_dist_table): New static array.
638 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
639 for block type 1.
640 * ztest.c (struct zlib_test): Add uncompressed_len.
641 (tests): Initialize uncompressed_len field. Add new test case.
642 (test_samples): Use uncompressed_len field.
643
644 2018-01-03 Jakub Jelinek <jakub@redhat.com>
645
646 Update copyright years.
647
648 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
649
650 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
651 * aclocal.m4: Regenerate.
652 * Makefile.in: Likewise.
653 * configure: Likewise.
654
655 2017-10-06 Ian Lance Taylor <iant@golang.org>
656
657 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
658 zlib uncompress function.
659
660 2017-10-05 Ian Lance Taylor <iant@golang.org>
661
662 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
663 Read a four byte integer.
664 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
665 boundary before ever calling elf_zlib_fetch.
666 * ztest.c (test_large): Simplify print statements a bit.
667
668 2017-10-02 Ian Lance Taylor <iant@golang.org>
669
670 * ztest.c: #include <errno.h>.
671 (TEST_TIMING): Don't define, don't test.
672 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
673 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
674 (ZLIB_CLOCK_GETTIME_ARG): Define.
675 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
676 * Makefile.am: Likewise.
677 * configure, Makefile.in: Rebuild.
678
679 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
680
681 PR other/67165
682 * Makefile.am: Append the content of clock_gettime_link to
683 ztest_LDADD.
684 * configure.ac: Test for the case that clock_gettime is in librt.
685 * Makefile.in: Regenerate.
686 * configure: Likewise.
687
688 PR other/67165
689 * configure.ac: Check for clock_gettime.
690 * config.h.in: Regenerate.
691 * configure: Likewise.
692 * ztest.c (average_time, test_large): Conditionalize test timing
693 on clock_gettime availability.
694
695 2017-09-29 Tony Reix <tony.reix@atos.net>
696
697 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
698 (STYP_DWARF, SSUBTYP_DW*): Define.
699 (enum dwarf_section): Define.
700 (struct dwsect_info): Define.
701 (xcoff_add): Look for DWARF sections, pass them to
702 backtrace_dwarf_add.
703
704 2017-09-28 Ian Lance Taylor <iant@golang.org>
705
706 PR other/67165
707 * elf.c (__builtin_prefetch): Define if not __GNUC__.
708 (unlikely): Define.
709 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
710 (b_elf_chdr): Define type.
711 (enum debug_section): Add ZDEBUG_xxx values.
712 (debug_section_names): Add names for new sections.
713 (struct debug_section_info): Add compressed field.
714 (elf_zlib_failed, elf_zlib_fetch): New static functions.
715 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
716 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
717 (HUFFMAN_SECONDARY_SHIFT): Define.
718 (ZDEBUG_TABLE_SIZE): Define.
719 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
720 (final_next_secondary): New static variable if
721 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
722 (elf_zlib_inflate_table): New static function.
723 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
724 function to produce fixed Huffman table.
725 (elf_zlib_default_table): New static variable.
726 (elf_zlib_inflate): New static function.
727 (elf_zlib_verify_checksum): Likewise.
728 (elf_zlib_inflate_and_verify): Likewise.
729 (elf_uncompress_zdebug): Likewise.
730 (elf_uncompress_chdr): Likewise.
731 (backtrace_uncompress_zdebug): New extern function.
732 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
733 sections, and uncompress them.
734 * internal.h (backtrace_compress_zdebug): Declare.
735 * ztest.c: New file.
736 * configure.ac: Check for -lz and check whether the linker
737 supports --compress-debug-sections.
738 * Makefile.am (ztest_SOURCES): New variable.
739 (ztest_CFLAGS, ztest_LDADD): New variables.
740 (check_PROGRAMS): Add ztest.
741 (ctestg_SOURCES): New variable.
742 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
743 (ctesta_SOURCES): New variable.
744 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
745 (check_PROGRAMS): Add ctestg and ctesta.
746 * configure, config.h.in, Makefile.in: Rebuild.
747
748 2017-09-22 Ian Lance Taylor <iant@golang.org>
749
750 PR sanitizer/77631
751 * configure.ac: Check for lstat and readlink.
752 * elf.c (lstat, readlink): Provide dummy versions if real versions
753 are not available.
754 * configure, config.h.in: Rebuild.
755
756 2017-09-21 Ian Lance Taylor <iant@google.com>
757
758 PR go/82284
759 * elf.c (backtrace_initialize): Set pd.exe_filename.
760
761 2017-09-20 Ian Lance Taylor <iant@golang.org>
762 Denis Khalikov <d.khalikov@partner.samsung.com>
763
764 PR sanitizer/77631
765 Support for external debug info.
766 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
767 (S_ISLNK): Define if not defined.
768 (xstrnlen): Define if strnlen is not available.
769 (b_elf_note): Define type.
770 (NT_GNU_BUILD_ID): Define macro.
771 (elf_crc32, elf_crc32_file): New static functions.
772 (elf_is_symlink, elf_readlink): New static functions.
773 (elf_open_debugfile_by_buildid): New static function.
774 (elf_try_debugfile): New static function.
775 (elf_find_debugfile_by_debuglink): New static function.
776 (elf_open_debugfile_by_debuglink): New static function.
777 (elf_add): Add filename and debuginfo parameters. Adjust all
778 callers. Look for external debug info notes, and try to fetch
779 debug info from external file.
780 (struct phdr_data): Add exe_filename field.
781 (phdr_callback): Pass filename to elf_add.
782 (backtrace_initialize): Add filename parameter.
783 * internal.h (backtrace_initialize): Add filename parameter.
784 * fileline.c (fileline_initialize): Pass filename to
785 backtrace_initialize.
786 * pecoff.c (fileline_initialize): Add unused filename parameter.
787 * unknown.c (fileline_initialize): Likewise.
788 * xcoff.c (fileline_initialize): Likewise.
789 * configure.ac: Check for objcopy --add-gnu-debuglink.
790 * Makefile.am (dtest): New test target.
791 * configure, Makefile.in: Rebuild.
792
793 2017-09-12 Steve Ellcey <sellcey@cavium.com>
794
795 PR other/81096
796 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
797 * Makefile.in: Regenerate.
798
799 2017-09-12 Steve Ellcey <sellcey@cavium.com>
800
801 PR other/81096
802 * libbacktrace/Makefile.in
803 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
804
805 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
806
807 PR bootstrap/81638
808 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
809
810 2017-07-28 Tony Reix <tony.reix@atos.net>
811
812 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
813
814 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
815
816 * fileline.c (fileline_initialize): Print pid_t as long.
817
818 2017-07-26 Tony Reix <tony.reix@atos.net>
819
820 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
821 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
822 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
823 * configure, config.h.in: Regenerate.
824
825 2017-07-21 Tony Reix <tony.reix@atos.net>
826
827 * filetype.awk: Add AIX XCOFF type detection.
828 * configure.ac: Recognize xcoff format.
829 * Makefile.am (FORMAT_FILES): Add xcoff.c.
830 * fileline.c: Include <unistd.h>.
831 (fileline_initialize): Add case for AIX procfs.
832 * xcoff.c: New file.
833 * configure, Makefile.in: Rebuild.
834
835 2017-06-21 Richard Biener <rguenther@suse.de>
836
837 * configure.ac: Add AC_SYS_LARGEFILE.
838 * config.h.in: Regenerate.
839 * configure: Likewise.
840
841 2017-06-11 Ian Lance Taylor <iant@golang.org>
842
843 * elf.c (backtrace_initialize): Always set *fileline_fn.
844 * ttest.c: New file.
845 * btest.c: Move support functions into testlib.c. Change calls to
846 check to pass file name.
847 * testlib.c: New file, copied from (part of) btest.c.
848 * testlib.h: New file, declarations for testlib.c.
849 * edtest.c: Use testlib.h and testlib.c.
850 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
851 * Makefile.am (btest_SOURCES): Add testlib.c.
852 (edtest_SOURCES): Likewise.
853 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
854 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
855 * configure, Makefile.in: Rebuild.
856
857 2017-05-19 Than McIntosh <thanm@google.com>
858
859 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
860 (read_line_header): Don't allocate dirs if dirs_count == 0.
861 * edtest.c: New file.
862 * edtest2.c: New file.
863 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
864 (check_PROGRAMS): Add edtest.
865 (edtest2_build.c, gen_edtest2_build): New targets.
866 * Makefile.in: Rebuild.
867
868 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
869
870 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
871 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
872
873 2017-01-01 Jakub Jelinek <jakub@redhat.com>
874
875 Update copyright years.
876
877 2016-11-15 Matthias Klose <doko@ubuntu.com>
878
879 * configure: Regenerate.
880
881 2016-09-11 Carlos Liam <carlos@aarzee.me>
882
883 * all: Remove meaningless trailing whitespace.
884
885 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
886
887 PR target/71161
888 * elf.c (phdr_callback) [__i386__]: Add
889 __attribute__((__force_align_arg_pointer__)).
890
891 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
892
893 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
894 avoid possible crash.
895 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
896 missing debug info anymore.
897
898 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
899
900 * mmap.c (MAP_FAILED): Define if not defined.
901
902 2016-01-04 Jakub Jelinek <jakub@redhat.com>
903
904 Update copyright years.
905
906 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
907
908 * configure.ac: Specify that DJGPP do not have mmap
909 even when sys/mman.h exists.
910 * configure: Regenerate
911
912 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
913
914 PR libgfortran/68115
915 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
916 * configure: Regenerate.
917 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
918 to void.
919
920 2015-09-17 Ian Lance Taylor <iant@google.com>
921
922 * posix.c (backtrace_open): Cast second argument of open() to int.
923
924 2015-09-11 Ian Lance Taylor <iant@google.com>
925
926 * Makefile.am (backtrace.lo): Depend on internal.h.
927 (sort.lo, stest.lo): Add explicit dependencies.
928 * Makefile.in: Rebuild.
929
930 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
931
932 * backtrace.c: #include <sys/types.h>.
933
934 2015-09-08 Ian Lance Taylor <iant@google.com>
935
936 PR other/67457
937 * backtrace.c: #include "internal.h".
938 (struct backtrace_data): Add can_alloc field.
939 (unwind): If can_alloc is false, don't try to get file/line
940 information.
941 (backtrace_full): Set can_alloc field in bdata.
942 * alloc.c (backtrace_alloc): Don't call error_callback if it is
943 NULL.
944 * mmap.c (backtrace_alloc): Likewise.
945 * internal.h: Update comments for backtrace_alloc and
946 backtrace_free.
947
948 2015-09-08 Ian Lance Taylor <iant@google.com>
949
950 PR other/67457
951 * mmap.c (backtrace_alloc): Correct test for mmap failure.
952
953 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
954
955 * configure.ac: For spu-*-* targets, set have_fcntl to no.
956 * configure: Regenerate.
957
958 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
959
960 * configure.ac: Remove [disable-shared] argument to LT_INIT.
961 Remove setting PIC_FLAG when building as target library.
962 * configure: Regenerate.
963
964 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
965
966 * configure.ac: Only compile with -fPIC if the target
967 supports it.
968 * configure: Regenerate.
969
970 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
971
972 * configure.ac: Set have_mmap to no on spu-*-* targets.
973 * configure: Regenerate.
974
975 2015-08-13 Ian Lance Taylor <iant@google.com>
976
977 * dwarf.c (read_function_entry): Add vec_inlined parameter.
978 Change all callers.
979
980 2015-06-11 Martin Sebor <msebor@redhat.com>
981
982 PR sanitizer/65479
983 * dwarf.c (struct line): Add new field idx.
984 (line_compare): Use it.
985 (add_line): Set it.
986 (read_line_info): Reset it.
987
988 2015-05-29 Tristan Gingold <gingold@adacore.com>
989
990 * pecoff.c: New file.
991 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
992 * Makefile.in: Regenerate.
993 * filetype.awk: Detect pecoff.
994 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
995 Add pecoff.
996 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
997 true.
998 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
999 * configure: Regenerate.
1000 * pecoff.c: New file.
1001
1002 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
1003
1004 * Makefile.in: Regenerated with automake-1.11.6.
1005 * aclocal.m4: Likewise.
1006 * configure: Likewise.
1007
1008 2015-01-24 Matthias Klose <doko@ubuntu.com>
1009
1010 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
1011 * configure: Regenerate.
1012
1013 2015-01-05 Jakub Jelinek <jakub@redhat.com>
1014
1015 Update copyright years.
1016
1017 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
1018
1019 PR bootstrap/63784
1020 * configure: Regenerated.
1021
1022 2014-11-11 David Malcolm <dmalcolm@redhat.com>
1023
1024 * ChangeLog.jit: New.
1025
1026 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1027
1028 PR target/63610
1029 * configure: Regenerate.
1030
1031 2014-10-23 Ian Lance Taylor <iant@google.com>
1032
1033 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
1034 Fix to return void *.
1035
1036 2014-05-08 Ian Lance Taylor <iant@google.com>
1037
1038 * mmap.c (backtrace_free): If freeing a large aligned block of
1039 memory, call munmap rather than holding onto it.
1040 (backtrace_vector_grow): When growing a vector, double the number
1041 of pages requested. When releasing the old version of a grown
1042 vector, pass the correct size to backtrace_free.
1043
1044 2014-03-07 Ian Lance Taylor <iant@google.com>
1045
1046 * sort.c (backtrace_qsort): Use middle element as pivot.
1047
1048 2014-03-06 Ian Lance Taylor <iant@google.com>
1049
1050 * sort.c: New file.
1051 * stest.c: New file.
1052 * internal.h (backtrace_qsort): Declare.
1053 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
1054 (read_line_info, read_function_entry): Likewise.
1055 (read_function_info, build_dwarf_data): Likewise.
1056 * elf.c (elf_initialize_syminfo): Likewise.
1057 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
1058 (stest_SOURCES, stest_LDADD): Define.
1059 (check_PROGRAMS): Add stest.
1060
1061 2014-02-07 Misty De Meo <misty@brew.sh>
1062
1063 PR target/58710
1064 * configure.ac: Use AC_LINK_IFELSE in check for
1065 _Unwind_GetIPInfo.
1066 * configure: Regenerate.
1067
1068 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
1069
1070 Update copyright years
1071
1072 2013-12-06 Jakub Jelinek <jakub@redhat.com>
1073
1074 * elf.c (ET_DYN): Undefine and define again.
1075 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
1076 return early -1 without closing the descriptor.
1077 (struct phdr_data): Add exe_descriptor.
1078 (phdr_callback): If pd->exe_descriptor is not -1, for very first
1079 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
1080 otherwise backtrace_close the exe_descriptor if not -1. Adjust
1081 call to elf_add.
1082 (backtrace_initialize): Adjust call to elf_add. If it returns
1083 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
1084
1085 2013-12-05 Ian Lance Taylor <iant@google.com>
1086
1087 * alloc.c (backtrace_vector_finish): Add error_callback and data
1088 parameters. Call backtrace_vector_release. Return address base.
1089 * mmap.c (backtrace_vector_finish): Add error_callback and data
1090 parameters. Return address base.
1091 * dwarf.c (read_function_info): Get new address base from
1092 backtrace_vector_finish.
1093 * internal.h (backtrace_vector_finish): Update declaration.
1094
1095 2013-11-27 Ian Lance Taylor <iant@google.com>
1096
1097 * dwarf.c (find_address_ranges): New static function, broken out
1098 of build_address_map.
1099 (build_address_map): Call it.
1100 * btest.c (check): Check for missing filename or function, rather
1101 than crashing.
1102 (f3): Check that enough frames were returned.
1103
1104 2013-11-19 Jakub Jelinek <jakub@redhat.com>
1105
1106 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
1107 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
1108 last argument.
1109 * btest.c (struct symdata): Add size field.
1110 (callback_three): Add symsize argument. Copy it to the data->size
1111 field.
1112 (f23): Set symdata.size to 0.
1113 (test5): Likewise. If sizeof (int) > 1, lookup address of
1114 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
1115 values.
1116
1117 * atomic.c: Include sys/types.h.
1118
1119 2013-11-18 Ian Lance Taylor <iant@google.com>
1120
1121 * configure.ac: Check for support of __atomic extensions.
1122 * internal.h: Declare or #define atomic functions for use in
1123 backtrace code.
1124 * atomic.c: New file.
1125 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
1126 (dwarf_fileline, backtrace_dwarf_add): Likewise.
1127 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
1128 (backtrace_initialize): Likewise.
1129 * fileline.c (fileline_initialize): Likewise.
1130 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
1131 * configure, config.h.in, Makefile.in: Rebuild.
1132
1133 2013-11-18 Jakub Jelinek <jakub@redhat.com>
1134
1135 * elf.c (SHN_UNDEF): Define.
1136 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
1137 with st_shndx == SHN_UNDEF. Add base_address to address fields.
1138 (elf_add): Adjust caller.
1139
1140 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
1141
1142 2013-11-16 Ian Lance Taylor <iant@google.com>
1143
1144 * backtrace.h (backtrace_create_state): Correct comment about
1145 threading.
1146
1147 2013-11-15 Ian Lance Taylor <iant@google.com>
1148
1149 * backtrace.h (backtrace_syminfo): Update comment and parameter
1150 name to take any address, not just a PC value.
1151 * elf.c (STT_OBJECT): Define.
1152 (elf_nosyms): Rename parameter pc to addr.
1153 (elf_symbol_search): Rename local variable pc to addr.
1154 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
1155 (elf_syminfo): Rename parameter pc to addr.
1156 * btest.c (global): New global variable.
1157 (test5): New test.
1158 (main): Call test5.
1159
1160 2013-10-17 Ian Lance Taylor <iant@google.com>
1161
1162 * elf.c (elf_add): Don't get the wrong offsets if a debug section
1163 is missing.
1164
1165 2013-10-15 David Malcolm <dmalcolm@redhat.com>
1166
1167 * configure.ac: Add --enable-host-shared, setting up
1168 pre-existing PIC_FLAG variable within Makefile.am et al.
1169 * configure: Regenerate.
1170
1171 2013-09-20 Alan Modra <amodra@gmail.com>
1172
1173 * configure: Regenerate.
1174
1175 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1176
1177 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
1178
1179 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
1180
1181 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
1182 dl_iterate_phdr callbacks.
1183
1184 2013-03-25 Ian Lance Taylor <iant@google.com>
1185
1186 * alloc.c: #include <sys/types.h>.
1187 * mmap.c: Likewise.
1188
1189 2013-01-31 Ian Lance Taylor <iant@google.com>
1190
1191 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
1192 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
1193
1194 2013-01-25 Jakub Jelinek <jakub@redhat.com>
1195
1196 PR other/56076
1197 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
1198 attribute was not seen.
1199
1200 2013-01-16 Ian Lance Taylor <iant@google.com>
1201
1202 * dwarf.c (struct unit): Add filename and abs_filename fields.
1203 (build_address_map): Set new fields when reading unit.
1204 (dwarf_lookup_pc): If we don't find an entry in the line table,
1205 just return the main file name.
1206
1207 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
1208
1209 Update copyright years.
1210
1211 2013-01-01 Ian Lance Taylor <iant@google.com>
1212
1213 PR bootstrap/54834
1214 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
1215 $(MULTIBUILDTOP)/../../gcc/include.
1216 * Makefile.in: Rebuild.
1217
1218 2013-01-01 Ian Lance Taylor <iant@google.com>
1219
1220 PR other/55536
1221 * mmap.c (backtrace_alloc): Don't call sync functions if not
1222 threaded.
1223 (backtrace_free): Likewise.
1224
1225 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
1226
1227 * mmapio.c: Define MAP_FAILED if not defined.
1228
1229 2012-12-11 Jakub Jelinek <jakub@redhat.com>
1230
1231 PR bootstrap/54926
1232 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
1233 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
1234 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
1235 accepts it.
1236 * Makefile.in: Regenerated.
1237 * configure: Regenerated.
1238
1239 2012-12-07 Jakub Jelinek <jakub@redhat.com>
1240
1241 PR bootstrap/54926
1242 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
1243 * Makefile.in: Regenerated.
1244
1245 2012-11-20 Ian Lance Taylor <iant@google.com>
1246
1247 * dwarf.c (read_attribute): Always clear val.
1248
1249 2012-11-13 Ian Lance Taylor <iant@google.com>
1250
1251 PR other/55312
1252 * configure.ac: Only add -Werror if building a target library.
1253 * configure: Rebuild.
1254
1255 2012-11-12 Ian Lance Taylor <iant@google.com>
1256 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1257 Gerald Pfeifer <gerald@pfeifer.com>
1258
1259 * configure.ac: Check for getexecname.
1260 * fileline.c: #include <errno.h>. Define getexecname if not
1261 available.
1262 (fileline_initialize): Try to find the executable in a few
1263 different ways.
1264 * print.c (error_callback): Only print the filename if it came
1265 from the backtrace state.
1266 * configure, config.h.in: Rebuild.
1267
1268 2012-10-29 Ian Lance Taylor <iant@google.com>
1269
1270 * mmap.c (backtrace_vector_release): Correct last patch: add
1271 aligned, not size.
1272
1273 2012-10-29 Ian Lance Taylor <iant@google.com>
1274
1275 * mmap.c (backtrace_vector_release): Make sure freed block is
1276 aligned on 8-byte boundary.
1277
1278 2012-10-26 Ian Lance Taylor <iant@google.com>
1279
1280 PR other/55087
1281 * posix.c (backtrace_open): Add does_not_exist parameter.
1282 * elf.c (phdr_callback): Do not warn if shared library could not
1283 be opened.
1284 * fileline.c (fileline_initialize): Update calls to
1285 backtrace_open.
1286 * internal.h (backtrace_open): Update declaration.
1287
1288 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
1289
1290 PR target/55061
1291 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
1292 * configure: Regenerate.
1293
1294 2012-10-24 Ian Lance Taylor <iant@google.com>
1295
1296 PR target/55061
1297 * configure.ac: Check whether -funwind-tables option works.
1298 * configure: Rebuild.
1299
1300 2012-10-11 Ian Lance Taylor <iant@google.com>
1301
1302 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
1303 * configure: Rebuild.
1304
1305 2012-10-10 Ian Lance Taylor <iant@google.com>
1306
1307 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
1308 lower case.
1309
1310 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
1311
1312 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
1313
1314 2012-10-09 Ian Lance Taylor <iant@google.com>
1315
1316 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
1317 (backtrace_dwarf_add): Likewise.
1318
1319 2012-10-09 Ian Lance Taylor <iant@google.com>
1320
1321 Add support for tracing through shared libraries.
1322 * configure.ac: Check for link.h and dl_iterate_phdr.
1323 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
1324 ELF macros before #defining them.
1325 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
1326 dl_iterate_phdr.
1327 (struct elf_syminfo_data): Add next field.
1328 (elf_initialize_syminfo): Initialize next field.
1329 (elf_add_syminfo_data): New static function.
1330 (elf_add): New static function, broken out of
1331 backtrace_initialize. Call backtrace_dwarf_add instead of
1332 backtrace_dwarf_initialize.
1333 (struct phdr_data): Define.
1334 (phdr_callback): New static function.
1335 (backtrace_initialize): Call elf_add.
1336 * dwarf.c (struct dwarf_data): Add next and base_address fields.
1337 (add_unit_addr): Add base_address parameter. Change all callers.
1338 (add_unit_ranges, build_address_map): Likewise.
1339 (add_line): Add ddata parameter. Change all callers.
1340 (read_line_program, add_function_range): Likewise.
1341 (dwarf_lookup_pc): New static function, broken out of
1342 dwarf_fileline.
1343 (dwarf_fileline): Call dwarf_lookup_pc.
1344 (build_dwarf_data): New static function.
1345 (backtrace_dwarf_add): New function.
1346 (backtrace_dwarf_initialize): Remove.
1347 * internal.h (backtrace_dwarf_initialize): Don't declare.
1348 (backtrace_dwarf_add): Declare.
1349 * configure, config.h.in: Rebuild.
1350
1351 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
1352
1353 * btest.c (f23): Avoid uninitialized variable warning.
1354
1355 2012-10-04 Ian Lance Taylor <iant@google.com>
1356
1357 * dwarf.c: If the system header files do not declare strnlen,
1358 provide our own version.
1359
1360 2012-10-03 Ian Lance Taylor <iant@google.com>
1361
1362 * dwarf.c (read_uleb128): Fix overflow test.
1363 (read_sleb128): Likewise.
1364 (build_address_map): Don't change unit_buf.start.
1365
1366 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1367
1368 PR other/54761
1369 * configure.ac (EXTRA_FLAGS): New.
1370 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1371 * configure, Makefile.in: Regenerate.
1372
1373 2012-09-29 Ian Lance Taylor <iant@google.com>
1374
1375 PR other/54749
1376 * fileline.c (fileline_initialize): Pass errnum as -1 when
1377 reporting that we could not read executable information after a
1378 previous failure.
1379
1380 2012-09-27 Ian Lance Taylor <iant@google.com>
1381
1382 PR bootstrap/54732
1383 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1384 * Makefile.am: Add dependencies for all objects.
1385 * configure, aclocal.m4, Makefile.in: Rebuild.
1386
1387 2012-09-27 Ian Lance Taylor <iant@google.com>
1388
1389 PR other/54726
1390 * elf.c (backtrace_initialize): Set *fileln_fn, not
1391 state->fileln_fn.
1392
1393 2012-09-19 Ian Lance Taylor <iant@google.com>
1394
1395 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1396 as a target library.
1397 * configure: Rebuild.
1398
1399 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1400 Ian Lance Taylor <iant@google.com>
1401
1402 * configure.ac (GCC_HEADER_STDINT): Invoke.
1403 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1404 * btest.c: Don't include <stdint.h>.
1405 * dwarf.c: Likewise.
1406 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1407
1408 2012-09-18 Ian Lance Taylor <iant@google.com>
1409
1410 PR bootstrap/54623
1411 * Makefile.am (AM_CPPFLAGS): Define.
1412 (AM_CFLAGS): Remove -I options.
1413 * Makefile.in: Rebuild.
1414
1415 2012-09-18 Ian Lance Taylor <iant@google.com>
1416
1417 * posix.c (O_BINARY): Define if not defined.
1418 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1419 HAVE_FCNTL is defined.
1420 * configure.ac: Test for the fcntl function.
1421 * configure, config.h.in: Rebuild.
1422
1423 2012-09-18 Ian Lance Taylor <iant@google.com>
1424
1425 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1426
1427 2012-09-18 Ian Lance Taylor <iant@google.com>
1428
1429 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1430
1431 2012-09-18 Ian Lance Taylor <iant@google.com>
1432
1433 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1434 * mmapio.c: Don't define _GNU_SOURCE.
1435 * configure, config.h.in: Rebuild.
1436
1437 2012-09-18 Ian Lance Taylor <iant@google.com>
1438
1439 * configure.ac: Check whether strnlen is declared.
1440 * dwarf.c: Declare strnlen if not declared.
1441 * configure, config.h.in: Rebuild.
1442
1443 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1444
1445 * fileline.c: Include <stdlib.h>.
1446 * mmap.c: Likewise.
1447
1448 2012-09-17 Ian Lance Taylor <iant@google.com>
1449
1450 PR bootstrap/54611
1451 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1452 parameter.
1453
1454 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1455
1456 PR bootstrap/54611
1457 * nounwind.c (backtrace_simple): Add state parameter.
1458
1459 2012-09-17 Ian Lance Taylor <iant@google.com>
1460
1461 PR bootstrap/54609
1462 * unknown.c (unknown_fileline): Add state parameter, remove
1463 fileline_data parameter, name error_callback parameter.
1464 (backtrace_initialize): Add state parameter.
1465
1466 2012-09-17 Ian Lance Taylor <iant@google.com>
1467
1468 * Initial implementation.
1469 \f
1470 Copyright (C) 2012-2020 Free Software Foundation, Inc.
1471
1472 Copying and distribution of this file, with or without modification,
1473 are permitted in any medium without royalty provided the copyright
1474 notice and this notice are preserved.