master
1/* Generic asm macros used on many machines.
2 Copyright (C) 1991-2025 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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
7 License as published by the Free Software Foundation; either
8 version 2.1 of the 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; if not, see
17 <https://www.gnu.org/licenses/>. */
18
19#ifndef C_LABEL
20
21/* Define a macro we can use to construct the asm name for a C symbol. */
22# define C_LABEL(name) name##:
23
24#endif
25
26#ifdef __ASSEMBLER__
27/* Mark the end of function named SYM. This is used on some platforms
28 to generate correct debugging information. */
29# ifndef END
30# define END(sym)
31# endif
32
33# ifndef JUMPTARGET
34# define JUMPTARGET(sym) sym
35# endif
36#endif
37
38/* Macros to generate eh_frame unwind information. */
39#ifdef __ASSEMBLER__
40# define cfi_startproc .cfi_startproc
41# define cfi_endproc .cfi_endproc
42# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
43# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
44# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
45# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
46# define cfi_offset(reg, off) .cfi_offset reg, off
47# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
48# define cfi_val_offset(reg, off) .cfi_val_offset reg, off
49# define cfi_register(r1, r2) .cfi_register r1, r2
50# define cfi_return_column(reg) .cfi_return_column reg
51# define cfi_restore(reg) .cfi_restore reg
52# define cfi_same_value(reg) .cfi_same_value reg
53# define cfi_undefined(reg) .cfi_undefined reg
54# define cfi_remember_state .cfi_remember_state
55# define cfi_restore_state .cfi_restore_state
56# define cfi_window_save .cfi_window_save
57# define cfi_personality(enc, exp) .cfi_personality enc, exp
58# define cfi_lsda(enc, exp) .cfi_lsda enc, exp
59
60#else /* ! ASSEMBLER */
61
62# define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
63# define CFI_STRINGIFY2(Name) #Name
64# define CFI_STARTPROC ".cfi_startproc"
65# define CFI_ENDPROC ".cfi_endproc"
66# define CFI_DEF_CFA(reg, off) \
67 ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
68# define CFI_DEF_CFA_REGISTER(reg) \
69 ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
70# define CFI_DEF_CFA_OFFSET(off) \
71 ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
72# define CFI_ADJUST_CFA_OFFSET(off) \
73 ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
74# define CFI_OFFSET(reg, off) \
75 ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
76# define CFI_REL_OFFSET(reg, off) \
77 ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
78# define CFI_VAL_OFFSET(reg, off) \
79 ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
80# define CFI_REGISTER(r1, r2) \
81 ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
82# define CFI_RETURN_COLUMN(reg) \
83 ".cfi_return_column " CFI_STRINGIFY(reg)
84# define CFI_RESTORE(reg) \
85 ".cfi_restore " CFI_STRINGIFY(reg)
86# define CFI_UNDEFINED(reg) \
87 ".cfi_undefined " CFI_STRINGIFY(reg)
88# define CFI_REMEMBER_STATE \
89 ".cfi_remember_state"
90# define CFI_RESTORE_STATE \
91 ".cfi_restore_state"
92# define CFI_WINDOW_SAVE \
93 ".cfi_window_save"
94# define CFI_PERSONALITY(enc, exp) \
95 ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
96# define CFI_LSDA(enc, exp) \
97 ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
98#endif
99
100#include "dwarf2.h"