Skip to content

Commit

Permalink
Add a preprocessor definitions to indidcate the landing pad labeling …
Browse files Browse the repository at this point in the history
…scheme and shadow stack.

Also add 2 more macros to let user able to determine the scheme.

Example code:
```c
 #ifdef __riscv_landing_pad
   #if defined(__riscv_landing_pad_unlabeled)
     ...
   #elif defined(__riscv_landing_pad_func_sig)
     ...
   #else
     #error "Unknown labeling scheme"
   #endif
 #endif
```
  • Loading branch information
kito-cheng committed Sep 23, 2024
1 parent 5ebc2c8 commit 21882fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/c-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ a|
|`+__riscv_misaligned_fast+` |1 | Scalar misaligned accesses are fast.
|`+__riscv_misaligned_slow+` |1 | Scalar misaligned accesses are supported, but may be substantially slower than aligned accesses.
|`+__riscv_misaligned_avoid+` |1 | Scalar misaligned accesses are not supported and could trap. (see <<__riscv_misaligned_fast_slow_avoid, `+__riscv_misaligned_{fast,slow,avoid}+`>>)
| `+__riscv_landing_pad+` | 1 | Defined if the landing pad is enabled.
| `+__riscv_landing_pad_unlabeled+` | 1 | Defined if the unlabeled labeling scheme is enabled.
| `+__riscv_landing_pad_func_sig+` | 1 | Defined if the function signature based labeling scheme is enabled.
| `+__riscv_shadow_stack+` | 1 | Defined if the shadow stack is enabled.
|===

[id=__riscv_v_min_vlen]
Expand Down

0 comments on commit 21882fa

Please sign in to comment.