lkml.org 
[lkml]   [2008]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 00/15] x86_64: Optimize percpu accesses
On Wed, 09 Jul 2008 13:22:06 -0700
ebiederm@xmission.com (Eric W. Biederman) wrote:

> Jeremy Fitzhardinge <jeremy@goop.org> writes:
>
> > It's just the stack canary. It isn't library accesses; it's the
> > code gcc generates:
> >
> > foo: subq $152, %rsp
> > movq %gs:40, %rax
> > movq %rax, 136(%rsp)
> > ...
> > movq 136(%rsp), %rdx
> > xorq %gs:40, %rdx
> > je .L3
> > call __stack_chk_fail
> > .L3:
> > addq $152, %rsp
> > .p2align 4,,4
> > ret
> >
> >
> > There are two irritating things here:
> >
> > One is that the kernel supports -fstack-protector for x86-64, which
> > forces us into all these contortions in the first place. We don't
> > support stack-protector for 32-bit (gcc does), and things are much
> > easier.
>
> How does gcc know to use %gs instead of the usual %fs for accessing
> the stack protector variable? My older gcc-4.1.x on ubuntu always
> uses %fs.

ubuntu broke gcc (they don't want to have compiler flags per package so
patches stuff in gcc instead).


> I think the unification is valid and useful, and that trying to keep
> that stupid stack canary working is currently more trouble then it is
> worth.

I think that "unification over everything" is stupid, especially if it
removes useful features.



--
If you want to reach me at my work email, use arjan@linux.intel.com
For development, discussion and tips for power savings,
visit http://www.lesswatts.org


\
 
 \ /
  Last update: 2008-07-09 23:13    [W:0.146 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site