Exception-Region-Output.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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-2017 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 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>GNU Compiler Collection (GCC) Internals: Exception Region Output</title>
  20. <meta name="description" content="GNU Compiler Collection (GCC) Internals: Exception Region Output">
  21. <meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Exception Region Output">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  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.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  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.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="Exception-Region-Output"></a>
  63. <div class="header">
  64. <p>
  65. 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>
  66. </div>
  67. <hr>
  68. <a name="Assembler-Commands-for-Exception-Regions"></a>
  69. <h4 class="subsection">17.20.9 Assembler Commands for Exception Regions</h4>
  70. <p>This describes commands marking the start and the end of an exception
  71. region.
  72. </p>
  73. <dl>
  74. <dt><a name="index-EH_005fFRAME_005fSECTION_005fNAME"></a>Macro: <strong>EH_FRAME_SECTION_NAME</strong></dt>
  75. <dd><p>If defined, a C string constant for the name of the section containing
  76. exception handling frame unwind information. If not defined, GCC will
  77. provide a default definition if the target supports named sections.
  78. <samp>crtstuff.c</samp> uses this macro to switch to the appropriate section.
  79. </p>
  80. <p>You should define this symbol if your target supports DWARF 2 frame
  81. unwind information and the default definition does not work.
  82. </p></dd></dl>
  83. <dl>
  84. <dt><a name="index-EH_005fFRAME_005fTHROUGH_005fCOLLECT2"></a>Macro: <strong>EH_FRAME_THROUGH_COLLECT2</strong></dt>
  85. <dd><p>If defined, DWARF 2 frame unwind information will identified by
  86. specially named labels. The collect2 process will locate these
  87. labels and generate code to register the frames.
  88. </p>
  89. <p>This might be necessary, for instance, if the system linker will not
  90. place the eh_frames in-between the sentinals from <samp>crtstuff.c</samp>,
  91. or if the system linker does garbage collection and sections cannot
  92. be marked as not to be collected.
  93. </p></dd></dl>
  94. <dl>
  95. <dt><a name="index-EH_005fTABLES_005fCAN_005fBE_005fREAD_005fONLY"></a>Macro: <strong>EH_TABLES_CAN_BE_READ_ONLY</strong></dt>
  96. <dd><p>Define this macro to 1 if your target is such that no frame unwind
  97. information encoding used with non-PIC code will ever require a
  98. runtime relocation, but the linker may not support merging read-only
  99. and read-write sections into a single read-write section.
  100. </p></dd></dl>
  101. <dl>
  102. <dt><a name="index-MASK_005fRETURN_005fADDR"></a>Macro: <strong>MASK_RETURN_ADDR</strong></dt>
  103. <dd><p>An rtx used to mask the return address found via <code>RETURN_ADDR_RTX</code>, so
  104. that it does not contain any extraneous set bits in it.
  105. </p></dd></dl>
  106. <dl>
  107. <dt><a name="index-DWARF2_005fUNWIND_005fINFO"></a>Macro: <strong>DWARF2_UNWIND_INFO</strong></dt>
  108. <dd><p>Define this macro to 0 if your target supports DWARF 2 frame unwind
  109. information, but it does not yet work with exception handling.
  110. Otherwise, if your target supports this information (if it defines
  111. <code>INCOMING_RETURN_ADDR_RTX</code> and <code>OBJECT_FORMAT_ELF</code>),
  112. GCC will provide a default definition of 1.
  113. </p></dd></dl>
  114. <dl>
  115. <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>
  116. <dd><p>This hook defines the mechanism that will be used for exception handling
  117. by the target. If the target has ABI specified unwind tables, the hook
  118. should return <code>UI_TARGET</code>. If the target is to use the
  119. <code>setjmp</code>/<code>longjmp</code>-based exception handling scheme, the hook
  120. should return <code>UI_SJLJ</code>. If the target supports DWARF 2 frame unwind
  121. information, the hook should return <code>UI_DWARF2</code>.
  122. </p>
  123. <p>A target may, if exceptions are disabled, choose to return <code>UI_NONE</code>.
  124. This may end up simplifying other parts of target-specific code. The
  125. default implementation of this hook never returns <code>UI_NONE</code>.
  126. </p>
  127. <p>Note that the value returned by this hook should be constant. It should
  128. not depend on anything except the command-line switches described by
  129. <var>opts</var>. In particular, the
  130. setting <code>UI_SJLJ</code> must be fixed at compiler start-up as C pre-processor
  131. macros and builtin functions related to exception handling are set up
  132. depending on this setting.
  133. </p>
  134. <p>The default implementation of the hook first honors the
  135. <samp>--enable-sjlj-exceptions</samp> configure option, then
  136. <code>DWARF2_UNWIND_INFO</code>, and finally defaults to <code>UI_SJLJ</code>. If
  137. <code>DWARF2_UNWIND_INFO</code> depends on command-line options, the target
  138. must define this hook so that <var>opts</var> is used correctly.
  139. </p></dd></dl>
  140. <dl>
  141. <dt><a name="index-TARGET_005fUNWIND_005fTABLES_005fDEFAULT"></a>Common Target Hook: <em>bool</em> <strong>TARGET_UNWIND_TABLES_DEFAULT</strong></dt>
  142. <dd><p>This variable should be set to <code>true</code> if the target ABI requires unwinding
  143. tables even when exceptions are not used. It must not be modified by
  144. command-line option processing.
  145. </p></dd></dl>
  146. <dl>
  147. <dt><a name="index-DONT_005fUSE_005fBUILTIN_005fSETJMP"></a>Macro: <strong>DONT_USE_BUILTIN_SETJMP</strong></dt>
  148. <dd><p>Define this macro to 1 if the <code>setjmp</code>/<code>longjmp</code>-based scheme
  149. should use the <code>setjmp</code>/<code>longjmp</code> functions from the C library
  150. instead of the <code>__builtin_setjmp</code>/<code>__builtin_longjmp</code> machinery.
  151. </p></dd></dl>
  152. <dl>
  153. <dt><a name="index-JMP_005fBUF_005fSIZE"></a>Macro: <strong>JMP_BUF_SIZE</strong></dt>
  154. <dd><p>This macro has no effect unless <code>DONT_USE_BUILTIN_SETJMP</code> is also
  155. defined. Define this macro if the default size of <code>jmp_buf</code> buffer
  156. for the <code>setjmp</code>/<code>longjmp</code>-based exception handling mechanism
  157. is not large enough, or if it is much too large.
  158. The default size is <code>FIRST_PSEUDO_REGISTER * sizeof(void *)</code>.
  159. </p></dd></dl>
  160. <dl>
  161. <dt><a name="index-DWARF_005fCIE_005fDATA_005fALIGNMENT"></a>Macro: <strong>DWARF_CIE_DATA_ALIGNMENT</strong></dt>
  162. <dd><p>This macro need only be defined if the target might save registers in the
  163. function prologue at an offset to the stack pointer that is not aligned to
  164. <code>UNITS_PER_WORD</code>. The definition should be the negative minimum
  165. alignment if <code>STACK_GROWS_DOWNWARD</code> is true, and the positive
  166. minimum alignment otherwise. See <a href="SDB-and-DWARF.html#SDB-and-DWARF">SDB and DWARF</a>. Only applicable if
  167. the target supports DWARF 2 frame unwind information.
  168. </p></dd></dl>
  169. <dl>
  170. <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>
  171. <dd><p>Contains the value true if the target should add a zero word onto the
  172. end of a Dwarf-2 frame info section when used for exception handling.
  173. Default value is false if <code>EH_FRAME_SECTION_NAME</code> is defined, and
  174. true otherwise.
  175. </p></dd></dl>
  176. <dl>
  177. <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>
  178. <dd><p>Given a register, this hook should return a parallel of registers to
  179. represent where to find the register pieces. Define this hook if the
  180. register and its mode are represented in Dwarf in non-contiguous
  181. locations, or if the register should be represented in more than one
  182. register in Dwarf. Otherwise, this hook should return <code>NULL_RTX</code>.
  183. If not defined, the default is to return <code>NULL_RTX</code>.
  184. </p></dd></dl>
  185. <dl>
  186. <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>
  187. <dd><p>Given a register, this hook should return the mode which the
  188. corresponding Dwarf frame register should have. This is normally
  189. used to return a smaller mode than the raw mode to prevent call
  190. clobbered parts of a register altering the frame register size
  191. </p></dd></dl>
  192. <dl>
  193. <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>
  194. <dd><p>If some registers are represented in Dwarf-2 unwind information in
  195. multiple pieces, define this hook to fill in information about the
  196. sizes of those pieces in the table used by the unwinder at runtime.
  197. It will be called by <code>expand_builtin_init_dwarf_reg_sizes</code> after
  198. filling in a single size corresponding to each hard register;
  199. <var>address</var> is the address of the table.
  200. </p></dd></dl>
  201. <dl>
  202. <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>
  203. <dd><p>This hook is used to output a reference from a frame unwinding table to
  204. the type_info object identified by <var>sym</var>. It should return <code>true</code>
  205. if the reference was output. Returning <code>false</code> will cause the
  206. reference to be output using the normal Dwarf2 routines.
  207. </p></dd></dl>
  208. <dl>
  209. <dt><a name="index-TARGET_005fARM_005fEABI_005fUNWINDER"></a>Target Hook: <em>bool</em> <strong>TARGET_ARM_EABI_UNWINDER</strong></dt>
  210. <dd><p>This flag should be set to <code>true</code> on targets that use an ARM EABI
  211. based unwinding library, and <code>false</code> on other targets. This effects
  212. the format of unwinding tables, and how the unwinder in entered after
  213. running a cleanup. The default is <code>false</code>.
  214. </p></dd></dl>
  215. <hr>
  216. <div class="header">
  217. <p>
  218. 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>
  219. </div>
  220. </body>
  221. </html>