This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Define TARGET_LIBC_PROVIDES_SSP for targets using glibc, use TLS access sequences on i386/x86_64/ppc/ppc64


On Mon, Jun 27, 2005 at 03:10:23AM -0400, Jakub Jelinek wrote:
> So, IMHO either we do a configure check for __stack_chk_guard in glibc
> and do something like:
> 
>   /* Targets must be able to place spill slots at lower addresses.  If the
>      target already uses a soft frame pointer, the transition is trivial.  */
>   if ((!FRAME_GROWS_DOWNWARD || TARGET_LIBC_PROVIDES_SSP < 0)
>       && flag_stack_protect)
>     {
>       warning (0, "-fstack-protector not supported for this target");
>       flag_stack_protect = 0;
>     }
>   if (!flag_stack_protect)
>     warn_stack_protect = 0;
> 
> and in Linux target headers:
> #ifdef HAVE_STACK_CHK_FAIL_IN_LIBC
> # define TARGET_LIBC_PROVIDES_SSP 1
> #else
> # define TARGET_LIBC_PROVIDES_SSP -1
> #endif
> 
> (my preferred choice, 4.1 will almost surely come up after glibc 2.4),
> or build a library separate from libgcc{,_s}, say libssp, that will contain
> the __stack_chk_* exports.

Either of these solutions would be acceptable to me.

Your point about the startup cost is a good argument for putting
these routines in something other than libgcc for *all* targets.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]