Commit Graph

371 Commits

Author SHA1 Message Date
Ian Lance Taylor
3e343ef7f0 libbacktrace: don't use ZSTD_CLEVEL_DEFAULT
PR 117812 reports that testing GCC with zstd 1.3.4 fails because
ZSTD_CLEVEL_DEFAULT is not defined, so avoid using it.

	PR libbacktrace/117812
	* zstdtest.c (test_large): Use 3 rather than ZSTD_CLEVEL_DEFAULT
2024-12-14 14:32:11 -08:00
GCC Administrator
20dcb7926b Daily bump. 2024-11-30 00:20:11 +00:00
Ian Lance Taylor
f8f5732534 libbacktrace: use WIN32_LEAN_AND_MEAN, not WIN32_MEAN_AND_LEAN
Patch from awmorgan.

	* fileline.c: Use WIN32_LEAN_AND_MEAN, not WIN32_MEAN_AND_LEAN.
	* pecoff.c: Likewise.
2024-11-29 13:18:26 -08:00
GCC Administrator
c232f92161 Daily bump. 2024-10-26 00:19:39 +00:00
Ian Lance Taylor
bab7a64c1a libbacktrace: recognize new Mach-O DWARF sections
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-25 15:20:55 -07:00
GCC Administrator
de14559ef5 Daily bump. 2024-10-19 00:19:43 +00:00
Ian Lance Taylor
f8687bceaa libbacktrace: don't get confused by overlapping address ranges
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-10-18 13:04:11 -07:00
GCC Administrator
8ac4db24e4 Daily bump. 2024-08-06 00:17:19 +00:00
Ian Lance Taylor
3a51aaf5f4 libbacktrace: avoid -Wpointer-arith errors
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-08-05 16:46:03 -07:00
GCC Administrator
e7f6a5dc4a Daily bump. 2024-07-31 00:19:44 +00:00
Ian Lance Taylor
37aa98f79a libbacktrace: fix syntax of Windows registration functions
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-30 09:27:59 -07:00
GCC Administrator
e20ea6bcf8 Daily bump. 2024-07-19 00:18:20 +00:00
Ian Lance Taylor
248e8530dd libbacktrace: use __has_attribute for fallthrough
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-18 11:35:44 -07:00
Ian Lance Taylor
93c54caa64 libbacktrace: add cast to avoid warning
* print.c (print_syminfo_callback): Add cast to avoid warning.
2024-07-17 17:59:41 -07:00
Ian Lance Taylor
30875fa698 libbacktrace: better backtrace_print when no debug info
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-17 17:39:27 -07:00
GCC Administrator
a922de0a7a Daily bump. 2024-07-18 00:18:58 +00:00
Ian Lance Taylor
a8b5ce1580 libbacktrace: add notes about dl_iterate_phdr to README
* README: Add notes about dl_iterate_phdr.
2024-07-17 17:03:30 -07:00
Ian Lance Taylor
f438299ef6 libbacktrace: update xcoff.c for base_address changes
* 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-16 21:27:05 -07:00
GCC Administrator
72bce1fbef Daily bump. 2024-07-17 00:18:32 +00:00
Ian Lance Taylor
c6803cdaba libbacktrace: support FDPIC
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-15 17:28:28 -07:00
GCC Administrator
2ee5b58be6 Daily bump. 2024-07-13 00:17:42 +00:00
Ian Lance Taylor
bf406a5369 libbacktrace: avoid infinite recursion
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-11 19:34:45 -07:00
Ian Lance Taylor
d7318f4cf8 libbacktrace: don't fail if symbol size is unknown
* btest.c (test5): Don't fail if symbol size is 0.
	* mtest.c (test5): Likewise.
2024-07-11 17:58:17 -07:00
Ian Lance Taylor
b870086904 libbacktrace: correctly gather Mach-O symbol table
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-11 17:54:43 -07:00
GCC Administrator
88ff0504ab Daily bump. 2024-07-12 00:17:52 +00:00
Ian Lance Taylor
8f7c06df42 libbacktrace: fix testsuite for clang
* 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-11 16:12:47 -07:00
Ian Lance Taylor
b96789abf8 libbacktrace: suggest how to fix missing debug info
* elf.c (elf_nodebug): Suggest -g.
	* macho.c (macho_nodebug): Suggest -g and dsymutil.
	* pecoff.c (coff_nodebug): Suggest -g.
2024-07-11 15:39:07 -07:00
Ian Lance Taylor
02f7525e5e libbacktrace: remove trailing whitespace
* dwarf.c: Remove trailing whitespace.
	* macho.c: Likewise.
2024-07-11 15:29:24 -07:00
GCC Administrator
6c08b82965 Daily bump. 2024-06-17 00:16:32 +00:00
Ian Lance Taylor
8348f8c22f libbacktrace: it's OK if zstd decompressor sees no backward bits
* elf.c (elf_fetch_bits_backward) Don't fail if no bits are
	available.
2024-06-16 15:44:36 -07:00
GCC Administrator
3e3d115c94 Daily bump. 2024-05-04 00:16:30 +00:00
Ian Lance Taylor
b69dac54ef libbacktrace: add DLLS as they are loaded
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-05-03 15:25:00 -07:00
GCC Administrator
deb69bfbb0 Daily bump. 2024-04-29 00:17:54 +00:00
Ian Lance Taylor
942a9cf2a9 libbacktrace: load Windows modules
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-28 11:14:17 -07:00
GCC Administrator
3091f1dfa7 Daily bump. 2024-04-24 00:16:29 +00:00
Ian Lance Taylor
d2f05fed44 libbacktrace: test --compress-debug-sections=ARG for each ARG
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-04-23 10:04:16 -07:00
GCC Administrator
c775a030af Daily bump. 2024-03-09 00:17:14 +00:00
Ian Lance Taylor
5825bd0e0d libbacktrace: don't assume compressed section is aligned
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-08 13:56:33 -08:00
GCC Administrator
ef1b788584 Daily bump. 2024-03-03 00:17:08 +00:00
Ian Lance Taylor
9b0d218544 libbacktrace: pass -no-install when linking test programs
* Makefile.am (libbacktrace_testing_ldflags): Define.
	(*_LDFLAGS): Add $(libbacktrace_testing_ldflags) for test
	programs.
	* Makefile.in: Regenerate
2024-03-02 13:11:07 -08:00
Ian Lance Taylor
c4f82ec6b4 libbacktrace: skip all LZMA block header padding bytes
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-02 12:17:18 -08:00
Ian Lance Taylor
282455d313 libbacktrace: use real .opd for debuginfo on ppc64 v1 ABI
PR libbacktrace/114201
	* elf.c (elf_add): Add caller_opd parameter.  Change all callers.
	Release opd data after all recursive calls.
2024-03-01 18:53:16 -08:00
GCC Administrator
306a4c3223 Daily bump. 2024-03-02 00:17:11 +00:00
Ian Lance Taylor
c6d4fb0062 libbacktrace: read symbol table of debuginfo file
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-02-29 19:45:57 -08:00
Jakub Jelinek
1ccad1f136 Update copyright years. 2024-01-05 08:54:28 +01:00
Jakub Jelinek
a945c346f5 Update copyright years. 2024-01-03 12:19:35 +01:00
Jakub Jelinek
6a720d41ff Update Copyright year in ChangeLog files
2023 -> 2024
2024-01-03 11:35:18 +01:00
GCC Administrator
8428bcd703 Daily bump. 2023-12-01 00:17:36 +00:00
Ian Lance Taylor
c6f7253bcc libbacktrace: support ASLR on Windows
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-30 11:24:57 -08:00
GCC Administrator
31d8cf17ca Daily bump. 2023-11-30 00:17:38 +00:00