1/* Copyright (C) 2003-2021 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Jakub Jelinek <jakub@redhat.com>.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public License as
7 published by the Free Software Foundation; either version 2.1 of the
8 License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If
17 not, see <https://www.gnu.org/licenses/>. */
18
19#include <stdio.h>
20#include <gnu/lib-names.h>
21#include <unwind-link.h>
22#include <sysdep.h>
23#include <unwind-resume.h>
24
25static struct unwind_link *
26link (void)
27{
28 struct unwind_link *unwind_link = __libc_unwind_link_get ();
29 if (unwind_link == NULL)
30 __libc_fatal (LIBGCC_S_SO " must be installed for unwinding to work\n");
31 return unwind_link;
32}
33
34#if !HAVE_ARCH_UNWIND_RESUME
35void
36_Unwind_Resume (struct _Unwind_Exception *exc)
37{
38 UNWIND_LINK_PTR (link (), _Unwind_Resume) (exc);
39}
40#endif
41
42_Unwind_Reason_Code
43__gcc_personality_v0 PERSONALITY_PROTO
44{
45 return UNWIND_LINK_PTR (link (), personality) PERSONALITY_ARGS;
46}
47
48_Unwind_Reason_Code
49_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
50 void *stop_argument)
51{
52 return UNWIND_LINK_PTR (link (), _Unwind_ForcedUnwind)
53 (exc, stop, stop_argument);
54}
55
56_Unwind_Word
57_Unwind_GetCFA (struct _Unwind_Context *context)
58{
59 return UNWIND_LINK_PTR (link (), _Unwind_GetCFA) (context);
60}
61