This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29838] New: -fstack-protector shouldn't use TLS in freestanding mode
- From: "samuel dot thibault at ens-lyon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Nov 2006 01:14:29 -0000
- Subject: [Bug c/29838] New: -fstack-protector shouldn't use TLS in freestanding mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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