[PATCH 08/12] De-PLTize __stack_chk_fail internal calls within libc.so.
Florian Weimer
fweimer@redhat.com
Thu Dec 15 14:21:00 GMT 2016
On 12/15/2016 03:15 PM, Nix wrote:
> Possible fix, untested:
>
> diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
> index 36908b5..0679354 100644
> --- a/sysdeps/generic/symbol-hacks.h
> +++ b/sysdeps/generic/symbol-hacks.h
> @@ -7,5 +7,7 @@ asm ("memcpy = __GI_memcpy");
>
> /* -fstack-protector generates calls to __stack_chk_fail, which need
> similar adjustments to avoid going through the PLT. */
> +#if defined __SSP__ || defined __SSP_ALL__ || defined __SSP_STRONG__
> asm ("__stack_chk_fail = __stack_chk_fail_local");
> #endif
> +#endif
The condition looks rather brittle. What if GCC grows an
-fstack-protector-light switch and __SSP_LIGHT__ macro?
I wonder if it's better to add something to $(no-stack-protector) and
use that in the conditional.
Thanks,
Florian
More information about the Libc-alpha
mailing list