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.
8 Output and Generation of Labels
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 .. prevent bad page break with this line
13 This is about outputting labels.
15 .. index:: assemble_name
17 .. c:macro:: ASM_OUTPUT_LABEL (stream, name)
19 A C statement (sans semicolon) to output to the stdio stream
20 :samp:`{stream}` the assembler definition of a label named :samp:`{name}`.
21 Use the expression ``assemble_name (stream, name)`` to
22 output the name itself; before and after that, output the additional
23 assembler syntax for defining the name, and a newline. A default
24 definition of this macro is provided which is correct for most systems.
26 .. c:macro:: ASM_OUTPUT_FUNCTION_LABEL (stream, name, decl)
28 A C statement (sans semicolon) to output to the stdio stream
29 :samp:`{stream}` the assembler definition of a label named :samp:`{name}` of
31 Use the expression ``assemble_name (stream, name)`` to
32 output the name itself; before and after that, output the additional
33 assembler syntax for defining the name, and a newline. A default
34 definition of this macro is provided which is correct for most systems.
36 If this macro is not defined, then the function name is defined in the
37 usual manner as a label (by means of ``ASM_OUTPUT_LABEL``).
39 .. index:: assemble_name_raw
41 .. c:macro:: ASM_OUTPUT_INTERNAL_LABEL (stream, name)
43 Identical to ``ASM_OUTPUT_LABEL``, except that :samp:`{name}` is known
44 to refer to a compiler-generated label. The default definition uses
45 ``assemble_name_raw``, which is like ``assemble_name`` except
46 that it is more efficient.
48 .. c:macro:: SIZE_ASM_OP
50 A C string containing the appropriate assembler directive to specify the
51 size of a symbol, without any arguments. On systems that use ELF, the
52 default (in :samp:`config/elfos.h`) is :samp:`"\\t.size\\t"`; on other
53 systems, the default is not to define this macro.
55 Define this macro only if it is correct to use the default definitions
56 of ``ASM_OUTPUT_SIZE_DIRECTIVE`` and ``ASM_OUTPUT_MEASURED_SIZE``
57 for your system. If you need your own custom definitions of those
58 macros, or if you do not need explicit symbol sizes at all, do not
61 .. c:macro:: ASM_OUTPUT_SIZE_DIRECTIVE (stream, name, size)
63 A C statement (sans semicolon) to output to the stdio stream
64 :samp:`{stream}` a directive telling the assembler that the size of the
65 symbol :samp:`{name}` is :samp:`{size}`. :samp:`{size}` is a ``HOST_WIDE_INT``.
66 If you define ``SIZE_ASM_OP``, a default definition of this macro is
69 .. c:macro:: ASM_OUTPUT_MEASURED_SIZE (stream, name)
71 A C statement (sans semicolon) to output to the stdio stream
72 :samp:`{stream}` a directive telling the assembler to calculate the size of
73 the symbol :samp:`{name}` by subtracting its address from the current
76 If you define ``SIZE_ASM_OP``, a default definition of this macro is
77 provided. The default assumes that the assembler recognizes a special
78 :samp:`.` symbol as referring to the current address, and can calculate
79 the difference between this and another symbol. If your assembler does
80 not recognize :samp:`.` or cannot do calculations with it, you will need
81 to redefine ``ASM_OUTPUT_MEASURED_SIZE`` to use some other technique.
83 .. c:macro:: NO_DOLLAR_IN_LABEL
85 Define this macro if the assembler does not accept the character
86 :samp:`$` in label names. By default constructors and destructors in
87 G++ have :samp:`$` in the identifiers. If this macro is defined,
88 :samp:`.` is used instead.
90 .. c:macro:: NO_DOT_IN_LABEL
92 Define this macro if the assembler does not accept the character
93 :samp:`.` in label names. By default constructors and destructors in G++
94 have names that use :samp:`.`. If this macro is defined, these names
95 are rewritten to avoid :samp:`.`.
97 .. c:macro:: TYPE_ASM_OP
99 A C string containing the appropriate assembler directive to specify the
100 type of a symbol, without any arguments. On systems that use ELF, the
101 default (in :samp:`config/elfos.h`) is :samp:`"\\t.type\\t"`; on other
102 systems, the default is not to define this macro.
104 Define this macro only if it is correct to use the default definition of
105 ``ASM_OUTPUT_TYPE_DIRECTIVE`` for your system. If you need your own
106 custom definition of this macro, or if you do not need explicit symbol
107 types at all, do not define this macro.
109 .. c:macro:: TYPE_OPERAND_FMT
111 A C string which specifies (using ``printf`` syntax) the format of
112 the second operand to ``TYPE_ASM_OP``. On systems that use ELF, the
113 default (in :samp:`config/elfos.h`) is :samp:`"@%s"`; on other systems,
114 the default is not to define this macro.
116 Define this macro only if it is correct to use the default definition of
117 ``ASM_OUTPUT_TYPE_DIRECTIVE`` for your system. If you need your own
118 custom definition of this macro, or if you do not need explicit symbol
119 types at all, do not define this macro.
121 .. c:macro:: ASM_OUTPUT_TYPE_DIRECTIVE (stream, type)
123 A C statement (sans semicolon) to output to the stdio stream
124 :samp:`{stream}` a directive telling the assembler that the type of the
125 symbol :samp:`{name}` is :samp:`{type}`. :samp:`{type}` is a C string; currently,
126 that string is always either :samp:`"function"` or :samp:`"object"`, but
127 you should not count on this.
129 If you define ``TYPE_ASM_OP`` and ``TYPE_OPERAND_FMT``, a default
130 definition of this macro is provided.
132 .. c:macro:: ASM_DECLARE_FUNCTION_NAME (stream, name, decl)
134 A C statement (sans semicolon) to output to the stdio stream
135 :samp:`{stream}` any text necessary for declaring the name :samp:`{name}` of a
136 function which is being defined. This macro is responsible for
137 outputting the label definition (perhaps using
138 ``ASM_OUTPUT_FUNCTION_LABEL``). The argument :samp:`{decl}` is the
139 ``FUNCTION_DECL`` tree node representing the function.
141 If this macro is not defined, then the function name is defined in the
142 usual manner as a label (by means of ``ASM_OUTPUT_FUNCTION_LABEL``).
144 You may wish to use ``ASM_OUTPUT_TYPE_DIRECTIVE`` in the definition
147 .. c:macro:: ASM_DECLARE_FUNCTION_SIZE (stream, name, decl)
149 A C statement (sans semicolon) to output to the stdio stream
150 :samp:`{stream}` any text necessary for declaring the size of a function
151 which is being defined. The argument :samp:`{name}` is the name of the
152 function. The argument :samp:`{decl}` is the ``FUNCTION_DECL`` tree node
153 representing the function.
155 If this macro is not defined, then the function size is not defined.
157 You may wish to use ``ASM_OUTPUT_MEASURED_SIZE`` in the definition
160 .. c:macro:: ASM_DECLARE_COLD_FUNCTION_NAME (stream, name, decl)
162 A C statement (sans semicolon) to output to the stdio stream
163 :samp:`{stream}` any text necessary for declaring the name :samp:`{name}` of a
164 cold function partition which is being defined. This macro is responsible
165 for outputting the label definition (perhaps using
166 ``ASM_OUTPUT_FUNCTION_LABEL``). The argument :samp:`{decl}` is the
167 ``FUNCTION_DECL`` tree node representing the function.
169 If this macro is not defined, then the cold partition name is defined in the
170 usual manner as a label (by means of ``ASM_OUTPUT_LABEL``).
172 You may wish to use ``ASM_OUTPUT_TYPE_DIRECTIVE`` in the definition
175 .. c:macro:: ASM_DECLARE_COLD_FUNCTION_SIZE (stream, name, decl)
177 A C statement (sans semicolon) to output to the stdio stream
178 :samp:`{stream}` any text necessary for declaring the size of a cold function
179 partition which is being defined. The argument :samp:`{name}` is the name of the
180 cold partition of the function. The argument :samp:`{decl}` is the
181 ``FUNCTION_DECL`` tree node representing the function.
183 If this macro is not defined, then the partition size is not defined.
185 You may wish to use ``ASM_OUTPUT_MEASURED_SIZE`` in the definition
188 .. c:macro:: ASM_DECLARE_OBJECT_NAME (stream, name, decl)
190 A C statement (sans semicolon) to output to the stdio stream
191 :samp:`{stream}` any text necessary for declaring the name :samp:`{name}` of an
192 initialized variable which is being defined. This macro must output the
193 label definition (perhaps using ``ASM_OUTPUT_LABEL``). The argument
194 :samp:`{decl}` is the ``VAR_DECL`` tree node representing the variable.
196 If this macro is not defined, then the variable name is defined in the
197 usual manner as a label (by means of ``ASM_OUTPUT_LABEL``).
199 You may wish to use ``ASM_OUTPUT_TYPE_DIRECTIVE`` and/or
200 ``ASM_OUTPUT_SIZE_DIRECTIVE`` in the definition of this macro.
202 .. function:: void TARGET_ASM_DECLARE_CONSTANT_NAME (FILE *file, const char *name, const_tree expr, HOST_WIDE_INT size)
204 .. hook-start:TARGET_ASM_DECLARE_CONSTANT_NAME
206 A target hook to output to the stdio stream :samp:`{file}` any text necessary
207 for declaring the name :samp:`{name}` of a constant which is being defined. This
208 target hook is responsible for outputting the label definition (perhaps using
209 ``assemble_label``). The argument :samp:`{exp}` is the value of the constant,
210 and :samp:`{size}` is the size of the constant in bytes. The :samp:`{name}`
211 will be an internal label.
213 The default version of this target hook, define the :samp:`{name}` in the
214 usual manner as a label (by means of ``assemble_label``).
216 You may wish to use ``ASM_OUTPUT_TYPE_DIRECTIVE`` in this target hook.
220 .. c:macro:: ASM_DECLARE_REGISTER_GLOBAL (stream, decl, regno, name)
222 A C statement (sans semicolon) to output to the stdio stream
223 :samp:`{stream}` any text necessary for claiming a register :samp:`{regno}`
224 for a global variable :samp:`{decl}` with name :samp:`{name}`.
226 If you don't define this macro, that is equivalent to defining it to do
229 .. c:macro:: ASM_FINISH_DECLARE_OBJECT (stream, decl, toplevel, atend)
231 A C statement (sans semicolon) to finish up declaring a variable name
232 once the compiler has processed its initializer fully and thus has had a
233 chance to determine the size of an array when controlled by an
234 initializer. This is used on systems where it's necessary to declare
235 something about the size of the object.
237 If you don't define this macro, that is equivalent to defining it to do
240 You may wish to use ``ASM_OUTPUT_SIZE_DIRECTIVE`` and/or
241 ``ASM_OUTPUT_MEASURED_SIZE`` in the definition of this macro.
243 .. function:: void TARGET_ASM_GLOBALIZE_LABEL (FILE *stream, const char *name)
245 .. hook-start:TARGET_ASM_GLOBALIZE_LABEL
247 This target hook is a function to output to the stdio stream
248 :samp:`{stream}` some commands that will make the label :samp:`{name}` global;
249 that is, available for reference from other files.
251 The default implementation relies on a proper definition of
256 .. function:: void TARGET_ASM_GLOBALIZE_DECL_NAME (FILE *stream, tree decl)
258 .. hook-start:TARGET_ASM_GLOBALIZE_DECL_NAME
260 This target hook is a function to output to the stdio stream
261 :samp:`{stream}` some commands that will make the name associated with :samp:`{decl}`
262 global; that is, available for reference from other files.
264 The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.
268 .. function:: void TARGET_ASM_ASSEMBLE_UNDEFINED_DECL (FILE *stream, const char *name, const_tree decl)
270 .. hook-start:TARGET_ASM_ASSEMBLE_UNDEFINED_DECL
272 This target hook is a function to output to the stdio stream
273 :samp:`{stream}` some commands that will declare the name associated with
274 :samp:`{decl}` which is not defined in the current translation unit. Most
275 assemblers do not require anything to be output in this case.
279 .. c:macro:: ASM_WEAKEN_LABEL (stream, name)
281 A C statement (sans semicolon) to output to the stdio stream
282 :samp:`{stream}` some commands that will make the label :samp:`{name}` weak;
283 that is, available for reference from other files but only used if
284 no other definition is available. Use the expression
285 ``assemble_name (stream, name)`` to output the name
286 itself; before and after that, output the additional assembler syntax
287 for making that name weak, and a newline.
289 If you don't define this macro or ``ASM_WEAKEN_DECL``, GCC will not
290 support weak symbols and you should not define the ``SUPPORTS_WEAK``
293 .. c:macro:: ASM_WEAKEN_DECL (stream, decl, name, value)
295 Combines (and replaces) the function of ``ASM_WEAKEN_LABEL`` and
296 ``ASM_OUTPUT_WEAK_ALIAS``, allowing access to the associated function
297 or variable decl. If :samp:`{value}` is not ``NULL``, this C statement
298 should output to the stdio stream :samp:`{stream}` assembler code which
299 defines (equates) the weak symbol :samp:`{name}` to have the value
300 :samp:`{value}`. If :samp:`{value}` is ``NULL``, it should output commands
301 to make :samp:`{name}` weak.
303 .. c:macro:: ASM_OUTPUT_WEAKREF (stream, decl, name, value)
305 Outputs a directive that enables :samp:`{name}` to be used to refer to
306 symbol :samp:`{value}` with weak-symbol semantics. ``decl`` is the
307 declaration of ``name``.
309 .. c:macro:: SUPPORTS_WEAK
311 A preprocessor constant expression which evaluates to true if the target
312 supports weak symbols.
314 If you don't define this macro, :samp:`defaults.h` provides a default
315 definition. If either ``ASM_WEAKEN_LABEL`` or ``ASM_WEAKEN_DECL``
316 is defined, the default definition is :samp:`1`; otherwise, it is :samp:`0`.
318 .. c:macro:: TARGET_SUPPORTS_WEAK
320 A C expression which evaluates to true if the target supports weak symbols.
322 If you don't define this macro, :samp:`defaults.h` provides a default
323 definition. The default definition is :samp:`(SUPPORTS_WEAK)`. Define
324 this macro if you want to control weak symbol support with a compiler
325 flag such as :option:`-melf`.
327 .. c:macro:: MAKE_DECL_ONE_ONLY (decl)
329 A C statement (sans semicolon) to mark :samp:`{decl}` to be emitted as a
330 public symbol such that extra copies in multiple translation units will
331 be discarded by the linker. Define this macro if your object file
332 format provides support for this concept, such as the :samp:`COMDAT`
333 section flags in the Microsoft Windows PE/COFF format, and this support
334 requires changes to :samp:`{decl}`, such as putting it in a separate section.
336 .. c:macro:: SUPPORTS_ONE_ONLY
338 A C expression which evaluates to true if the target supports one-only
341 If you don't define this macro, :samp:`varasm.cc` provides a default
342 definition. If ``MAKE_DECL_ONE_ONLY`` is defined, the default
343 definition is :samp:`1`; otherwise, it is :samp:`0`. Define this macro if
344 you want to control one-only symbol support with a compiler flag, or if
345 setting the ``DECL_ONE_ONLY`` flag is enough to mark a declaration to
346 be emitted as one-only.
348 .. function:: void TARGET_ASM_ASSEMBLE_VISIBILITY (tree decl, int visibility)
350 .. hook-start:TARGET_ASM_ASSEMBLE_VISIBILITY
352 This target hook is a function to output to :samp:`{asm_out_file}` some
353 commands that will make the symbol(s) associated with :samp:`{decl}` have
354 hidden, protected or internal visibility as specified by :samp:`{visibility}`.
358 .. c:macro:: TARGET_WEAK_NOT_IN_ARCHIVE_TOC
360 A C expression that evaluates to true if the target's linker expects
361 that weak symbols do not appear in a static archive's table of contents.
362 The default is ``0``.
364 Leaving weak symbols out of an archive's table of contents means that,
365 if a symbol will only have a definition in one translation unit and
366 will have undefined references from other translation units, that
367 symbol should not be weak. Defining this macro to be nonzero will
368 thus have the effect that certain symbols that would normally be weak
369 (explicit template instantiations, and vtables for polymorphic classes
370 with noninline key methods) will instead be nonweak.
372 The C++ ABI requires this macro to be zero. Define this macro for
373 targets where full C++ ABI compliance is impossible and where linker
374 restrictions require weak symbols to be left out of a static archive's
377 .. c:macro:: ASM_OUTPUT_EXTERNAL (stream, decl, name)
379 A C statement (sans semicolon) to output to the stdio stream
380 :samp:`{stream}` any text necessary for declaring the name of an external
381 symbol named :samp:`{name}` which is referenced in this compilation but
382 not defined. The value of :samp:`{decl}` is the tree node for the
385 This macro need not be defined if it does not need to output anything.
386 The GNU assembler and most Unix assemblers don't require anything.
388 .. function:: void TARGET_ASM_EXTERNAL_LIBCALL (rtx symref)
390 .. hook-start:TARGET_ASM_EXTERNAL_LIBCALL
392 This target hook is a function to output to :samp:`{asm_out_file}` an assembler
393 pseudo-op to declare a library function name external. The name of the
394 library function is given by :samp:`{symref}`, which is a ``symbol_ref``.
398 .. function:: void TARGET_ASM_MARK_DECL_PRESERVED (const char *symbol)
400 .. hook-start:TARGET_ASM_MARK_DECL_PRESERVED
402 This target hook is a function to output to :samp:`{asm_out_file}` an assembler
403 directive to annotate :samp:`{symbol}` as used. The Darwin target uses the
404 .no_dead_code_strip directive.
408 .. c:macro:: ASM_OUTPUT_LABELREF (stream, name)
410 A C statement (sans semicolon) to output to the stdio stream
411 :samp:`{stream}` a reference in assembler syntax to a label named
412 :samp:`{name}`. This should add :samp:`_` to the front of the name, if that
413 is customary on your operating system, as it is in most Berkeley Unix
414 systems. This macro is used in ``assemble_name``.
416 .. function:: tree TARGET_MANGLE_ASSEMBLER_NAME (const char *name)
418 .. hook-start:TARGET_MANGLE_ASSEMBLER_NAME
420 Given a symbol :samp:`{name}`, perform same mangling as ``varasm.cc`` 's
421 ``assemble_name``, but in memory rather than to a file stream, returning
422 result as an ``IDENTIFIER_NODE``. Required for correct LTO symtabs. The
423 default implementation calls the ``TARGET_STRIP_NAME_ENCODING`` hook and
424 then prepends the ``USER_LABEL_PREFIX``, if any.
428 .. c:macro:: ASM_OUTPUT_SYMBOL_REF (stream, sym)
430 A C statement (sans semicolon) to output a reference to
431 ``SYMBOL_REF`` :samp:`{sym}`. If not defined, ``assemble_name``
432 will be used to output the name of the symbol. This macro may be used
433 to modify the way a symbol is referenced depending on information
434 encoded by ``TARGET_ENCODE_SECTION_INFO``.
436 .. c:macro:: ASM_OUTPUT_LABEL_REF (stream, buf)
438 A C statement (sans semicolon) to output a reference to :samp:`{buf}`, the
439 result of ``ASM_GENERATE_INTERNAL_LABEL``. If not defined,
440 ``assemble_name`` will be used to output the name of the symbol.
441 This macro is not used by ``output_asm_label``, or the ``%l``
442 specifier that calls it; the intention is that this macro should be set
443 when it is necessary to output a label differently when its address is
446 .. function:: void TARGET_ASM_INTERNAL_LABEL (FILE *stream, const char *prefix, unsigned long labelno)
448 .. hook-start:TARGET_ASM_INTERNAL_LABEL
450 A function to output to the stdio stream :samp:`{stream}` a label whose
451 name is made from the string :samp:`{prefix}` and the number :samp:`{labelno}`.
453 It is absolutely essential that these labels be distinct from the labels
454 used for user-level functions and variables. Otherwise, certain programs
455 will have name conflicts with internal labels.
457 It is desirable to exclude internal labels from the symbol table of the
458 object file. Most assemblers have a naming convention for labels that
459 should be excluded; on many systems, the letter :samp:`L` at the
460 beginning of a label has this effect. You should find out what
461 convention your system uses, and follow it.
463 The default version of this function utilizes ``ASM_GENERATE_INTERNAL_LABEL``.
467 .. c:macro:: ASM_OUTPUT_DEBUG_LABEL (stream, prefix, num)
469 A C statement to output to the stdio stream :samp:`{stream}` a debug info
470 label whose name is made from the string :samp:`{prefix}` and the number
471 :samp:`{num}`. This is useful for VLIW targets, where debug info labels
472 may need to be treated differently than branch target labels. On some
473 systems, branch target labels must be at the beginning of instruction
474 bundles, but debug info labels can occur in the middle of instruction
477 If this macro is not defined, then ``(*targetm.asm_out.internal_label)`` will be
480 .. c:macro:: ASM_GENERATE_INTERNAL_LABEL (string, prefix, num)
482 A C statement to store into the string :samp:`{string}` a label whose name
483 is made from the string :samp:`{prefix}` and the number :samp:`{num}`.
485 This string, when output subsequently by ``assemble_name``, should
486 produce the output that ``(*targetm.asm_out.internal_label)`` would produce
487 with the same :samp:`{prefix}` and :samp:`{num}`.
489 If the string begins with :samp:`*`, then ``assemble_name`` will
490 output the rest of the string unchanged. It is often convenient for
491 ``ASM_GENERATE_INTERNAL_LABEL`` to use :samp:`*` in this way. If the
492 string doesn't start with :samp:`*`, then ``ASM_OUTPUT_LABELREF`` gets
493 to output the string, and may change it. (Of course,
494 ``ASM_OUTPUT_LABELREF`` is also part of your machine description, so
495 you should know what it does on your machine.)
497 .. c:macro:: ASM_FORMAT_PRIVATE_NAME (outvar, name, number)
499 A C expression to assign to :samp:`{outvar}` (which is a variable of type
500 ``char *``) a newly allocated string made from the string
501 :samp:`{name}` and the number :samp:`{number}`, with some suitable punctuation
502 added. Use ``alloca`` to get space for the string.
504 The string will be used as an argument to ``ASM_OUTPUT_LABELREF`` to
505 produce an assembler label for an internal static variable whose name is
506 :samp:`{name}`. Therefore, the string must be such as to result in valid
507 assembler code. The argument :samp:`{number}` is different each time this
508 macro is executed; it prevents conflicts between similarly-named
509 internal static variables in different scopes.
511 Ideally this string should not be a valid C identifier, to prevent any
512 conflict with the user's own symbols. Most assemblers allow periods
513 or percent signs in assembler symbols; putting at least one of these
514 between the name and the number will suffice.
516 If this macro is not defined, a default definition will be provided
517 which is correct for most systems.
519 .. c:macro:: ASM_OUTPUT_DEF (stream, name, value)
521 A C statement to output to the stdio stream :samp:`{stream}` assembler code
522 which defines (equates) the symbol :samp:`{name}` to have the value :samp:`{value}`.
524 .. index:: SET_ASM_OP
526 If ``SET_ASM_OP`` is defined, a default definition is provided which is
527 correct for most systems.
529 .. c:macro:: ASM_OUTPUT_DEF_FROM_DECLS (stream, decl_of_name, decl_of_value)
531 A C statement to output to the stdio stream :samp:`{stream}` assembler code
532 which defines (equates) the symbol whose tree node is :samp:`{decl_of_name}`
533 to have the value of the tree node :samp:`{decl_of_value}`. This macro will
534 be used in preference to :samp:`ASM_OUTPUT_DEF` if it is defined and if
535 the tree nodes are available.
537 .. index:: SET_ASM_OP
539 If ``SET_ASM_OP`` is defined, a default definition is provided which is
540 correct for most systems.
542 .. c:macro:: TARGET_DEFERRED_OUTPUT_DEFS (decl_of_name, decl_of_value)
544 A C statement that evaluates to true if the assembler code which defines
545 (equates) the symbol whose tree node is :samp:`{decl_of_name}` to have the value
546 of the tree node :samp:`{decl_of_value}` should be emitted near the end of the
547 current compilation unit. The default is to not defer output of defines.
548 This macro affects defines output by :samp:`ASM_OUTPUT_DEF` and
549 :samp:`ASM_OUTPUT_DEF_FROM_DECLS`.
551 .. c:macro:: ASM_OUTPUT_WEAK_ALIAS (stream, name, value)
553 A C statement to output to the stdio stream :samp:`{stream}` assembler code
554 which defines (equates) the weak symbol :samp:`{name}` to have the value
555 :samp:`{value}`. If :samp:`{value}` is ``NULL``, it defines :samp:`{name}` as
556 an undefined weak symbol.
558 Define this macro if the target only supports weak aliases; define
559 ``ASM_OUTPUT_DEF`` instead if possible.
561 .. c:macro:: OBJC_GEN_METHOD_LABEL (buf, is_inst, class_name, cat_name, sel_name)
563 Define this macro to override the default assembler names used for
566 The default name is a unique method number followed by the name of the
567 class (e.g. :samp:`_1_Foo`). For methods in categories, the name of
568 the category is also included in the assembler name (e.g.
571 These names are safe on most systems, but make debugging difficult since
572 the method's selector is not present in the name. Therefore, particular
573 systems define other ways of computing names.
575 :samp:`{buf}` is an expression of type ``char *`` which gives you a
576 buffer in which to store the name; its length is as long as
577 :samp:`{class_name}`, :samp:`{cat_name}` and :samp:`{sel_name}` put together, plus
580 The argument :samp:`{is_inst}` specifies whether the method is an instance
581 method or a class method; :samp:`{class_name}` is the name of the class;
582 :samp:`{cat_name}` is the name of the category (or ``NULL`` if the method is not
583 in a category); and :samp:`{sel_name}` is the name of the selector.
585 On systems where the assembler can handle quoted names, you can use this
586 macro to provide more human-readable names.