[libbacktrace] Handle alt FORMS without .gnu_debugaltlink
[gcc.git] / libbacktrace / ChangeLog
1 2019-01-17 Tom de Vries <tdevries@suse.de>
2
3 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_NONE.
4 (read_attribute): Add altlink parameter. Handle missing altlink for
5 DW_FORM_GNU_strp_alt and DW_FORM_GNU_ref_alt.
6 (find_address_ranges, build_address_map, build_dwarf_data): Add and
7 handle altlink parameter.
8 (read_referenced_name, read_function_entry): Add argument to
9 read_attribute call.
10
11 2019-01-17 Tom de Vries <tdevries@suse.de>
12
13 * dwarf.c (struct dwarf_data): Add altlink field.
14 (backtrace_dwarf_add): Add and handle fileline_altlink parameter.
15 * elf.c (elf_add): Add argument to backtrace_dwarf_add call.
16 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
17 * internal.h (backtrace_dwarf_add): Add fileline_altlink parameter.
18 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
19 * xcoff.c (xcoff_add): Same.
20
21 2019-01-17 Tom de Vries <tdevries@suse.de>
22
23 * internal.h (backtrace_dwarf_add): Add fileline_entry parameter.
24 * dwarf.c (backtrace_dwarf_add): Add and handle fileline_entry parameter.
25 * elf.c (elf_add): Add and handle fileline_entry parameter. Add
26 argument to backtrace_dwarf_add call.
27 (phdr_callback, backtrace_initialize): Add argument to elf_add calls.
28 * pecoff.c (coff_add): Add argument to backtrace_dwarf_add call.
29 * xcoff.c (xcoff_add): Same.
30
31 2019-01-17 Tom de Vries <tdevries@suse.de>
32
33 * elf.c (elf_add): Add and handle with_buildid_data and
34 with_buildid_size parameters. Handle .gnu_debugaltlink section.
35 (phdr_callback, backtrace_initialize): Add arguments to elf_add calls.
36
37 2019-01-16 Tom de Vries <tdevries@suse.de>
38
39 * dwarf.c (read_referenced_name_from_attr): New function. Factor out
40 of ...
41 (read_referenced_name): ... here, and ...
42 (read_function_entry): ... here.
43
44 2019-01-16 Tom de Vries <tdevries@suse.de>
45
46 * dwarf.c (read_referenced_name): Don't allow DW_AT_name to override any
47 name.
48 (read_function_entry): Same. Don't allow name found via
49 DW_AT_abstract_origin or case DW_AT_specification to override linkage
50 name.
51
52 2019-01-09 Sandra Loosemore <sandra@codesourcery.com>
53
54 PR other/16615
55
56 * backtrace.h: Mechanically replace "can not" with "cannot".
57
58 2019-01-01 Jakub Jelinek <jakub@redhat.com>
59
60 Update copyright years.
61
62 2018-12-29 Gerald Pfeifer <gerald@pfeifer.com>
63
64 * Makefile.am (xcoff_%.c): Use an actual newline instead of \n
65 in sed pattern.
66 * Makefile.in: Regenerate.
67
68 2018-12-28 Tom de Vries <tdevries@suse.de>
69
70 * dwarf.c (build_address_map): Reuse unused units.
71
72 2018-12-28 Tom de Vries <tdevries@suse.de>
73
74 * dwarf.c (build_address_map): Simplify by removing local variable
75 abbrevs.
76
77 2018-12-28 Ian Lance Taylor <iant@golang.org>
78 Tom de Vries <tdevries@suse.de>
79
80 PR libbacktrace/88063
81 * dwarf.c (free_unit_addrs_vector): Remove.
82 (build_address_map): Keep track of allocated units in vector. Free
83 allocated units and corresponding abbrevs upon failure. Remove now
84 redundant call to free_unit_addrs_vector. Free addrs vector upon
85 failure. Free allocated unit vector.
86
87 2018-12-28 Tom de Vries <tdevries@suse.de>
88
89 * dwarf.c (build_address_map): Free addrs vector upon failure.
90
91 2018-12-14 Tom de Vries <tdevries@suse.de>
92
93 PR testsuite/88491
94 * allocfail.sh: Remove "set -o pipefail".
95
96 2018-12-12 Tom de Vries <tdevries@suse.de>
97
98 * Makefile.am (TESTS): Add allocfail.sh.
99 (check_PROGRAMS): Add allocfail.
100 * Makefile.in: Regenerate.
101 * instrumented_alloc.c: New file. Redefine malloc and realloc.
102 Include alloc.c.
103 * allocfail.c: New file.
104 * allocfail.sh: New file.
105
106 2018-11-30 Tom de Vries <tdevries@suse.de>
107
108 * Makefile.am (check_PROGRAMS): Add test_elf, test_xcoff_32,
109 test_xcoff_64, test_pecoff and test_unknown.
110 * Makefile.in: Regenerate.
111 * test_format.c: New file.
112
113 2018-11-30 Tom de Vries <tdevries@suse.de>
114
115 * Makefile.am : Add _with_alloc version for each test in
116 check_PROGRAMS.
117 * Makefile.in: Regenerate.
118
119 2018-11-30 Tom de Vries <tdevries@suse.de>
120
121 * internal.h (backtrace_vector_free): New static inline fuction,
122 factored out of ...
123 * dwarf.c (read_line_info): ... here.
124
125 2018-11-28 Tom de Vries <tdevries@suse.de>
126
127 * dwarf.c (read_abbrevs): Fix handling of abbrevs->abbrevs allocation
128 failure.
129
130 2018-11-27 Tom de Vries <tdevries@suse.de>
131
132 * mmap.c (backtrace_vector_release): Same.
133 * unittest.c (test1): Add check.
134
135 2018-11-27 Tom de Vries <tdevries@suse.de>
136
137 * alloc.c (backtrace_vector_release): Handle vec->size == 0 using free
138 instead of realloc.
139 * Makefile.am (check_PROGRAMS): Add unittest.
140 * Makefile.in: Regenerate.
141 * unittest.c: New file.
142
143 2018-11-22 Tom de Vries <tdevries@suse.de>
144
145 * dwarf.c (read_initial_length): Factor out of ...
146 (build_address_map, read_line_info): ... here.
147
148 2018-11-21 Tom de Vries <tdevries@suse.de>
149
150 * dwarf.c (read_string): Factor out of ...
151 (read_attribute, read_line_header, read_line_program): ... here.
152
153 2018-10-31 Joseph Myers <joseph@codesourcery.com>
154
155 PR bootstrap/82856
156 * Makefile.am: Include multilib.am.
157 * configure.ac: Remove AC_PREREQ. Use AC_LANG_SOURCE.
158 * Makefile.in, aclocal.m4, config.h.in, configure: Regenerate.
159
160 2018-10-05 Ian Lance Taylor <iant@golang.org>
161
162 PR libbacktrace/87529
163 * backtrace.h: Document that backtrace_create_state should be
164 called only once.
165
166 2018-08-05 Iain Buclaw <ibuclaw@gdcproject.org>
167
168 * configure.ac: Move define of HAVE_ZLIB into check for -lz.
169 * Makefile.in: Regenerate.
170 * config.h.in: Likewise.
171 * configure: Likewise.
172
173 2018-08-01 Tony Reix <tony.reix@atos.net>
174
175 * xcoff.c (struct xcoff_line, struct xcoff_line_vector): Remove.
176 (struct xcoff_func, struct xcoff_func_vector): New structs.
177 (xcoff_syminfo): Drop leading dot from symbol name.
178 (xcoff_line_compare, xcoff_line_search): Remove.
179 (xcoff_func_compare, xcoff_func_search): New static functions.
180 (xcoff_lookup_pc): Search function table.
181 (xcoff_add_line, xcoff_process_linenos): Remove.
182 (xcoff_initialize_fileline): Build function table.
183
184 2018-06-21 Denis Khalikov <d.khalikov@partner.samsung.com>
185
186 PR other/86198
187 * elf.c (elf_add): Increase ".note.gnu.build-id" section size
188 checking up to 36 bytes.
189
190 2018-04-24 H.J. Lu <hongjiu.lu@intel.com>
191
192 * configure: Regenerated.
193
194 2018-04-19 Jakub Jelinek <jakub@redhat.com>
195
196 * configure: Regenerated.
197
198 2018-04-17 Ian Lance Taylor <iant@golang.org>
199
200 * backtrace.c: Revert last two changes. Don't call mmap
201 directly.
202
203 2018-04-17 Ian Lance Taylor <iant@golang.org>
204
205 * backtrace.c: Include backtrace-supported.h before checking
206 BACKTRACE_USES_MALLOC.
207
208 2018-04-17 Ian Lance Taylor <iant@golang.org>
209
210 * backtrace.c (backtrace_full): When testing whether we can
211 allocate memory, call mmap directly, and munmap the memory.
212
213 2018-04-04 Jakub Jelinek <jakub@redhat.com>
214
215 PR other/85161
216 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for
217 big endian, only use 32-bit loads if endianity macros are predefined
218 and indicate big or little endian.
219
220 2018-02-14 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
221
222 PR target/84148
223 * configure: Regenerate.
224
225 2018-02-15 Jakub Jelinek <jakub@redhat.com>
226
227 PR other/82368
228 * elf.c (SHT_PROGBITS): Undefine and define.
229
230 2018-02-14 Jakub Jelinek <jakub@redhat.com>
231
232 PR other/82368
233 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define.
234 (struct elf_ppc64_opd_data): New type.
235 (elf_initialize_syminfo): Add opd argument, handle symbols
236 pointing into the PowerPC64 ELFv1 .opd section.
237 (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer
238 to structure with .opd data to elf_initialize_syminfo.
239
240 2018-01-31 Ian Lance Taylor <iant@golang.org>
241
242 * elf.c (elf_add): Close descriptor if we use a debugfile.
243 * btest.c (check_open_files): New static function.
244 (main): Call check_open_files.
245
246 2018-01-25 Ian Lance Taylor <iant@golang.org>
247
248 * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the
249 desired CRC is zero.
250 (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo.
251
252 2018-01-25 Ian Lance Taylor <iant@golang.org>
253
254 * pecoff.c (coff_add): Only release syms_view if it is valid.
255
256 2018-01-25 Ian Lance Taylor <iant@golang.org>
257
258 * pecoff.c (coff_add): Another memcpy -> coff_read4 fix.
259
260 2018-01-24 Ian Lance Taylor <iant@golang.org>
261
262 * pecoff.c (coff_add): Use coff_read4, not memcpy.
263
264 2018-01-24 Ian Lance Taylor <iant@golang.org>
265
266 PR other/68239
267 * mmap.c (backtrace_free_locked): Don't put more than 16 entries
268 on the free list.
269
270 2018-01-19 Tony Reix <tony.reix@atos.net>
271
272 * xcoff.c (xcoff_incl_compare): New function.
273 (xcoff_incl_search): New function.
274 (xcoff_process_linenos): Use bsearch to find include file.
275 (xcoff_initialize_fileline): Sort include file information.
276
277 2018-01-16 Ian Lance Taylor <iant@golang.org>
278
279 * elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be
280 288.
281 (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to
282 elf_zlib_inflate_table. Generate elf_zlib_default_dist_table.
283 (elf_zlib_default_table): Update.
284 (elf_zlib_default_dist_table): New static array.
285 (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table
286 for block type 1.
287 * ztest.c (struct zlib_test): Add uncompressed_len.
288 (tests): Initialize uncompressed_len field. Add new test case.
289 (test_samples): Use uncompressed_len field.
290
291 2018-01-03 Jakub Jelinek <jakub@redhat.com>
292
293 Update copyright years.
294
295 2017-11-17 Igor Tsimbalist <igor.v.tsimbalist@intel.com>
296
297 * configure.ac: Add CET_FLAGS to EXTRA_FLAGS.
298 * aclocal.m4: Regenerate.
299 * Makefile.in: Likewise.
300 * configure: Likewise.
301
302 2017-10-06 Ian Lance Taylor <iant@golang.org>
303
304 * ztest.c (test_large): Pass unsigned long *, not size_t *, to
305 zlib uncompress function.
306
307 2017-10-05 Ian Lance Taylor <iant@golang.org>
308
309 * elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.
310 Read a four byte integer.
311 (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit
312 boundary before ever calling elf_zlib_fetch.
313 * ztest.c (test_large): Simplify print statements a bit.
314
315 2017-10-02 Ian Lance Taylor <iant@golang.org>
316
317 * ztest.c: #include <errno.h>.
318 (TEST_TIMING): Don't define, don't test.
319 (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME.
320 (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise.
321 (ZLIB_CLOCK_GETTIME_ARG): Define.
322 * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK.
323 * Makefile.am: Likewise.
324 * configure, Makefile.in: Rebuild.
325
326 2017-10-02 Thomas Schwinge <thomas@codesourcery.com>
327
328 PR other/67165
329 * Makefile.am: Append the content of clock_gettime_link to
330 ztest_LDADD.
331 * configure.ac: Test for the case that clock_gettime is in librt.
332 * Makefile.in: Regenerate.
333 * configure: Likewise.
334
335 PR other/67165
336 * configure.ac: Check for clock_gettime.
337 * config.h.in: Regenerate.
338 * configure: Likewise.
339 * ztest.c (average_time, test_large): Conditionalize test timing
340 on clock_gettime availability.
341
342 2017-09-29 Tony Reix <tony.reix@atos.net>
343
344 * xcoff.c: Initial support for DWARF debug sections in XCOFF.
345 (STYP_DWARF, SSUBTYP_DW*): Define.
346 (enum dwarf_section): Define.
347 (struct dwsect_info): Define.
348 (xcoff_add): Look for DWARF sections, pass them to
349 backtrace_dwarf_add.
350
351 2017-09-28 Ian Lance Taylor <iant@golang.org>
352
353 PR other/67165
354 * elf.c (__builtin_prefetch): Define if not __GNUC__.
355 (unlikely): Define.
356 (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define.
357 (b_elf_chdr): Define type.
358 (enum debug_section): Add ZDEBUG_xxx values.
359 (debug_section_names): Add names for new sections.
360 (struct debug_section_info): Add compressed field.
361 (elf_zlib_failed, elf_zlib_fetch): New static functions.
362 (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define.
363 (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define.
364 (HUFFMAN_SECONDARY_SHIFT): Define.
365 (ZDEBUG_TABLE_SIZE): Define.
366 (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define.
367 (final_next_secondary): New static variable if
368 BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE.
369 (elf_zlib_inflate_table): New static function.
370 (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main
371 function to produce fixed Huffman table.
372 (elf_zlib_default_table): New static variable.
373 (elf_zlib_inflate): New static function.
374 (elf_zlib_verify_checksum): Likewise.
375 (elf_zlib_inflate_and_verify): Likewise.
376 (elf_uncompress_zdebug): Likewise.
377 (elf_uncompress_chdr): Likewise.
378 (backtrace_uncompress_zdebug): New extern function.
379 (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug
380 sections, and uncompress them.
381 * internal.h (backtrace_compress_zdebug): Declare.
382 * ztest.c: New file.
383 * configure.ac: Check for -lz and check whether the linker
384 supports --compress-debug-sections.
385 * Makefile.am (ztest_SOURCES): New variable.
386 (ztest_CFLAGS, ztest_LDADD): New variables.
387 (check_PROGRAMS): Add ztest.
388 (ctestg_SOURCES): New variable.
389 (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables.
390 (ctesta_SOURCES): New variable.
391 (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables.
392 (check_PROGRAMS): Add ctestg and ctesta.
393 * configure, config.h.in, Makefile.in: Rebuild.
394
395 2017-09-22 Ian Lance Taylor <iant@golang.org>
396
397 PR sanitizer/77631
398 * configure.ac: Check for lstat and readlink.
399 * elf.c (lstat, readlink): Provide dummy versions if real versions
400 are not available.
401 * configure, config.h.in: Rebuild.
402
403 2017-09-21 Ian Lance Taylor <iant@google.com>
404
405 PR go/82284
406 * elf.c (backtrace_initialize): Set pd.exe_filename.
407
408 2017-09-20 Ian Lance Taylor <iant@golang.org>
409 Denis Khalikov <d.khalikov@partner.samsung.com>
410
411 PR sanitizer/77631
412 Support for external debug info.
413 * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>.
414 (S_ISLNK): Define if not defined.
415 (xstrnlen): Define if strnlen is not available.
416 (b_elf_note): Define type.
417 (NT_GNU_BUILD_ID): Define macro.
418 (elf_crc32, elf_crc32_file): New static functions.
419 (elf_is_symlink, elf_readlink): New static functions.
420 (elf_open_debugfile_by_buildid): New static function.
421 (elf_try_debugfile): New static function.
422 (elf_find_debugfile_by_debuglink): New static function.
423 (elf_open_debugfile_by_debuglink): New static function.
424 (elf_add): Add filename and debuginfo parameters. Adjust all
425 callers. Look for external debug info notes, and try to fetch
426 debug info from external file.
427 (struct phdr_data): Add exe_filename field.
428 (phdr_callback): Pass filename to elf_add.
429 (backtrace_initialize): Add filename parameter.
430 * internal.h (backtrace_initialize): Add filename parameter.
431 * fileline.c (fileline_initialize): Pass filename to
432 backtrace_initialize.
433 * pecoff.c (fileline_initialize): Add unused filename parameter.
434 * unknown.c (fileline_initialize): Likewise.
435 * xcoff.c (fileline_initialize): Likewise.
436 * configure.ac: Check for objcopy --add-gnu-debuglink.
437 * Makefile.am (dtest): New test target.
438 * configure, Makefile.in: Rebuild.
439
440 2017-09-12 Steve Ellcey <sellcey@cavium.com>
441
442 PR other/81096
443 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS)
444 * Makefile.in: Regenerate.
445
446 2017-09-12 Steve Ellcey <sellcey@cavium.com>
447
448 PR other/81096
449 * libbacktrace/Makefile.in
450 (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS)
451
452 2017-08-02 David Edelsohn <dje.gcc@gmail.com>
453
454 PR bootstrap/81638
455 * xcoff.c (xcoff_process_linenos): Initialize incl to NULL.
456
457 2017-07-28 Tony Reix <tony.reix@atos.net>
458
459 * xcoff.c: Don't leak a file descriptor if an archive is malformed.
460
461 2017-07-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
462
463 * fileline.c (fileline_initialize): Print pid_t as long.
464
465 2017-07-26 Tony Reix <tony.reix@atos.net>
466
467 * configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery.
468 * filetype.awk: Separate AIX XCOFF32 and XCOFF64.
469 * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats.
470 * configure, config.h.in: Regenerate.
471
472 2017-07-21 Tony Reix <tony.reix@atos.net>
473
474 * filetype.awk: Add AIX XCOFF type detection.
475 * configure.ac: Recognize xcoff format.
476 * Makefile.am (FORMAT_FILES): Add xcoff.c.
477 * fileline.c: Include <unistd.h>.
478 (fileline_initialize): Add case for AIX procfs.
479 * xcoff.c: New file.
480 * configure, Makefile.in: Rebuild.
481
482 2017-06-21 Richard Biener <rguenther@suse.de>
483
484 * configure.ac: Add AC_SYS_LARGEFILE.
485 * config.h.in: Regenerate.
486 * configure: Likewise.
487
488 2017-06-11 Ian Lance Taylor <iant@golang.org>
489
490 * elf.c (backtrace_initialize): Always set *fileline_fn.
491 * ttest.c: New file.
492 * btest.c: Move support functions into testlib.c. Change calls to
493 check to pass file name.
494 * testlib.c: New file, copied from (part of) btest.c.
495 * testlib.h: New file, declarations for testlib.c.
496 * edtest.c: Use testlib.h and testlib.c.
497 * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional.
498 * Makefile.am (btest_SOURCES): Add testlib.c.
499 (edtest_SOURCES): Likewise.
500 (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD.
501 (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define.
502 * configure, Makefile.in: Rebuild.
503
504 2017-05-19 Than McIntosh <thanm@google.com>
505
506 * dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.
507 (read_line_header): Don't allocate dirs if dirs_count == 0.
508 * edtest.c: New file.
509 * edtest2.c: New file.
510 * Makefile.am (edtest_SOURCES, edtest_LDADD): Define.
511 (check_PROGRAMS): Add edtest.
512 (edtest2_build.c, gen_edtest2_build): New targets.
513 * Makefile.in: Rebuild.
514
515 2017-03-08 Sam Thursfield <sam.thursfield@codethink.co.uk>
516
517 * btest.c (test5): Replace #ifdef guard with 'unused' attribute
518 to fix compile warning when BACKTRACE_SUPPORTED isn't defined.
519
520 2017-01-01 Jakub Jelinek <jakub@redhat.com>
521
522 Update copyright years.
523
524 2016-11-15 Matthias Klose <doko@ubuntu.com>
525
526 * configure: Regenerate.
527
528 2016-09-11 Carlos Liam <carlos@aarzee.me>
529
530 * all: Remove meaningless trailing whitespace.
531
532 2016-05-18 Uros Bizjak <ubizjak@gmail.com>
533
534 PR target/71161
535 * elf.c (phdr_callback) [__i386__]: Add
536 __attribute__((__force_align_arg_pointer__)).
537
538 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com>
539
540 * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to
541 avoid possible crash.
542 (elf_add): Don't set *fileline_fn to elf_nodebug value in case of
543 missing debug info anymore.
544
545 2016-02-06 John David Anglin <danglin@gcc.gnu.org>
546
547 * mmap.c (MAP_FAILED): Define if not defined.
548
549 2016-01-04 Jakub Jelinek <jakub@redhat.com>
550
551 Update copyright years.
552
553 2015-12-18 Andris Pavenis <andris.pavenis@iki.fi>
554
555 * configure.ac: Specify that DJGPP do not have mmap
556 even when sys/mman.h exists.
557 * configure: Regenerate
558
559 2015-12-09 John David Anglin <danglin@gcc.gnu.org>
560
561 PR libgfortran/68115
562 * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*.
563 * configure: Regenerate.
564 * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call
565 to void.
566
567 2015-09-17 Ian Lance Taylor <iant@google.com>
568
569 * posix.c (backtrace_open): Cast second argument of open() to int.
570
571 2015-09-11 Ian Lance Taylor <iant@google.com>
572
573 * Makefile.am (backtrace.lo): Depend on internal.h.
574 (sort.lo, stest.lo): Add explicit dependencies.
575 * Makefile.in: Rebuild.
576
577 2015-09-09 Hans-Peter Nilsson <hp@axis.com>
578
579 * backtrace.c: #include <sys/types.h>.
580
581 2015-09-08 Ian Lance Taylor <iant@google.com>
582
583 PR other/67457
584 * backtrace.c: #include "internal.h".
585 (struct backtrace_data): Add can_alloc field.
586 (unwind): If can_alloc is false, don't try to get file/line
587 information.
588 (backtrace_full): Set can_alloc field in bdata.
589 * alloc.c (backtrace_alloc): Don't call error_callback if it is
590 NULL.
591 * mmap.c (backtrace_alloc): Likewise.
592 * internal.h: Update comments for backtrace_alloc and
593 backtrace_free.
594
595 2015-09-08 Ian Lance Taylor <iant@google.com>
596
597 PR other/67457
598 * mmap.c (backtrace_alloc): Correct test for mmap failure.
599
600 2015-08-31 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
601
602 * configure.ac: For spu-*-* targets, set have_fcntl to no.
603 * configure: Regenerate.
604
605 2015-08-27 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
606
607 * configure.ac: Remove [disable-shared] argument to LT_INIT.
608 Remove setting PIC_FLAG when building as target library.
609 * configure: Regenerate.
610
611 2015-08-26 Hans-Peter Nilsson <hp@axis.com>
612
613 * configure.ac: Only compile with -fPIC if the target
614 supports it.
615 * configure: Regenerate.
616
617 2015-08-24 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
618
619 * configure.ac: Set have_mmap to no on spu-*-* targets.
620 * configure: Regenerate.
621
622 2015-08-13 Ian Lance Taylor <iant@google.com>
623
624 * dwarf.c (read_function_entry): Add vec_inlined parameter.
625 Change all callers.
626
627 2015-06-11 Martin Sebor <msebor@redhat.com>
628
629 PR sanitizer/65479
630 * dwarf.c (struct line): Add new field idx.
631 (line_compare): Use it.
632 (add_line): Set it.
633 (read_line_info): Reset it.
634
635 2015-05-29 Tristan Gingold <gingold@adacore.com>
636
637 * pecoff.c: New file.
638 * Makefile.am (FORMAT_FILES): Add pecoff.c and dependencies.
639 * Makefile.in: Regenerate.
640 * filetype.awk: Detect pecoff.
641 * configure.ac: Define BACKTRACE_SUPPORTS_DATA on elf platforms.
642 Add pecoff.
643 * btest.c (test5): Test enabled only if BACKTRACE_SUPPORTS_DATA is
644 true.
645 * backtrace-supported.h.in (BACKTRACE_SUPPORTS_DATA): Define.
646 * configure: Regenerate.
647 * pecoff.c: New file.
648
649 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
650
651 * Makefile.in: Regenerated with automake-1.11.6.
652 * aclocal.m4: Likewise.
653 * configure: Likewise.
654
655 2015-01-24 Matthias Klose <doko@ubuntu.com>
656
657 * configure.ac: Move AM_ENABLE_MULTILIB before AC_PROG_CC.
658 * configure: Regenerate.
659
660 2015-01-05 Jakub Jelinek <jakub@redhat.com>
661
662 Update copyright years.
663
664 2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
665
666 PR bootstrap/63784
667 * configure: Regenerated.
668
669 2014-11-11 David Malcolm <dmalcolm@redhat.com>
670
671 * ChangeLog.jit: New.
672
673 2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
674
675 PR target/63610
676 * configure: Regenerate.
677
678 2014-10-23 Ian Lance Taylor <iant@google.com>
679
680 * internal.h (backtrace_atomic_load_pointer) [no atomic or sync]:
681 Fix to return void *.
682
683 2014-05-08 Ian Lance Taylor <iant@google.com>
684
685 * mmap.c (backtrace_free): If freeing a large aligned block of
686 memory, call munmap rather than holding onto it.
687 (backtrace_vector_grow): When growing a vector, double the number
688 of pages requested. When releasing the old version of a grown
689 vector, pass the correct size to backtrace_free.
690
691 2014-03-07 Ian Lance Taylor <iant@google.com>
692
693 * sort.c (backtrace_qsort): Use middle element as pivot.
694
695 2014-03-06 Ian Lance Taylor <iant@google.com>
696
697 * sort.c: New file.
698 * stest.c: New file.
699 * internal.h (backtrace_qsort): Declare.
700 * dwarf.c (read_abbrevs): Call backtrace_qsort instead of qsort.
701 (read_line_info, read_function_entry): Likewise.
702 (read_function_info, build_dwarf_data): Likewise.
703 * elf.c (elf_initialize_syminfo): Likewise.
704 * Makefile.am (libbacktrace_la_SOURCES): Add sort.c.
705 (stest_SOURCES, stest_LDADD): Define.
706 (check_PROGRAMS): Add stest.
707
708 2014-02-07 Misty De Meo <misty@brew.sh>
709
710 PR target/58710
711 * configure.ac: Use AC_LINK_IFELSE in check for
712 _Unwind_GetIPInfo.
713 * configure: Regenerate.
714
715 2014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
716
717 Update copyright years
718
719 2013-12-06 Jakub Jelinek <jakub@redhat.com>
720
721 * elf.c (ET_DYN): Undefine and define again.
722 (elf_add): Add exe argument, if true and ehdr.e_type is ET_DYN,
723 return early -1 without closing the descriptor.
724 (struct phdr_data): Add exe_descriptor.
725 (phdr_callback): If pd->exe_descriptor is not -1, for very first
726 call if dlpi_name is NULL just call elf_add with the exe_descriptor,
727 otherwise backtrace_close the exe_descriptor if not -1. Adjust
728 call to elf_add.
729 (backtrace_initialize): Adjust call to elf_add. If it returns
730 -1, set pd.exe_descriptor to descriptor, otherwise set it to -1.
731
732 2013-12-05 Ian Lance Taylor <iant@google.com>
733
734 * alloc.c (backtrace_vector_finish): Add error_callback and data
735 parameters. Call backtrace_vector_release. Return address base.
736 * mmap.c (backtrace_vector_finish): Add error_callback and data
737 parameters. Return address base.
738 * dwarf.c (read_function_info): Get new address base from
739 backtrace_vector_finish.
740 * internal.h (backtrace_vector_finish): Update declaration.
741
742 2013-11-27 Ian Lance Taylor <iant@google.com>
743
744 * dwarf.c (find_address_ranges): New static function, broken out
745 of build_address_map.
746 (build_address_map): Call it.
747 * btest.c (check): Check for missing filename or function, rather
748 than crashing.
749 (f3): Check that enough frames were returned.
750
751 2013-11-19 Jakub Jelinek <jakub@redhat.com>
752
753 * backtrace.h (backtrace_syminfo_callback): Add symsize argument.
754 * elf.c (elf_syminfo): Pass 0 or sym->size to the callback as
755 last argument.
756 * btest.c (struct symdata): Add size field.
757 (callback_three): Add symsize argument. Copy it to the data->size
758 field.
759 (f23): Set symdata.size to 0.
760 (test5): Likewise. If sizeof (int) > 1, lookup address of
761 ((uintptr_t) &global) + 1. Verify symdata.val and symdata.size
762 values.
763
764 * atomic.c: Include sys/types.h.
765
766 2013-11-18 Ian Lance Taylor <iant@google.com>
767
768 * configure.ac: Check for support of __atomic extensions.
769 * internal.h: Declare or #define atomic functions for use in
770 backtrace code.
771 * atomic.c: New file.
772 * dwarf.c (dwarf_lookup_pc): Use atomic functions.
773 (dwarf_fileline, backtrace_dwarf_add): Likewise.
774 * elf.c (elf_add_syminfo_data, elf_syminfo): Likewise.
775 (backtrace_initialize): Likewise.
776 * fileline.c (fileline_initialize): Likewise.
777 * Makefile.am (libbacktrace_la_SOURCES): Add atomic.c.
778 * configure, config.h.in, Makefile.in: Rebuild.
779
780 2013-11-18 Jakub Jelinek <jakub@redhat.com>
781
782 * elf.c (SHN_UNDEF): Define.
783 (elf_initialize_syminfo): Add base_address argument. Ignore symbols
784 with st_shndx == SHN_UNDEF. Add base_address to address fields.
785 (elf_add): Adjust caller.
786
787 * elf.c (phdr_callback): Process info->dlpi_addr == 0 normally.
788
789 2013-11-16 Ian Lance Taylor <iant@google.com>
790
791 * backtrace.h (backtrace_create_state): Correct comment about
792 threading.
793
794 2013-11-15 Ian Lance Taylor <iant@google.com>
795
796 * backtrace.h (backtrace_syminfo): Update comment and parameter
797 name to take any address, not just a PC value.
798 * elf.c (STT_OBJECT): Define.
799 (elf_nosyms): Rename parameter pc to addr.
800 (elf_symbol_search): Rename local variable pc to addr.
801 (elf_initialize_syminfo): Add STT_OBJECT symbols to elf_symbols.
802 (elf_syminfo): Rename parameter pc to addr.
803 * btest.c (global): New global variable.
804 (test5): New test.
805 (main): Call test5.
806
807 2013-10-17 Ian Lance Taylor <iant@google.com>
808
809 * elf.c (elf_add): Don't get the wrong offsets if a debug section
810 is missing.
811
812 2013-10-15 David Malcolm <dmalcolm@redhat.com>
813
814 * configure.ac: Add --enable-host-shared, setting up
815 pre-existing PIC_FLAG variable within Makefile.am et al.
816 * configure: Regenerate.
817
818 2013-09-20 Alan Modra <amodra@gmail.com>
819
820 * configure: Regenerate.
821
822 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
823
824 * elf.c (elf_syminfo): Loop over the elf_syminfo_data chain.
825
826 2013-07-23 Alexander Monakov <amonakov@ispras.ru>
827
828 * elf.c (backtrace_initialize): Pass elf_fileline_fn to
829 dl_iterate_phdr callbacks.
830
831 2013-03-25 Ian Lance Taylor <iant@google.com>
832
833 * alloc.c: #include <sys/types.h>.
834 * mmap.c: Likewise.
835
836 2013-01-31 Ian Lance Taylor <iant@google.com>
837
838 * dwarf.c (read_function_info): Permit fvec parameter to be NULL.
839 (dwarf_lookup_pc): Don't use ddata->fvec if threaded.
840
841 2013-01-25 Jakub Jelinek <jakub@redhat.com>
842
843 PR other/56076
844 * dwarf.c (read_line_header): Don't crash if DW_AT_comp_dir
845 attribute was not seen.
846
847 2013-01-16 Ian Lance Taylor <iant@google.com>
848
849 * dwarf.c (struct unit): Add filename and abs_filename fields.
850 (build_address_map): Set new fields when reading unit.
851 (dwarf_lookup_pc): If we don't find an entry in the line table,
852 just return the main file name.
853
854 2013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
855
856 Update copyright years.
857
858 2013-01-01 Ian Lance Taylor <iant@google.com>
859
860 PR bootstrap/54834
861 * Makefile.am (AM_CPPFLAGS): Remove -I ../gcc/include and -I
862 $(MULTIBUILDTOP)/../../gcc/include.
863 * Makefile.in: Rebuild.
864
865 2013-01-01 Ian Lance Taylor <iant@google.com>
866
867 PR other/55536
868 * mmap.c (backtrace_alloc): Don't call sync functions if not
869 threaded.
870 (backtrace_free): Likewise.
871
872 2012-12-12 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
873
874 * mmapio.c: Define MAP_FAILED if not defined.
875
876 2012-12-11 Jakub Jelinek <jakub@redhat.com>
877
878 PR bootstrap/54926
879 * Makefile.am (AM_CFLAGS): Remove -frandom-seed=$@.
880 * configure.ac: If --with-target-subdir, add -frandom-seed=$@
881 to EXTRA_FLAGS unconditionally, otherwise check whether the compiler
882 accepts it.
883 * Makefile.in: Regenerated.
884 * configure: Regenerated.
885
886 2012-12-07 Jakub Jelinek <jakub@redhat.com>
887
888 PR bootstrap/54926
889 * Makefile.am (AM_CFLAGS): Add -frandom-seed=$@.
890 * Makefile.in: Regenerated.
891
892 2012-11-20 Ian Lance Taylor <iant@google.com>
893
894 * dwarf.c (read_attribute): Always clear val.
895
896 2012-11-13 Ian Lance Taylor <iant@google.com>
897
898 PR other/55312
899 * configure.ac: Only add -Werror if building a target library.
900 * configure: Rebuild.
901
902 2012-11-12 Ian Lance Taylor <iant@google.com>
903 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
904 Gerald Pfeifer <gerald@pfeifer.com>
905
906 * configure.ac: Check for getexecname.
907 * fileline.c: #include <errno.h>. Define getexecname if not
908 available.
909 (fileline_initialize): Try to find the executable in a few
910 different ways.
911 * print.c (error_callback): Only print the filename if it came
912 from the backtrace state.
913 * configure, config.h.in: Rebuild.
914
915 2012-10-29 Ian Lance Taylor <iant@google.com>
916
917 * mmap.c (backtrace_vector_release): Correct last patch: add
918 aligned, not size.
919
920 2012-10-29 Ian Lance Taylor <iant@google.com>
921
922 * mmap.c (backtrace_vector_release): Make sure freed block is
923 aligned on 8-byte boundary.
924
925 2012-10-26 Ian Lance Taylor <iant@google.com>
926
927 PR other/55087
928 * posix.c (backtrace_open): Add does_not_exist parameter.
929 * elf.c (phdr_callback): Do not warn if shared library could not
930 be opened.
931 * fileline.c (fileline_initialize): Update calls to
932 backtrace_open.
933 * internal.h (backtrace_open): Update declaration.
934
935 2012-10-26 Jack Howarth <howarth@bromo.med.uc.edu>
936
937 PR target/55061
938 * configure.ac: Check for _Unwind_GetIPInfo function declaration.
939 * configure: Regenerate.
940
941 2012-10-24 Ian Lance Taylor <iant@google.com>
942
943 PR target/55061
944 * configure.ac: Check whether -funwind-tables option works.
945 * configure: Rebuild.
946
947 2012-10-11 Ian Lance Taylor <iant@google.com>
948
949 * configure.ac: Do not use dl_iterate_phdr on Solaris 10.
950 * configure: Rebuild.
951
952 2012-10-10 Ian Lance Taylor <iant@google.com>
953
954 * elf.c: Rename all Elf typedefs to start with b_elf, and be all
955 lower case.
956
957 2012-10-10 Hans-Peter Nilsson <hp@bitrange.com>
958
959 * elf.c (elf_add_syminfo_data): Add casts to avoid warning.
960
961 2012-10-09 Ian Lance Taylor <iant@google.com>
962
963 * dwarf.c (dwarf_fileline): Add cast to avoid warning.
964 (backtrace_dwarf_add): Likewise.
965
966 2012-10-09 Ian Lance Taylor <iant@google.com>
967
968 Add support for tracing through shared libraries.
969 * configure.ac: Check for link.h and dl_iterate_phdr.
970 * elf.c: #include <link.h> if system has dl_iterate_phdr. #undef
971 ELF macros before #defining them.
972 (dl_phdr_info, dl_iterate_phdr): Define if system does not have
973 dl_iterate_phdr.
974 (struct elf_syminfo_data): Add next field.
975 (elf_initialize_syminfo): Initialize next field.
976 (elf_add_syminfo_data): New static function.
977 (elf_add): New static function, broken out of
978 backtrace_initialize. Call backtrace_dwarf_add instead of
979 backtrace_dwarf_initialize.
980 (struct phdr_data): Define.
981 (phdr_callback): New static function.
982 (backtrace_initialize): Call elf_add.
983 * dwarf.c (struct dwarf_data): Add next and base_address fields.
984 (add_unit_addr): Add base_address parameter. Change all callers.
985 (add_unit_ranges, build_address_map): Likewise.
986 (add_line): Add ddata parameter. Change all callers.
987 (read_line_program, add_function_range): Likewise.
988 (dwarf_lookup_pc): New static function, broken out of
989 dwarf_fileline.
990 (dwarf_fileline): Call dwarf_lookup_pc.
991 (build_dwarf_data): New static function.
992 (backtrace_dwarf_add): New function.
993 (backtrace_dwarf_initialize): Remove.
994 * internal.h (backtrace_dwarf_initialize): Don't declare.
995 (backtrace_dwarf_add): Declare.
996 * configure, config.h.in: Rebuild.
997
998 2012-10-04 Gerald Pfeifer <gerald@pfeifer.com>
999
1000 * btest.c (f23): Avoid uninitialized variable warning.
1001
1002 2012-10-04 Ian Lance Taylor <iant@google.com>
1003
1004 * dwarf.c: If the system header files do not declare strnlen,
1005 provide our own version.
1006
1007 2012-10-03 Ian Lance Taylor <iant@google.com>
1008
1009 * dwarf.c (read_uleb128): Fix overflow test.
1010 (read_sleb128): Likewise.
1011 (build_address_map): Don't change unit_buf.start.
1012
1013 2012-10-02 Uros Bizjak <ubizjak@gmail.com>
1014
1015 PR other/54761
1016 * configure.ac (EXTRA_FLAGS): New.
1017 * Makefile.am (AM_FLAGS): Add $(EXTRA_FLAGS).
1018 * configure, Makefile.in: Regenerate.
1019
1020 2012-09-29 Ian Lance Taylor <iant@google.com>
1021
1022 PR other/54749
1023 * fileline.c (fileline_initialize): Pass errnum as -1 when
1024 reporting that we could not read executable information after a
1025 previous failure.
1026
1027 2012-09-27 Ian Lance Taylor <iant@google.com>
1028
1029 PR bootstrap/54732
1030 * configure.ac: Add no-dependencies to AM_INIT_AUTOMAKE.
1031 * Makefile.am: Add dependencies for all objects.
1032 * configure, aclocal.m4, Makefile.in: Rebuild.
1033
1034 2012-09-27 Ian Lance Taylor <iant@google.com>
1035
1036 PR other/54726
1037 * elf.c (backtrace_initialize): Set *fileln_fn, not
1038 state->fileln_fn.
1039
1040 2012-09-19 Ian Lance Taylor <iant@google.com>
1041
1042 * configure.ac: Only use GCC_CHECK_UNWIND_GETIPINFO when compiled
1043 as a target library.
1044 * configure: Rebuild.
1045
1046 2012-09-19 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1047 Ian Lance Taylor <iant@google.com>
1048
1049 * configure.ac (GCC_HEADER_STDINT): Invoke.
1050 * backtrace.h: If we can't find <stdint.h>, use "gstdint.h".
1051 * btest.c: Don't include <stdint.h>.
1052 * dwarf.c: Likewise.
1053 * configure, aclocal.m4, Makefile.in, config.h.in: Rebuild.
1054
1055 2012-09-18 Ian Lance Taylor <iant@google.com>
1056
1057 PR bootstrap/54623
1058 * Makefile.am (AM_CPPFLAGS): Define.
1059 (AM_CFLAGS): Remove -I options.
1060 * Makefile.in: Rebuild.
1061
1062 2012-09-18 Ian Lance Taylor <iant@google.com>
1063
1064 * posix.c (O_BINARY): Define if not defined.
1065 (backtrace_open): Pass O_BINARY to open. Only call fcntl if
1066 HAVE_FCNTL is defined.
1067 * configure.ac: Test for the fcntl function.
1068 * configure, config.h.in: Rebuild.
1069
1070 2012-09-18 Ian Lance Taylor <iant@google.com>
1071
1072 * btest.c (test1, test2, test3, test4): Add the unused attribute.
1073
1074 2012-09-18 Ian Lance Taylor <iant@google.com>
1075
1076 * dwarf.c: Correct test of HAVE_DECL_STRNLEN.
1077
1078 2012-09-18 Ian Lance Taylor <iant@google.com>
1079
1080 * configure.ac: Add AC_USE_SYSTEM_EXTENSIONS.
1081 * mmapio.c: Don't define _GNU_SOURCE.
1082 * configure, config.h.in: Rebuild.
1083
1084 2012-09-18 Ian Lance Taylor <iant@google.com>
1085
1086 * configure.ac: Check whether strnlen is declared.
1087 * dwarf.c: Declare strnlen if not declared.
1088 * configure, config.h.in: Rebuild.
1089
1090 2012-09-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1091
1092 * fileline.c: Include <stdlib.h>.
1093 * mmap.c: Likewise.
1094
1095 2012-09-17 Ian Lance Taylor <iant@google.com>
1096
1097 PR bootstrap/54611
1098 * nounwind.c (backtrace_full): Rename from backtrace. Add state
1099 parameter.
1100
1101 2012-09-17 Gerald Pfeifer <gerald@pfeifer.com>
1102
1103 PR bootstrap/54611
1104 * nounwind.c (backtrace_simple): Add state parameter.
1105
1106 2012-09-17 Ian Lance Taylor <iant@google.com>
1107
1108 PR bootstrap/54609
1109 * unknown.c (unknown_fileline): Add state parameter, remove
1110 fileline_data parameter, name error_callback parameter.
1111 (backtrace_initialize): Add state parameter.
1112
1113 2012-09-17 Ian Lance Taylor <iant@google.com>
1114
1115 * Initial implementation.
1116 \f
1117 Copyright (C) 2012-2019 Free Software Foundation, Inc.
1118
1119 Copying and distribution of this file, with or without modification,
1120 are permitted in any medium without royalty provided the copyright
1121 notice and this notice are preserved.