aboutsummaryrefslogtreecommitdiff
path: root/libc/startup
diff options
context:
space:
mode:
authorNick Desaulniers <nickdesaulniers@users.noreply.github.com>2023-12-19 11:05:12 -0800
committerGitHub <noreply@github.com>2023-12-19 11:05:12 -0800
commit315a5cce89d8f15da5c47d85abbc8155b9c0f0b0 (patch)
tree14be834af68c522fe0cd28c8ce0cb15a44a91825 /libc/startup
parent0768253c20402c8a7a357210923c6867efc0ef5c (diff)
downloadllvm-315a5cce89d8f15da5c47d85abbc8155b9c0f0b0.zip
llvm-315a5cce89d8f15da5c47d85abbc8155b9c0f0b0.tar.gz
llvm-315a5cce89d8f15da5c47d85abbc8155b9c0f0b0.tar.bz2
[libc] move __stack_chk_fail to src/ from startup/ (#75863)
__stack_chk_fail should be provided by libc.a, not startup files. Add __stack_chk_fail to existing linux and arm entrypoints. On Windows (when not targeting MinGW), it seems that the corresponding function identifier is __security_check_cookie, so no entrypoint is added for Windows. Baremetal targets also ought to be compileable with `-fstack-protector*` There is no common header for this prototype, since calls to __stack_chk_fail are meant to be inserted by the compiler upon function return when compiled `-fstack-protector*`.
Diffstat (limited to 'libc/startup')
-rw-r--r--libc/startup/linux/x86_64/start.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/libc/startup/linux/x86_64/start.cpp b/libc/startup/linux/x86_64/start.cpp
index c98f58a..bc03a3c 100644
--- a/libc/startup/linux/x86_64/start.cpp
+++ b/libc/startup/linux/x86_64/start.cpp
@@ -25,11 +25,6 @@
extern "C" int main(int, char **, char **);
-extern "C" void __stack_chk_fail() {
- LIBC_NAMESPACE::write_to_stderr("stack smashing detected");
- LIBC_NAMESPACE::abort();
-}
-
namespace LIBC_NAMESPACE {
#ifdef SYS_mmap2