Skip to content
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

Correct improper uses of "naked" attribute #115

Open
reticulatedpines opened this issue Oct 12, 2023 · 1 comment
Open

Correct improper uses of "naked" attribute #115

reticulatedpines opened this issue Oct 12, 2023 · 1 comment

Comments

@reticulatedpines
Copy link
Owner

We use "naked" on some functions, e.g. backtrace_getstr() (here, presumably to avoid disturbing register contents before doing the backtrace), but, GCC states: "While using extended asm or a mixture of basic asm and C code may appear to work, they cannot be depended upon to work reliably and are not supported"
https://gcc.gnu.org/onlinedocs/gcc/ARM-Function-Attributes.html

We use both extended asm and C in functions marked naked, which is not supported.

I couldn't find a way to get GCC to warn about this behaviour, so reliably detecting it may be impossible. We don't use it very often so at a minimum we should audit and fix all naked functions.

@reticulatedpines
Copy link
Owner Author

We do this in copy_and_restart()! That will want fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant