summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-05-16 14:59:34 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2009-05-16 14:59:34 +0000
commit5b818e69bce954be61aeebb12d111006ce13c0eb (patch)
tree1fe9948601dc7a6f840fdda516d4a0a3eabed428 /libc/sysdeps
parent56582813a2a1bb763cad0cfa761f5df76c707cb3 (diff)
Merge changes between r8452 and r8459 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@8460 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/i386/____longjmp_chk.S45
-rw-r--r--libc/sysdeps/i386/__longjmp.S11
-rw-r--r--libc/sysdeps/mach/hurd/.cvsignore4
-rw-r--r--libc/sysdeps/unix/common/.cvsignore4
-rw-r--r--libc/sysdeps/unix/sysv/linux/Versions2
-rw-r--r--libc/sysdeps/unix/sysv/linux/fallocate64.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/Versions4
-rw-r--r--libc/sysdeps/unix/sysv/linux/i386/fallocate64.c2
-rw-r--r--libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions3
-rw-r--r--libc/sysdeps/unix/sysv/linux/s390/s390-32/Versions3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sh/Versions3
-rw-r--r--libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions3
-rw-r--r--libc/sysdeps/unix/sysv/linux/wordsize-64/Versions5
-rw-r--r--libc/sysdeps/x86_64/____longjmp_chk.S42
-rw-r--r--libc/sysdeps/x86_64/__longjmp.S3
15 files changed, 124 insertions, 12 deletions
diff --git a/libc/sysdeps/i386/____longjmp_chk.S b/libc/sysdeps/i386/____longjmp_chk.S
new file mode 100644
index 000000000..6cd74968a
--- /dev/null
+++ b/libc/sysdeps/i386/____longjmp_chk.S
@@ -0,0 +1,45 @@
+/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+ .section .rodata.str1.1,"aMS",@progbits,1
+ .type longjmp_msg,@object
+longjmp_msg:
+ .string "longjmp causes uninitialized stack frame"
+ .size longjmp_msg, .-longjmp_msg
+
+
+#define __longjmp ____longjmp_chk
+
+#ifdef PIC
+# define CALL_FAIL movl %ebx, %ecx; \
+ cfi_register(%ebx,%ecx); \
+ LOAD_PIC_REG (bx); \
+ leal longjmp_msg@GOTOFF(%ebx), %eax; \
+ call __GI___fortify_fail@PLT
+#else
+# define CALL_FAIL movl $longjmp_msg, %eax; \
+ call __fortify_fail
+#endif
+
+#define CHECK_ESP(reg) \
+ cmpl reg, %esp; \
+ jbe .Lok; \
+ CALL_FAIL; \
+.Lok:
+
+#include "__longjmp.S"
diff --git a/libc/sysdeps/i386/__longjmp.S b/libc/sysdeps/i386/__longjmp.S
index 559d56b25..15c9e55ec 100644
--- a/libc/sysdeps/i386/__longjmp.S
+++ b/libc/sysdeps/i386/__longjmp.S
@@ -1,5 +1,6 @@
/* longjmp for i386.
- Copyright (C) 1995-1998,2000,2002,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998,2000,2002,2005,2006,2009
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -40,6 +41,9 @@ ENTRY (BP_SYM (__longjmp))
movl (JB_SP*4)(%eax), %ecx
PTR_DEMANGLE (%edx)
PTR_DEMANGLE (%ecx)
+# ifdef CHECK_ESP
+ CHECK_ESP (%ecx)
+# endif
cfi_def_cfa(%eax, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %ecx)
@@ -63,6 +67,11 @@ ENTRY (BP_SYM (__longjmp))
movl JBUF(%esp), %ecx /* User's jmp_buf in %ecx. */
CHECK_BOUNDS_BOTH_WIDE (%ecx, JBUF(%esp), $JB_SIZE)
+# ifdef CHECK_ESP
+ movl (JB_SP*4)(%ecx), %eax
+ CHECK_ESP (%eax)
+# endif
+
movl VAL(%esp), %eax /* Second argument is return value. */
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
diff --git a/libc/sysdeps/mach/hurd/.cvsignore b/libc/sysdeps/mach/hurd/.cvsignore
deleted file mode 100644
index 1f69fd919..000000000
--- a/libc/sysdeps/mach/hurd/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*
diff --git a/libc/sysdeps/unix/common/.cvsignore b/libc/sysdeps/unix/common/.cvsignore
deleted file mode 100644
index 1f69fd919..000000000
--- a/libc/sysdeps/unix/common/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-*.gz *.Z *.tar *.tgz
-=*
-TODO COPYING* AUTHORS copyr-* copying.*
-glibc-*
diff --git a/libc/sysdeps/unix/sysv/linux/Versions b/libc/sysdeps/unix/sysv/linux/Versions
index b348570bd..2b5f2fb03 100644
--- a/libc/sysdeps/unix/sysv/linux/Versions
+++ b/libc/sysdeps/unix/sysv/linux/Versions
@@ -139,7 +139,7 @@ libc {
epoll_create1; inotify_init1;
}
GLIBC_2.10 {
- fallocate; fallocate64;
+ fallocate;
}
GLIBC_PRIVATE {
# functions used in other libraries
diff --git a/libc/sysdeps/unix/sysv/linux/fallocate64.c b/libc/sysdeps/unix/sysv/linux/fallocate64.c
index ebcaf671b..751a7b227 100644
--- a/libc/sysdeps/unix/sysv/linux/fallocate64.c
+++ b/libc/sysdeps/unix/sysv/linux/fallocate64.c
@@ -23,7 +23,7 @@
/* Reserve storage for the data of the file associated with FD. */
int
-__fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
+fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
{
#ifdef __NR_fallocate
return INLINE_SYSCALL (fallocate, 6, fd, mode,
diff --git a/libc/sysdeps/unix/sysv/linux/i386/Versions b/libc/sysdeps/unix/sysv/linux/i386/Versions
index abd1d152d..f3544acb7 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/Versions
+++ b/libc/sysdeps/unix/sysv/linux/i386/Versions
@@ -41,6 +41,10 @@ libc {
# v*
vm86;
}
+ GLIBC_2.11 {
+ # f*
+ fallocate64;
+ }
GLIBC_PRIVATE {
__modify_ldt;
}
diff --git a/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c b/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
index b744710a9..4998f5e64 100644
--- a/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
+++ b/libc/sysdeps/unix/sysv/linux/i386/fallocate64.c
@@ -26,7 +26,7 @@ extern int __call_fallocate (int fd, int mode, __off64_t offset, __off64_t len)
/* Reserve storage for the data of the file associated with FD. */
int
-__fallocate64_l64 (int fd, int mode, __off64_t offset, __off64_t len)
+fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
{
return __call_fallocate (fd, mode, offset, len);
}
diff --git a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
index 181d70150..6fa0119e9 100644
--- a/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
+++ b/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/Versions
@@ -27,4 +27,7 @@ libc {
GLIBC_2.3.4 {
setcontext; getcontext; swapcontext; makecontext;
}
+ GLIBC_2.11 {
+ fallocate64;
+ }
}
diff --git a/libc/sysdeps/unix/sysv/linux/s390/s390-32/Versions b/libc/sysdeps/unix/sysv/linux/s390/s390-32/Versions
index b6d608d0a..24e0b1d4c 100644
--- a/libc/sysdeps/unix/sysv/linux/s390/s390-32/Versions
+++ b/libc/sysdeps/unix/sysv/linux/s390/s390-32/Versions
@@ -43,6 +43,9 @@ libc {
getutmp;
getutmpx;
}
+ GLIBC_2.11 {
+ fallocate64;
+ }
}
libutil {
diff --git a/libc/sysdeps/unix/sysv/linux/sh/Versions b/libc/sysdeps/unix/sysv/linux/sh/Versions
index 763be6022..bd30f928d 100644
--- a/libc/sysdeps/unix/sysv/linux/sh/Versions
+++ b/libc/sysdeps/unix/sysv/linux/sh/Versions
@@ -24,4 +24,7 @@ libc {
GLIBC_2.3.3 {
posix_fadvise64; posix_fallocate64;
}
+ GLIBC_2.11 {
+ fallocate64;
+ }
}
diff --git a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
index c585af360..c9a5b3e9d 100644
--- a/libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
+++ b/libc/sysdeps/unix/sysv/linux/sparc/sparc32/Versions
@@ -20,4 +20,7 @@ libc {
GLIBC_2.3.3 {
posix_fadvise64; posix_fallocate64;
}
+ GLIBC_2.11 {
+ fallocate64;
+ }
}
diff --git a/libc/sysdeps/unix/sysv/linux/wordsize-64/Versions b/libc/sysdeps/unix/sysv/linux/wordsize-64/Versions
new file mode 100644
index 000000000..a3b40ccd1
--- /dev/null
+++ b/libc/sysdeps/unix/sysv/linux/wordsize-64/Versions
@@ -0,0 +1,5 @@
+libc {
+ GLIBC_2.10 {
+ fallocate64;
+ }
+}
diff --git a/libc/sysdeps/x86_64/____longjmp_chk.S b/libc/sysdeps/x86_64/____longjmp_chk.S
new file mode 100644
index 000000000..030a0dcaa
--- /dev/null
+++ b/libc/sysdeps/x86_64/____longjmp_chk.S
@@ -0,0 +1,42 @@
+/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+ .section .rodata.str1.1,"aMS",@progbits,1
+ .type longjmp_msg,@object
+longjmp_msg:
+ .string "longjmp causes uninitialized stack frame"
+ .size longjmp_msg, .-longjmp_msg
+
+
+#define __longjmp ____longjmp_chk
+
+#ifdef PIC
+# define CALL_FAIL leaq longjmp_msg(%rip), %rdi; \
+ call __GI___fortify_fail
+#else
+# define CALL_FAIL movq $longjmp_msg, %rdi; \
+ call __fortify_fail
+#endif
+
+#define CHECK_RSP(reg) \
+ cmpq reg, %rsp; \
+ jbe .Lok; \
+ CALL_FAIL; \
+.Lok:
+
+#include "__longjmp.S"
diff --git a/libc/sysdeps/x86_64/__longjmp.S b/libc/sysdeps/x86_64/__longjmp.S
index a68e7a8a4..7649e9924 100644
--- a/libc/sysdeps/x86_64/__longjmp.S
+++ b/libc/sysdeps/x86_64/__longjmp.S
@@ -33,6 +33,9 @@ ENTRY(__longjmp)
PTR_DEMANGLE (%r9)
PTR_DEMANGLE (%rdx)
#endif
+#ifdef CHECK_RSP
+ CHECK_RSP (%r8)
+#endif
/* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)