solaris_ld_v2_maps = @solaris_ld_v2_maps@
enable_execute_stack = @enable_execute_stack@
unwind_header = @unwind_header@
+md_unwind_def_header = @md_unwind_def_header@
md_unwind_header = @md_unwind_header@
sfp_machine_header = @sfp_machine_header@
thread_header = @thread_header@
# Create links to files specified in config.host.
-LIBGCC_LINKS = enable-execute-stack.c unwind.h md-unwind-support.h \
+LIBGCC_LINKS = enable-execute-stack.c \
+ unwind.h md-unwind-def.h md-unwind-support.h \
sfp-machine.h gthr-default.h
enable-execute-stack.c: $(srcdir)/$(enable_execute_stack)
-$(LN_S) $< $@
unwind.h: $(srcdir)/$(unwind_header)
-$(LN_S) $< $@
+md-unwind-def.h: $(srcdir)/config/$(md_unwind_def_header)
+ -$(LN_S) $< $@
md-unwind-support.h: $(srcdir)/config/$(md_unwind_header)
-$(LN_S) $< $@
sfp-machine.h: $(srcdir)/config/$(sfp_machine_header)
# If either is set, EXTRA_PARTS and
# EXTRA_MULTILIB_PARTS inherited from the GCC
# subdirectory will be ignored.
-# md_unwind_header The name of a header file defining
-# MD_FALLBACK_FRAME_STATE_FOR.
+# md_unwind_def_header The name of a header file defining architecture
+# -specific frame information types for unwinding.
+# md_unwind_header The name of a header file defining architecture
+# -specific handlers used in the unwinder.
# sfp_machine_header The name of a sfp-machine.h header file for soft-fp.
# Defaults to "$cpu_type/sfp-machine.h" if it exists,
# no-sfp-machine.h otherwise.
tmake_file=
tm_file=
tm_define=
+md_unwind_def_header=no-unwind.h
md_unwind_header=no-unwind.h
unwind_header=unwind-generic.h
tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
tmake_file="${tmake_file} t-dfprules"
+ md_unwind_def_header=aarch64/aarch64-unwind-def.h
md_unwind_header=aarch64/aarch64-unwind.h
;;
aarch64*-*-freebsd*)
tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
tmake_file="${tmake_file} t-dfprules"
+ md_unwind_def_header=aarch64/aarch64-unwind-def.h
md_unwind_header=aarch64/freebsd-unwind.h
;;
aarch64*-*-netbsd*)
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-softfp t-softfp t-crtfm"
tmake_file="${tmake_file} t-dfprules"
+ md_unwind_def_header=aarch64/aarch64-unwind-def.h
md_unwind_header=aarch64/aarch64-unwind.h
;;
aarch64*-*-fuchsia*)
;;
aarch64*-*-linux*)
extra_parts="$extra_parts crtfastmath.o"
+ md_unwind_def_header=aarch64/aarch64-unwind-def.h
md_unwind_header=aarch64/linux-unwind.h
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
;;
aarch64*-*-gnu*)
extra_parts="$extra_parts crtfastmath.o"
+ md_unwind_def_header=aarch64/aarch64-unwind-def.h
md_unwind_header=aarch64/gnu-unwind.h
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-lse t-slibgcc-libgcc"
;;
aarch64*-*-vxworks7*)
extra_parts="$extra_parts crtfastmath.o"
+ md_unwind_def_header=aarch64/aarch64-unwind-def.h
md_unwind_header=aarch64/aarch64-unwind.h
tmake_file="${tmake_file} ${cpu_type}/t-aarch64"
tmake_file="${tmake_file} ${cpu_type}/t-lse"
--- /dev/null
+/* Copyright (C) 2024 Free Software Foundation, Inc.
+ Contributed by Arm Ltd.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC 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 General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+<http://www.gnu.org/licenses/>. */
+
+#if !defined (AARCH64_UNWIND_DEF_H) && !defined (__ILP32__)
+#define AARCH64_UNWIND_DEF_H
+
+/* The key used to sign a function's return address. */
+typedef enum {
+ AARCH64_PAUTH_KEY_A,
+ AARCH64_PAUTH_KEY_B,
+} __attribute__((packed)) aarch64_pointer_auth_key;
+
+typedef struct
+{
+ aarch64_pointer_auth_key signing_key;
+} _AArch64Ext_Unwind_FrameState;
+
+#define MD_ARCH_FRAME_STATE_T _AArch64Ext_Unwind_FrameState
+
+#endif /* defined AARCH64_UNWIND_DEF_H && defined __ILP32__ */
#if !defined (AARCH64_UNWIND_H) && !defined (__ILP32__)
#define AARCH64_UNWIND_H
+#include "aarch64-unwind-def.h"
+
#include "ansidecl.h"
#include <stdbool.h>
aarch64_ra_signing_sp = 0x1,
} __attribute__((packed)) aarch64_ra_signing_method_t;
-/* The key used to sign a function's return address. */
-typedef enum {
- AARCH64_PAUTH_KEY_A,
- AARCH64_PAUTH_KEY_B,
-} __attribute__((packed)) aarch64_pointer_auth_key;
-
#define MD_ARCH_EXTENSION_CIE_AUG_HANDLER(fs, aug) \
aarch64_cie_aug_handler (fs, aug)
/* AArch64 B-key pointer authentication. */
if (aug == 'B')
{
- fs->regs.signing_key = AARCH64_PAUTH_KEY_B;
+ fs->regs.arch_fs.signing_key = AARCH64_PAUTH_KEY_B;
return true;
}
return false;
/* By default, DW_CFA_AARCH64_negate_ra_state assumes key A is being used
for signing. This can be overridden by adding 'B' to the augmentation
string. */
- fs->regs.signing_key = AARCH64_PAUTH_KEY_A;
+ fs->regs.arch_fs.signing_key = AARCH64_PAUTH_KEY_A;
/* All registers are initially in state REG_UNSAVED, which indicates that
they inherit register values from the previous frame. However, the
if (signing_method == aarch64_ra_signing_sp)
{
_Unwind_Word salt = (_Unwind_Word) context->cfa;
- if (fs->regs.signing_key == AARCH64_PAUTH_KEY_B)
+ if (fs->regs.arch_fs.signing_key == AARCH64_PAUTH_KEY_B)
return __builtin_aarch64_autib1716 (addr, salt);
return __builtin_aarch64_autia1716 (addr, salt);
}
/* Dummy header for targets without a definition of
- MD_FALLBACK_FRAME_STATE_FOR. */
+ architecture-specific frame information types, or
+ handlers used in the unwinder. */
ac_subst_vars='LTLIBOBJS
LIBOBJS
md_unwind_header
+md_unwind_def_header
unwind_header
enable_execute_stack
asm_hidden_op
+
# We need multilib support.
ac_config_files="$ac_config_files Makefile"
AC_SUBST(asm_hidden_op)
AC_SUBST(enable_execute_stack)
AC_SUBST(unwind_header)
+AC_SUBST(md_unwind_def_header)
AC_SUBST(md_unwind_header)
AC_SUBST(sfp_machine_header)
AC_SUBST(thread_header)
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+#include "md-unwind-def.h"
+
enum register_rule
{
REG_UNSAVED,
Note: this information has to be saved in struct frame_state_reg_info
instead of _Unwind_FrameState as DW_CFA_restore_state has to be able to
restore them. */
-#if defined(__aarch64__) && !defined (__ILP32__)
- unsigned char signing_key;
+#if defined(MD_ARCH_FRAME_STATE_T)
+ MD_ARCH_FRAME_STATE_T arch_fs;
#endif
} regs;