{"id":2233235,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2233235/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/CAMe9rOqvPAqWgkBFOXEFSWMO3-MSzrpUOdwYB-Vsog6=QcXOYw@mail.gmail.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.1/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<CAMe9rOqvPAqWgkBFOXEFSWMO3-MSzrpUOdwYB-Vsog6=QcXOYw@mail.gmail.com>","date":"2026-05-05T22:23:45","name":"Update __stack_chk_guard documentation","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a8fc80efe66ed6e85bb572a80fd8b1d3ffc2cbde","submitter":{"id":4387,"url":"http://patchwork.ozlabs.org/api/1.1/people/4387/?format=json","name":"H.J. Lu","email":"hjl.tools@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/CAMe9rOqvPAqWgkBFOXEFSWMO3-MSzrpUOdwYB-Vsog6=QcXOYw@mail.gmail.com/mbox/","series":[{"id":502901,"url":"http://patchwork.ozlabs.org/api/1.1/series/502901/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=502901","date":"2026-05-05T22:23:45","name":"Update __stack_chk_guard documentation","version":1,"mbox":"http://patchwork.ozlabs.org/series/502901/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2233235/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2233235/checks/","tags":{},"headers":{"Return-Path":"<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":["incoming@patchwork.ozlabs.org","gcc-patches@gcc.gnu.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","gcc-patches@gcc.gnu.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=CFf08jOw;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)","sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=CFf08jOw","sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","sourceware.org; spf=pass smtp.mailfrom=gmail.com","server2.sourceware.org;\n arc=pass smtp.remote-ip=2607:f8b0:4864:20::633"],"Received":["from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g9CkH6QMZz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 06 May 2026 08:24:54 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5EFAA4BA2E21\n\tfor <incoming@patchwork.ozlabs.org>; Tue,  5 May 2026 22:24:52 +0000 (GMT)","from mail-pl1-x633.google.com (mail-pl1-x633.google.com\n [IPv6:2607:f8b0:4864:20::633])\n by sourceware.org (Postfix) with ESMTPS id 0FB354BA2E0B\n for <gcc-patches@gcc.gnu.org>; Tue,  5 May 2026 22:24:25 +0000 (GMT)","by mail-pl1-x633.google.com with SMTP id\n d9443c01a7336-2ba17c8cfacso27053805ad.2\n for <gcc-patches@gcc.gnu.org>; Tue, 05 May 2026 15:24:24 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 5EFAA4BA2E21","OpenDKIM Filter v2.11.0 sourceware.org 0FB354BA2E0B"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 0FB354BA2E0B","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 0FB354BA2E0B","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1778019865; cv=pass;\n b=vzR1ern9RwdqCSiSw/O+Iw4TdEHrYgc+2+agmaGhXnM6vIdgwx/+KBeqVFlH1cqLOfbhV0Z3OQ96Z0/swkbmYHlvnR9QgkbOaKFT9arm66sp3Vg26b0c+8GQcp4DO2oD8/2sWReCPzWRlfSFlMs/eNLuc4U6T1OA0dkcImSjZ6Q=","i=1; a=rsa-sha256; t=1778019863; cv=none;\n d=google.com; s=arc-20240605;\n b=G1cjFjQRQLS9Lp7mGzDCILCgjmPz3OoPuhfldJysJvVCmf5SCFJHgEIU/G9GSDWIPA\n 31kBbwtgKGTDQvNXXCcVo2ReuE6J7eQsuP02ubcetzL2/MarRdsuVPsnaHiQkkRKCwMe\n 3QcbiFK0tg4HFIkW3VoZIPD4aZ3UyoRYVLDGZIseEbj48EUUS/VDpA73yQZT/uCj6rSB\n HlQy+nU/lAkCmp0sMKvv4MBZkt9qcJy9uMPQWfL+ViDLAyhLGEqVBh1/A4t4QRHnouA1\n LKMLzzQwhQU7xFcw92sZkr3YCYlPP/PS1vnLOhaLpyJ+MKD0KZr+jRsThkMF5OA5EJkJ\n Mwzw=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1778019865; c=relaxed/simple;\n bh=fkmHKspt4OqwM5/YP+jukUiejGdgTyF1iJpzFfD6g4U=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=PujoNDuxGp81waELVz6JkL3h2Wj0VSc5/oGpQr2P0F849RW60/aJR78ZQGlpcJ3lYTz3TzjRFEtP3hww/RT6mUvQ3MLUxu7nIOowVSr4TAd3CBWamKDUf+Dbcx7mYj1daNLN//3sedcYt/3AMuiqNtASZdiVij7ePfgj21uxk8Y=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=to:subject:message-id:date:from:mime-version:dkim-signature;\n bh=MMGvFIjxHt4FYCoLvMLY9SC2+NIWLK36VpMMj9ntiMg=;\n fh=1L2/IiukS00vgiXcKREcvt+pFBEM8GuYOng2C1a9k1k=;\n b=ZVkzbgBfIB0aaZbAz3TeH5V7XO0RNBnP4szA9Z782/KtblN1IzI1TupV8yxhdnBWUq\n ivbnoMqwlmkAUHaCI/hQCt7xLnLtt9IfIyBJxeT1xiP4GCuxK95Mr2Jqz1O9xqIYcJwG\n 3pKuzSTTbxqtot0e9mujkzoji1cyN2YA2HIGtXGQWyfD3/rrQYzzX7cylyiHerPeFgu3\n x4FolL/YGzdGYU5nXn23SnnA/9yatl97S4BodsA2TfBrm2ts2t+UKlHNJhOWchdeHxSn\n /g7qifi5j1TrAYepLi4H2Qu7kwMKn0J59n6DihDAWSoCfCgyq4i97KdmwlsVa95Y84KN\n FZ0w==; darn=gcc.gnu.org"],"ARC-Authentication-Results":["i=2; server2.sourceware.org","i=1; mx.google.com; arc=none"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1778019863; x=1778624663; darn=gcc.gnu.org;\n h=to:subject:message-id:date:from:mime-version:from:to:cc:subject\n :date:message-id:reply-to;\n bh=MMGvFIjxHt4FYCoLvMLY9SC2+NIWLK36VpMMj9ntiMg=;\n b=CFf08jOwhvERKR0nrcoLvrVywvGW8Hr5UJ8rvWgEjMFe7s8W/vFfFeyUVPscVLhVRd\n BmY8630Fh7s57wxCS2Vi0HzpdlgEa5zwvCVFet/2vU4nzu9VJ0YNUDT2/RgYFmItEYKR\n UAQ5gHmWi8BCTfgoFz43jppbUQks81/XH/2khDIcfvNzH+IY8Gl6Q6KRd2X8etfzgwaI\n 3dmUESNOZSE8wsR7z0YDM/+Tkj0SGrVIGeo2nZIt8gkC7xUQJau2eek9wdPlSm3JtohL\n z6OXORyBUvnhpR5I+kD/aDbWtPQz3qMnx0DFdQz82mXOAV9Rn25a38BYw5uMmsUWxDoF\n hWLQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778019863; x=1778624663;\n h=to:subject:message-id:date:from:mime-version:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=MMGvFIjxHt4FYCoLvMLY9SC2+NIWLK36VpMMj9ntiMg=;\n b=sMVGpoNG0oYTy2n/vZRtd+tLp/0am+f9Da4F20uRAGnisOLvP2IbquaalgMnglAGHF\n 12nO74QgJ6Xqk/PvdmDhWmDtnLsBhjC7uVNj+3+/JsnUlmAd8VmsAYTas4AEu5q7Pa6G\n +VqtO1R63ATNeYtEwJ13SIXrUSuloa0cicKdY2oUaSHXAQKbKdMvxcvCEODz7SMUu8Wp\n 44QB7I//egWiGG94lxBnjicdS/Of6dWy0GLHnw1tPGAgSc69Wrha7kOMmXNKMDGGSoHk\n h1nzoIFXXjPLFBE1JuOnWvQp7PCJB68aOIe9V7slCR1VSDu4x9bWwO7i1zvHzXPx9UAU\n dhEw==","X-Gm-Message-State":"AOJu0YzqPX0WCtcbZoLv5Vt8/J0E7vR9kUbG5MWEpe3YekHgjGfqMOL9\n 6EdYCwc+KqazOa037YDdbZmVjHIJfPsxeH5zZSARO+NfJhtTyq4V1MIgDs0RLLYAYB2GIWC7TGR\n 23PvclMJIc2kv2gHhZ7oaMffeYkio5E9h2c0i8WEOjiIV","X-Gm-Gg":"AeBDiesRaIvJkGUvoL3odHV/GFdAQxJEsSSsy1qixsGdVmMY1WbHCHFqctwIXG7GrV7\n UvTSDkg1nq2XWUC3Vgef+ikXlbhIHkLG9v3MgB1lXXFn6pExKDjNvpSOF2aYtt/Tr9XtKUdDDZl\n TKbb+lxnvXKmWGtO1xETpSvZYGAmy/WkY4dYXsdvSD/8Co1isBHM5aIqdCLymz6Ma4olyul9Ej0\n v3MjOwtUVFtwEN5WCIdSSND3jN4V5gqxykC1WtS7gn76V5yr5zND2D49UnxtT4bzYSnjD6IvkuJ\n 7tpsuSeQ3g71lwK81/aa","X-Received":"by 2002:a17:903:3b87:b0:2b2:4ded:954e with SMTP id\n d9443c01a7336-2ba798d3e8emr6614075ad.24.1778019863359; Tue, 05 May 2026\n 15:24:23 -0700 (PDT)","MIME-Version":"1.0","From":"\"H.J. Lu\" <hjl.tools@gmail.com>","Date":"Wed, 6 May 2026 06:23:45 +0800","X-Gm-Features":"AVHnY4JMdlxb7255mf952IoozEqUSM1m2V-nGv1G28P8Jkl0B-wKQE-Kc0VlhD4","Message-ID":"\n <CAMe9rOqvPAqWgkBFOXEFSWMO3-MSzrpUOdwYB-Vsog6=QcXOYw@mail.gmail.com>","Subject":"[PATCH] Update __stack_chk_guard documentation","To":"GCC Patches <gcc-patches@gcc.gnu.org>","Content-Type":"multipart/mixed; boundary=\"0000000000005c0abf065119825b\"","X-BeenThere":"gcc-patches@gcc.gnu.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Gcc-patches mailing list <gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>","List-Archive":"<https://gcc.gnu.org/pipermail/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-request@gcc.gnu.org?subject=help>","List-Subscribe":"<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"},"content":"Documentation of __stack_chk_guard\n\n@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_GUARD (void)\nThis hook returns a @code{DECL} node for the external variable to use\nfor the stack protection guard.  This variable is initialized by the\nruntime to some random value and is used to initialize the guard value\nthat is placed at the top of the local stack frame.  The type of this\nvariable must be @code{ptr_type_node}.\n\nThe default version of this hook creates a variable called\n@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.\n@end deftypefn\n\nwas added by\n\ncommit 7d69de618e732d343228a07d797a30e39a6363f4\nAuthor:     Richard Henderson <rth@redhat.com>\nAuthorDate: Mon Jun 27 00:41:16 2005 -0700\nCommit:     Jakub Jelinek <jakub@gcc.gnu.org>\nCommitDate: Mon Jun 27 09:41:16 2005 +0200\n\n    c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__.\n\n__stack_chk_guard was moved to libssp later by\n\ncommit 77008252819720c987f11b3dade670e2b3ba09b8\nAuthor:     Jakub Jelinek <jakub@redhat.com>\nAuthorDate: Sat Jul 2 10:52:21 2005 +0200\nCommit:     Jakub Jelinek <jakub@gcc.gnu.org>\nCommitDate: Sat Jul 2 10:52:21 2005 +0200\n\n    Makefile.def (target_modules): Add libssp.\n\nIts documentation became stale.  Update __stack_chk_guard type to\nuintptr_t if it is a global symbol and its normal location to libssp.\n\nPR libgcc/125190\n* target.def (stack_protect_guard): __stack_chk_guard type is\nuintptr_t if it is a global symbol.  It is normally defined in\nlibssp.\n(stack_protect_guard_symbol_p): It is in libssp.\n* doc/tm.texi: Regenerated.","diff":"From 2cb9e1da33dbc251b36ef8c01bf46b53717c5d83 Mon Sep 17 00:00:00 2001\nFrom: \"H.J. Lu\" <hjl.tools@gmail.com>\nDate: Wed, 6 May 2026 06:16:35 +0800\nSubject: [PATCH] Update __stack_chk_guard documentation\n\nDocumentation of __stack_chk_guard\n\n@deftypefn {Target Hook} tree TARGET_STACK_PROTECT_GUARD (void)\nThis hook returns a @code{DECL} node for the external variable to use\nfor the stack protection guard.  This variable is initialized by the\nruntime to some random value and is used to initialize the guard value\nthat is placed at the top of the local stack frame.  The type of this\nvariable must be @code{ptr_type_node}.\n\nThe default version of this hook creates a variable called\n@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.\n@end deftypefn\n\nwas added by\n\ncommit 7d69de618e732d343228a07d797a30e39a6363f4\nAuthor:     Richard Henderson <rth@redhat.com>\nAuthorDate: Mon Jun 27 00:41:16 2005 -0700\nCommit:     Jakub Jelinek <jakub@gcc.gnu.org>\nCommitDate: Mon Jun 27 09:41:16 2005 +0200\n\n    c-cppbuiltin.c (c_cpp_builtins): Add __SSP_ALL__ and __SSP__.\n\n__stack_chk_guard was moved to libssp later by\n\ncommit 77008252819720c987f11b3dade670e2b3ba09b8\nAuthor:     Jakub Jelinek <jakub@redhat.com>\nAuthorDate: Sat Jul 2 10:52:21 2005 +0200\nCommit:     Jakub Jelinek <jakub@gcc.gnu.org>\nCommitDate: Sat Jul 2 10:52:21 2005 +0200\n\n    Makefile.def (target_modules): Add libssp.\n\nIts documentation became stale.  Update __stack_chk_guard type to\nuintptr_t if it is a global symbol and its normal location to libssp.\n\n\tPR libgcc/125190\n\t* target.def (stack_protect_guard): __stack_chk_guard type is\n\tuintptr_t if it is a global symbol.  It is normally defined in\n\tlibssp.\n\t(stack_protect_guard_symbol_p): It is in libssp.\n\t* doc/tm.texi: Regenerated.\n\nSigned-off-by: H.J. Lu <hjl.tools@gmail.com>\n---\n gcc/doc/tm.texi | 8 +++++---\n gcc/target.def  | 8 +++++---\n 2 files changed, 10 insertions(+), 6 deletions(-)\n\ndiff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi\nindex 2a8670b46c1..b63b99ecffa 100644\n--- a/gcc/doc/tm.texi\n+++ b/gcc/doc/tm.texi\n@@ -5426,15 +5426,17 @@ This hook returns a @code{DECL} node for the external variable to use\n for the stack protection guard.  This variable is initialized by the\n runtime to some random value and is used to initialize the guard value\n that is placed at the top of the local stack frame.  The type of this\n-variable must be @code{ptr_type_node}.\n+variable must be @code{uintptr_t} if it is defined as a global symbol.\n+Otherwise, its type must be @code{ptr_type_node}.\n \n The default version of this hook creates a variable called\n-@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.\n+@samp{__stack_chk_guard}, which is normally defined in @file{libssp}\n+as a global symbol.\n @end deftypefn\n \n @deftypefn {Target Hook} bool TARGET_STACK_PROTECT_GUARD_SYMBOL_P (void)\n Usually, the compiler uses an external variable @samp{__stack_chk_guard}\n-defined in @file{libgcc2.c} as the stack protection guard symbol.  Define\n+defined in @file{libssp} as the stack protection guard symbol.  Define\n this hook to return true if a user provided definition of\n @samp{__stack_chk_guard} with the @code{uintptr_t} type is used.\n @end deftypefn\ndiff --git a/gcc/target.def b/gcc/target.def\nindex a52205ffba2..e677baaddb8 100644\n--- a/gcc/target.def\n+++ b/gcc/target.def\n@@ -4647,10 +4647,12 @@ DEFHOOK\n for the stack protection guard.  This variable is initialized by the\\n\\\n runtime to some random value and is used to initialize the guard value\\n\\\n that is placed at the top of the local stack frame.  The type of this\\n\\\n-variable must be @code{ptr_type_node}.\\n\\\n+variable must be @code{uintptr_t} if it is defined as a global symbol.\\n\\\n+Otherwise, its type must be @code{ptr_type_node}.\\n\\\n \\n\\\n The default version of this hook creates a variable called\\n\\\n-@samp{__stack_chk_guard}, which is normally defined in @file{libgcc2.c}.\",\n+@samp{__stack_chk_guard}, which is normally defined in @file{libssp}\\n\\\n+as a global symbol.\",\n  tree, (void),\n  default_stack_protect_guard)\n \n@@ -4659,7 +4661,7 @@ The default version of this hook creates a variable called\\n\\\n DEFHOOK\n (stack_protect_guard_symbol_p,\n  \"Usually, the compiler uses an external variable @samp{__stack_chk_guard}\\n\\\n-defined in @file{libgcc2.c} as the stack protection guard symbol.  Define\\n\\\n+defined in @file{libssp} as the stack protection guard symbol.  Define\\n\\\n this hook to return true if a user provided definition of\\n\\\n @samp{__stack_chk_guard} with the @code{uintptr_t} type is used.\",\n  bool, (void),\n-- \n2.54.0\n\n","prefixes":[]}