mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-09 23:00:07 +00:00
460860f457
Linux 6.7 removed ia64 from the official tree [1], following the general principle that a glibc port needs upstream support for the architecture in all the components it depends on (binutils, GCC, and the Linux kernel). Apart from the removal of sysdeps/ia64 and sysdeps/unix/sysv/linux/ia64, there are updates to various comments referencing ia64 for which removal of those references seemed appropriate. The configuration is removed from README and build-many-glibcs.py. The CONTRIBUTED-BY, elf/elf.h, manual/contrib.texi (the porting mention), *.po files, config.guess, and longlong.h are not changed. For Linux it allows cleanup some clone2 support on multiple files. The following bug can be closed as WONTFIX: BZ 22634 [2], BZ 14250 [3], BZ 21634 [4], BZ 10163 [5], BZ 16401 [6], and BZ 11585 [7]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43ff221426d33db909f7159fdf620c3b052e2d1c [2] https://sourceware.org/bugzilla/show_bug.cgi?id=22634 [3] https://sourceware.org/bugzilla/show_bug.cgi?id=14250 [4] https://sourceware.org/bugzilla/show_bug.cgi?id=21634 [5] https://sourceware.org/bugzilla/show_bug.cgi?id=10163 [6] https://sourceware.org/bugzilla/show_bug.cgi?id=16401 [7] https://sourceware.org/bugzilla/show_bug.cgi?id=11585 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
201 lines
7.5 KiB
C
201 lines
7.5 KiB
C
/* Exception handling and frame unwind runtime interface routines.
|
|
Copyright (C) 2001-2024 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
|
|
<https://www.gnu.org/licenses/>. */
|
|
|
|
/* This is derived from the C++ ABI for IA-64. Where we diverge
|
|
for cross-architecture compatibility are noted with "@@@". */
|
|
|
|
#ifndef _UNWIND_H
|
|
#define _UNWIND_H 1
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* Level 1: Base ABI */
|
|
|
|
/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is
|
|
inefficient for 32-bit and smaller machines. */
|
|
typedef unsigned _Unwind_Word __attribute__((__mode__(__unwind_word__)));
|
|
typedef signed _Unwind_Sword __attribute__((__mode__(__unwind_word__)));
|
|
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
|
|
typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
|
|
|
|
/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and
|
|
consumer of an exception. We'll go along with this for now even on
|
|
32-bit machines. We'll need to provide some other option for
|
|
16-bit machines and for machines with > 8 bits per byte. */
|
|
typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
|
|
|
|
/* The unwind interface uses reason codes in several contexts to
|
|
identify the reasons for failures or other actions. */
|
|
typedef enum
|
|
{
|
|
_URC_NO_REASON = 0,
|
|
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
|
|
_URC_FATAL_PHASE2_ERROR = 2,
|
|
_URC_FATAL_PHASE1_ERROR = 3,
|
|
_URC_NORMAL_STOP = 4,
|
|
_URC_END_OF_STACK = 5,
|
|
_URC_HANDLER_FOUND = 6,
|
|
_URC_INSTALL_CONTEXT = 7,
|
|
_URC_CONTINUE_UNWIND = 8
|
|
} _Unwind_Reason_Code;
|
|
|
|
|
|
/* The unwind interface uses a pointer to an exception header object
|
|
as its representation of an exception being thrown. In general, the
|
|
full representation of an exception object is language- and
|
|
implementation-specific, but it will be prefixed by a header
|
|
understood by the unwind interface. */
|
|
|
|
struct _Unwind_Exception;
|
|
|
|
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
|
|
struct _Unwind_Exception *);
|
|
|
|
struct _Unwind_Exception
|
|
{
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
_Unwind_Exception_Class exception_class;
|
|
_Unwind_Exception_Cleanup_Fn exception_cleanup;
|
|
_Unwind_Word private_1;
|
|
_Unwind_Word private_2;
|
|
};
|
|
|
|
/* The IA-64 ABI says that this structure must be double-word aligned. */
|
|
_Unwind_Word unwind_exception_align[2]
|
|
__attribute__ ((__aligned__ (2 * sizeof (_Unwind_Word))));
|
|
};
|
|
};
|
|
|
|
|
|
/* The ACTIONS argument to the personality routine is a bitwise OR of one
|
|
or more of the following constants. */
|
|
typedef int _Unwind_Action;
|
|
|
|
#define _UA_SEARCH_PHASE 1
|
|
#define _UA_CLEANUP_PHASE 2
|
|
#define _UA_HANDLER_FRAME 4
|
|
#define _UA_FORCE_UNWIND 8
|
|
#define _UA_END_OF_STACK 16
|
|
|
|
/* This is an opaque type used to refer to a system-specific data
|
|
structure used by the system unwinder. This context is created and
|
|
destroyed by the system, and passed to the personality routine
|
|
during unwinding. */
|
|
struct _Unwind_Context;
|
|
|
|
/* Raise an exception, passing along the given exception object. */
|
|
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
|
|
|
|
/* Raise an exception for forced unwinding. */
|
|
|
|
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
|
|
(int, _Unwind_Action, _Unwind_Exception_Class,
|
|
struct _Unwind_Exception *, struct _Unwind_Context *, void *);
|
|
|
|
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
|
|
_Unwind_Stop_Fn,
|
|
void *);
|
|
|
|
/* Helper to invoke the exception_cleanup routine. */
|
|
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
|
|
|
|
/* Resume propagation of an existing exception. This is used after
|
|
e.g. executing cleanup code, and not to implement rethrowing. */
|
|
extern void _Unwind_Resume (struct _Unwind_Exception *);
|
|
|
|
/* @@@ Use unwind data to perform a stack backtrace. The trace callback
|
|
is called for every stack frame in the call chain, but no cleanup
|
|
actions are performed. */
|
|
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
|
|
(struct _Unwind_Context *, void *);
|
|
|
|
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
|
|
|
|
/* These functions are used for communicating information about the unwind
|
|
context (i.e. the unwind descriptors and the user register state) between
|
|
the unwind library and the personality routine and landing pad. Only
|
|
selected registers maybe manipulated. */
|
|
|
|
extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
|
|
extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
|
|
|
|
extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
|
|
extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
|
|
|
|
/* @@@ Retrieve the CFA of the given context. */
|
|
extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
|
|
|
|
extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
|
|
|
|
extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
|
|
|
|
|
|
/* The personality routine is the function in the C++ (or other language)
|
|
runtime library which serves as an interface between the system unwind
|
|
library and language-specific exception handling semantics. It is
|
|
specific to the code fragment described by an unwind info block, and
|
|
it is always referenced via the pointer in the unwind info block, and
|
|
hence it has no ABI-specified name.
|
|
|
|
Note that this implies that two different C++ implementations can
|
|
use different names, and have different contents in the language
|
|
specific data area. Moreover, that the language specific data
|
|
area contains no version info because name of the function invoked
|
|
provides more effective versioning by detecting at link time the
|
|
lack of code to handle the different data format. */
|
|
|
|
typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
|
|
(int, _Unwind_Action, _Unwind_Exception_Class,
|
|
struct _Unwind_Exception *, struct _Unwind_Context *);
|
|
|
|
/* @@@ The following alternate entry points are for setjmp/longjmp
|
|
based unwinding. */
|
|
|
|
struct SjLj_Function_Context;
|
|
extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
|
|
extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
|
|
|
|
extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException
|
|
(struct _Unwind_Exception *);
|
|
extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind
|
|
(struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
|
|
extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *);
|
|
|
|
/* @@@ The following provide access to the base addresses for text
|
|
and data-relative addressing in the LDSA. In order to stay link
|
|
compatible with the standard ABI for IA-64, we inline these. */
|
|
|
|
extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
|
|
extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
|
|
|
|
/* @@@ Given an address, return the entry point of the function that
|
|
contains it. */
|
|
extern void * _Unwind_FindEnclosingFunction (void *pc);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* unwind.h */
|