Skip to content

Commit

Permalink
Use __CET__ macro to enable IBT support. (#11081)
Browse files Browse the repository at this point in the history
According to the GCC documentation [1], the macro `__CET__` is dfined
when `-fcf-protection` compiler option is used. Therefore use this macro
to enable IBT support instead of special casing for `__OpenBSD__`.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fcf-protection
  • Loading branch information
voxik committed Jul 3, 2024
1 parent b160a78 commit d9398ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coroutine/amd64/Context.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,7 @@
## Copyright, 2018, by Samuel Williams.
##

#if defined(__OpenBSD__)
#if defined(__CET__)
#include <cet.h>
#endif

Expand All @@ -17,7 17,7 @@
.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer):

#if defined(__OpenBSD__)
#if defined(__CET__)
_CET_ENDBR
#endif

Expand Down

0 comments on commit d9398ac

Please sign in to comment.