Landing: e8385ea3b578
Project / Subsystem
gcc / libgcc
Date
2026-07-22
Author
Piotr Kubaj
Commit
e8385ea3b57862ce6c6ace5e6973b96cf238f4b6
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- libgcc
- patch_id
- —
- commit_hash
- e8385ea3b57862ce6c6ace5e6973b96cf238f4b6
- source_type
- github
- headline
- FreeBSD/powerpc64 ELFv2: Fix TOC restore during unwinding
- tldr
- Corrects stack unwinding on FreeBSD/powerpc64 ELFv2 by properly restoring the TOC pointer.
- author
- Piotr Kubaj
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • powerpc
- • unwinding
- • ABI
- • freebsd
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-07-22T00:00:00.000Z
This change fixes a bug in libgcc’s unwinding mechanisms on FreeBSD for powerpc64 ELFv2 systems. The Table of Contents (TOC) pointer, essential for accessing global data and PLT entries, was not being restored correctly during stack unwinding when the unwind information didn’t explicitly detail the TOC save slot. The previous implementation incorrectly assumed an ELFv1 TOC save offset, leading to crashes or incorrect behavior in C++ exception handling and function calls across module boundaries. The fix introduces a macro to correctly determine the TOC save slot based on the ELF version.