aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86_64
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-12-18 06:58:22 +0000
committerUlrich Drepper <drepper@redhat.com>2005-12-18 06:58:22 +0000
commit827b70873b41363c864fb65e99829204595d0f85 (patch)
tree5d2e3811b6b0da44f18a7c8920dffdc524e3cd66 /sysdeps/x86_64
parent8292f6fc71a60e92a23be053c500f504c6802c54 (diff)
downloadglibc-827b70873b41363c864fb65e99829204595d0f85.tar
glibc-827b70873b41363c864fb65e99829204595d0f85.tar.gz
glibc-827b70873b41363c864fb65e99829204595d0f85.tar.bz2
glibc-827b70873b41363c864fb65e99829204595d0f85.zip
* elf/Versions [GLIBC_PRIVATE]: Export __pointer_chk_guard if defined.
* elf/rtld.c: Define __pointer_chk_guard_local and if necessary __pointer_chk_guard. (_rtld_global_ro): Initialize _dl_pointer_guard. (dl_main): Initialize __pointer_chk_guard_local and either __pointer_chk_guard or TLS value if necessary. (process_envvars): Recognize and handle LD_POINTER_GUARD. * sysdeps/generic/ldsodefs.h (rtld_global_ro): Add _dl_pointer_guard. * sysdeps/i386/__longjmp.S: Use PTR_DEMANGLE for PC if defined. * sysdeps/x86_64/__longjmp.S: Likewise. * sysdeps/i386/bsd-_setjmp.S: Use PTR_MANGLE for PC if defined. * sysdeps/i386/bsd-_setjmp.S: Likewise. * sysdeps/i386/setjmp.S: Likewise. [IS_IN_rtld]: Avoid call to __sigjmp_save. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep.h: Define PTR_MANGLE and PTR_DEMANGLE. * sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise. * sysdeps/i386/elf/setjmp.S: Removed. * sysdeps/i386/elf/bsd-setjmp.S: Removed.
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r--sysdeps/x86_64/__longjmp.S5
-rw-r--r--sysdeps/x86_64/setjmp.S15
2 files changed, 16 insertions, 4 deletions
diff --git a/sysdeps/x86_64/__longjmp.S b/sysdeps/x86_64/__longjmp.S
index 9ed480c540..becfb4f79d 100644
--- a/sysdeps/x86_64/__longjmp.S
+++ b/sysdeps/x86_64/__longjmp.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2004, 2005 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
@@ -50,5 +50,8 @@ ENTRY(__longjmp)
mov %esi, %eax
movq (JB_PC*8)(%rdi),%rdx
movq (JB_RSP*8)(%rdi),%rsp
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (%rdx)
+#endif
jmpq *%rdx
END (BP_SYM (__longjmp))
diff --git a/sysdeps/x86_64/setjmp.S b/sysdeps/x86_64/setjmp.S
index 811ab1d913..8af5502042 100644
--- a/sysdeps/x86_64/setjmp.S
+++ b/sysdeps/x86_64/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for x86-64.
- Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2003, 2005 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
@@ -34,13 +34,22 @@ ENTRY (__sigsetjmp)
leaq 8(%rsp), %rdx /* Save SP as it will be after we return. */
movq %rdx, (JB_RSP*8)(%rdi)
movq (%rsp), %rax /* Save PC we are returning to now. */
+#ifdef PTR_MANGLE
+ PTR_MANGLE (%rax)
+#endif
movq %rax, (JB_PC*8)(%rdi)
+#if defined NOT_IN_libc && defined IS_IN_rtld
+ /* In ld.so we never save the signal mask. */
+ xorl %eax, %eax
+ retq
+#else
/* Make a tail call to __sigjmp_save; it takes the same args. */
-#ifdef PIC
+# ifdef PIC
jmp C_SYMBOL_NAME (BP_SYM (__sigjmp_save))@PLT
-#else
+# else
jmp BP_SYM (__sigjmp_save)
+# endif
#endif
END (BP_SYM (__sigsetjmp))
hidden_def (__sigsetjmp)