-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHERI] Correctly add .cfi_undefined to _start
The existing approach of using inline assembly to inject .cfi_undefined into _start was fragile: after upgrading to LLVM 16, the undefined information was placed before the normal stack setup metadata which meant it was being ignored by libunwind and it continues unwinding. For dynamically linked libraries this should not cause any problems since (as of the last commit) RTLD's entry point has the required termination annotation, but for statically linked binaries we keep unwinding and eventually trigger a bounds violation while parsing nonsense data. Make this current annotation less fragile by using a naked function that has the .cfi_undefined annotation and calls the real C entry.
- Loading branch information
1 parent
047c38e
commit 389d945
Showing
4 changed files
with
39 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters