Subversion Repositories Kolibri OS

Rev

Rev 5222 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5222 Rev 6324
Line 1... Line 1...
1
/* dw2gencfi.h - Support for generating Dwarf2 CFI information.
1
/* dw2gencfi.h - Support for generating Dwarf2 CFI information.
2
   Copyright 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
2
   Copyright (C) 2003-2015 Free Software Foundation, Inc.
3
   Contributed by Michal Ludvig 
3
   Contributed by Michal Ludvig 
Line 4... Line 4...
4
 
4
 
Line 5... Line 5...
5
   This file is part of GAS, the GNU Assembler.
5
   This file is part of GAS, the GNU Assembler.
Line 34... Line 34...
34
 
34
 
35
/* Entry points for backends to add unwind information.  */
35
/* Entry points for backends to add unwind information.  */
36
extern void cfi_new_fde (struct symbol *);
36
extern void cfi_new_fde (struct symbol *);
37
extern void cfi_end_fde (struct symbol *);
37
extern void cfi_end_fde (struct symbol *);
-
 
38
extern void cfi_set_return_column (unsigned);
38
extern void cfi_set_return_column (unsigned);
39
extern void cfi_set_sections (void);
-
 
40
extern void cfi_add_advance_loc (struct symbol *);
Line 39... Line 41...
39
extern void cfi_add_advance_loc (struct symbol *);
41
extern void cfi_add_label (const char *);
40
 
42
 
41
extern void cfi_add_CFA_offset (unsigned, offsetT);
43
extern void cfi_add_CFA_offset (unsigned, offsetT);
42
extern void cfi_add_CFA_def_cfa (unsigned, offsetT);
44
extern void cfi_add_CFA_def_cfa (unsigned, offsetT);
Line 55... Line 57...
55
#define SUPPORT_FRAME_LINKONCE 1
57
#define SUPPORT_FRAME_LINKONCE 1
56
#else
58
#else
57
#define SUPPORT_FRAME_LINKONCE 0
59
#define SUPPORT_FRAME_LINKONCE 0
58
#endif
60
#endif
Line -... Line 61...
-
 
61
 
-
 
62
#ifdef tc_cfi_reloc_for_encoding
-
 
63
#define SUPPORT_COMPACT_EH 1
-
 
64
#else
-
 
65
#define SUPPORT_COMPACT_EH 0
-
 
66
#endif
-
 
67
 
-
 
68
#define MULTIPLE_FRAME_SECTIONS (SUPPORT_FRAME_LINKONCE || SUPPORT_COMPACT_EH)
59
 
69
 
60
struct cfi_insn_data
70
struct cfi_insn_data
61
{
71
{
62
  struct cfi_insn_data *next;
72
  struct cfi_insn_data *next;
63
#if SUPPORT_FRAME_LINKONCE
73
#if MULTIPLE_FRAME_SECTIONS
64
  segT cur_seg;
74
  segT cur_seg;
65
#endif
75
#endif
66
  int insn;
76
  int insn;
67
  union
77
  union
Line 92... Line 102...
92
    struct
102
    struct
93
    {
103
    {
94
      unsigned reg, encoding;
104
      unsigned reg, encoding;
95
      expressionS exp;
105
      expressionS exp;
96
    } ea;
106
    } ea;
-
 
107
 
-
 
108
    const char *sym_name;
97
  } u;
109
  } u;
98
};
110
};
Line -... Line 111...
-
 
111
 
-
 
112
/* An enumeration describing the Compact EH header format.  The least
-
 
113
   significant bit is used to distinguish the entries.
-
 
114
 
-
 
115
   Inline Compact:			Function offset [0]
-
 
116
					Four chars of unwind data.
-
 
117
   Out-of-line Compact:			Function offset [1]
-
 
118
					Compact unwind data offset [0]
-
 
119
   Legacy:				Function offset [1]
-
 
120
					Unwind data offset [1]
-
 
121
 
-
 
122
   The header type is initialized to EH_COMPACT_UNKNOWN until the
-
 
123
   format is discovered by encountering a .fde_data entry.
-
 
124
   Failure to find a .fde_data entry will cause an EH_COMPACT_LEGACY
-
 
125
   header to be generated.  */
-
 
126
 
-
 
127
enum {
-
 
128
  EH_COMPACT_UNKNOWN,
-
 
129
  EH_COMPACT_LEGACY,
-
 
130
  EH_COMPACT_INLINE,
-
 
131
  EH_COMPACT_OUTLINE,
-
 
132
  EH_COMPACT_OUTLINE_DONE,
-
 
133
  /* Outline if .cfi_inline_lsda used, otherwise legacy FDE.  */
-
 
134
  EH_COMPACT_HAS_LSDA
-
 
135
};
99
 
136
 
100
struct fde_entry
137
struct fde_entry
101
{
138
{
102
  struct fde_entry *next;
139
  struct fde_entry *next;
103
#if SUPPORT_FRAME_LINKONCE
140
#if MULTIPLE_FRAME_SECTIONS
104
  segT cur_seg;
141
  segT cur_seg;
105
#endif
142
#endif
106
  symbolS *start_address;
143
  symbolS *start_address;
107
  symbolS *end_address;
144
  symbolS *end_address;
108
  struct cfi_insn_data *data;
145
  struct cfi_insn_data *data;
109
  struct cfi_insn_data **last;
146
  struct cfi_insn_data **last;
110
  unsigned char per_encoding;
147
  unsigned char per_encoding;
-
 
148
  unsigned char lsda_encoding;
111
  unsigned char lsda_encoding;
149
  int personality_id;
112
  expressionS personality;
150
  expressionS personality;
113
  expressionS lsda;
151
  expressionS lsda;
114
  unsigned int return_column;
152
  unsigned int return_column;
115
  unsigned int signal_frame;
153
  unsigned int signal_frame;
116
#if SUPPORT_FRAME_LINKONCE
154
#if MULTIPLE_FRAME_SECTIONS
117
  int handled;
155
  int handled;
-
 
156
#endif
-
 
157
  int eh_header_type;
-
 
158
  /* Compact unwinding opcodes, not including the PR byte or LSDA.  */
-
 
159
  int eh_data_size;
-
 
160
  bfd_byte *eh_data;
-
 
161
  /* For out of line tables and FDEs.  */
-
 
162
  symbolS *eh_loc;
118
#endif
163
  int sections;
Line 119... Line 164...
119
};
164
};
120
 
165
 
Line 126... Line 171...
126
#define CFI_return_column	0x101
171
#define CFI_return_column	0x101
127
#define CFI_rel_offset		0x102
172
#define CFI_rel_offset		0x102
128
#define CFI_escape		0x103
173
#define CFI_escape		0x103
129
#define CFI_signal_frame	0x104
174
#define CFI_signal_frame	0x104
130
#define CFI_val_encoded_addr	0x105
175
#define CFI_val_encoded_addr	0x105
-
 
176
#define CFI_label		0x106
-
 
177
 
-
 
178
/* By default emit .eh_frame only, not .debug_frame.  */
-
 
179
#define CFI_EMIT_eh_frame               (1 << 0)
-
 
180
#define CFI_EMIT_debug_frame            (1 << 1)
-
 
181
#define CFI_EMIT_target                 (1 << 2)
-
 
182
#define CFI_EMIT_eh_frame_compact       (1 << 3)
Line 131... Line 183...
131
 
183