From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24085 invoked by alias); 15 Nov 2006 01:14:46 -0000 Received: (qmail 24008 invoked by uid 48); 15 Nov 2006 01:14:29 -0000 Date: Wed, 15 Nov 2006 01:14:00 -0000 Subject: [Bug c/29838] New: -fstack-protector shouldn't use TLS in freestanding mode X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "samuel dot thibault at ens-lyon dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-11/txt/msg01334.txt.bz2 List-Id: Hi, On some architectures, when given -fstack-protector (which is the default on ubuntu), gcc generates a TLS reference for the stack guard. For instance, on linux x86 with a fairly recent version of glibc: echo 'void f (void) { volatile char a[8]; a[3]; }' | gcc -S -x c -O2 -fstack-protector - -o - generates a %gs:0x14 reference. In freestanding mode, this poses problem because the target (typically an OS kernel) does not necessarily have TLS. In such case, gcc should default back to referencing __stack_chk_guard. Samuel -- Summary: -fstack-protector shouldn't use TLS in freestanding mode Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: samuel dot thibault at ens-lyon dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29838