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