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

KAsan globals metadata size question #220

Open
0528Mike opened this issue Oct 16, 2023 · 2 comments
Open

KAsan globals metadata size question #220

0528Mike opened this issue Oct 16, 2023 · 2 comments

Comments

@0528Mike
Copy link

Open asan global=1, and the compiler will generate a descriptor structure of nearly 80 bytes for each global variable. There is a lot of data in the structure that I do not need. Is there any way to remove them, as I am using Kasan on an embedded board and memory resources are scarce

@melver
Copy link
Collaborator

melver commented Oct 16, 2023

If you're using Clang, you can pass try to pass -mllvm -asan-globals=0 as additional CFLAGS to disable globals instrumentation. GCC might have a similar param.

But there is no Kconfig variable to do that.

@0528Mike
Copy link
Author

However, this method still cannot solve the problem of the compiler generating a nearly 80 byte metadata for each global variable. Once there are many global variables that I need to protect, this approach will cause my bin file to be very large.

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

2 participants