[libc-commits] [libc] [libc] add __stack_chk_guard to generic (PR #121121)

Tristan Ross via libc-commits libc-commits at lists.llvm.org
Mon Dec 30 23:08:07 PST 2024


https://github.com/RossComputerGuy updated https://github.com/llvm/llvm-project/pull/121121

>From 2b4301e4d29764a1e952d1c93360e045f71081d8 Mon Sep 17 00:00:00 2001
From: Tristan Ross <tristan.ross at midstall.com>
Date: Wed, 25 Dec 2024 18:02:38 -0800
Subject: [PATCH] [libc] add __stack_chk_guard to generic

---
 libc/src/compiler/generic/__stack_chk_fail.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libc/src/compiler/generic/__stack_chk_fail.cpp b/libc/src/compiler/generic/__stack_chk_fail.cpp
index c76ec1407ad356..183cf9eb2cbf23 100644
--- a/libc/src/compiler/generic/__stack_chk_fail.cpp
+++ b/libc/src/compiler/generic/__stack_chk_fail.cpp
@@ -12,6 +12,8 @@
 
 extern "C" {
 
+uintptr_t __stack_chk_guard = static_cast<uintptr_t>(0xa9fff01234);
+
 void __stack_chk_fail(void) {
   LIBC_NAMESPACE::write_to_stderr("stack smashing detected\n");
   LIBC_NAMESPACE::abort();



More information about the libc-commits mailing list