https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94218
Bug ID: 94218 Summary: Different __builtin_setjmp/__builtin_longjmp buffer layout is suggested in case of cet. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: gsdrtge6h at protonmail dot com Target Milestone: --- Target: ia32 Created attachment 48058 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48058&action=edit test for setjmp call The current implementation layout is to put shadow stack pointer at jb + 16 and normal stack pointer at jb + 24 when cet is enabled. rdsspq %rax movq %rax, jb_extern+16(%rip) movq %rsp, jb_extern+24(%rip) When CET is disabled normal stack pointer goes to jb + 16. It is suggested to switch the locations of shadow stack pointer and normal stack pointer within the jump buffer. This way there can be a chance to link legacy/no-cet __builtin_longjmp() code with cet __builtin_setjmp() code.