summaryrefslogtreecommitdiff
path: root/libssp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2015-04-22 10:21:45 +0000
committer <>2015-04-25 21:44:09 +0000
commitf80b5ea1605c9f9408c5aa386ba71c16d918ebbf (patch)
treebb7eafaa81fc4b8c5c215bc08d517fd158db234a /libssp
parentc27a97d04853380f1e80525391b3f0d156ed4c84 (diff)
downloadgcc-tarball-f80b5ea1605c9f9408c5aa386ba71c16d918ebbf.tar.gz
Imported from /home/lorry/working-area/delta_gcc-tarball/gcc-5.1.0.tar.bz2.gcc-5.1.0
Diffstat (limited to 'libssp')
-rw-r--r--libssp/ChangeLog25
-rwxr-xr-xlibssp/configure4
-rw-r--r--libssp/gets-chk.c5
-rw-r--r--libssp/ssp.c16
4 files changed, 42 insertions, 8 deletions
diff --git a/libssp/ChangeLog b/libssp/ChangeLog
index dbf37536da..b4e6d42cda 100644
--- a/libssp/ChangeLog
+++ b/libssp/ChangeLog
@@ -1,14 +1,27 @@
-2014-10-30 Release Manager
+2015-04-22 Release Manager
- * GCC 4.9.2 released.
+ * GCC 5.1.0 released.
-2014-07-16 Release Manager
+2015-02-09 Georg Koppen <gk@torproject.org>
- * GCC 4.9.1 released.
+ * ssp.c: Conditionally include <windows.h>
+ (__guard_setup): For Windows, use approved methods to get
+ a suitable random number for the stack check guard rather
+ than reading /dev/random.
-2014-04-22 Release Manager
+2015-01-22 Matthias Klose <doko@ubuntu.com>
- * GCC 4.9.0 released.
+ * gets-chk.c: Declare prototype for gets in C11 mode.
+
+2014-11-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR bootstrap/63784
+ * configure: Regenerated.
+
+2014-11-11 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR target/63610
+ * configure: Regenerate.
2013-12-07 Jakub Jelinek <jakub@redhat.com>
diff --git a/libssp/configure b/libssp/configure
index b26c0b3352..332aa2caa2 100755
--- a/libssp/configure
+++ b/libssp/configure
@@ -7123,7 +7123,7 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[91]*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[012]*)
+ 10.[012][,.]*)
_lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
@@ -8427,7 +8427,7 @@ _LT_EOF
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
diff --git a/libssp/gets-chk.c b/libssp/gets-chk.c
index 053c446264..92768e4da1 100644
--- a/libssp/gets-chk.c
+++ b/libssp/gets-chk.c
@@ -51,6 +51,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
# include <string.h>
#endif
+#if !(!defined __USE_ISOC11 \
+ || (defined __cplusplus && __cplusplus <= 201103L))
+extern char *gets (char *);
+#endif
+
extern void __chk_fail (void) __attribute__((__noreturn__));
char *
diff --git a/libssp/ssp.c b/libssp/ssp.c
index 96adf17ce3..38e3ec83f6 100644
--- a/libssp/ssp.c
+++ b/libssp/ssp.c
@@ -55,6 +55,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Native win32 apps don't know about /dev/tty but can print directly
to the console using "CONOUT$" */
#if defined (_WIN32) && !defined (__CYGWIN__)
+#include <windows.h>
# define _PATH_TTY "CONOUT$"
#else
# define _PATH_TTY "/dev/tty"
@@ -75,6 +76,20 @@ __guard_setup (void)
if (__stack_chk_guard != 0)
return;
+#if defined (_WIN32) && !defined (__CYGWIN__)
+ HCRYPTPROV hprovider = 0;
+ if (CryptAcquireContext(&hprovider, NULL, NULL, PROV_RSA_FULL,
+ CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
+ {
+ if (CryptGenRandom(hprovider, sizeof (__stack_chk_guard),
+ (BYTE *)&__stack_chk_guard) && __stack_chk_guard != 0)
+ {
+ CryptReleaseContext(hprovider, 0);
+ return;
+ }
+ CryptReleaseContext(hprovider, 0);
+ }
+#else
fd = open ("/dev/urandom", O_RDONLY);
if (fd != -1)
{
@@ -85,6 +100,7 @@ __guard_setup (void)
return;
}
+#endif
/* If a random generator can't be used, the protector switches the guard
to the "terminator canary". */
p = (unsigned char *) &__stack_chk_guard;