OSDN Git Service

* decl.c (finish_method): Give methods once-only linkage.
[pf3gnuchains/gcc-fork.git] / gcc / unwind-compat.c
1 /* Backward compatibility unwind routines.
2    Copyright (C) 2004
3    Free Software Foundation, Inc.
4
5    This file is part of GCC.
6
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2, or (at your option)
10    any later version.
11
12    In addition to the permissions in the GNU General Public License, the
13    Free Software Foundation gives you unlimited permission to link the
14    compiled version of this file into combinations with other programs,
15    and to distribute those combinations without any restriction coming
16    from the use of this file.  (The General Public License restrictions
17    do apply in other respects; for example, they cover modification of
18    the file, and distribution when not linked into a combined
19    executable.)
20
21    GCC is distributed in the hope that it will be useful, but WITHOUT
22    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
24    License for more details.
25
26    You should have received a copy of the GNU General Public License
27    along with GCC; see the file COPYING.  If not, write to the Free
28    Software Foundation, 59 Temple Place - Suite 330, Boston, MA
29    02111-1307, USA.  */
30
31 #if defined (USE_GAS_SYMVER) && defined (USE_LIBUNWIND_EXCEPTIONS)
32 #include "unwind.h"
33 #include "unwind-dw2-fde.h"
34 #include "unwind-compat.h"
35
36 extern _Unwind_Reason_Code __libunwind_Unwind_Backtrace
37   (_Unwind_Trace_Fn, void *);
38
39 _Unwind_Reason_Code
40 _Unwind_Backtrace (_Unwind_Trace_Fn trace, void *trace_argument)
41 {
42   return __libunwind_Unwind_Backtrace (trace, trace_argument);
43 }
44 symver (_Unwind_Backtrace, GCC_3.3);
45
46 extern void __libunwind_Unwind_DeleteException
47   (struct _Unwind_Exception *);
48
49 void
50 _Unwind_DeleteException (struct _Unwind_Exception *exc)
51 {
52   return __libunwind_Unwind_DeleteException (exc);
53 }
54 symver (_Unwind_DeleteException, GCC_3.0);
55
56 extern void * __libunwind_Unwind_FindEnclosingFunction (void *);
57
58 void *
59 _Unwind_FindEnclosingFunction (void *pc)
60 {
61   return __libunwind_Unwind_FindEnclosingFunction (pc);
62 }
63 symver (_Unwind_FindEnclosingFunction, GCC_3.3);
64
65 extern _Unwind_Reason_Code __libunwind_Unwind_ForcedUnwind
66   (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
67
68 _Unwind_Reason_Code
69 _Unwind_ForcedUnwind (struct _Unwind_Exception *exc,
70                       _Unwind_Stop_Fn stop, void * stop_argument)
71 {
72   return __libunwind_Unwind_ForcedUnwind (exc, stop, stop_argument);
73 }
74 symver (_Unwind_ForcedUnwind, GCC_3.0);
75
76 extern _Unwind_Word __libunwind_Unwind_GetCFA
77   (struct _Unwind_Context *);
78
79 _Unwind_Word
80 _Unwind_GetCFA (struct _Unwind_Context *context)
81 {
82   return __libunwind_Unwind_GetCFA (context);
83 }
84 symver (_Unwind_GetCFA, GCC_3.3);
85
86 #ifdef __ia64__
87 extern _Unwind_Word __libunwind_Unwind_GetBSP
88   (struct _Unwind_Context *);
89
90 _Unwind_Word
91 _Unwind_GetBSP (struct _Unwind_Context * context)
92 {
93   return __libunwind_Unwind_GetBSP (context);
94 }
95 symver (_Unwind_GetBSP, GCC_3.3.2);
96 #else
97 extern _Unwind_Ptr __libunwind_Unwind_GetDataRelBase
98   (struct _Unwind_Context *);
99
100 _Unwind_Ptr
101 _Unwind_GetDataRelBase (struct _Unwind_Context *context)
102 {
103   return __libunwind_Unwind_GetDataRelBase (context);
104 }
105 symver (_Unwind_GetDataRelBase, GCC_3.0);
106
107 extern _Unwind_Ptr __libunwind_Unwind_GetTextRelBase
108   (struct _Unwind_Context *);
109
110 _Unwind_Ptr
111 _Unwind_GetTextRelBase (struct _Unwind_Context *context)
112 {
113   return __libunwind_Unwind_GetTextRelBase (context);
114 }
115 symver (_Unwind_GetTextRelBase, GCC_3.0);
116 #endif
117
118 extern _Unwind_Word __libunwind_Unwind_GetGR
119   (struct _Unwind_Context *, int );
120
121 _Unwind_Word
122 _Unwind_GetGR (struct _Unwind_Context *context, int index)
123 {
124   return __libunwind_Unwind_GetGR (context, index);
125 }
126 symver (_Unwind_GetGR, GCC_3.0);
127
128 extern _Unwind_Ptr __libunwind_Unwind_GetIP (struct _Unwind_Context *);
129
130 _Unwind_Ptr
131 _Unwind_GetIP (struct _Unwind_Context *context)
132 {
133   return __libunwind_Unwind_GetIP (context);
134 }
135 symver (_Unwind_GetIP, GCC_3.0);
136
137 extern void *__libunwind_Unwind_GetLanguageSpecificData
138   (struct _Unwind_Context *);
139
140 void *
141 _Unwind_GetLanguageSpecificData (struct _Unwind_Context *context)
142 {
143   return __libunwind_Unwind_GetLanguageSpecificData (context);
144 }
145 symver (_Unwind_GetLanguageSpecificData, GCC_3.0);
146
147 extern _Unwind_Ptr __libunwind_Unwind_GetRegionStart
148   (struct _Unwind_Context *);
149
150 _Unwind_Ptr
151 _Unwind_GetRegionStart (struct _Unwind_Context *context)
152 {
153   return __libunwind_Unwind_GetRegionStart (context);
154 }
155 symver (_Unwind_GetRegionStart, GCC_3.0);
156
157 extern _Unwind_Reason_Code __libunwind_Unwind_RaiseException
158   (struct _Unwind_Exception *);
159
160 _Unwind_Reason_Code
161 _Unwind_RaiseException(struct _Unwind_Exception *exc)
162 {
163   return __libunwind_Unwind_RaiseException (exc);
164 }
165 symver (_Unwind_RaiseException, GCC_3.0);
166
167 extern void __libunwind_Unwind_Resume (struct _Unwind_Exception *);
168
169 void
170 _Unwind_Resume (struct _Unwind_Exception *exc)
171 {
172   __libunwind_Unwind_Resume (exc);
173 }
174 symver (_Unwind_Resume, GCC_3.0);
175
176 extern _Unwind_Reason_Code __libunwind_Unwind_Resume_or_Rethrow
177    (struct _Unwind_Exception *);
178
179 _Unwind_Reason_Code
180 _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *exc)
181 {
182   return __libunwind_Unwind_Resume_or_Rethrow (exc);
183 }
184 symver (_Unwind_Resume_or_Rethrow, GCC_3.3);
185
186 extern void __libunwind_Unwind_SetGR
187   (struct _Unwind_Context *, int, _Unwind_Word);
188
189 void
190 _Unwind_SetGR (struct _Unwind_Context *context, int index,
191                _Unwind_Word val) 
192 {
193   __libunwind_Unwind_SetGR (context, index, val);
194 }
195 symver (_Unwind_SetGR, GCC_3.0);
196
197 extern void __libunwind_Unwind_SetIP
198   (struct _Unwind_Context *, _Unwind_Ptr);
199
200 void
201 _Unwind_SetIP (struct _Unwind_Context *context, _Unwind_Ptr val)
202 {
203   return __libunwind_Unwind_SetIP (context, val);
204 }
205 symver (_Unwind_SetIP, GCC_3.0);
206 #endif