https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113312
--- Comment #15 from H. Peter Anvin <hpa at zytor dot com> --- That should be fine for this use case, obviously. I should add the following: the reason the assembly stub isn't a problem for FRED whereas it is a bit of a nuisance for IDT-style delivery is that with FRED, vector dispatch is done in software, not hardware. This is exactly because *most* operating systems do need some amount of common entry/exit code anyway, and having to duplicate it is a severe nuisance. In the specific case of Linux, the full register set, including saved registers, are a required part of the exception frame in order for things like ptrace() and fork() to work correctly, so relying on the compiler to save the "saved" registers doesn't work for us anyway. So since there is only *one* instance of the assembly stub needed, it means there isn't a whole separate stub needed for every handler.