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