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

-fsanitize=thread and -fsanitize=kernel-address produce unwanted .eh_frame and .init_array.* sections #45823

Closed
kees opened this issue Jun 27, 2020 · 4 comments
Labels
bugzilla Issues migrated from bugzilla compiler-rt

Comments

@kees
Copy link
Contributor

kees commented Jun 27, 2020

Bugzilla Link 46478
Resolution FIXED
Resolved on Apr 27, 2021 20:19
Version unspecified
OS Linux
Blocks #4440
CC @melver,@ramosian-glider,@MaskRay,@nickdesaulniers

Extended Description

Building the Linux kernel with -fsanitize=thread produces unwanted .eh_frame and .init_array.0 sections, even with -fno-unwind-tables and -fno-asynchronous-unwind-tables.

@kees
Copy link
Contributor Author

kees commented Jun 27, 2020

@kees
Copy link
Contributor Author

kees commented Jun 29, 2020

-fsanitize=kernel-address also causes this problem.

@nickdesaulniers
Copy link
Member

Related? https://reviews.llvm.org/D100251

@MaskRay
Copy link
Member

MaskRay commented Apr 28, 2021

The .eh_frame issue was fixed by https://reviews.llvm.org/D100251 (target: 13.0.0).

For .init_array.0, -fsanitize={address,memory,thread,...} instrumentations create a module constructor which is placed in .init_array.0 .
For memory/thread, the module constructor just calls an init function which is really small.
For address, the module constructor needs to register global variables (even under -fsanitize=kernel-address), which cannot be simply ignored.

It is likely that the kernel doesn't need .init_array.0 for memory/thread, but introducing a new option seems overkill to me.
Ignoring it with the current /DISCARD/ : { ... (.init_array.) } works quite well.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compiler-rt
Projects
None yet
Development

No branches or pull requests

3 participants