aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace
AgeCommit message (Collapse)AuthorFilesLines
2024-10-26Daily bump.GCC Administrator1-0/+5
2024-10-25libbacktrace: recognize new Mach-O DWARF sectionsIan Lance Taylor1-2/+2
Patch from Pavel Safonov. These sections are used on macOS Sequoia. Fixes https://github.com/ianlancetaylor/libbacktrace/issues/136 * macho.c (dwarf_section_names): Add __debug_addr and __debug_line_str.
2024-10-19Daily bump.GCC Administrator1-0/+6
2024-10-18libbacktrace: don't get confused by overlapping address rangesIan Lance Taylor1-15/+199
Fixes https://github.com/ianlancetaylor/libbacktrace/issues/137. * dwarf.c (resolve_unit_addrs_overlap_walk): New static function. (resolve_unit_addrs_overlap): New static function. (build_dwarf_data): Call resolve_unit_addrs_overlap.
2024-08-06Daily bump.GCC Administrator1-0/+7
2024-08-05libbacktrace: avoid -Wpointer-arith errorsIan Lance Taylor4-6/+11
Based on patch from Kirill Müller. * configure.ac (ACX_PROG_CC_WARNING_OPTS): Add -Wpointer-arith. * pecoff.c (coff_add): Cast void pointers. * xcoff.c (xcoff_add): Likewise. * configure: Regenerate.
2024-07-31Daily bump.GCC Administrator1-0/+6
2024-07-30libbacktrace: fix syntax of Windows registration functionsIan Lance Taylor1-2/+2
Adjust the syntax to keep MSVC happy. Fixes https://github.com/ianlancetaylor/libbacktrace/issues/131 * pecoff.c (LDR_DLL_NOTIFICATION): Put function modifier inside parentheses. (LDR_REGISTER_FUNCTION): Likewise.
2024-07-19Daily bump.GCC Administrator1-0/+17
2024-07-18libbacktrace: use __has_attribute for fallthroughIan Lance Taylor2-7/+12
Also convert some FALLTHROUGH comments to ATTRIBUTE_FALLTHROUGH. * internal.h: Use __has_attribute to check for fallthrough attribute. * elf.c (elf_zstd_decompress): Use ATTRIBUTE_FALLTHROUGH rather than a FALLTHROUGH comment.
2024-07-17libbacktrace: add cast to avoid warningIan Lance Taylor1-1/+1
* print.c (print_syminfo_callback): Add cast to avoid warning.
2024-07-17libbacktrace: better backtrace_print when no debug infoIan Lance Taylor1-15/+40
Fixes https://github.com/ianlancetaylor/libbacktrace/issues/59 * print.c (print_syminfo_callback): New static function. (print_callback): Call backtrace_syminfo if there is no function or file name.
2024-07-18Daily bump.GCC Administrator1-0/+20
2024-07-17libbacktrace: add notes about dl_iterate_phdr to READMEIan Lance Taylor1-1/+11
* README: Add notes about dl_iterate_phdr.
2024-07-16libbacktrace: update xcoff.c for base_address changesIan Lance Taylor3-21/+31
* xcoff.c (struct xcoff_fileline_data): Change base_address field to struct libbacktrace_base_address. (xcoff_initialize_syminfo): Change base_address to struct libbacktrace_base_address. Use libbacktrace_add_base. (xcoff_initialize_fileline): Likewise. (xcoff_lookup_pc): Use libbacktrace_add_base. (xcoff_add): Change base_address to struct libbacktrace_base_address. (xcoff_armem_add, xcoff_add_shared_libs): Likewise. (backtrace_initialize): Likewise. * Makefile.am (xcoff.lo): Remove unused target. (xcoff_32.lo, xcoff_64.lo): New targets. * Makefile.in: Regenerate.
2024-07-17Daily bump.GCC Administrator1-0/+34
2024-07-15libbacktrace: support FDPICIan Lance Taylor5-62/+123
Based on patch by Max Filippov. * internal.h: If FDPIC, #include <link.h> and/or <sys/link.h>. (libbacktrace_using_fdpic): Define. (struct libbacktrace_base_address): Define. (libbacktrace_add_base): Define. (backtrace_dwarf_add): Change base_address to struct libbacktrace_base_address. * dwarf.c (struct dwarf_data): Change base_address to struct libbacktrace_base_address. (add_ranges, find_address_ranges, build_ddress_map): Likewise. (build_dwarf_data, build_dwarf_add): Likewise. (add_low_high_range): Change base_address to struct libbacktrace_base_address. Use libbacktrace_add_base. (add_ranges_from_ranges, add_ranges_from_rnglists): Likewise. (add_line): Use libbacktrace_add_base. * elf.c (elf_initialize_syminfo): Change base_address to struct libbacktrace_base_address. Use libbacktrace_add_base. (elf_add): Change base_address to struct libbacktrace_base_address. (phdr_callback): Likewise. Initialize base_address.m. (backtrace_initialize): If using FDPIC, don't call elf_add with main executable; always use dl_iterate_phdr. * macho.c (macho_add_symtab): Change base_address to struct libbacktrace_base_address. Use libbacktrace_add_base. (macho_syminfo): Change base_address to struct libbacktrace_base_address. (macho_add_fat, macho_add_dsym, macho_add): Likewise. (backtrace_initialize): Likewise. Initialize base_address.m. * pecoff.c (coff_initialize_syminfo): Change base_address to struct libbacktrace_base_address. Use libbacktrace_add_base. (coff_add): Change base_address to struct libbacktrace_base_address. Initialize base_address.m.
2024-07-13Daily bump.GCC Administrator1-0/+23
2024-07-11libbacktrace: avoid infinite recursionIan Lance Taylor3-42/+134
We could get an infinite recursion in an odd case in which a .gnu_debugdata section was added to a debug file, and mini_debuginfo was put into the debug file, and the debug file was put into a /usr/lib/debug directory to be found by build ID. This combination doesn't really make sense but we shouldn't get an infinite recursion. * elf.c (elf_add): Don't use .gnu_debugdata if we are already reading a debuginfo file. * Makefile.am (m2test_*): New test targets. (CHECK_PROGRAMS): Add m2test. (MAKETESTS): Add m2test_minidebug2. (%_minidebug2): New pattern. (CLEANFILES): Remove minidebug2 files. * Makefile.in: Regenerate.
2024-07-11libbacktrace: don't fail if symbol size is unknownIan Lance Taylor2-2/+2
* btest.c (test5): Don't fail if symbol size is 0. * mtest.c (test5): Likewise.
2024-07-11libbacktrace: correctly gather Mach-O symbol tableIan Lance Taylor1-6/+8
For PR libbacktrace/97082. * macho.c (MACH_O_N_EXT): Don't define. (MACH_O_N_UNDF): Define. (macho_defined_symbol): Don't discard N_EXT symbols. Do discard N_UNDF symbols.
2024-07-12Daily bump.GCC Administrator1-0/+19
2024-07-11libbacktrace: fix testsuite for clangIan Lance Taylor5-7/+9
* btest.c (test1, test3): Add optnone attribute. * edtest.c (test1): Likewise. * mtest.c (test1, test3): Likewise. * configure.ac: Use -Wno-attributes and -Wno-unknown-attributes. * configure: Regenerate.
2024-07-11libbacktrace: suggest how to fix missing debug infoIan Lance Taylor3-3/+3
* elf.c (elf_nodebug): Suggest -g. * macho.c (macho_nodebug): Suggest -g and dsymutil. * pecoff.c (coff_nodebug): Suggest -g.
2024-07-11libbacktrace: remove trailing whitespaceIan Lance Taylor2-3/+2
* dwarf.c: Remove trailing whitespace. * macho.c: Likewise.
2024-06-17Daily bump.GCC Administrator1-0/+5
2024-06-16libbacktrace: it's OK if zstd decompressor sees no backward bitsIan Lance Taylor1-8/+1
* elf.c (elf_fetch_bits_backward) Don't fail if no bits are available.
2024-05-04Daily bump.GCC Administrator1-0/+9
2024-05-03libbacktrace: add DLLS as they are loadedIan Lance Taylor1-0/+106
Patch from Björn Schäpers. * pecoff.c (struct dll_notification_data): Define. (LDR_DLL_NOTIFICATION): New typedef. (LDR_REGISTER_FUNCTION): New typedef. (struct dll_notification_context): Define. (dll_notification): New static function. (backtrace_initialize): Register DLL notification.
2024-04-29Daily bump.GCC Administrator1-0/+10
2024-04-28libbacktrace: load Windows modulesIan Lance Taylor4-8/+87
Patch from Björn Schäpers <bjoern@hazardy.de>. * configure.ac: Checked for tlhelp32.h * pecoff.c: Include <tlhelp32.h> if available. (backtrace_initialize): Use tlhelp32 api for a snapshot to detect loaded modules. (coff_add): New argument for the module handle of the file, to get the base address. * configure, config.h.in: Regenerate.
2024-04-24Daily bump.GCC Administrator1-0/+12
2024-04-23libbacktrace: test --compress-debug-sections=ARG for each ARGIan Lance Taylor4-116/+214
This should fix a testsuite problem with Solaris ld that supports zlib but not zlib-gabi. * configure.ac: Test --compress-debug-sections=zlib-gnu and --compress-debug-sections=zlib-gabi separately, setting new automake conditionals. * Makefile.am (ctestg, ctestg_alloc): Only build if HAVE_COMPRESSED_DEBUG_ZLIB_GNU. (ctesta, ctesta_alloc): Only build if HAVE_COMPRESSED_DEBUG_ZLIB_GABI. (ctestzstd_alloc): New test if HAVE_COMPRESSED_DEBUG_ZSTD. * configure, Makefile.in: Regenerate.
2024-03-09Daily bump.GCC Administrator1-0/+5
2024-03-08libbacktrace: don't assume compressed section is alignedIan Lance Taylor1-10/+13
Patch originally by GitHub user ubyte at https://github.com/ianlancetaylor/libbacktrace/pull/120. * elf.c (elf_uncompress_chdr): Don't assume compressed section is aligned.
2024-03-03Daily bump.GCC Administrator1-0/+18
2024-03-02libbacktrace: pass -no-install when linking test programsIan Lance Taylor2-43/+105
* Makefile.am (libbacktrace_testing_ldflags): Define. (*_LDFLAGS): Add $(libbacktrace_testing_ldflags) for test programs. * Makefile.in: Regenerate
2024-03-02libbacktrace: skip all LZMA block header padding bytesIan Lance Taylor1-8/+10
Fixes https://github.com/ianlancetaylor/libbacktrace/issues/118 * elf.c (elf_uncompress_lzma_block): Skip all header padding bytes and verify that they are zero.
2024-03-01libbacktrace: use real .opd for debuginfo on ppc64 v1 ABIIan Lance Taylor1-21/+31
PR libbacktrace/114201 * elf.c (elf_add): Add caller_opd parameter. Change all callers. Release opd data after all recursive calls.
2024-03-02Daily bump.GCC Administrator1-0/+8
2024-02-29libbacktrace: read symbol table of debuginfo fileIan Lance Taylor3-7/+48
These become another symbol table to search. This is needed if people use --strip-all rather than --strip-debug when adding a debuglink section. Patch is from GitHub user pickard1. Fixes https://github.com/ianlancetaylor/libbacktrace/issues/113. * elf.c (elf_add): Add the symbol table from a debuginfo file. * Makefile.am (MAKETESTS): Add buildidfull and gnudebuglinkfull variants of buildid and gnudebuglink tests. (%_gnudebuglinkfull, %_buildidfull): New patterns. * Makefile.in: Regenerate.
2024-01-05Update copyright years.Jakub Jelinek1-1/+1
2024-01-03Update copyright years.Jakub Jelinek41-41/+41
2024-01-03Update Copyright year in ChangeLog filesJakub Jelinek1-1/+1
2023 -> 2024
2023-12-01Daily bump.GCC Administrator1-0/+5
2023-11-30libbacktrace: support ASLR on WindowsIan Lance Taylor1-1/+23
Patch from Björn Schäpers. * pecoff.c: Include <windows.h> if available. (coff_add): On Windows call GetModuleHandle to get base address.
2023-11-30Daily bump.GCC Administrator1-0/+9
2023-11-29libbacktrace: call GetModuleFileNameA on WindowsIan Lance Taylor4-2/+66
Patch from Björn Schäpers. * fileline.c: Include <windows.h> if available. (windows_get_executable_path): New static function. (fileline_initialize): Call windows_get_executable_path. * configure.ac: Checked for windows.h * configure: Regenerate. * config.h.in: Regenerate.
2023-10-23Daily bump.GCC Administrator1-0/+5
2023-10-22Config,Darwin: Allow for configuring Darwin to use embedded runpath.Iain Sandoe2-5/+73
Recent Darwin versions place contraints on the use of run paths specified in environment variables. This breaks some assumptions in the GCC build. This change allows the user to configure a Darwin build to use '@rpath/libraryname.dylib' in library names and then to add an embedded runpath to executables (and libraries with dependents). The embedded runpath is added by default unless the user adds '-nodefaultrpaths' to the link line. For an installed compiler, it means that any executable built with that compiler will reference the runtimes installed with the compiler (equivalent to hard-coding the library path into the name of the library). During build-time configurations any "-B" entries will be added to the runpath thus the newly-built libraries will be found by exes. Since the install name is set in libtool, that decision needs to be available here (but might also cause dependent ones in Makefiles, so we need to export a conditional). This facility is not available for Darwin 8 or earlier, however the existing environment variable runpath does work there. We default this on for systems where the external DYLD_LIBRARY_PATH does not work and off for Darwin 8 or earlier. For systems that can use either method, if the value is unset, we use the default (which is currently DYLD_LIBRARY_PATH). ChangeLog: * configure: Regenerate. * configure.ac: Do not add default runpaths to GCC exes when we are building -static-libstdc++/-static-libgcc (the default). * libtool.m4: Add 'enable-darwin-at-runpath'. Act on the enable flag to alter Darwin libraries to use @rpath names. gcc/ChangeLog: * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * config/darwin.h: Handle Darwin rpaths. * config/darwin.opt: Handle Darwin rpaths. * Makefile.in: Handle Darwin rpaths. gcc/ada/ChangeLog: * gcc-interface/Makefile.in: Handle Darwin rpaths. gcc/jit/ChangeLog: * Make-lang.in: Handle Darwin rpaths. libatomic/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libbacktrace/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libcc1/ChangeLog: * configure: Regenerate. libffi/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. libgcc/ChangeLog: * config/t-slibgcc-darwin: Generate libgcc_s with an @rpath name. * config.host: Handle Darwin rpaths. libgfortran/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths libgm2/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * libm2cor/Makefile.am: Handle Darwin rpaths. * libm2cor/Makefile.in: Regenerate. * libm2iso/Makefile.am: Handle Darwin rpaths. * libm2iso/Makefile.in: Regenerate. * libm2log/Makefile.am: Handle Darwin rpaths. * libm2log/Makefile.in: Regenerate. * libm2min/Makefile.am: Handle Darwin rpaths. * libm2min/Makefile.in: Regenerate. * libm2pim/Makefile.am: Handle Darwin rpaths. * libm2pim/Makefile.in: Regenerate. libgomp/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths libitm/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libobjc/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * libdruntime/Makefile.am: Handle Darwin rpaths. * libdruntime/Makefile.in: Regenerate. * src/Makefile.am: Handle Darwin rpaths. * src/Makefile.in: Regenerate. libquadmath/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libsanitizer/ChangeLog: * asan/Makefile.am: Handle Darwin rpaths. * asan/Makefile.in: Regenerate. * configure: Regenerate. * hwasan/Makefile.am: Handle Darwin rpaths. * hwasan/Makefile.in: Regenerate. * lsan/Makefile.am: Handle Darwin rpaths. * lsan/Makefile.in: Regenerate. * tsan/Makefile.am: Handle Darwin rpaths. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.am: Handle Darwin rpaths. * ubsan/Makefile.in: Regenerate. libssp/ChangeLog: * Makefile.am: Handle Darwin rpaths. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Handle Darwin rpaths. libstdc++-v3/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. * src/Makefile.am: Handle Darwin rpaths. * src/Makefile.in: Regenerate. libvtv/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. lto-plugin/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths. zlib/ChangeLog: * configure: Regenerate. * configure.ac: Handle Darwin rpaths.