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