2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: assembler format, output of assembler code
10 The Overall Framework of an Assembler File
11 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 .. prevent bad page break with this line
15 This describes the overall framework of an assembly file.
17 .. index:: default_file_start
19 .. include:: ../tm.rst.in
20 :start-after: [TARGET_ASM_FILE_START]
21 :end-before: [TARGET_ASM_FILE_START]
24 .. include:: ../tm.rst.in
25 :start-after: [TARGET_ASM_FILE_START_APP_OFF]
26 :end-before: [TARGET_ASM_FILE_START_APP_OFF]
29 .. include:: ../tm.rst.in
30 :start-after: [TARGET_ASM_FILE_START_FILE_DIRECTIVE]
31 :end-before: [TARGET_ASM_FILE_START_FILE_DIRECTIVE]
34 .. include:: ../tm.rst.in
35 :start-after: [TARGET_ASM_FILE_END]
36 :end-before: [TARGET_ASM_FILE_END]
39 .. function:: void file_end_indicate_exec_stack ()
41 Some systems use a common convention, the :samp:`.note.GNU-stack`
42 special section, to indicate whether or not an object file relies on
43 the stack being executable. If your system uses this convention, you
44 should define ``TARGET_ASM_FILE_END`` to this function. If you
45 need to do other things in that hook, have your hook function call
48 .. include:: ../tm.rst.in
49 :start-after: [TARGET_ASM_LTO_START]
50 :end-before: [TARGET_ASM_LTO_START]
53 .. include:: ../tm.rst.in
54 :start-after: [TARGET_ASM_LTO_END]
55 :end-before: [TARGET_ASM_LTO_END]
58 .. include:: ../tm.rst.in
59 :start-after: [TARGET_ASM_CODE_END]
60 :end-before: [TARGET_ASM_CODE_END]
63 .. c:macro:: ASM_COMMENT_START
65 A C string constant describing how to begin a comment in the target
66 assembler language. The compiler assumes that the comment will end at
69 .. c:macro:: ASM_APP_ON
71 A C string constant for text to be output before each ``asm``
72 statement or group of consecutive ones. Normally this is
73 ``"#APP"``, which is a comment that has no effect on most
74 assemblers but tells the GNU assembler that it must check the lines
75 that follow for all valid assembler constructs.
77 .. c:macro:: ASM_APP_OFF
79 A C string constant for text to be output after each ``asm``
80 statement or group of consecutive ones. Normally this is
81 ``"#NO_APP"``, which tells the GNU assembler to resume making the
82 time-saving assumptions that are valid for ordinary compiler output.
84 .. c:macro:: ASM_OUTPUT_SOURCE_FILENAME (stream, name)
86 A C statement to output COFF information or DWARF debugging information
87 which indicates that filename :samp:`{name}` is the current source file to
88 the stdio stream :samp:`{stream}`.
90 This macro need not be defined if the standard form of output
91 for the file format in use is appropriate.
93 .. include:: ../tm.rst.in
94 :start-after: [TARGET_ASM_OUTPUT_SOURCE_FILENAME]
95 :end-before: [TARGET_ASM_OUTPUT_SOURCE_FILENAME]
98 .. include:: ../tm.rst.in
99 :start-after: [TARGET_ASM_OUTPUT_IDENT]
100 :end-before: [TARGET_ASM_OUTPUT_IDENT]
103 .. c:macro:: OUTPUT_QUOTED_STRING (stream, string)
105 A C statement to output the string :samp:`{string}` to the stdio stream
106 :samp:`{stream}`. If you do not call the function ``output_quoted_string``
107 in your config files, GCC will only call it to output filenames to
108 the assembler source. So you can use it to canonicalize the format
109 of the filename using this macro.
111 .. include:: ../tm.rst.in
112 :start-after: [TARGET_ASM_NAMED_SECTION]
113 :end-before: [TARGET_ASM_NAMED_SECTION]
116 .. include:: ../tm.rst.in
117 :start-after: [TARGET_ASM_ELF_FLAGS_NUMERIC]
118 :end-before: [TARGET_ASM_ELF_FLAGS_NUMERIC]
121 .. include:: ../tm.rst.in
122 :start-after: [TARGET_ASM_FUNCTION_SECTION]
123 :end-before: [TARGET_ASM_FUNCTION_SECTION]
126 .. include:: ../tm.rst.in
127 :start-after: [TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS]
128 :end-before: [TARGET_ASM_FUNCTION_SWITCHED_TEXT_SECTIONS]
131 .. include:: ../tm.rst.in
132 :start-after: [TARGET_HAVE_NAMED_SECTIONS]
133 :end-before: [TARGET_HAVE_NAMED_SECTIONS]
136 This flag is true if the target supports ``TARGET_ASM_NAMED_SECTION``.
137 It must not be modified by command-line option processing.
139 .. _target_have_switchable_bss_sections:
141 .. include:: ../tm.rst.in
142 :start-after: [TARGET_HAVE_SWITCHABLE_BSS_SECTIONS]
143 :end-before: [TARGET_HAVE_SWITCHABLE_BSS_SECTIONS]
146 .. include:: ../tm.rst.in
147 :start-after: [TARGET_SECTION_TYPE_FLAGS]
148 :end-before: [TARGET_SECTION_TYPE_FLAGS]
151 .. include:: ../tm.rst.in
152 :start-after: [TARGET_ASM_RECORD_GCC_SWITCHES]
153 :end-before: [TARGET_ASM_RECORD_GCC_SWITCHES]
156 .. include:: ../tm.rst.in
157 :start-after: [TARGET_ASM_RECORD_GCC_SWITCHES_SECTION]
158 :end-before: [TARGET_ASM_RECORD_GCC_SWITCHES_SECTION]