From ef443476d9706035ac219f0280ef0b817dda7a6d Mon Sep 17 00:00:00 2001 From: kan Date: Tue, 14 Jul 2009 21:19:13 +0000 Subject: Second attempt at eliminating .text relocations in shared libraries compiled with stack protector. Use libssp_nonshared library to pull __stack_chk_fail_local symbol into each library that needs it instead of pulling it from libc. GCC generates local calls to this function which result in absolute relocations put into position-independent code segment, making dynamic loader do extra work every time given shared library is being relocated and making affected text pages non-shareable. Reviewed by: kib Approved by: re (kib) --- gnu/lib/libgcc/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnu/lib/libgcc') diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index 49b96e6..399aff8 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -7,6 +7,12 @@ SHLIB_NAME= libgcc_s.so.1 SHLIBDIR?= /lib .include +# +# libgcc is linked in last and thus cannot depend on ssp symbols coming +# from earlier libraries. Disable stack protection for this library. +# +MK_SSP= no + .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" .PATH: ${GCCDIR}/config/${GCC_CPU} ${GCCDIR}/config ${GCCDIR} -- cgit v1.1