You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
13KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Exception Region Output (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Exception Region Output (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Exception Region Output (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Assembler-Format.html#Assembler-Format" rel="up" title="Assembler Format">
  30. <link href="Alignment-Output.html#Alignment-Output" rel="next" title="Alignment Output">
  31. <link href="Dispatch-Tables.html#Dispatch-Tables" rel="prev" title="Dispatch Tables">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Exception-Region-Output"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Alignment-Output.html#Alignment-Output" accesskey="n" rel="next">Alignment Output</a>, Previous: <a href="Dispatch-Tables.html#Dispatch-Tables" accesskey="p" rel="prev">Dispatch Tables</a>, Up: <a href="Assembler-Format.html#Assembler-Format" accesskey="u" rel="up">Assembler Format</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Assembler-Commands-for-Exception-Regions"></a>
  68. <h4 class="subsection">18.20.9 Assembler Commands for Exception Regions</h4>
  69. <p>This describes commands marking the start and the end of an exception
  70. region.
  71. </p>
  72. <dl>
  73. <dt><a name="index-EH_005fFRAME_005fSECTION_005fNAME"></a>Macro: <strong>EH_FRAME_SECTION_NAME</strong></dt>
  74. <dd><p>If defined, a C string constant for the name of the section containing
  75. exception handling frame unwind information. If not defined, GCC will
  76. provide a default definition if the target supports named sections.
  77. <samp>crtstuff.c</samp> uses this macro to switch to the appropriate section.
  78. </p>
  79. <p>You should define this symbol if your target supports DWARF 2 frame
  80. unwind information and the default definition does not work.
  81. </p></dd></dl>
  82. <dl>
  83. <dt><a name="index-EH_005fFRAME_005fTHROUGH_005fCOLLECT2"></a>Macro: <strong>EH_FRAME_THROUGH_COLLECT2</strong></dt>
  84. <dd><p>If defined, DWARF 2 frame unwind information will identified by
  85. specially named labels. The collect2 process will locate these
  86. labels and generate code to register the frames.
  87. </p>
  88. <p>This might be necessary, for instance, if the system linker will not
  89. place the eh_frames in-between the sentinals from <samp>crtstuff.c</samp>,
  90. or if the system linker does garbage collection and sections cannot
  91. be marked as not to be collected.
  92. </p></dd></dl>
  93. <dl>
  94. <dt><a name="index-EH_005fTABLES_005fCAN_005fBE_005fREAD_005fONLY"></a>Macro: <strong>EH_TABLES_CAN_BE_READ_ONLY</strong></dt>
  95. <dd><p>Define this macro to 1 if your target is such that no frame unwind
  96. information encoding used with non-PIC code will ever require a
  97. runtime relocation, but the linker may not support merging read-only
  98. and read-write sections into a single read-write section.
  99. </p></dd></dl>
  100. <dl>
  101. <dt><a name="index-MASK_005fRETURN_005fADDR"></a>Macro: <strong>MASK_RETURN_ADDR</strong></dt>
  102. <dd><p>An rtx used to mask the return address found via <code>RETURN_ADDR_RTX</code>, so
  103. that it does not contain any extraneous set bits in it.
  104. </p></dd></dl>
  105. <dl>
  106. <dt><a name="index-DWARF2_005fUNWIND_005fINFO"></a>Macro: <strong>DWARF2_UNWIND_INFO</strong></dt>
  107. <dd><p>Define this macro to 0 if your target supports DWARF 2 frame unwind
  108. information, but it does not yet work with exception handling.
  109. Otherwise, if your target supports this information (if it defines
  110. <code>INCOMING_RETURN_ADDR_RTX</code> and <code>OBJECT_FORMAT_ELF</code>),
  111. GCC will provide a default definition of 1.
  112. </p></dd></dl>
  113. <dl>
  114. <dt><a name="index-TARGET_005fEXCEPT_005fUNWIND_005fINFO"></a>Common Target Hook: <em>enum unwind_info_type</em> <strong>TARGET_EXCEPT_UNWIND_INFO</strong> <em>(struct gcc_options *<var>opts</var>)</em></dt>
  115. <dd><p>This hook defines the mechanism that will be used for exception handling
  116. by the target. If the target has ABI specified unwind tables, the hook
  117. should return <code>UI_TARGET</code>. If the target is to use the
  118. <code>setjmp</code>/<code>longjmp</code>-based exception handling scheme, the hook
  119. should return <code>UI_SJLJ</code>. If the target supports DWARF 2 frame unwind
  120. information, the hook should return <code>UI_DWARF2</code>.
  121. </p>
  122. <p>A target may, if exceptions are disabled, choose to return <code>UI_NONE</code>.
  123. This may end up simplifying other parts of target-specific code. The
  124. default implementation of this hook never returns <code>UI_NONE</code>.
  125. </p>
  126. <p>Note that the value returned by this hook should be constant. It should
  127. not depend on anything except the command-line switches described by
  128. <var>opts</var>. In particular, the
  129. setting <code>UI_SJLJ</code> must be fixed at compiler start-up as C pre-processor
  130. macros and builtin functions related to exception handling are set up
  131. depending on this setting.
  132. </p>
  133. <p>The default implementation of the hook first honors the
  134. <samp>--enable-sjlj-exceptions</samp> configure option, then
  135. <code>DWARF2_UNWIND_INFO</code>, and finally defaults to <code>UI_SJLJ</code>. If
  136. <code>DWARF2_UNWIND_INFO</code> depends on command-line options, the target
  137. must define this hook so that <var>opts</var> is used correctly.
  138. </p></dd></dl>
  139. <dl>
  140. <dt><a name="index-TARGET_005fUNWIND_005fTABLES_005fDEFAULT"></a>Common Target Hook: <em>bool</em> <strong>TARGET_UNWIND_TABLES_DEFAULT</strong></dt>
  141. <dd><p>This variable should be set to <code>true</code> if the target ABI requires unwinding
  142. tables even when exceptions are not used. It must not be modified by
  143. command-line option processing.
  144. </p></dd></dl>
  145. <dl>
  146. <dt><a name="index-DONT_005fUSE_005fBUILTIN_005fSETJMP"></a>Macro: <strong>DONT_USE_BUILTIN_SETJMP</strong></dt>
  147. <dd><p>Define this macro to 1 if the <code>setjmp</code>/<code>longjmp</code>-based scheme
  148. should use the <code>setjmp</code>/<code>longjmp</code> functions from the C library
  149. instead of the <code>__builtin_setjmp</code>/<code>__builtin_longjmp</code> machinery.
  150. </p></dd></dl>
  151. <dl>
  152. <dt><a name="index-JMP_005fBUF_005fSIZE"></a>Macro: <strong>JMP_BUF_SIZE</strong></dt>
  153. <dd><p>This macro has no effect unless <code>DONT_USE_BUILTIN_SETJMP</code> is also
  154. defined. Define this macro if the default size of <code>jmp_buf</code> buffer
  155. for the <code>setjmp</code>/<code>longjmp</code>-based exception handling mechanism
  156. is not large enough, or if it is much too large.
  157. The default size is <code>FIRST_PSEUDO_REGISTER * sizeof(void *)</code>.
  158. </p></dd></dl>
  159. <dl>
  160. <dt><a name="index-DWARF_005fCIE_005fDATA_005fALIGNMENT"></a>Macro: <strong>DWARF_CIE_DATA_ALIGNMENT</strong></dt>
  161. <dd><p>This macro need only be defined if the target might save registers in the
  162. function prologue at an offset to the stack pointer that is not aligned to
  163. <code>UNITS_PER_WORD</code>. The definition should be the negative minimum
  164. alignment if <code>STACK_GROWS_DOWNWARD</code> is true, and the positive
  165. minimum alignment otherwise. See <a href="DWARF.html#DWARF">DWARF</a>. Only applicable if
  166. the target supports DWARF 2 frame unwind information.
  167. </p></dd></dl>
  168. <dl>
  169. <dt><a name="index-TARGET_005fTERMINATE_005fDW2_005fEH_005fFRAME_005fINFO"></a>Target Hook: <em>bool</em> <strong>TARGET_TERMINATE_DW2_EH_FRAME_INFO</strong></dt>
  170. <dd><p>Contains the value true if the target should add a zero word onto the
  171. end of a Dwarf-2 frame info section when used for exception handling.
  172. Default value is false if <code>EH_FRAME_SECTION_NAME</code> is defined, and
  173. true otherwise.
  174. </p></dd></dl>
  175. <dl>
  176. <dt><a name="index-TARGET_005fDWARF_005fREGISTER_005fSPAN"></a>Target Hook: <em>rtx</em> <strong>TARGET_DWARF_REGISTER_SPAN</strong> <em>(rtx <var>reg</var>)</em></dt>
  177. <dd><p>Given a register, this hook should return a parallel of registers to
  178. represent where to find the register pieces. Define this hook if the
  179. register and its mode are represented in Dwarf in non-contiguous
  180. locations, or if the register should be represented in more than one
  181. register in Dwarf. Otherwise, this hook should return <code>NULL_RTX</code>.
  182. If not defined, the default is to return <code>NULL_RTX</code>.
  183. </p></dd></dl>
  184. <dl>
  185. <dt><a name="index-TARGET_005fDWARF_005fFRAME_005fREG_005fMODE"></a>Target Hook: <em>machine_mode</em> <strong>TARGET_DWARF_FRAME_REG_MODE</strong> <em>(int <var>regno</var>)</em></dt>
  186. <dd><p>Given a register, this hook should return the mode which the
  187. corresponding Dwarf frame register should have. This is normally
  188. used to return a smaller mode than the raw mode to prevent call
  189. clobbered parts of a register altering the frame register size
  190. </p></dd></dl>
  191. <dl>
  192. <dt><a name="index-TARGET_005fINIT_005fDWARF_005fREG_005fSIZES_005fEXTRA"></a>Target Hook: <em>void</em> <strong>TARGET_INIT_DWARF_REG_SIZES_EXTRA</strong> <em>(tree <var>address</var>)</em></dt>
  193. <dd><p>If some registers are represented in Dwarf-2 unwind information in
  194. multiple pieces, define this hook to fill in information about the
  195. sizes of those pieces in the table used by the unwinder at runtime.
  196. It will be called by <code>expand_builtin_init_dwarf_reg_sizes</code> after
  197. filling in a single size corresponding to each hard register;
  198. <var>address</var> is the address of the table.
  199. </p></dd></dl>
  200. <dl>
  201. <dt><a name="index-TARGET_005fASM_005fTTYPE"></a>Target Hook: <em>bool</em> <strong>TARGET_ASM_TTYPE</strong> <em>(rtx <var>sym</var>)</em></dt>
  202. <dd><p>This hook is used to output a reference from a frame unwinding table to
  203. the type_info object identified by <var>sym</var>. It should return <code>true</code>
  204. if the reference was output. Returning <code>false</code> will cause the
  205. reference to be output using the normal Dwarf2 routines.
  206. </p></dd></dl>
  207. <dl>
  208. <dt><a name="index-TARGET_005fARM_005fEABI_005fUNWINDER"></a>Target Hook: <em>bool</em> <strong>TARGET_ARM_EABI_UNWINDER</strong></dt>
  209. <dd><p>This flag should be set to <code>true</code> on targets that use an ARM EABI
  210. based unwinding library, and <code>false</code> on other targets. This effects
  211. the format of unwinding tables, and how the unwinder in entered after
  212. running a cleanup. The default is <code>false</code>.
  213. </p></dd></dl>
  214. <hr>
  215. <div class="header">
  216. <p>
  217. Next: <a href="Alignment-Output.html#Alignment-Output" accesskey="n" rel="next">Alignment Output</a>, Previous: <a href="Dispatch-Tables.html#Dispatch-Tables" accesskey="p" rel="prev">Dispatch Tables</a>, Up: <a href="Assembler-Format.html#Assembler-Format" accesskey="u" rel="up">Assembler Format</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  218. </div>
  219. </body>
  220. </html>