[PATCH v5 0/5] Implement Structured Exception Handling (SEH) on AArch64
Evgeny Karpov
evgeny.karpov@arm.com
Tue Feb 24 09:49:18 GMT 2026
Hello,
Thank you for reviewing v4!
v5 contains multiple changes and v4 has been deeply refactored.
It should better prevent x86_64 mingw from regression and separate
different approaches in the implementation.
Changes in v5:
- In many places int, uint32_t and int32_t have been replaced to unsigned.
- Refactor and move SEH aarch64 implementation to separate files.
- Replace uintptr_t with bfd_vma.
- Update comments.
- Add dedicated initializers.
- Move some variables inside loops.
- Fix the definition for packing some unwinding codes.
- Add description to seh commands.
- Rename prolog_instruction_count to prolog_insn_count.
- Relocate variable initilization closer to place of use.
- Add unwind_ prefix to unwind type enumerator.
Changes in v3(v4) 2025-08-14:
- Make the AArch64 implementation fully static.
- Fix ARM64_MAX_UNWIND_CODES and introduce AARCH64_MAX_UNWIND_CODES_SIZE.
- Add validation for the epilogue_scope array.
- Add an upper bound for the register number.
- Exclude changes in md_do_align.
- Refactor the AArch64 SEH implementation to emit .pdata/.xdata records at
the end of assembly.
- Declare md_finish for AArch64 to trigger obj_coff_generate_pdata.
- Support different fragment ordering in frag_offset_ignore_align_p
- Change signed to unsigned.
- Replace Arm64 / arm64 with AArch64 / aarch64.
- Add references to the official documentation to clarify
implementation.
- Add static and aarch64_ prefix.
- Rebase onto the current master.
- Fix comments.
- Correct code style and naming.
https://sourceware.org/pipermail/binutils/2025-August/143401.html
Changes in v2 2025-05-09:
- Add guards for different architectures
- Fix code style issues and typos
- Move Arm64-specific code to pdata/xdata functions
- Prefer unsigned int over uint32_t in some places
- Revert memory release to the original implementation
- Refactor long function fragmentation
- Fix the function size calculation issue related to code alignment
https://sourceware.org/pipermail/binutils/2025-May/140961.html
v1 2025-04-09:
This patch series supports the GCC patch series that implements SEH
support for the aarch64-w64-mingw32 target.
https://gcc.gnu.org/pipermail/gcc-patches/2024-November/669003.html
The patch series has been tested by applying internal tests and passing
all Boost library tests that involve exception handling.
https://sourceware.org/pipermail/binutils/2025-April/140495.html
Regards,
Evgeny
Evgeny Karpov (5):
Adjust pdata function table entries sorting for AArch64
Extract SEH shared helpers into separate file.
aarch64: Implement Structured Exception Handling (SEH) on AArch64
Support different fragment ordering in frag_offset_ignore_align_p
aarch64: Emit pdata/xdata SEH records from md_finish
bfd/peXXigen.c | 16 +-
gas/config/obj-coff-seh-aarch64.c | 872 ++++++++++++++++++++++++++++++
gas/config/obj-coff-seh-aarch64.h | 265 +++++++++
gas/config/obj-coff-seh-shared.c | 219 ++++++++
gas/config/obj-coff-seh.c | 193 -------
gas/config/obj-coff-seh.h | 5 +
gas/config/obj-coff.c | 5 +
gas/config/tc-aarch64.c | 12 +
gas/config/tc-aarch64.h | 5 +
gas/frags.c | 24 +-
10 files changed, 1419 insertions(+), 197 deletions(-)
create mode 100644 gas/config/obj-coff-seh-aarch64.c
create mode 100644 gas/config/obj-coff-seh-aarch64.h
create mode 100644 gas/config/obj-coff-seh-shared.c
More information about the Binutils
mailing list