aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace
AgeCommit message (Collapse)AuthorFilesLines
2020-07-31Daily bump.GCC Administrator1-0/+5
2020-07-30Require CET support only for the final GCC buildH.J. Lu1-5/+18
With --enable-cet, require CET support only for the final GCC build. Don't enable CET without CET support for non-bootstrap build, in stage1 nor for build support. config/ PR bootstrap/96202 * cet.m4 (GCC_CET_HOST_FLAGS): Don't enable CET without CET support in stage1 nor for build support. gcc/ PR bootstrap/96202 * configure: Regenerated. libbacktrace/ PR bootstrap/96202 * configure: Regenerated. libcc1/ PR bootstrap/96202 * configure: Regenerated. libcpp/ PR bootstrap/96202 * configure: Regenerated. libdecnumber/ PR bootstrap/96202 * configure: Regenerated. libiberty/ PR bootstrap/96202 * configure: Regenerated. lto-plugin/ PR bootstrap/96202 * configure: Regenerated.
2020-07-09Daily bump.GCC Administrator1-0/+5
2020-07-07libbacktrace: test linker support for DWARF 5Ian Lance Taylor2-4/+12
On AIX, the compiler supports DWARF 5 but the linker does not. 2020-07-07 Clement Chigot <clement.chigot@atos.net> * configure.ac: Test linker support for DWARF5 * configure: Regenerate
2020-05-30Daily bump.GCC Administrator1-0/+5
2020-05-29Avoid nested save_CFLAGS and save_LDFLAGSH.J. Lu1-8/+9
Avoid nested save_CFLAGS and save_LDFLAGS by replacing save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS in cet.m4. config/ PR bootstrap/95413 * cet.m4: Replace save_CFLAGS and save_LDFLAGS with cet_save_CFLAGS and cet_save_LDFLAGS. gcc/ PR bootstrap/95413 * configure: Regenerated. libatomic/ PR bootstrap/95413 * configure: Regenerated. libbacktrace/ PR bootstrap/95413 * configure: Regenerated. libcc1/ PR bootstrap/95413 * configure: Regenerated. libcpp/ PR bootstrap/95413 * configure: Regenerated. libdecnumber/ PR bootstrap/95413 * configure: Regenerated. libgcc/ PR bootstrap/95413 * configure: Regenerated. libgfortran/ PR bootstrap/95413 * configure: Regenerated. libgomp/ PR bootstrap/95413 * configure: Regenerated. libiberty/ PR bootstrap/95413 * configure: Regenerated. libitm/ PR bootstrap/95413 * configure: Regenerated. libobjc/ PR bootstrap/95413 * configure: Regenerated. libphobos/ PR bootstrap/95413 * configure: Regenerated. libquadmath/ PR bootstrap/95413 * configure: Regenerated. libsanitizer/ PR bootstrap/95413 * configure: Regenerated. libssp/ PR bootstrap/95413 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95413 * configure: Regenerated. libvtv/ PR bootstrap/95413 * configure: Regenerated. lto-plugin/ PR bootstrap/95413 * configure: Regenerated. zlib/ PR bootstrap/95413 * configure: Regenerated.
2020-05-15x86: Also check if -fcf-protection worksH.J. Lu2-0/+8
When defaulting CET run-time support to auto, check if -fcf-protection works. Even if the stage1 GCC doesn't support -fcf-protection, since the final GCC does, CET run-time support will be enabled by default if binutils support CET. config/ PR bootstrap/95147 * cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works when defaulting to auto. libatomic/ PR bootstrap/95147 * configure: Regenerated. libbacktrace/ PR bootstrap/95147 * configure: Regenerated. libgcc/ PR bootstrap/95147 * configure: Regenerated. libgfortran/ PR bootstrap/95147 * configure: Regenerated. libgomp/ PR bootstrap/95147 * configure: Regenerated. libitm/ PR bootstrap/95147 * configure: Regenerated. libobjc/ PR bootstrap/95147 * configure: Regenerated. libphobos/ PR bootstrap/95147 * configure: Regenerated. libquadmath/ PR bootstrap/95147 * configure: Regenerated. libsanitizer/ PR bootstrap/95147 * configure: Regenerated. libssp/ PR bootstrap/95147 * configure: Regenerated. libstdc++-v3/ PR bootstrap/95147 * configure: Regenerated. libvtv/ PR bootstrap/95147 * configure: Regenerated. zlib/ PR bootstrap/95147 * configure: Regenerated.
2020-05-14x86: Default CET run-time support to autoH.J. Lu2-5/+15
CET has been added since GCC 8. This patch defaults CET run-time support to auto. It enables CET run-time support if asssembler supports CET instructions and multi-byte NOPs are enabled via SSE2. config/ * cet.m4 (GCC_CET_FLAGS): Change default to auto. gcc/ * configure: Regenerated. libatomic/ * configure: Regenerated. libbacktrace/ * configure: Regenerated. libcc1/ * configure: Regenerated. libcpp/ * configure: Regenerated. libdecnumber/ * configure: Regenerated. libgcc/ * configure: Regenerated. libgfortran/ * configure: Regenerated. libgomp/ * configure: Regenerated. libitm/ * configure: Regenerated. libobjc/ * configure: Regenerated. libquadmath/ * configure: Regenerated. libsanitizer/ * configure: Regenerated. libssp/ * configure: Regenerated. libstdc++-v3/ * configure: Regenerated. libvtv/ * configure: Regenerated. zlib/ * configure: Regenerated.
2020-05-13libbacktrace: mark test_large parameter unused in ztest.cIan Lance Taylor2-1/+5
libbacktrace/ * ztest.c (test_large): Mark state ATTRIBUTE_UNUSED.
2020-05-13libbacktrace: treat EACCESS like ENOENTIan Lance Taylor2-1/+11
libbacktrace/ PR go/95061 * posix.c (backtrace_open): Treat EACCESS like ENOENT.
2020-05-12libbacktrace: Enable Intel CET on Intel CET enabled host for jitH.J. Lu5-4/+201
Since on Intel CET enabled host, dlopen in Intel CET enabled applications fails on shared libraries which aren't Intel CET enabled, compile with -fcf-protection on Intel CET enabled host when jit is enabled to enable Intel CET on libgccjit. * Makefile.am (AM_CFLAGS): Add $(CET_HOST_FLAGS). * configure.ac: Add GCC_CET_HOST_FLAGS(CET_HOST_FLAGS) and AC_SUBST(CET_HOST_FLAGS). Clear CET_HOST_FLAGS if jit isn't enabled. * Makefile.in: Regenerated. * configure: Likewise.
2020-05-11libbacktrace: declare getpagesize if necessaryIan Lance Taylor7-2/+34
libbacktrace/ PR libbacktrace/95012 * configure.ac: Check for getpagesize declaration. * mmap.c: Declare getpagesize if necessary. * mmapio.c: Likewise.
2020-05-09libbacktrace: don't crash if ELF file has no sectionsIan Lance Taylor2-0/+7
libbacktrace/ * elf.c (elf_add): Bail early if there are no section headers at all.
2020-05-09libbacktrace: don't free ELF strtab if error occurs after saving syminfoIan Lance Taylor2-0/+6
* elf.c (elf_add): Don't free strtab if an error occurs after recording symbol information.
2020-05-09libbacktrace: add Mach-O supportIan Lance Taylor8-49/+1580
libbacktrace/ PR libbacktrace/88745 * macho.c: New file. * filetype.awk: Recognize Mach-O files. * Makefile.am (FORMAT_FILES): Add macho.c. (check_DATA): New variable. Set to .dSYM if HAVE_DSYMUTIL. (%.dSYM): New pattern target. (test_macho_SOURCES, test_macho_CFLAGS): New targets. (test_macho_LDADD): New target. (BUILDTESTS): Add test_macho. (macho.lo): Add dependencies. * configure.ac: Recognize macho file type. Check for mach-o/dyld.h. Don't try to run objcopy if we don't find it. Look for dsymutil and define a HAVE_DSYMUTIL conditional. * Makefile.in: Regenerate. * configure: Regenerate. * config.h.in: Regenerate.
2020-05-09libbacktrace: support short readIan Lance Taylor2-7/+19
* read.c (backtrace_get_view): Support short read.
2020-05-09libbacktrace: sometimes read debug sections individuallyIan Lance Taylor2-19/+88
libbacktrace/ * elf.c (elf_add): If debug sections are very large or far apart, read them individually rather than as a single view.
2020-05-09libbacktrace: support fetching executable name using sysctlIan Lance Taylor5-1/+201
This supports FreeBSD and NetBSD when /proc is not mounted. libbacktrace/ * fileline.c (sysctl_exec_name): New static function. (sysctl_exec_name1): New macro or static function. (sysctl_exec_name2): Likewise. (fileline_initialize): Try sysctl_exec_name[12]. * configure.ac: Check for sysctl args to fetch executable name. * configure: Regenerate. * config.h.in: Regenerate.
2020-02-15libbacktrace: update to current libgo test fileIan Lance Taylor2-2/+6
* ztest.c (test_large): Update file to current libgo test file.
2020-02-03libbacktrace: always pass -g when compiling test codeIan Lance Taylor4-64/+320
This approach required adding a few casts to ztest.c, as it is now compiled with -Wall. Fixes PR libbacktrace/90636
2020-01-01Update copyright years.Jakub Jelinek38-38/+42
From-SVN: r279813
2019-12-13libbacktrace: add DWARF 5 supportIan Lance Taylor10-167/+1213
* dwarf.c (struct attr): Add val field. (enum attr_val_encoding): Add ATTR_VAL_ADDDRESS_INDEX, ATTR_VAL_STRING_INDEX, ATTR_VAL_RNGLISTS_INDEX. (struct line_header): Add addrsize field. (struct line_header_format): Define. (struct unit): Add str_offsets_base, addr_base, and rnglists_base fields. (read_uint24): New static function. (read_attribute): Add implicit_val parameter. Replace dwarf_str and dwarf_str_size parameters with dwarf_sections parameter. Add support for new DWARF 5 forms. Change all callers. (resolve_string): New static function. (resolve_addr_index): Likewise. (read_abbrevs): Support DW_FORM_implicit_const. (struct pcrange): Add lowpc_is_addr_index, highpc_is_addr_Index, and ranges_is_index fields. (update_pcrange): Support DWARF 5 encodings. (add_high_low_range): New static function, split out of add_ranges. (add_ranges_from_ranges): Likewise. (add_ranges_from_rnglists): New static function. (add_ranges): Just call new helper functions. (find_address_ranges): Use resolve_string for strings, after reading all attributes. Handle new DWARF 5 attributes. (build_address_map): Support DWARF 5 compilation units. (read_v2_paths): New static function, split out of read_line_header. (read_lnct): New static function. (read_line_header_format_entries): Likewise. (read_line_header): Add ddata parameter. Support DWARF 5 line headers. Call new helper functions. Change all callers. (read_line_program): Use addrsize from line program header. Don't special case directory index 0 for DWARF 5. (read_referenced_name): Use resolve_string. (read_function_entry): Handle DWARF 5 encodings. Use resolve_string. * internal.h (enum dwarf_section): Add DEBUG_ADDR, DEBUG_STR_OFFSETS, DEBUG_LINE_STR, DEBUG_RNGLISTS. * elf.c (dwarf_section_names): Add new section names. * pecoff.c (dwarf_section_names): Likewise. * xcoff.c (xcoff_add): Clear dwarf_sections before setting fields. * configure.ac: Define HAVE_DWARF5 automake conditional. * Makefile.am (dwarf5_SOURCES): New variable if HAVE_DWARF5. (dwarf5_CFLAGS, dwarf5_LDADD): Likewise. (dwarf5_alloc_SOURCES, dwarf5_alloc_CFLAGS): Likewise. (dwarf5_alloc_LDADD): Likewise. (BUILDTESTS): Add dwarf5 tests if HAVE_DWARF5. (CLEANFILES, clean-local): Define. From-SVN: r279380
2019-12-10libbacktrace: remove duplicate low_pc/high_pc/range handlingIan Lance Taylor2-235/+179
* dwarf.c (struct pcrange): Define. (update_pcrange, add_ranges): New static functions. (add_unit_addr): Change signature to work with add_ranges. Don't add base_address here. (add_unit_ranges): Remove. (find_address_ranges): Replace str/ranges parameters with dwarf_sections. Use update_pcrange and add_ranges. Change all callers. (add_function_range): Change signature to work with add_ranges. Don't add base_address here. (add_function_ranges): Remove. (read_function_entry): Use update_pcrange and add_ranges. From-SVN: r279154
2019-12-05* edtest.c (test1): Add noclone attribute.Ian Lance Taylor2-2/+5
From-SVN: r278985
2019-12-05libbacktrace: simplify DWARF section handlingIan Lance Taylor6-208/+183
This is in preparation for adding DWARF 5 support. * internal.h (enum dwarf_section): Define. (struct dwarf_sections): Define. (backtrace_dwarf_add): Update declaration to replace specific section parameters with dwarf_sections parameter. * dwarf.c (struct dwarf_data): Replace specific section fields with dwarf_sections field. (read_attribute): Use dwarf_sections with altlink. (build_address_map): Replace specific section parameters with dwarf_sections parameter. Change all callers. (read_line_info): Use dwarf_sections with ddata. (read_referenced_name): Likewise. (add_function_ranges): Likewise. (read_function_entry): Likewise. (read_function_info): Likewise. (build_dwarf_data): Replace specific section parameters with dwarf_sections parameter. Change all callers. (backtrace_dwarf_add): Likewise. * elf.c (enum debug_section): Remove. (dwarf_section_names): Remove .zdebug names. (elf_add): Track zsections separately. Build dwarf_sections. * pecoff.c (enum debug_section): Remove. (struct debug_section_info): Remove data field. (coff_add): Build dwarf_sections. * xcoff.c (enum dwarf_section): Remove. Replace DWSECT_xxx references with DEBUG_xxx references. (xcoff_add): Build dwarf_sections. From-SVN: r278984
2019-09-27Regenerate `configure' scripts for `uclinuxfdpiceabi' libtool.m4 updateMaciej W. Rozycki2-5/+14
A change made with r275564 ("[ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts") to libtool.m4 has not regenerated all the `configure' scripts affected. Fix it. gcc/ * configure: Regenerate. libatomic/ * configure: Regenerate. libbacktrace/ * configure: Regenerate. libcc1/ * configure: Regenerate. libffi/ * configure: Regenerate. libgfortran/ * configure: Regenerate. libgomp/ * configure: Regenerate. libhsail-rt/ * configure: Regenerate. libitm/ * configure: Regenerate. libobjc/ * configure: Regenerate. liboffloadmic/ * configure: Regenerate. libphobos/ * configure: Regenerate. libquadmath/ * configure: Regenerate. libsanitizer/ * configure: Regenerate. libssp/ * configure: Regenerate. libstdc++-v3/ * configure: Regenerate. libvtv/ * configure: Regenerate. lto-plugin/ * configure: Regenerate. zlib/ * configure: Regenerate. From-SVN: r276213
2019-09-26re PR libbacktrace/91908 (New libbacktrace tests fail to build)Ian Lance Taylor3-2/+11
PR libbacktrace/91908 * pecoff.c (backtrace_initialize): Explicitly cast unchecked __sync_bool_compare_and_swap to void. * xcoff.c (backtrace_initialize): Likewise. From-SVN: r276168
2019-09-03Remove Cell Broadband Engine SPU targetsUlrich Weigand3-10/+9
From-SVN: r275343
2019-05-24Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and test_elf_64.Clement Chigot3-25/+75
* Makefile.am (BUILDTESTS): Remove test_elf, add test_elf_32 and test_elf_64. * Makefile.in: Regenerate. From-SVN: r271602
2019-05-14Remove obsolete Solaris 10 supportRainer Orth3-12/+6
libstdc++-v3: * config/os/solaris/solaris2.10: Move to ... * config/os/solaris: ... this. * configure.host (os_include_dir): Adapt. (abi_baseline_pair): Remove Solaris 10 handling. * config/abi/post/i386-solaris2.10: Remove. * config/abi/post/sparc-solaris2.10: Remove. * config/abi/post/i386-solaris2.11: Rename to ... * config/abi/post/i386-solaris: ... this. * config/abi/post/sparc-solaris2.11: Rename to ... * config/abi/post/sparc-solaris: ... this. * libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] [__sun]: Remove workaround. * testsuite/ext/enc_filebuf/char/13598.cc: Remove *-*-solaris2.10 xfail. libsanitizer: * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10* handling. * configure: Regenerate. libgcc: * config.host: Simplify various *-*-solaris2.1[0-9]* to *-*-solaris2*. * configure.ac: Likewise. * configure: Regenerate. * config/i386/sol2-unwind.h (x86_fallback_frame_state): Remove Solaris 10 and Solaris 11 < snv_125 handling. libbacktrace: * configure.ac (have_dl_iterate_phdr): Remove *-*-solaris2.10* handling. * configure: Regenerate. gcc/testsuite: * gcc.dg/atomic/c11-atomic-exec-4.c: Simplify triplet to *-*-solaris2*. * gcc.dg/atomic/c11-atomic-exec-5.c: Likewise. * gcc.dg/c99-math-double-1.c: Likewise. * gcc.dg/c99-math-float-1.c: Likewise. * gcc.dg/c99-math-long-double-1.c: Likewise. * gcc.misc-tests/linkage.exp: Simplify triplet to x86_64-*-solaris2*. * gcc.target/i386/mcount_pic.c: Remove *-*-solaris2.10* && !gld xfail. * gcc.target/i386/pr63620.c: Likewise. * lib/target-supports.exp (check_sse_os_support_available): Remove Solaris 9/x86 workaround. gcc: * config.gcc: Move *-*-solaris2.10* from obsolete configurations to unsupported ones. Simplify x86_64-*-solaris2.1[0-9]* to x86_64-*-solaris2*. * config.host: Likewise. * config/i386/sol2.h (ASM_COMMENT_START): Remove. * config/sparc/driver-sparc.c (host_detect_local_cpu) [__sun__ && __svr4__]: Remove "brand" fallback. [!KSTAT_DATA_STRING]: Remove. * configure.ac (gcc_cv_ld_hidden): Simplify *-*-solaris2.1[0-9]* to *-*-solaris2*. (comdat_group): Likewise. (set_have_as_tls): Likewise. (gcc_cv_target_dl_iterate_phdr): Likewise. (gcc_cv_as_shf_merge): Remove Solaris 10/x86 workaround. (gcc_cv_ld_aligned_shf_merge): Remove Solaris 10/SPARC workaround. * configure: Regenerate. * doc/install.texi: Simplify Solaris target triplets. (Specific, i?86-*-solaris2*): Remove Solaris 10 references. (Specific, *-*-solaris2*): Document Solaris 10 removal. Remove Solaris 10 references. Remove obsolete Solaris bug reference. (Specific, sparc-sun-solaris2.10): Remove. From-SVN: r271183
2019-03-11re PR libbacktrace/89669 (/usr/ccs/bin/ld: Unsatisfied symbols: ↵Ian Lance Taylor3-35/+57
backtrace_uncompress_zdebug) PR libbacktrace/89669 * Makefile.am (BUILDTESTS): Only add ztest and ztest_alloc if HAVE_ELF. * Makefile.in: Regenerate. From-SVN: r269594
2019-02-26[libbacktrace] Fix btest-lto for older gccTom de Vries2-1/+6
With gcc 4.8.5, btest_lto ends up with a privatized name for the variable with name 'global': ... $ nm btest_lto | grep ' d ' | grep global 0000000000617150 d global.2530 ... which makes test5 fail: ... test5: unexpected syminfo name got global.2530 expected global ... Fix this failure by accepting this type of name as a valid name in btest_lto. 2019-02-26 Tom de Vries <tdevries@suse.de> * btest.c (test5): Allow global.* as minimal symbol name for global. From-SVN: r269217
2019-02-26[libbacktrace] Require dwz for b3test_dwz_buildidTom de Vries3-35/+46
If dwz is not available, then the libbacktrace test b3test_dwz_buildid fails like this: ... gmake[4]: *** No rule to make target 'b3test_dwz_buildid' ... Fix this by guarding the test with HAVE_DWZ. Tested on x86_64 with and without dwz installed. 2019-02-26 Tom de Vries <tdevries@suse.de> * Makefile.am (TESTS): Only add b3test_dwz_buildid if HAVE_DWZ. * Makefile.in: Regenerate. From-SVN: r269204
2019-02-12[libbacktrace] Handle bsearch with NULL base in dwarf_lookup_pcTom de Vries2-2/+9
The call to bsearch in dwarf_lookup_pc can have NULL as base argument when the nmemb argument is 0. The base argument is required to be pointing to the initial member of an array of nmemb objects. It is not specified what constitutes a valid pointer to an array of 0 objects, but glibc declares base with attribute non-null, so the NULL will trigger a sanitizer runtime error. Fix this by only calling bsearch if nmemb != 0. 2019-02-12 Tom de Vries <tdevries@suse.de> PR libbacktrace/81983 * dwarf.c (dwarf_lookup_pc): Don't call bsearch if nmemb == 0. From-SVN: r268796
2019-02-10[libbacktrace] Add btest_ltoTom de Vries4-27/+83
Add libbacktrace test-case using -flto. 2019-02-10 Tom de Vries <tdevries@suse.de> * Makefile.am (BUILDTESTS): Add btest_lto. * Makefile.in: Regenerate. * btest.c (test1, f2, f3, test3, f22, f23): Declare with __attribute__((noclone)). From-SVN: r268736
2019-02-08[libbacktrace] Declare external backtrace fns noinlineTom de Vries4-3/+9
The backtrace functions backtrace_full, backtrace_print and backtrace_simple walk the call stack, but make sure to skip the first entry, in order to skip over the functions themselves, and start the backtrace at the caller of the functions. When compiling with -flto, the functions may be inlined, causing them to skip over the caller instead. Fix this by declaring the functions with __attribute__((noinline)). 2019-02-08 Tom de Vries <tdevries@suse.de> * backtrace.c (backtrace_full): Declare with __attribute__((noinline)). * print.c (backtrace_print): Same. * simple.c (backtrace_simple): Same. From-SVN: r268668
2019-02-08[libbacktrace] Handle DW_FORM_ref_addrTom de Vries2-20/+18
Add handling of the DW_FORM_ref_addr encoding to libbacktrace. 2019-02-08 Tom de Vries <tdevries@suse.de> PR libbacktrace/78063 * dwarf.c (build_address_map): Keep all parsed units. (read_referenced_name_from_attr): Handle DW_FORM_ref_addr. From-SVN: r268663
2019-01-31[libbacktrace] Fix .gnu_debugaltlink build-id checkTom de Vries2-2/+8
The 'debugaltlink_name_len =+ 1' bug reported in PR89136 exposes the fact that the build-id is not verified for the .gnu_debugaltlink. Fix both problems. 2019-01-31 Tom de Vries <tdevries@suse.de> PR libbacktrace/89136 * elf.c (elf_add): Read build-id if with_buildid_data. Fix 'debugaltlink_name_len =+ 1'. From-SVN: r268419
2019-01-29[libbacktrace] Add test-cases exercising build-id and dwzTom de Vries7-43/+345
Add test-cases b2test_buildid and b3test_dwz_buildid. The last one triggers the segfault fixed by "[backtrace] Avoid segfault" ( r268275 ). 2019-01-29 Tom de Vries <tdevries@suse.de> * install-debuginfo-for-buildid.sh.in: New script. * Makefile.am (check_PROGRAMS): Add b2test and b3test. (TESTS): Add b2test_buildid and b3test_dwz_buildid. * Makefile.in: Regenerate. * configure.ac (HAVE_ELF): Set with AM_CONDITIONAL. (READELF): Set with AC_CHECK_PROG. (install-debuginfo-for-buildid.sh): Generate with AC_CONFIG_FILES. * configure: Regenerate. * elf.c (SYSTEM_BUILD_ID_DIR): Factor out of ... (elf_open_debugfile_by_buildid): ... here. From-SVN: r268369
2019-01-29[libbacktrace] Don't assign check_PROGRAMS to TESTSTom de Vries3-77/+93
In automake files, the check_PROGRAMS variable lists programs that need to be build for testing, and TESTS lists the programs that need to be run. The libbacktrace/Makefile.am uses a shortcut: ... TESTS = $(check_PROGRAMS) ... to make sure that each program added with: ... check_PROGRAMS += foo ... is both build and run. However, for the allocfail.sh test, we need allocfail to be build and allocfail.sh to be run: ... check_PROGRAMS += allocfail TESTS += allocfail.sh ... but the shortcut causes allocfail also to be run, which is not required. Fix this by removing the short-cut, allowing check_PROGRAMS to retain its original semantics, and introducing a variable BUILDTESTS for programs that need to be both build and run. 2019-01-29 Tom de Vries <tdevries@suse.de> * Makefile.am: Replace check_PROGRAMS with BUILDTESTS, except for allocfail. (TESTS): Don't add check_PROGRAMS. Add BUILDTESTS. (check_PROGRAMS): Add BUILDTESTS. * Makefile.in: Regenerate. From-SVN: r268360
2019-01-28[libbacktrace] Fix and simplify xcoff_%.c pattern ruleTom de Vries3-4/+12
When generating xcoff_%.c, the last command is a sed command. In case of a sed failure, this will leave an incomplete file, which will appear as up to date to make, so consequently it will not be regenerated. Fix this by sedding into a temporary file instead. Also, use $< to access the prerequisite xcoff.c, instead of spelling out the file name once more. 2019-01-28 Tom de Vries <tdevries@suse.de> * Makefile.am (xcoff_%.c): Generate sed result into temporary file. Use $< to access prerequisite. * Makefile.in: Regenerate. From-SVN: r268344
2019-01-25[backtrace] Avoid segfaultNathan Sidwell2-1/+6
https://gcc.gnu.org/ml/gcc-patches/2019-01/msg01521.html * elf.c (elf_add): Pass "" filename to recursive call with separated debug. From-SVN: r268275
2019-01-25[libbacktrace] Fix strrchr segfaultTom de Vries4-8/+29
Currently, when running a libbacktrace testcase t with .gnu_debuglink to t.debug, and t.debug having a .gnu_debugaltlink to t.alt.debug, a segfault is triggered when calling strrchr with a NULL string from elf_find_debugfile_by_debuglink. The NULL string originates from the elf_add called for the .gnu_debugaltlink, which uses NULL as filename argument. Fix this by using "" as filename argument instead. 2019-01-25 Tom de Vries <tdevries@suse.de> * elf.c (elf_add): When handling .gnu_debugaltlink, call elf_add with filename == "". * Makefile.am (TESTS): Add btest_dwz_gnudebuglink. * Makefile.in: Regenerate. From-SVN: r268269
2019-01-25[libbacktrace] Rename dtest to btest_gnudebuglinkTom de Vries3-11/+17
Create a pattern rule for copying an existing test-case, separating out the debug information into a .debug file, and referencing the .debug file from the copied test-case using a .gnu_debuglink. 2019-01-25 Tom de Vries <tdevries@suse.de> * Makefile.am: Rewrite dtest rule into "%_gnudebuglink" pattern rule. (TESTS): Rename dtest to btest_gnudebuglink. * Makefile.in: Regenerate. From-SVN: r268268
2019-01-23[libbacktrace] Use size_t for low_offset/high_offset fields of struct unitTom de Vries2-6/+12
2019-01-23 Tom de Vries <tdevries@suse.de> * dwarf.c (struct unit): Use size_t for low_offset/high_offset fields. (units_search, find_unit): Use size_t for offset. (build_address_map): Use size_t for unit_offset. From-SVN: r268180
2019-01-20* allocfail.c (main): Increase portability of printf statement.Gerald Pfeifer2-1/+5
From-SVN: r268105
2019-01-18re PR libbacktrace/88890 (libbacktrace on 32-bit system with ↵Ian Lance Taylor5-4/+25
_FILE_OFFSET_BITS == 64) PR libbacktrace/88890 * mmapio.c (backtrace_get_view): Change size parameter to uint64_t. Check that value fits in size_t. * read.c (backtrace_get_view): Likewise. * internal.h (backtrace_get_view): Update declaration. * elf.c (elf_add): Pass shstrhdr->sh_size to backtrace_get_view. From-SVN: r268082
2019-01-17[libbacktrace] Add btest_dwz test-caseTom de Vries5-9/+106
Add test-case to verify that libbacktrace can read debug info that was compressed with dwz. 2019-01-17 Tom de Vries <tdevries@suse.de> PR libbacktrace/82857 * configure.ac (DWZ): Set with AC_CHECK_PROG. (HAVE_DWZ): Set with AM_CONDITIONAL. * configure: Regenerate. * Makefile.am (TESTS): Add btest_dwz. * Makefile.in: Regenerate. From-SVN: r268032
2019-01-17[libbacktrace] Handle DW_FORM_GNU_ref_altTom de Vries2-1/+24
Handle DW_FORM_GNU_ref_alt which references the .debug_info section in the .gnu_debugaltlink file. 2019-01-17 Tom de Vries <tdevries@suse.de> PR libbacktrace/82857 * dwarf.c (enum attr_val_encoding): Add ATTR_VAL_REF_ALT_INFO. (read_attribute): Handle DW_FORM_GNU_ref_alt using ATTR_VAL_REF_ALT_INFO. (read_referenced_name_from_attr): Handle DW_FORM_GNU_ref_alt. From-SVN: r268031
2019-01-17[libbacktrace] Add find_unitTom de Vries2-11/+87
Add a function that finds the unit given an offset into .debug_info. 2019-01-17 Tom de Vries <tdevries@suse.de> * dwarf.c (struct unit): Add low_offset and high_offset fields. (struct unit_vector): New type. (struct dwarf_data): Add units and units_counts fields. (find_unit): New function. (find_address_ranges): Add and handle unit_tag parameter. (build_address_map): Add and handle units_vec parameter. (build_dwarf_data): Pass units_vec to build_address_map. Store resulting units vector. From-SVN: r268030