From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1DCC73858298; Tue, 19 Jul 2022 16:44:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1DCC73858298 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/81708] The x86 stack canary location should be customizable Date: Tue, 19 Jul 2022 16:44:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com X-Bugzilla-Status: REOPENED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ubizjak at gmail dot com X-Bugzilla-Target-Milestone: 8.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2022 16:44:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D81708 --- Comment #16 from Uro=C5=A1 Bizjak --- (In reply to Alexandre Oliva from comment #15) > Uro=C5=A1, >=20 > stack-prot-sym.c fails on ia32 with PIC/PIE: the address/value of my_guard > is loaded from the GOT, instead of appearing as %gs:my_guard. >=20 > After being confused by the expectation that my_guard should be a LE TLS > symbol, I'm coming to the conclusion that my expectation was incorrect, a= nd > it is indeed supposed to be a plain offset, so the code is correct, if not > as efficient as on PDC. Does that sound right? >=20 > I'm undecided as to whether avoiding the GOT reference, and requiring the > symbol to be usable as a link-time constant, would be desirable/doable.=20 > Thoughts? The current implementation was implemented specifically for linux, as reque= sted in Comment #0, without any other usages in mind. Also, I'm not deeply famil= iar with the details of symbol linking, so perhaps HJ can help here.=