This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch roland/arm created. glibc-2.20-371-g0876c23
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 16 Dec 2014 22:35:55 -0000
- Subject: GNU C Library master sources branch roland/arm created. glibc-2.20-371-g0876c23
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, roland/arm has been created
at 0876c234aa0b3d79e98bee43ce0d3a496fa7c2b3 (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0876c234aa0b3d79e98bee43ce0d3a496fa7c2b3
commit 0876c234aa0b3d79e98bee43ce0d3a496fa7c2b3
Author: Roland McGrath <roland@hack.frob.com>
Date: Tue Dec 16 13:55:53 2014 -0800
foo
diff --git a/ChangeLog b/ChangeLog
index 76a9849..7cc9534 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2014-12-16 Roland McGrath <roland@hack.frob.com>
+
+ * sysdeps/generic/unwind-resume.h: New file.
+ * sysdeps/gnu/unwind-resume.c (libgcc_s_personality): Use
+ PERSONALITY_PROTO macro for the prototype.
+ (__gcc_personality_v0): Likewise, and PERSONALITY_ARGS for the callee
+ argument list.
+ (libgcc_s_resume): Variable renamed to __libgcc_s_resume, made hidden
+ global rather than static.
+ (_Unwind_Resume): Updated user.
+ Conditionalize definition on [!HAVE_ARCH_UNWIND_RESUME].
+ (init): Likewise. Renamed to __libgcc_s_init, made hidden global
+ rather than static.
+ (_Unwind_Resume, __gcc_personality_v0): Updated callers.
+ * sysdeps/arm/arm-unwind-resume.S: New file.
+ * sysdeps/arm/rt-arm-unwind-resume.S: New file.
+ * sysdeps/arm/Makefile [$(subdir) = csu]
+ (routines, shared-only-routines): Add arm-unwind-resume.
+ (librt-sysdep_routines, librt-shared-only-routines):
+ Add rt-arm-unwind-resume.
+ * sysdeps/unix/sysv/linux/arm/unwind-resume.c: File removed.
+
2014-12-16 Joseph Myers <joseph@codesourcery.com>
[BZ #17719]
diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
index db60a17..8c6b2ef 100644
--- a/sysdeps/arm/Makefile
+++ b/sysdeps/arm/Makefile
@@ -50,6 +50,9 @@ shared-only-routines += libc-aeabi_read_tp
# cantunwind marker. There's one in start.S. To make sure we reach it, add
# unwind tables for __libc_start_main.
CFLAGS-libc-start.c += -fexceptions
+
+routines += arm-unwind-resume
+shared-only-routines += arm-unwind-resume
endif
ifeq ($(subdir),gmon)
@@ -61,6 +64,6 @@ CFLAGS-backtrace.c += -funwind-tables
endif
ifeq ($(subdir),rt)
-librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1
-librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1
+librt-sysdep_routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
+librt-shared-only-routines += rt-aeabi_unwind_cpp_pr1 rt-arm-unwind-resume
endif
diff --git a/sysdeps/arm/arm-unwind-resume.S b/sysdeps/arm/arm-unwind-resume.S
new file mode 100644
index 0000000..f50ee2c
--- /dev/null
+++ b/sysdeps/arm/arm-unwind-resume.S
@@ -0,0 +1,43 @@
+/* _Unwind_Resume wrapper for ARM EABI.
+ Copyright (C) 2014 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <sysdep.h>
+
+ENTRY (_Unwind_Resume)
+ /* if (__libgcc_s_resume != NULL) return (*__libgcc_s_resume) (...); */
+ LDR_HIDDEN (ip, ip, __libgcc_s_resume, 0)
+ cmp ip, #0
+ it ne
+ bxne ip
+
+ /* We only really need to save and restore LR, but
+ the ABI requires the stack be kept aligned to 8 bytes,
+ so we push and pop r0 as well just to even out the stack. */
+ push {r0, lr}
+ cfi_adjust_cfa_offset (8)
+ cfi_rel_offset (r0, 0)
+ cfi_rel_offset (lr, 4)
+ bl __libgcc_s_init
+ pop {r0, lr}
+ cfi_adjust_cfa_offset (-8)
+ cfi_restore (r0)
+ cfi_restore (lr)
+
+ LDR_HIDDEN (ip, ip, __libgcc_s_resume, 0)
+ bx ip
+END (_Unwind_Resume)
diff --git a/sysdeps/arm/rt-arm-unwind-resume.S b/sysdeps/arm/rt-arm-unwind-resume.S
new file mode 100644
index 0000000..9144b0c
--- /dev/null
+++ b/sysdeps/arm/rt-arm-unwind-resume.S
@@ -0,0 +1 @@
+#include <arm-unwind-resume.S>
diff --git a/sysdeps/arm/unwind-resume.h b/sysdeps/arm/unwind-resume.h
new file mode 100644
index 0000000..1474bb0
--- /dev/null
+++ b/sysdeps/arm/unwind-resume.h
@@ -0,0 +1,33 @@
+/* Definitions for unwind-resume.c. ARM (EABI) version.
+ Copyright (C) 2014 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; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+/* The EABI personality routine has a different signature than the
+ canonical one. These macros tell sysdeps/gnu/unwind*.c how to
+ define __gcc_personality_v0. */
+#define PERSONALITY_PROTO \
+ (_Unwind_State state, \
+ struct _Unwind_Exception *ue_header, \
+ struct _Unwind_Context *context)
+#define PERSONALITY_ARGS \
+ (state, ue_header, context)
+
+/* It's vitally important that _Unwind_Resume not have a stack frame; the
+ ARM unwinder relies on register state at entrance. So we write this in
+ assembly (see arm-unwind-resume.S). This macro tells the generic code
+ not to provide the generic C definition. */
+#define HAVE_ARCH_UNWIND_RESUME 1
diff --git a/sysdeps/generic/unwind-resume.h b/sysdeps/generic/unwind-resume.h
new file mode 100644
index 0000000..bc5e326
--- /dev/null
+++ b/sysdeps/generic/unwind-resume.h
@@ -0,0 +1,33 @@
+/* Definitions for unwind-resume.c. Generic version.
+ Copyright (C) 2014 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; see the file COPYING.LIB. If
+ not, see <http://www.gnu.org/licenses/>. */
+
+/* These describe the arguments to unwinder personality functions,
+ specifically __gcc_personality_v0. A machine-specific sysdeps
+ file might define them differently. */
+#define PERSONALITY_PROTO \
+ (int version, _Unwind_Action actions, \
+ _Unwind_Exception_Class exception_class, \
+ struct _Unwind_Exception *ue_header, \
+ struct _Unwind_Context *context)
+#define PERSONALITY_ARGS \
+ (version, actions, exception_class, ue_header, context)
+
+/* This is defined nonzero by a machine-specific sysdeps file if
+ _Unwind_Resume is provided separately and thus the generic C
+ version should not be defined. */
+#define HAVE_ARCH_UNWIND_RESUME 0
diff --git a/sysdeps/gnu/unwind-resume.c b/sysdeps/gnu/unwind-resume.c
index 5044a71..c9234e2 100644
--- a/sysdeps/gnu/unwind-resume.c
+++ b/sysdeps/gnu/unwind-resume.c
@@ -20,15 +20,15 @@
#include <stdio.h>
#include <unwind.h>
#include <gnu/lib-names.h>
+#include <unwind-resume.h>
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
- __attribute__ ((noreturn));
-static _Unwind_Reason_Code (*libgcc_s_personality)
- (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
- struct _Unwind_Context *);
+void (*__libgcc_s_resume) (struct _Unwind_Exception *exc)
+ attribute_hidden __attribute__ ((noreturn));
-static void
-init (void)
+static _Unwind_Reason_Code (*libgcc_s_personality) PERSONALITY_PROTO;
+
+void attribute_hidden
+__libgcc_s_init (void)
{
void *resume, *personality;
void *handle;
@@ -41,26 +41,24 @@ init (void)
__libc_fatal (LIBGCC_S_SO
" must be installed for pthread_cancel to work\n");
- libgcc_s_resume = resume;
+ __libgcc_s_resume = resume;
libgcc_s_personality = personality;
}
+#if !HAVE_ARCH_UNWIND_RESUME
void
_Unwind_Resume (struct _Unwind_Exception *exc)
{
- if (__glibc_unlikely (libgcc_s_resume == NULL))
- init ();
- (*libgcc_s_resume) (exc);
+ if (__glibc_unlikely (__libgcc_s_resume == NULL))
+ __libgcc_s_init ();
+ (*__libgcc_s_resume) (exc);
}
+#endif
_Unwind_Reason_Code
-__gcc_personality_v0 (int version, _Unwind_Action actions,
- _Unwind_Exception_Class exception_class,
- struct _Unwind_Exception *ue_header,
- struct _Unwind_Context *context)
+__gcc_personality_v0 PERSONALITY_PROTO
{
if (__glibc_unlikely (libgcc_s_personality == NULL))
- init ();
- return (*libgcc_s_personality) (version, actions, exception_class,
- ue_header, context);
+ __libgcc_s_init ();
+ return (*libgcc_s_personality) PERSONALITY_ARGS;
}
diff --git a/sysdeps/unix/sysv/linux/arm/unwind-resume.c b/sysdeps/unix/sysv/linux/arm/unwind-resume.c
deleted file mode 100644
index 1f1eb71..0000000
--- a/sysdeps/unix/sysv/linux/arm/unwind-resume.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Copyright (C) 2003-2014 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Jakub Jelinek <jakub@redhat.com>.
-
- 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, see
- <http://www.gnu.org/licenses/>. */
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <unwind.h>
-
-static void (*libgcc_s_resume) (struct _Unwind_Exception *exc)
- __attribute_used__;
-static _Unwind_Reason_Code (*libgcc_s_personality)
- (_Unwind_State, struct _Unwind_Exception *, struct _Unwind_Context *);
-
-static void init (void) __attribute_used__;
-
-static void
-init (void)
-{
- void *resume, *personality;
- void *handle;
-
- handle = __libc_dlopen ("libgcc_s.so.1");
-
- if (handle == NULL
- || (resume = __libc_dlsym (handle, "_Unwind_Resume")) == NULL
- || (personality = __libc_dlsym (handle, "__gcc_personality_v0")) == NULL)
- __libc_fatal ("libgcc_s.so.1 must be installed for pthread_cancel to work\n");
-
- libgcc_s_resume = resume;
- libgcc_s_personality = personality;
-}
-
-/* It's vitally important that _Unwind_Resume not have a stack frame; the
- ARM unwinder relies on register state at entrance. So we write this in
- assembly. */
-
-#define STR1(S) #S
-#define STR(S) STR1(S)
-
-asm (
-" .globl _Unwind_Resume\n"
-" .type _Unwind_Resume, %function\n"
-"_Unwind_Resume:\n"
-" .cfi_sections .debug_frame\n"
-" " CFI_STARTPROC "\n"
-" push {r4, r5, r6, lr}\n"
-" " CFI_ADJUST_CFA_OFFSET (16)" \n"
-" " CFI_REL_OFFSET (r4, 0) "\n"
-" " CFI_REL_OFFSET (r5, 4) "\n"
-" " CFI_REL_OFFSET (r6, 8) "\n"
-" " CFI_REL_OFFSET (lr, 12) "\n"
-" " CFI_REMEMBER_STATE "\n"
-" ldr r4, 1f\n"
-" ldr r5, 2f\n"
-"3: add r4, pc, r4\n"
-" ldr r3, [r4, r5]\n"
-" mov r6, r0\n"
-" cmp r3, #0\n"
-" beq 4f\n"
-"5: mov r0, r6\n"
-" pop {r4, r5, r6, lr}\n"
-" " CFI_ADJUST_CFA_OFFSET (-16) "\n"
-" " CFI_RESTORE (r4) "\n"
-" " CFI_RESTORE (r5) "\n"
-" " CFI_RESTORE (r6) "\n"
-" " CFI_RESTORE (lr) "\n"
-" bx r3\n"
-" " CFI_RESTORE_STATE "\n"
-"4: bl init\n"
-" ldr r3, [r4, r5]\n"
-" b 5b\n"
-" " CFI_ENDPROC "\n"
-" .align 2\n"
-"1: .word _GLOBAL_OFFSET_TABLE_ - 3b - " STR (PC_OFS) "\n"
-"2: .word libgcc_s_resume(GOTOFF)\n"
-" .size _Unwind_Resume, .-_Unwind_Resume\n"
-);
-
-_Unwind_Reason_Code
-__gcc_personality_v0 (_Unwind_State state,
- struct _Unwind_Exception *ue_header,
- struct _Unwind_Context *context)
-{
- if (__builtin_expect (libgcc_s_personality == NULL, 0))
- init ();
- return libgcc_s_personality (state, ue_header, context);
-}
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources