aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace
AgeCommit message (Collapse)AuthorFilesLines
2018-04-24Regenerate configure of target librariesH.J. Lu2-1/+5
* configure: Regenerated. From-SVN: r259610
2018-04-19cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace ↵Jakub Jelinek2-7/+10
--enable-cet=default with --enable-cet=auto. * config/cet.m4 (GCC_CET_FLAGS): Default to --disable-cet, replace --enable-cet=default with --enable-cet=auto. * doc/install.texi: Document --disable-cet being the default and --enable-cet=auto. * configure: Regenerated. From-SVN: r259487
2018-04-17backtrace.c: Revert last two changes.Ian Lance Taylor2-34/+16
* backtrace.c: Revert last two changes. Don't call mmap directly. From-SVN: r259440
2018-04-17backtrace.c: Include backtrace-supported.h before checking ↵Ian Lance Taylor2-1/+7
BACKTRACE_USES_MALLOC. * backtrace.c: Include backtrace-supported.h before checking BACKTRACE_USES_MALLOC. From-SVN: r259439
2018-04-17backtrace.c (backtrace_full): When testing whether we can allocate memory...Ian Lance Taylor2-11/+38
* backtrace.c (backtrace_full): When testing whether we can allocate memory, call mmap directly, and munmap the memory. Fixes https://github.com/ianlancetaylor/libbacktrace/issues/13 . From-SVN: r259434
2018-04-04re PR other/85161 (Test case failures in libbacktrace on powerpc64 BE ↵Jakub Jelinek2-1/+15
starting with r253456) PR other/85161 * elf.c (elf_zlib_fetch): Fix up predefined macro names in test for big endian, only use 32-bit loads if endianity macros are predefined and indicate big or little endian. From-SVN: r259096
2018-02-19CET shouldn't be enabled in 32-bit run-time libraries by defualtIgor Tsimbalist2-1/+21
ENDBR32 and RDSSPD are multi-byte NOPs on x86-64 processors and newer x86 processors, starting Pentium Pro. They are UD on older 32-bit processors. Detect this at configure time and adjust the default value for enable_cet. GCC will enable CET in 32-bit run-time libraries in any case if --enable-cet is used to configure GCC. PR target/84148 * config/cet.m4: Check if target support multi-byte NOPS (SSE). * libatomic/configure: Regenerate. * libbacktrace/configure: Likewise. * libgcc/configure: Likewise. * libgfortran/configure: Likewise. * libgomp/configure: Likewise. * libitm/configure: Likewise. * libmpx/configure: Likewise. * libobjc/configure: Likewise. * libquadmath/configure: Likewise. * libsanitizer/configure: Likewise. * libssp/configure: Likewise. * libstdc++-v3/configure: Likewise. * libvtv/configure: Likewise. From-SVN: r257809
2018-02-15re PR other/82368 (with r253275 several new test cases in libbacktrace fail)Jakub Jelinek2-0/+7
PR other/82368 * elf.c (SHT_PROGBITS): Undefine and define. From-SVN: r257685
2018-02-14re PR other/82368 (with r253275 several new test cases in libbacktrace fail)Jakub Jelinek2-3/+70
PR other/82368 * elf.c (EM_PPC64, EF_PPC64_ABI): Undefine and define. (struct elf_ppc64_opd_data): New type. (elf_initialize_syminfo): Add opd argument, handle symbols pointing into the PowerPC64 ELFv1 .opd section. (elf_add): Read .opd section on PowerPC64 ELFv1, pass pointer to structure with .opd data to elf_initialize_syminfo. From-SVN: r257658
2018-01-31elf.c (elf_add): Close descriptor if we use a debugfile.Ian Lance Taylor3-4/+46
* elf.c (elf_add): Close descriptor if we use a debugfile. * btest.c (check_open_files): New static function. (main): Call check_open_files. From-SVN: r257275
2018-01-25elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the desired CRC ↵Ian Lance Taylor2-7/+20
is zero. * elf.c (elf_open_debugfile_by_debuglink): Don't check CRC if the desired CRC is zero. (elf_add): Don't clear *found_sym and *found_dwarf if debuginfo. From-SVN: r257062
2018-01-25* pecoff.c (coff_add): Only release syms_view if it is valid.Ian Lance Taylor2-2/+9
From-SVN: r257053
2018-01-25* pecoff.c (coff_add): Another memcpy -> coff_read4 fix.Ian Lance Taylor2-2/+6
From-SVN: r257052
2018-01-25* pecoff.c (coff_add): Use coff_read4, not memcpy.Ian Lance Taylor2-1/+5
From-SVN: r257040
2018-01-25re PR other/68239 (libbacktrace allocation is sometimes very slow)Ian Lance Taylor2-1/+29
PR other/68239 * mmap.c (backtrace_free_locked): Don't put more than 16 entries on the free list. From-SVN: r257039
2018-01-19xcoff.c (xcoff_incl_compare): New function.Tony Reix2-9/+50
* xcoff.c (xcoff_incl_compare): New function. (xcoff_incl_search): New function. (xcoff_process_linenos): Use bsearch to find include file. (xcoff_initialize_fileline): Sort include file information. From-SVN: r256895
2018-01-17elf.c (codes): Fix size to be 288.Ian Lance Taylor3-37/+174
* elf.c (codes) [GENERATE_FIXED_HUFFMAN_TABLE]: Fix size to be 288. (main) [GENERATE_FIXED_HUFFMAN_TABLE]: Pass 288 to elf_zlib_inflate_table. Generate elf_zlib_default_dist_table. (elf_zlib_default_table): Update. (elf_zlib_default_dist_table): New static array. (elf_zlib_inflate): Use elf_zlib_default_dist_table for dist table for block type 1. * ztest.c (struct zlib_test): Add uncompressed_len. (tests): Initialize uncompressed_len field. Add new test case. (test_samples): Use uncompressed_len field. From-SVN: r256776
2018-01-03Update copyright years.Jakub Jelinek32-32/+36
From-SVN: r256169
2017-11-17Enable building libbacktrace with Intel CETIgor Tsimbalist5-3/+94
libbacktrace/ * configure.ac: Add CET_FLAGS to EXTRA_FLAGS. * aclocal.m4: Regenerate. * Makefile.in: Likewise. * configure: Likewise. From-SVN: r254892
2017-10-06ztest.c (test_large): Pass unsigned long *, not size_t *, to zlib uncompress ↵Ian Lance Taylor2-1/+9
function. * ztest.c (test_large): Pass unsigned long *, not size_t *, to zlib uncompress function. From-SVN: r253491
2017-10-05elf.c (elf_zlib_fetch): Change pval argument to uint64_t *.Ian Lance Taylor3-16/+47
* elf.c (elf_zlib_fetch): Change pval argument to uint64_t *. Read a four byte integer. (elf_zlib_inflate): Change val to uint64_t. Align pin to a 32-bit boundary before ever calling elf_zlib_fetch. * ztest.c (test_large): Simplify print statements a bit. From-SVN: r253456
2017-10-03ztest.c: #include <errno.h>.Ian Lance Taylor6-22/+48
* ztest.c: #include <errno.h>. (TEST_TIMING): Don't define, don't test. (xclock_gettime, xclockid_t): Define if !HAVE_CLOCK_GETTIME. (clockid_t, clock_gettime, CLOCK_REALTIME): Likewise. (ZLIB_CLOCK_GETTIME_ARG): Define. * configure.ac: Change clock_gettime_link to CLOCK_GETTIME_LINK. * Makefile.am: Likewise. * configure, Makefile.in: Rebuild. From-SVN: r253377
2017-10-02libbacktrace: Support the case that clock_gettime is in librtThomas Schwinge5-4/+78
libbacktrace/ PR other/67165 * Makefile.am: Append the content of clock_gettime_link to ztest_LDADD. * configure.ac: Test for the case that clock_gettime is in librt. * Makefile.in: Regenerate. * configure: Likewise. From-SVN: r253345
2017-10-02libbacktrace: Conditionalize test timing on clock_gettime availabilityThomas Schwinge5-1/+39
libbacktrace/ PR other/67165 * configure.ac: Check for clock_gettime. * config.h.in: Regenerate. * configure: Likewise. * ztest.c (average_time, test_large): Conditionalize test timing on clock_gettime availability. From-SVN: r253344
2017-09-29xcoff.c: Initial support for DWARF debug sections in XCOFF.Tony Reix2-11/+142
* xcoff.c: Initial support for DWARF debug sections in XCOFF. (STYP_DWARF, SSUBTYP_DW*): Define. (enum dwarf_section): Define. (struct dwsect_info): Define. (xcoff_add): Look for DWARF sections, pass them to backtrace_dwarf_add. From-SVN: r253297
2017-09-29re PR other/67165 (please enable libbacktrace to work with compressed debug ↵Ian Lance Taylor9-15/+2377
sections) PR other/67165 * elf.c (__builtin_prefetch): Define if not __GNUC__. (unlikely): Define. (SHF_UNCOMPRESSED, ELFCOMPRESS_ZLIB): Define. (b_elf_chdr): Define type. (enum debug_section): Add ZDEBUG_xxx values. (debug_section_names): Add names for new sections. (struct debug_section_info): Add compressed field. (elf_zlib_failed, elf_zlib_fetch): New static functions. (HUFFMAN_TABLE_SIZE, HUFFMAN_VALUE_MASK): Define. (HUFFMAN_BITS_SHIFT, HUFFMAN_BITS_MASK): Define. (HUFFMAN_SECONDARY_SHIFT): Define. (ZDEBUG_TABLE_SIZE): Define. (ZDEBUG_TABLE_CODELEN_OFFSET, ZDEBUG_TABLE_WORK_OFFSET): Define. (final_next_secondary): New static variable if BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE. (elf_zlib_inflate_table): New static function. (BACKTRACE_GENERATE_FIXED_HUFFMAN_TABLE): If define, define main function to produce fixed Huffman table. (elf_zlib_default_table): New static variable. (elf_zlib_inflate): New static function. (elf_zlib_verify_checksum): Likewise. (elf_zlib_inflate_and_verify): Likewise. (elf_uncompress_zdebug): Likewise. (elf_uncompress_chdr): Likewise. (backtrace_uncompress_zdebug): New extern function. (elf_add): Look for .zdebug sections and SHF_COMPRESSED debug sections, and uncompress them. * internal.h (backtrace_compress_zdebug): Declare. * ztest.c: New file. * configure.ac: Check for -lz and check whether the linker supports --compress-debug-sections. * Makefile.am (ztest_SOURCES): New variable. (ztest_CFLAGS, ztest_LDADD): New variables. (check_PROGRAMS): Add ztest. (ctestg_SOURCES): New variable. (ctestg_CFLAGS, ctestg_LDFLAGS, ctestg_LDADD): New variables. (ctesta_SOURCES): New variable. (ctesta_CFLAGS, ctesta_LDFLAGS, ctesta_LDADD): New variables. (check_PROGRAMS): Add ctestg and ctesta. * configure, config.h.in, Makefile.in: Rebuild. From-SVN: r253275
2017-09-22re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info ↵Ian Lance Taylor5-0/+57
is split) PR sanitizer/77631 * configure.ac: Check for lstat and readlink. * elf.c (lstat, readlink): Provide dummy versions if real versions are not available. * configure, config.h.in: Rebuild. From-SVN: r253095
2017-09-21re PR go/82284 (go -version segfaults on big endian architectures)Ian Lance Taylor2-0/+6
PR go/82284 * elf.c (backtrace_initialize): Set pd.exe_filename. From-SVN: r253078
2017-09-20re PR sanitizer/77631 (no symbols in backtrace shown by ASan when debug info ↵Ian Lance Taylor11-19/+705
is split) PR sanitizer/77631 Support for external debug info. * elf.c: Include <errno.h>, <sys/stat.h>, <unistd.h>. (S_ISLNK): Define if not defined. (xstrnlen): Define if strnlen is not available. (b_elf_note): Define type. (NT_GNU_BUILD_ID): Define macro. (elf_crc32, elf_crc32_file): New static functions. (elf_is_symlink, elf_readlink): New static functions. (elf_open_debugfile_by_buildid): New static function. (elf_try_debugfile): New static function. (elf_find_debugfile_by_debuglink): New static function. (elf_open_debugfile_by_debuglink): New static function. (elf_add): Add filename and debuginfo parameters. Adjust all callers. Look for external debug info notes, and try to fetch debug info from external file. (struct phdr_data): Add exe_filename field. (phdr_callback): Pass filename to elf_add. (backtrace_initialize): Add filename parameter. * internal.h (backtrace_initialize): Add filename parameter. * fileline.c (fileline_initialize): Pass filename to backtrace_initialize. * pecoff.c (fileline_initialize): Add unused filename parameter. * unknown.c (fileline_initialize): Likewise. * xcoff.c (fileline_initialize): Likewise. * configure.ac: Check for objcopy --add-gnu-debuglink. * Makefile.am (dtest): New test target. * configure, Makefile.in: Rebuild. Co-Authored-By: Denis Khalikov <d.khalikov@partner.samsung.com> From-SVN: r253032
2017-09-12re PR other/81096 (test case ttest in libbacktrace fails starting with its ↵Steve Ellcey2-1/+7
introduction in r249111) 2017-09-12 Steve Ellcey <sellcey@cavium.com> PR other/81096 * Makefile.am (ttest_CFLAGS): Add $(AM_CFLAGS) * Makefile.in: Regenerate. From-SVN: r252038
2017-09-12re PR other/81096 (test case ttest in libbacktrace fails starting with its ↵Steve Ellcey2-1/+7
introduction in r249111) 2017-09-12 Steve Ellcey <sellcey@cavium.com> PR other/81096 * libbacktrace/Makefile.in (HAVE_PTHREAD_TRUE@@NATIVE_TRUE@ttest_CFLAGS): Add $(AM_CFLAGS) From-SVN: r252035
2017-08-02Add PR number.David Edelsohn1-0/+1
From-SVN: r250825
2017-08-02* xcoff.c (xcoff_process_linenos): Initialize incl to NULL.David Edelsohn2-1/+5
From-SVN: r250824
2017-07-28* xcoff.c: Don't leak a file descriptor if an archive is malformed.Tony Reix2-4/+9
From-SVN: r250684
2017-07-28Fix pid_t printingRainer Orth2-1/+6
* fileline.c (fileline_initialize): Print pid_t as long. From-SVN: r250675
2017-07-26configure.ac: Check for XCOFF32/XCOFF64.Tony Reix7-33/+1544
* configure.ac: Check for XCOFF32/XCOFF64. Check for loadquery. * filetype.awk: Separate AIX XCOFF32 and XCOFF64. * xcoff.c: Add support for AIX XCOFF32 and XCOFF64 formats. * configure, config.h.in: Regenerate. From-SVN: r250590
2017-07-21filetype.awk: Add AIX XCOFF type detection.Tony Reix8-3/+109
* filetype.awk: Add AIX XCOFF type detection. * configure.ac: Recognize xcoff format. * Makefile.am (FORMAT_FILES): Add xcoff.c. * fileline.c: Include <unistd.h>. (fileline_initialize): Add case for AIX procfs. * xcoff.c: New file. * configure, Makefile.in: Rebuild. From-SVN: r250435
2017-06-21configure.ac: Add AC_SYS_LARGEFILE.Richard Biener4-2/+217
2017-06-21 Richard Biener <rguenther@suse.de> * configure.ac: Add AC_SYS_LARGEFILE. * config.h.in: Regenerate. * configure: Likewise. From-SVN: r249436
2017-06-12elf.c (backtrace_initialize): Always set *fileline_fn.Ian Lance Taylor11-420/+656
* elf.c (backtrace_initialize): Always set *fileline_fn. * ttest.c: New file. * btest.c: Move support functions into testlib.c. Change calls to check to pass file name. * testlib.c: New file, copied from (part of) btest.c. * testlib.h: New file, declarations for testlib.c. * edtest.c: Use testlib.h and testlib.c. * configure.ac: Test for -pthread, set HAVE_PTHREAD conditional. * Makefile.am (btest_SOURCES): Add testlib.c. (edtest_SOURCES): Likewise. (CHECK_PROGRAMS): Add ttest if HAVE_PTHREAD. (ttest_SOURCES, ttest_CFLAGS, ttest_LDADD): Define. * configure, Makefile.in: Rebuild. From-SVN: r249111
2017-05-19dwarf.c (free_line_header): Don't free dirs if dirs_count == 0.Than McIntosh6-15/+365
* dwarf.c (free_line_header): Don't free dirs if dirs_count == 0. (read_line_header): Don't allocate dirs if dirs_count == 0. * edtest.c: New file. * edtest2.c: New file. * Makefile.am (edtest_SOURCES, edtest_LDADD): Define. (check_PROGRAMS): Add edtest. (edtest2_build.c, gen_edtest2_build): New targets. * Makefile.in: Rebuild. From-SVN: r248295
2017-03-08btest.c (test5): Replace #ifdef guard with 'unused' attribute to fix compile ↵Sam Thursfield2-3/+6
warning when... * btest.c (test5): Replace #ifdef guard with 'unused' attribute to fix compile warning when BACKTRACE_SUPPORTED isn't defined. From-SVN: r245977
2017-01-01Update copyright years.Jakub Jelinek25-25/+29
From-SVN: r243994
2016-11-15config-ml.in: Remove references to GCJ.Matthias Klose2-1/+4
<toplevel> 2016-11-15 Matthias Klose <doko@ubuntu.com> * config-ml.in: Remove references to GCJ. * configure.ac: Likewise. * configure: Regenerate. config/ 2016-11-15 Matthias Klose <doko@ubuntu.com> multi.m4: Don't set GCJ. gcc/ 2016-11-15 Matthias Klose <doko@ubuntu.com> * doc/install.texi: Remove references to gcj/libjava. * doc/invoke.texi: Likewise. */ (where necessary) 2016-11-15 Matthias Klose <doko@ubuntu.com> * configure: Regenerate. From-SVN: r242433
2016-09-11* all: Remove meaningless trailing whitespace.Carlos Liam25-75/+79
From-SVN: r240084
2016-05-18re PR target/71161 (Lots of ASAN and libgo runtime FAILs after r236090)Uros Bizjak2-2/+12
PR target/71161 * elf.c (phdr_callback) [__i386__]: Add __attribute__((__force_align_arg_pointer__)). From-SVN: r236397
2016-03-02elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to avoid ↵Max Ostapenko2-2/+8
possible crash. libbacktrace/ 2016-03-02 Maxim Ostapenko <m.ostapenko@partner.samsung.com> * elf.c (backtrace_initialize): Properly initialize elf_fileline_fn to avoid possible crash. (elf_add): Don't set *fileline_fn to elf_nodebug value in case of missing debug info anymore. From-SVN: r233911
2016-02-06mmap.c (MAP_FAILED): Define if not defined.John David Anglin2-0/+8
* mmap.c (MAP_FAILED): Define if not defined. From-SVN: r233196
2016-01-04Update copyright years.Jakub Jelinek25-24/+34
From-SVN: r232055
2015-12-18Specify that DJGPP do not have mmap even when sys/mman.h existsAndris Pavenis3-2/+9
* configure.ac: Specify that DJGPP do not have mmap even when sys/mman.h exists * configure: Regenerate From-SVN: r231802
2015-12-10PR 68115/libfortranJohn David Anglin4-4/+19
PR 68115/libfortran * configure.ac: Set libbacktrace_cv_sys_sync to no on hppa*-*-hpux*. * configure: Regenerate. * elf.c (backtrace_initialize): Cast __sync_bool_compare_and_swap call to void. From-SVN: r231485