summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2009-06-29 01:33:59 +0000
committerkan <kan@FreeBSD.org>2009-06-29 01:33:59 +0000
commita3faeb1b4110d52bf2e7fe7d46368df8a3b74ff2 (patch)
treeb971befb61e661c38ca8a12e087cc3b59f93ce95
parentf780ef8f1980f918f04365b9374ef3f0b5c8652b (diff)
downloadFreeBSD-src-a3faeb1b4110d52bf2e7fe7d46368df8a3b74ff2.zip
FreeBSD-src-a3faeb1b4110d52bf2e7fe7d46368df8a3b74ff2.tar.gz
Back out previous revision until better tested fix is ready.
Approved by: re (impliciti, by approving previos check-in)
-rw-r--r--Makefile.inc12
-rw-r--r--gnu/lib/libgcc/Makefile8
-rw-r--r--gnu/lib/libssp/libssp_nonshared/Makefile2
-rw-r--r--gnu/usr.bin/cc/cc_tools/freebsd-native.h8
-rw-r--r--lib/libc/Makefile2
-rw-r--r--lib/libc/sys/Symbol.map1
-rw-r--r--lib/libc/sys/stack_protector.c7
-rw-r--r--libexec/rtld-elf/Makefile2
8 files changed, 12 insertions, 20 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index d05b004..0f8d28e 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1069,7 +1069,7 @@ libraries:
#
# static libgcc.a prerequisite for shared libc
#
-_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc
+_prereq_libs= gnu/lib/libgcc
# These dependencies are not automatically generated:
#
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index 65c99d0..49b96e6 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -6,12 +6,6 @@ LIB= gcc
SHLIB_NAME= libgcc_s.so.1
SHLIBDIR?= /lib
-#
-# libgcc is linked in last and thus cannot depend on ssp symbols coming
-# from earlier libraries. Disable stack protection for this library.
-#
-WITHOUT_SSP= yes
-
.include <bsd.own.mk>
.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
@@ -24,7 +18,7 @@ CFLAGS+= -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED \
-I${.CURDIR}/../../usr.bin/cc/cc_tools
LDFLAGS+= -nodefaultlibs
-LDADD+= -lc -lssp_nonshared
+LDADD+= -lc
OBJS= # added to below in various ways depending on TARGET_ARCH
diff --git a/gnu/lib/libssp/libssp_nonshared/Makefile b/gnu/lib/libssp/libssp_nonshared/Makefile
index 9454495..1dcd54f 100644
--- a/gnu/lib/libssp/libssp_nonshared/Makefile
+++ b/gnu/lib/libssp/libssp_nonshared/Makefile
@@ -13,6 +13,6 @@ SRCS= ssp-local.c
CFLAGS+= -DHAVE_CONFIG_H
CFLAGS+= -I${.CURDIR}/.. -I${GCCLIB}/libssp -I${GCCLIB}/include
-CFLAGS+= -fPIC -DPIC -fvisibility=hidden
+CFLAGS+= -fPIC -DPIC
.include <bsd.lib.mk>
diff --git a/gnu/usr.bin/cc/cc_tools/freebsd-native.h b/gnu/usr.bin/cc/cc_tools/freebsd-native.h
index b9ddea1..6f7fd7b 100644
--- a/gnu/usr.bin/cc/cc_tools/freebsd-native.h
+++ b/gnu/usr.bin/cc/cc_tools/freebsd-native.h
@@ -62,11 +62,3 @@
/* FreeBSD is 4.4BSD derived */
#define bsd4_4
-
-/*
- * Link in libssp_nonshared to get local hidden symbol for
- * __stack_chk_fail_local into each binary that needs it.
- * Linux does this with static part of their libc.so linker script, we reuse
- * libssp_nonshared.a for the same purpose.
- */
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared}"
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 4f13f8e..cf9ef3a 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -26,7 +26,7 @@ PRECIOUSLIB=
#
DPADD+= ${LIBGCC}
LDFLAGS+= -nodefaultlibs
-LDADD+= -lgcc -lssp_nonshared
+LDADD+= -lgcc
# Define (empty) variables so that make doesn't give substitution
# errors if the included makefiles don't change these:
diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map
index 41f34ae..88bc779 100644
--- a/lib/libc/sys/Symbol.map
+++ b/lib/libc/sys/Symbol.map
@@ -282,6 +282,7 @@ FBSD_1.0 {
socket;
socketpair;
__stack_chk_fail;
+ __stack_chk_fail_local;
__stack_chk_guard;
stat;
statfs;
diff --git a/lib/libc/sys/stack_protector.c b/lib/libc/sys/stack_protector.c
index 63beebc..f753fcd 100644
--- a/lib/libc/sys/stack_protector.c
+++ b/lib/libc/sys/stack_protector.c
@@ -47,6 +47,7 @@ static void __guard_setup(void) __attribute__((__constructor__, __used__));
static void __fail(const char *);
void __stack_chk_fail(void);
void __chk_fail(void);
+void __stack_chk_fail_local(void);
/*LINTED used*/
static void
@@ -108,4 +109,8 @@ __chk_fail(void)
__fail("buffer overflow detected; terminated");
}
-__sym_compat(__stack_chk_fail_local, __stack_chk_fail, FBSD_1.0);
+void
+__stack_chk_fail_local(void)
+{
+ __stack_chk_fail();
+}
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 5e9729c..7c20398 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -22,7 +22,7 @@ MLINKS= rtld.1 ld-elf.so.1.1 \
CFLAGS+= -fpic -DPIC
LDFLAGS+= -shared -Wl,-Bsymbolic
DPADD= ${LIBC_PIC}
-LDADD= -lc_pic -lssp_nonshared
+LDADD= -lc_pic
.if ${MACHINE_ARCH} != "ia64"
.if ${MK_SYMVER} == "yes"
OpenPOWER on IntegriCloud