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