From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E64C03858C74; Wed, 31 Jan 2024 22:58:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E64C03858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706741895; bh=qMkMZEp0EQJArVLdOhoKaDH6FF9CvHc9/7qYahSVjps=; h=From:To:Subject:Date:From; b=KAcjQrqTRhXe6OwNPInh+yYq3/yibQOHeWTzM3kFLr3tl2gXh/rj2v8FT6RCpwxWj 2nlDsShx7vBh/bmc/uHmd6kslnR4qiW73jE8uqCoJc6oRVPGMvT7P8xFf5n6RgrToO B9RqqnWPUVoNu0iXD2scEVt5fqobyDUAAtZfuxMg= From: "matheus.a.m.moreira at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113694] New: Allow renaming stack smashing protector symbols Date: Wed, 31 Jan 2024 22:58:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: matheus.a.m.moreira at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113694 Bug ID: 113694 Summary: Allow renaming stack smashing protector symbols Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: matheus.a.m.moreira at gmail dot com Target Milestone: --- I'm writing freestanding Linux applications which are compiled with -ffreestanding -nostdlib. In order to integrate with the stack smashing protector, I need to provide the following symbols: __stack_chk_guard __stack_chk_fail It would be nice if there was a compiler option to rename these symbols to something else. I want to make them consistent with the rest of my code, thereby improving its quality. A couple of options would be enough: -fstack-protector-canary=3Dmy_variable -fstack-protector-handler=3Dmy_function Attributes could work too: uintptr_t my_canary __attribute__((stack_protector_canary)); __attribute__((noreturn, stack_protector_handler)) void __stack_chk_fail(void);=