diff options
author | Alexander Kabaev <kan@FreeBSD.org> | 2009-07-14 21:19:13 +0000 |
---|---|---|
committer | Alexander Kabaev <kan@FreeBSD.org> | 2009-07-14 21:19:13 +0000 |
commit | 2286fe763592aa13d320186bf3e233a560af749b (patch) | |
tree | 50c2540e7067c9b377ade1910cd0348aeab454e7 /share | |
parent | 0fe0ed8bf88b8aed13fc4533e97b94d2919ac6d5 (diff) | |
download | src-2286fe763592aa13d320186bf3e233a560af749b.tar.gz src-2286fe763592aa13d320186bf3e233a560af749b.zip |
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)
Notes
Notes:
svn path=/head/; revision=195697
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.lib.mk | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 741c9cb2b618..982ff50cfc48 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -200,11 +200,11 @@ ${SHLIB_NAME}: ${SOBJS} @ln -fs ${.TARGET} ${SHLIB_LINK} .endif .if !defined(NM) - @${CC} ${LDFLAGS} -shared -Wl,-x \ + @${CC} ${LDFLAGS} ${SSP_CFLAGS} -shared -Wl,-x \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `lorder ${SOBJS} | tsort -q` ${LDADD} .else - @${CC} ${LDFLAGS} -shared -Wl,-x \ + @${CC} ${LDFLAGS} ${SSP_CFLAGS} -shared -Wl,-x \ -o ${.TARGET} -Wl,-soname,${SONAME} \ `NM='${NM}' lorder ${SOBJS} | tsort -q` ${LDADD} .endif |