Bartosz Taudul
e842bf223f
Use correct type for phdr addresses.
2026-07-07 17:54:03 +02:00
Ivan Molodetskikh
16a148f0be
Replace __WORDSIZE with __SIZEOF_POINTER__
...
__WORDSIZE has been relocated from bits/reg.h (now an empty header) to
sys/reg.h in 2024:
https://git.musl-libc.org/cgit/musl/commit/?id=e709a6f07ade208ba513f9225222336f30c304b0
And in any case, it's a private definition. Let's use a common
documented define instead:
https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
Fixes symbol resolution on musl (particularly, postmarketOS aarch64).
2026-07-06 18:57:31 +03:00
Ivan Molodetskikh
279f7ba0df
libbacktrace: Fix missing table assignment in RLE seq decode
...
Fixes segfault when decompressing mesa debuginfo on Aeryn.
2026-06-27 11:05:12 +03:00
Ivan Molodetskikh
bd2106db68
libbacktrace: support compressed block with window descriptor
...
Some debuginfo on AerynOS has this format.
2026-06-26 10:46:33 +03:00
Ian Lance Taylor
99c13e53bf
libbacktrace: support compressed block with no sequences
...
* elf.c (elf_zstd_decompress_frame): Support a compressed block
with no sequences, only literals.
Fixes https://github.com/ianlancetaylor/libbacktrace/issues/164
2026-06-26 10:46:17 +03:00
Ian Lance Taylor
7fbe1d1345
libbacktrace: support multiple zstd frames
...
Based on patch by GitHub user ofats.
* elf.c (elf_zstd_decompress_frame): New static function,
broken out of elf_zstd_decompress.
(elf_zstd_decompress): Call elf_zstd_decompress_frame in a loop.
* zstdtest.c (test_large): Compress the file in chunks.
2026-06-26 10:41:29 +03:00
Ivan Molodetskikh
5745b489a2
callstack: Calculate end address from highest LOAD header
...
Headers aren't guaranteed to be sorted in final address order. For
example, from readelf -lW of a .so built with clang:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
PHDR 0x000040 0x0000000000000040 0x0000000000000040 0x000230 0x000230 R 0x8
LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x5e8274 0x5e8274 R 0x1000
LOAD 0x5e8280 0x00000000005e9280 0x00000000005e9280 0x51e990 0x51e990 R E 0x1000
LOAD 0xb06c10 0x0000000000b08c10 0x0000000000b08c10 0x031628 0x0323f0 RW 0x1000
LOAD 0xb38240 0x0000000000b3b240 0x0000000000b3b240 0x009aa8 0x011c40 RW 0x1000
DYNAMIC 0xb32270 0x0000000000b34270 0x0000000000b34270 0x000410 0x000410 RW 0x8
GNU_RELRO 0xb06c10 0x0000000000b08c10 0x0000000000b08c10 0x031628 0x0323f0 R 0x1
GNU_EH_FRAME 0x4e8360 0x00000000004e8360 0x00000000004e8360 0x029cf4 0x029cf4 R 0x4
GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RW 0
NOTE 0x000270 0x0000000000000270 0x0000000000000270 0x000024 0x000024 R 0x4
2026-06-26 10:41:29 +03:00
Bartosz Taudul
7974a74580
Add external_file support to libbacktrace
...
- Add external_file field to backtrace_state struct
- Add backtrace_create_state_for_file() function that marks
state for external ELF files not loaded in current process
- In backtrace_initialize, use external_file flag to:
- Pass exe=0 to elf_add for ET_DYN files (allows DWARF loading)
- Skip dl_iterate_phdr enumeration (avoids noise from current process)
This enables symbol resolution from arbitrary ELF files on disk,
with caller responsible for address translation.
2026-03-30 19:52:12 +02:00
Bartosz Taudul
2f1fc19f88
libbacktrace: use correct names in #undef of ELF macros (b9e4006)
2026-03-30 19:40:30 +02:00
Bartosz Taudul
52607f70fe
libbacktrace: add casts to avoid undefined shifts (78af4ff, 0034e33)
2026-03-30 19:38:45 +02:00
Bartosz Taudul
d79b7d4176
libbacktrace: don't get confused by overlapping address ranges (3d0be55)
2026-03-30 19:33:37 +02:00
Simonas Kazlauskas
10b5f0d878
fix: GetDebugInfoDescriptor signature
2025-11-13 19:19:52 +02:00
PewPewCrit
11c9e3fa35
libbacktrace: recognize new Mach-O DWARF sections
...
Reference: libbacktrace@d48f84034ce3e53e501d10593710d025cb1121db
2025-08-04 14:17:18 +03:00
Bartosz Taudul
e26c34346b
libbacktrace: support FDPIC (1dd5c40)
2024-08-24 18:15:52 +02:00
Bartosz Taudul
0d0e56dca3
libbacktrace: avoid infinite recursion (febbb9b)
2024-08-24 18:02:05 +02:00
Bartosz Taudul
12c8592325
libbacktrace: fix UBSAN issues (5aa9254)
2024-08-24 18:01:10 +02:00
Bartosz Taudul
ef21f5867e
libbacktrace: correctly gather Mach-O symbol table (3fda5a8)
2024-08-24 17:57:43 +02:00
Bartosz Taudul
ba79deddf6
libbacktrace: it's OK if zstd decompressor sees no backward bits (4ead348)
2024-08-24 17:55:41 +02:00
Ikko Eltociear Ashimine
dfbf0652f2
libbacktrace: update elf.cpp
...
previouly -> previously
2024-07-01 02:20:56 +09:00
Bartosz Taudul
2df972d586
libbacktrace: don't assume compressed section is aligned (7ead8c1)
2024-03-13 00:29:01 +01:00
Bartosz Taudul
49478ec3b3
libbacktrace: skip all LZMA block header padding bytes (28824f2)
2024-03-13 00:24:13 +01:00
Bartosz Taudul
1f90cd473b
libbacktrace: use real .opd for debuginfo on ppc64 v1 ABI (592e9c8)
2024-03-13 00:23:08 +01:00
Bartosz Taudul
a9feb75bdf
libbacktrace: read symbol table of debuginfo file (36cfdc1)
2024-03-13 00:20:14 +01:00
Bartosz Taudul
a4eecd508d
libbacktrace: call GetModuleFileNameA on Windows (25889d2)
2024-03-13 00:18:14 +01:00
Bartosz Taudul
11bf33c32c
libbacktrace: look for _pgmptr on Windows (c1c86fa2)
2024-03-13 00:15:10 +01:00
trodrigues
8503f32b36
fix typos and compilation warnings
2023-12-09 09:37:14 -06:00
trodrigues
e80e1d2484
fix line endings
2023-12-06 12:29:26 -06:00
Tiago Rodrigues
8dfc5fe41f
re-apply diff
2023-12-06 12:39:52 -05:00
Tiago Rodrigues
38559172bb
checkout elf.cpp as it looks like line ending were screwed up
2023-12-06 12:37:53 -05:00
Tiago Rodrigues
24b6c649d3
fix typo
2023-12-06 12:32:37 -05:00
trodrigues
b835d73590
Add support for libbacktrace to detect new elfs have been dynamically loaded after backtrace_initialize() has been called, and consider them for symbol resolution
2023-12-05 20:09:11 -06:00
xhe
4e771b2da0
adapt libbacktrace to musl
...
Signed-off-by: xhe <xw897002528@gmail.com >
2023-09-10 19:26:38 +08:00
Bartosz Taudul
77402eb9c2
libbacktrace: minor fixes for zstd decompression (cdb64b68)
2023-04-05 17:24:19 +02:00
Bartosz Taudul
0f19727dc6
libbacktrace: change PC variables from uint64_t to uintptr_t (afe2967c)
2023-04-05 17:23:04 +02:00
Bartosz Taudul
b53acde418
Fix type.
2023-01-05 20:34:50 +01:00
Bartosz Taudul
236bbfa8b1
libbacktrace: unpack literals into output buffer (da7eff2)
2023-01-05 20:31:05 +01:00
Bartosz Taudul
d8fc004bfa
libbacktrace: rewrite and simplify main zstd loop (fd9442f)
2023-01-05 20:29:51 +01:00
Bartosz Taudul
08d403e324
libbacktrace: support zstd decompression (c992dd8)
2023-01-05 20:27:36 +01:00
Bartosz Taudul
1601ddeab5
Resolve relative file names to absolute ones.
...
Note that this is a tentative fix, which *should* be working, but it may as
well not be correct in some edge cases. Who knows.
2022-08-16 23:48:46 +02:00
Bartosz Taudul
8ccfe93044
Apply 7409767 from libbacktrace.
2022-07-20 00:41:22 +02:00
Bartosz Taudul
06c7984a16
Move all client headers and sources to public/ directory.
2022-07-17 15:47:38 +02:00