-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a preprocessor definitions to indidcate the landing pad labeling … #76
base: main
Are you sure you want to change the base?
Conversation
8ab23cf
to
779beee
Compare
riscv-c-api.md
Outdated
| __riscv_landing_pad_simple | 1 | Constant value for the simple labeling scheme. | | ||
| __riscv_landing_pad_func_sig | 2 | Constant value for the function signature based labeling scheme. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| __riscv_landing_pad_simple | 1 | Defined if the "simple" landing pad is in use. Constant value for the simple labeling scheme. |
| __riscv_landing_pad_func_sig | 2 | Defined if the "func_sig" landing pad is in use. Constant value for the function signature based labeling scheme. |
Add some conditions to spare the preprocessor from bloated macros?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if we are to limit when these macros are defined, why not just use:
#if defined(__riscv_zicfilp_landing_pad_simple)
...
#elif defined(__riscv_zicfilp_landing_pad_func_sig)
...
#endif
? This avoids more new macros, and it's clear when these macros would be defined, and when they would not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, but I keep __riscv_landing_pad
for now, we could remove that later...if that is not really used in anywhere :)
21aac32
to
3e51600
Compare
…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 ```
971a381
to
21882fa
Compare
Changes:
|
…scheme and shadow stack
Also add 2 more macro to let user able to determine the scheme.
Example code: