blob: 569944bcc09abb48e36578dfef4a320a2bd4c936 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1988-2015 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
"GNU Free Documentation License".
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development. -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Compiler Collection (GCC) Internals: Label Output</title>
<meta name="description" content="GNU Compiler Collection (GCC) Internals: Label Output">
<meta name="keywords" content="GNU Compiler Collection (GCC) Internals: Label Output">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Assembler-Format.html#Assembler-Format" rel="up" title="Assembler Format">
<link href="Initialization.html#Initialization" rel="next" title="Initialization">
<link href="Uninitialized-Data.html#Uninitialized-Data" rel="prev" title="Uninitialized Data">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Label-Output"></a>
<div class="header">
<p>
Next: <a href="Initialization.html#Initialization" accesskey="n" rel="next">Initialization</a>, Previous: <a href="Uninitialized-Data.html#Uninitialized-Data" accesskey="p" rel="prev">Uninitialized Data</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>
</div>
<hr>
<a name="Output-and-Generation-of-Labels"></a>
<h4 class="subsection">17.20.4 Output and Generation of Labels</h4>
<p>This is about outputting labels.
</p>
<a name="index-assemble_005fname"></a>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fLABEL"></a>Macro: <strong>ASM_OUTPUT_LABEL</strong> <em>(<var>stream</var>, <var>name</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> the assembler definition of a label named <var>name</var>.
Use the expression <code>assemble_name (<var>stream</var>, <var>name</var>)</code> to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fFUNCTION_005fLABEL"></a>Macro: <strong>ASM_OUTPUT_FUNCTION_LABEL</strong> <em>(<var>stream</var>, <var>name</var>, <var>decl</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> the assembler definition of a label named <var>name</var> of
a function.
Use the expression <code>assemble_name (<var>stream</var>, <var>name</var>)</code> to
output the name itself; before and after that, output the additional
assembler syntax for defining the name, and a newline. A default
definition of this macro is provided which is correct for most systems.
</p>
<p>If this macro is not defined, then the function name is defined in the
usual manner as a label (by means of <code>ASM_OUTPUT_LABEL</code>).
</p></dd></dl>
<a name="index-assemble_005fname_005fraw"></a>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fINTERNAL_005fLABEL"></a>Macro: <strong>ASM_OUTPUT_INTERNAL_LABEL</strong> <em>(<var>stream</var>, <var>name</var>)</em></dt>
<dd><p>Identical to <code>ASM_OUTPUT_LABEL</code>, except that <var>name</var> is known
to refer to a compiler-generated label. The default definition uses
<code>assemble_name_raw</code>, which is like <code>assemble_name</code> except
that it is more efficient.
</p></dd></dl>
<dl>
<dt><a name="index-SIZE_005fASM_005fOP"></a>Macro: <strong>SIZE_ASM_OP</strong></dt>
<dd><p>A C string containing the appropriate assembler directive to specify the
size of a symbol, without any arguments. On systems that use ELF, the
default (in <samp>config/elfos.h</samp>) is &lsquo;<samp>&quot;\t.size\t&quot;</samp>&rsquo;; on other
systems, the default is not to define this macro.
</p>
<p>Define this macro only if it is correct to use the default definitions
of <code>ASM_OUTPUT_SIZE_DIRECTIVE</code> and <code>ASM_OUTPUT_MEASURED_SIZE</code>
for your system. If you need your own custom definitions of those
macros, or if you do not need explicit symbol sizes at all, do not
define this macro.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fSIZE_005fDIRECTIVE"></a>Macro: <strong>ASM_OUTPUT_SIZE_DIRECTIVE</strong> <em>(<var>stream</var>, <var>name</var>, <var>size</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> a directive telling the assembler that the size of the
symbol <var>name</var> is <var>size</var>. <var>size</var> is a <code>HOST_WIDE_INT</code>.
If you define <code>SIZE_ASM_OP</code>, a default definition of this macro is
provided.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fMEASURED_005fSIZE"></a>Macro: <strong>ASM_OUTPUT_MEASURED_SIZE</strong> <em>(<var>stream</var>, <var>name</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> a directive telling the assembler to calculate the size of
the symbol <var>name</var> by subtracting its address from the current
address.
</p>
<p>If you define <code>SIZE_ASM_OP</code>, a default definition of this macro is
provided. The default assumes that the assembler recognizes a special
&lsquo;<samp>.</samp>&rsquo; symbol as referring to the current address, and can calculate
the difference between this and another symbol. If your assembler does
not recognize &lsquo;<samp>.</samp>&rsquo; or cannot do calculations with it, you will need
to redefine <code>ASM_OUTPUT_MEASURED_SIZE</code> to use some other technique.
</p></dd></dl>
<dl>
<dt><a name="index-NO_005fDOLLAR_005fIN_005fLABEL"></a>Macro: <strong>NO_DOLLAR_IN_LABEL</strong></dt>
<dd><p>Define this macro if the assembler does not accept the character
&lsquo;<samp>$</samp>&rsquo; in label names. By default constructors and destructors in
G++ have &lsquo;<samp>$</samp>&rsquo; in the identifiers. If this macro is defined,
&lsquo;<samp>.</samp>&rsquo; is used instead.
</p></dd></dl>
<dl>
<dt><a name="index-NO_005fDOT_005fIN_005fLABEL"></a>Macro: <strong>NO_DOT_IN_LABEL</strong></dt>
<dd><p>Define this macro if the assembler does not accept the character
&lsquo;<samp>.</samp>&rsquo; in label names. By default constructors and destructors in G++
have names that use &lsquo;<samp>.</samp>&rsquo;. If this macro is defined, these names
are rewritten to avoid &lsquo;<samp>.</samp>&rsquo;.
</p></dd></dl>
<dl>
<dt><a name="index-TYPE_005fASM_005fOP"></a>Macro: <strong>TYPE_ASM_OP</strong></dt>
<dd><p>A C string containing the appropriate assembler directive to specify the
type of a symbol, without any arguments. On systems that use ELF, the
default (in <samp>config/elfos.h</samp>) is &lsquo;<samp>&quot;\t.type\t&quot;</samp>&rsquo;; on other
systems, the default is not to define this macro.
</p>
<p>Define this macro only if it is correct to use the default definition of
<code>ASM_OUTPUT_TYPE_DIRECTIVE</code> for your system. If you need your own
custom definition of this macro, or if you do not need explicit symbol
types at all, do not define this macro.
</p></dd></dl>
<dl>
<dt><a name="index-TYPE_005fOPERAND_005fFMT"></a>Macro: <strong>TYPE_OPERAND_FMT</strong></dt>
<dd><p>A C string which specifies (using <code>printf</code> syntax) the format of
the second operand to <code>TYPE_ASM_OP</code>. On systems that use ELF, the
default (in <samp>config/elfos.h</samp>) is &lsquo;<samp>&quot;@%s&quot;</samp>&rsquo;; on other systems,
the default is not to define this macro.
</p>
<p>Define this macro only if it is correct to use the default definition of
<code>ASM_OUTPUT_TYPE_DIRECTIVE</code> for your system. If you need your own
custom definition of this macro, or if you do not need explicit symbol
types at all, do not define this macro.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fTYPE_005fDIRECTIVE"></a>Macro: <strong>ASM_OUTPUT_TYPE_DIRECTIVE</strong> <em>(<var>stream</var>, <var>type</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> a directive telling the assembler that the type of the
symbol <var>name</var> is <var>type</var>. <var>type</var> is a C string; currently,
that string is always either &lsquo;<samp>&quot;function&quot;</samp>&rsquo; or &lsquo;<samp>&quot;object&quot;</samp>&rsquo;, but
you should not count on this.
</p>
<p>If you define <code>TYPE_ASM_OP</code> and <code>TYPE_OPERAND_FMT</code>, a default
definition of this macro is provided.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fDECLARE_005fFUNCTION_005fNAME"></a>Macro: <strong>ASM_DECLARE_FUNCTION_NAME</strong> <em>(<var>stream</var>, <var>name</var>, <var>decl</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> any text necessary for declaring the name <var>name</var> of a
function which is being defined. This macro is responsible for
outputting the label definition (perhaps using
<code>ASM_OUTPUT_FUNCTION_LABEL</code>). The argument <var>decl</var> is the
<code>FUNCTION_DECL</code> tree node representing the function.
</p>
<p>If this macro is not defined, then the function name is defined in the
usual manner as a label (by means of <code>ASM_OUTPUT_FUNCTION_LABEL</code>).
</p>
<p>You may wish to use <code>ASM_OUTPUT_TYPE_DIRECTIVE</code> in the definition
of this macro.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fDECLARE_005fFUNCTION_005fSIZE"></a>Macro: <strong>ASM_DECLARE_FUNCTION_SIZE</strong> <em>(<var>stream</var>, <var>name</var>, <var>decl</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> any text necessary for declaring the size of a function
which is being defined. The argument <var>name</var> is the name of the
function. The argument <var>decl</var> is the <code>FUNCTION_DECL</code> tree node
representing the function.
</p>
<p>If this macro is not defined, then the function size is not defined.
</p>
<p>You may wish to use <code>ASM_OUTPUT_MEASURED_SIZE</code> in the definition
of this macro.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fDECLARE_005fOBJECT_005fNAME"></a>Macro: <strong>ASM_DECLARE_OBJECT_NAME</strong> <em>(<var>stream</var>, <var>name</var>, <var>decl</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> any text necessary for declaring the name <var>name</var> of an
initialized variable which is being defined. This macro must output the
label definition (perhaps using <code>ASM_OUTPUT_LABEL</code>). The argument
<var>decl</var> is the <code>VAR_DECL</code> tree node representing the variable.
</p>
<p>If this macro is not defined, then the variable name is defined in the
usual manner as a label (by means of <code>ASM_OUTPUT_LABEL</code>).
</p>
<p>You may wish to use <code>ASM_OUTPUT_TYPE_DIRECTIVE</code> and/or
<code>ASM_OUTPUT_SIZE_DIRECTIVE</code> in the definition of this macro.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fDECLARE_005fCONSTANT_005fNAME"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_DECLARE_CONSTANT_NAME</strong> <em>(FILE *<var>file</var>, const char *<var>name</var>, const_tree <var>expr</var>, HOST_WIDE_INT <var>size</var>)</em></dt>
<dd><p>A target hook to output to the stdio stream <var>file</var> any text necessary
for declaring the name <var>name</var> of a constant which is being defined. This
target hook is responsible for outputting the label definition (perhaps using
<code>assemble_label</code>). The argument <var>exp</var> is the value of the constant,
and <var>size</var> is the size of the constant in bytes. The <var>name</var>
will be an internal label.
</p>
<p>The default version of this target hook, define the <var>name</var> in the
usual manner as a label (by means of <code>assemble_label</code>).
</p>
<p>You may wish to use <code>ASM_OUTPUT_TYPE_DIRECTIVE</code> in this target hook.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fDECLARE_005fREGISTER_005fGLOBAL"></a>Macro: <strong>ASM_DECLARE_REGISTER_GLOBAL</strong> <em>(<var>stream</var>, <var>decl</var>, <var>regno</var>, <var>name</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> any text necessary for claiming a register <var>regno</var>
for a global variable <var>decl</var> with name <var>name</var>.
</p>
<p>If you don&rsquo;t define this macro, that is equivalent to defining it to do
nothing.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fFINISH_005fDECLARE_005fOBJECT"></a>Macro: <strong>ASM_FINISH_DECLARE_OBJECT</strong> <em>(<var>stream</var>, <var>decl</var>, <var>toplevel</var>, <var>atend</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to finish up declaring a variable name
once the compiler has processed its initializer fully and thus has had a
chance to determine the size of an array when controlled by an
initializer. This is used on systems where it&rsquo;s necessary to declare
something about the size of the object.
</p>
<p>If you don&rsquo;t define this macro, that is equivalent to defining it to do
nothing.
</p>
<p>You may wish to use <code>ASM_OUTPUT_SIZE_DIRECTIVE</code> and/or
<code>ASM_OUTPUT_MEASURED_SIZE</code> in the definition of this macro.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fGLOBALIZE_005fLABEL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_GLOBALIZE_LABEL</strong> <em>(FILE *<var>stream</var>, const char *<var>name</var>)</em></dt>
<dd><p>This target hook is a function to output to the stdio stream
<var>stream</var> some commands that will make the label <var>name</var> global;
that is, available for reference from other files.
</p>
<p>The default implementation relies on a proper definition of
<code>GLOBAL_ASM_OP</code>.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fGLOBALIZE_005fDECL_005fNAME"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_GLOBALIZE_DECL_NAME</strong> <em>(FILE *<var>stream</var>, tree <var>decl</var>)</em></dt>
<dd><p>This target hook is a function to output to the stdio stream
<var>stream</var> some commands that will make the name associated with <var>decl</var>
global; that is, available for reference from other files.
</p>
<p>The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fASSEMBLE_005fUNDEFINED_005fDECL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_ASSEMBLE_UNDEFINED_DECL</strong> <em>(FILE *<var>stream</var>, const char *<var>name</var>, const_tree <var>decl</var>)</em></dt>
<dd><p>This target hook is a function to output to the stdio stream
<var>stream</var> some commands that will declare the name associated with
<var>decl</var> which is not defined in the current translation unit. Most
assemblers do not require anything to be output in this case.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fWEAKEN_005fLABEL"></a>Macro: <strong>ASM_WEAKEN_LABEL</strong> <em>(<var>stream</var>, <var>name</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> some commands that will make the label <var>name</var> weak;
that is, available for reference from other files but only used if
no other definition is available. Use the expression
<code>assemble_name (<var>stream</var>, <var>name</var>)</code> to output the name
itself; before and after that, output the additional assembler syntax
for making that name weak, and a newline.
</p>
<p>If you don&rsquo;t define this macro or <code>ASM_WEAKEN_DECL</code>, GCC will not
support weak symbols and you should not define the <code>SUPPORTS_WEAK</code>
macro.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fWEAKEN_005fDECL"></a>Macro: <strong>ASM_WEAKEN_DECL</strong> <em>(<var>stream</var>, <var>decl</var>, <var>name</var>, <var>value</var>)</em></dt>
<dd><p>Combines (and replaces) the function of <code>ASM_WEAKEN_LABEL</code> and
<code>ASM_OUTPUT_WEAK_ALIAS</code>, allowing access to the associated function
or variable decl. If <var>value</var> is not <code>NULL</code>, this C statement
should output to the stdio stream <var>stream</var> assembler code which
defines (equates) the weak symbol <var>name</var> to have the value
<var>value</var>. If <var>value</var> is <code>NULL</code>, it should output commands
to make <var>name</var> weak.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fWEAKREF"></a>Macro: <strong>ASM_OUTPUT_WEAKREF</strong> <em>(<var>stream</var>, <var>decl</var>, <var>name</var>, <var>value</var>)</em></dt>
<dd><p>Outputs a directive that enables <var>name</var> to be used to refer to
symbol <var>value</var> with weak-symbol semantics. <code>decl</code> is the
declaration of <code>name</code>.
</p></dd></dl>
<dl>
<dt><a name="index-SUPPORTS_005fWEAK"></a>Macro: <strong>SUPPORTS_WEAK</strong></dt>
<dd><p>A preprocessor constant expression which evaluates to true if the target
supports weak symbols.
</p>
<p>If you don&rsquo;t define this macro, <samp>defaults.h</samp> provides a default
definition. If either <code>ASM_WEAKEN_LABEL</code> or <code>ASM_WEAKEN_DECL</code>
is defined, the default definition is &lsquo;<samp>1</samp>&rsquo;; otherwise, it is &lsquo;<samp>0</samp>&rsquo;.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fSUPPORTS_005fWEAK"></a>Macro: <strong>TARGET_SUPPORTS_WEAK</strong></dt>
<dd><p>A C expression which evaluates to true if the target supports weak symbols.
</p>
<p>If you don&rsquo;t define this macro, <samp>defaults.h</samp> provides a default
definition. The default definition is &lsquo;<samp>(SUPPORTS_WEAK)</samp>&rsquo;. Define
this macro if you want to control weak symbol support with a compiler
flag such as <samp>-melf</samp>.
</p></dd></dl>
<dl>
<dt><a name="index-MAKE_005fDECL_005fONE_005fONLY"></a>Macro: <strong>MAKE_DECL_ONE_ONLY</strong> <em>(<var>decl</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to mark <var>decl</var> to be emitted as a
public symbol such that extra copies in multiple translation units will
be discarded by the linker. Define this macro if your object file
format provides support for this concept, such as the &lsquo;<samp>COMDAT</samp>&rsquo;
section flags in the Microsoft Windows PE/COFF format, and this support
requires changes to <var>decl</var>, such as putting it in a separate section.
</p></dd></dl>
<dl>
<dt><a name="index-SUPPORTS_005fONE_005fONLY"></a>Macro: <strong>SUPPORTS_ONE_ONLY</strong></dt>
<dd><p>A C expression which evaluates to true if the target supports one-only
semantics.
</p>
<p>If you don&rsquo;t define this macro, <samp>varasm.c</samp> provides a default
definition. If <code>MAKE_DECL_ONE_ONLY</code> is defined, the default
definition is &lsquo;<samp>1</samp>&rsquo;; otherwise, it is &lsquo;<samp>0</samp>&rsquo;. Define this macro if
you want to control one-only symbol support with a compiler flag, or if
setting the <code>DECL_ONE_ONLY</code> flag is enough to mark a declaration to
be emitted as one-only.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fASSEMBLE_005fVISIBILITY"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_ASSEMBLE_VISIBILITY</strong> <em>(tree <var>decl</var>, int <var>visibility</var>)</em></dt>
<dd><p>This target hook is a function to output to <var>asm_out_file</var> some
commands that will make the symbol(s) associated with <var>decl</var> have
hidden, protected or internal visibility as specified by <var>visibility</var>.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fWEAK_005fNOT_005fIN_005fARCHIVE_005fTOC"></a>Macro: <strong>TARGET_WEAK_NOT_IN_ARCHIVE_TOC</strong></dt>
<dd><p>A C expression that evaluates to true if the target&rsquo;s linker expects
that weak symbols do not appear in a static archive&rsquo;s table of contents.
The default is <code>0</code>.
</p>
<p>Leaving weak symbols out of an archive&rsquo;s table of contents means that,
if a symbol will only have a definition in one translation unit and
will have undefined references from other translation units, that
symbol should not be weak. Defining this macro to be nonzero will
thus have the effect that certain symbols that would normally be weak
(explicit template instantiations, and vtables for polymorphic classes
with noninline key methods) will instead be nonweak.
</p>
<p>The C++ ABI requires this macro to be zero. Define this macro for
targets where full C++ ABI compliance is impossible and where linker
restrictions require weak symbols to be left out of a static archive&rsquo;s
table of contents.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fEXTERNAL"></a>Macro: <strong>ASM_OUTPUT_EXTERNAL</strong> <em>(<var>stream</var>, <var>decl</var>, <var>name</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> any text necessary for declaring the name of an external
symbol named <var>name</var> which is referenced in this compilation but
not defined. The value of <var>decl</var> is the tree node for the
declaration.
</p>
<p>This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don&rsquo;t require anything.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fEXTERNAL_005fLIBCALL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_EXTERNAL_LIBCALL</strong> <em>(rtx <var>symref</var>)</em></dt>
<dd><p>This target hook is a function to output to <var>asm_out_file</var> an assembler
pseudo-op to declare a library function name external. The name of the
library function is given by <var>symref</var>, which is a <code>symbol_ref</code>.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fMARK_005fDECL_005fPRESERVED"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_MARK_DECL_PRESERVED</strong> <em>(const char *<var>symbol</var>)</em></dt>
<dd><p>This target hook is a function to output to <var>asm_out_file</var> an assembler
directive to annotate <var>symbol</var> as used. The Darwin target uses the
.no_dead_code_strip directive.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fLABELREF"></a>Macro: <strong>ASM_OUTPUT_LABELREF</strong> <em>(<var>stream</var>, <var>name</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output to the stdio stream
<var>stream</var> a reference in assembler syntax to a label named
<var>name</var>. This should add &lsquo;<samp>_</samp>&rsquo; to the front of the name, if that
is customary on your operating system, as it is in most Berkeley Unix
systems. This macro is used in <code>assemble_name</code>.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fMANGLE_005fASSEMBLER_005fNAME"></a>Target Hook: <em>tree</em> <strong>TARGET_MANGLE_ASSEMBLER_NAME</strong> <em>(const char *<var>name</var>)</em></dt>
<dd><p>Given a symbol <var>name</var>, perform same mangling as <code>varasm.c</code>&rsquo;s <code>assemble_name</code>, but in memory rather than to a file stream, returning result as an <code>IDENTIFIER_NODE</code>. Required for correct LTO symtabs. The default implementation calls the <code>TARGET_STRIP_NAME_ENCODING</code> hook and then prepends the <code>USER_LABEL_PREFIX</code>, if any.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fSYMBOL_005fREF"></a>Macro: <strong>ASM_OUTPUT_SYMBOL_REF</strong> <em>(<var>stream</var>, <var>sym</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output a reference to
<code>SYMBOL_REF</code> <var>sym</var>. If not defined, <code>assemble_name</code>
will be used to output the name of the symbol. This macro may be used
to modify the way a symbol is referenced depending on information
encoded by <code>TARGET_ENCODE_SECTION_INFO</code>.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fLABEL_005fREF"></a>Macro: <strong>ASM_OUTPUT_LABEL_REF</strong> <em>(<var>stream</var>, <var>buf</var>)</em></dt>
<dd><p>A C statement (sans semicolon) to output a reference to <var>buf</var>, the
result of <code>ASM_GENERATE_INTERNAL_LABEL</code>. If not defined,
<code>assemble_name</code> will be used to output the name of the symbol.
This macro is not used by <code>output_asm_label</code>, or the <code>%l</code>
specifier that calls it; the intention is that this macro should be set
when it is necessary to output a label differently when its address is
being taken.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fASM_005fINTERNAL_005fLABEL"></a>Target Hook: <em>void</em> <strong>TARGET_ASM_INTERNAL_LABEL</strong> <em>(FILE *<var>stream</var>, const char *<var>prefix</var>, unsigned long <var>labelno</var>)</em></dt>
<dd><p>A function to output to the stdio stream <var>stream</var> a label whose
name is made from the string <var>prefix</var> and the number <var>labelno</var>.
</p>
<p>It is absolutely essential that these labels be distinct from the labels
used for user-level functions and variables. Otherwise, certain programs
will have name conflicts with internal labels.
</p>
<p>It is desirable to exclude internal labels from the symbol table of the
object file. Most assemblers have a naming convention for labels that
should be excluded; on many systems, the letter &lsquo;<samp>L</samp>&rsquo; at the
beginning of a label has this effect. You should find out what
convention your system uses, and follow it.
</p>
<p>The default version of this function utilizes <code>ASM_GENERATE_INTERNAL_LABEL</code>.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fDEBUG_005fLABEL"></a>Macro: <strong>ASM_OUTPUT_DEBUG_LABEL</strong> <em>(<var>stream</var>, <var>prefix</var>, <var>num</var>)</em></dt>
<dd><p>A C statement to output to the stdio stream <var>stream</var> a debug info
label whose name is made from the string <var>prefix</var> and the number
<var>num</var>. This is useful for VLIW targets, where debug info labels
may need to be treated differently than branch target labels. On some
systems, branch target labels must be at the beginning of instruction
bundles, but debug info labels can occur in the middle of instruction
bundles.
</p>
<p>If this macro is not defined, then <code>(*targetm.asm_out.internal_label)</code> will be
used.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fGENERATE_005fINTERNAL_005fLABEL"></a>Macro: <strong>ASM_GENERATE_INTERNAL_LABEL</strong> <em>(<var>string</var>, <var>prefix</var>, <var>num</var>)</em></dt>
<dd><p>A C statement to store into the string <var>string</var> a label whose name
is made from the string <var>prefix</var> and the number <var>num</var>.
</p>
<p>This string, when output subsequently by <code>assemble_name</code>, should
produce the output that <code>(*targetm.asm_out.internal_label)</code> would produce
with the same <var>prefix</var> and <var>num</var>.
</p>
<p>If the string begins with &lsquo;<samp>*</samp>&rsquo;, then <code>assemble_name</code> will
output the rest of the string unchanged. It is often convenient for
<code>ASM_GENERATE_INTERNAL_LABEL</code> to use &lsquo;<samp>*</samp>&rsquo; in this way. If the
string doesn&rsquo;t start with &lsquo;<samp>*</samp>&rsquo;, then <code>ASM_OUTPUT_LABELREF</code> gets
to output the string, and may change it. (Of course,
<code>ASM_OUTPUT_LABELREF</code> is also part of your machine description, so
you should know what it does on your machine.)
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fFORMAT_005fPRIVATE_005fNAME"></a>Macro: <strong>ASM_FORMAT_PRIVATE_NAME</strong> <em>(<var>outvar</var>, <var>name</var>, <var>number</var>)</em></dt>
<dd><p>A C expression to assign to <var>outvar</var> (which is a variable of type
<code>char *</code>) a newly allocated string made from the string
<var>name</var> and the number <var>number</var>, with some suitable punctuation
added. Use <code>alloca</code> to get space for the string.
</p>
<p>The string will be used as an argument to <code>ASM_OUTPUT_LABELREF</code> to
produce an assembler label for an internal static variable whose name is
<var>name</var>. Therefore, the string must be such as to result in valid
assembler code. The argument <var>number</var> is different each time this
macro is executed; it prevents conflicts between similarly-named
internal static variables in different scopes.
</p>
<p>Ideally this string should not be a valid C identifier, to prevent any
conflict with the user&rsquo;s own symbols. Most assemblers allow periods
or percent signs in assembler symbols; putting at least one of these
between the name and the number will suffice.
</p>
<p>If this macro is not defined, a default definition will be provided
which is correct for most systems.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fDEF"></a>Macro: <strong>ASM_OUTPUT_DEF</strong> <em>(<var>stream</var>, <var>name</var>, <var>value</var>)</em></dt>
<dd><p>A C statement to output to the stdio stream <var>stream</var> assembler code
which defines (equates) the symbol <var>name</var> to have the value <var>value</var>.
</p>
<a name="index-SET_005fASM_005fOP"></a>
<p>If <code>SET_ASM_OP</code> is defined, a default definition is provided which is
correct for most systems.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fDEF_005fFROM_005fDECLS"></a>Macro: <strong>ASM_OUTPUT_DEF_FROM_DECLS</strong> <em>(<var>stream</var>, <var>decl_of_name</var>, <var>decl_of_value</var>)</em></dt>
<dd><p>A C statement to output to the stdio stream <var>stream</var> assembler code
which defines (equates) the symbol whose tree node is <var>decl_of_name</var>
to have the value of the tree node <var>decl_of_value</var>. This macro will
be used in preference to &lsquo;<samp>ASM_OUTPUT_DEF</samp>&rsquo; if it is defined and if
the tree nodes are available.
</p>
<a name="index-SET_005fASM_005fOP-1"></a>
<p>If <code>SET_ASM_OP</code> is defined, a default definition is provided which is
correct for most systems.
</p></dd></dl>
<dl>
<dt><a name="index-TARGET_005fDEFERRED_005fOUTPUT_005fDEFS"></a>Macro: <strong>TARGET_DEFERRED_OUTPUT_DEFS</strong> <em>(<var>decl_of_name</var>, <var>decl_of_value</var>)</em></dt>
<dd><p>A C statement that evaluates to true if the assembler code which defines
(equates) the symbol whose tree node is <var>decl_of_name</var> to have the value
of the tree node <var>decl_of_value</var> should be emitted near the end of the
current compilation unit. The default is to not defer output of defines.
This macro affects defines output by &lsquo;<samp>ASM_OUTPUT_DEF</samp>&rsquo; and
&lsquo;<samp>ASM_OUTPUT_DEF_FROM_DECLS</samp>&rsquo;.
</p></dd></dl>
<dl>
<dt><a name="index-ASM_005fOUTPUT_005fWEAK_005fALIAS"></a>Macro: <strong>ASM_OUTPUT_WEAK_ALIAS</strong> <em>(<var>stream</var>, <var>name</var>, <var>value</var>)</em></dt>
<dd><p>A C statement to output to the stdio stream <var>stream</var> assembler code
which defines (equates) the weak symbol <var>name</var> to have the value
<var>value</var>. If <var>value</var> is <code>NULL</code>, it defines <var>name</var> as
an undefined weak symbol.
</p>
<p>Define this macro if the target only supports weak aliases; define
<code>ASM_OUTPUT_DEF</code> instead if possible.
</p></dd></dl>
<dl>
<dt><a name="index-OBJC_005fGEN_005fMETHOD_005fLABEL"></a>Macro: <strong>OBJC_GEN_METHOD_LABEL</strong> <em>(<var>buf</var>, <var>is_inst</var>, <var>class_name</var>, <var>cat_name</var>, <var>sel_name</var>)</em></dt>
<dd><p>Define this macro to override the default assembler names used for
Objective-C methods.
</p>
<p>The default name is a unique method number followed by the name of the
class (e.g. &lsquo;<samp>_1_Foo</samp>&rsquo;). For methods in categories, the name of
the category is also included in the assembler name (e.g.
&lsquo;<samp>_1_Foo_Bar</samp>&rsquo;).
</p>
<p>These names are safe on most systems, but make debugging difficult since
the method&rsquo;s selector is not present in the name. Therefore, particular
systems define other ways of computing names.
</p>
<p><var>buf</var> is an expression of type <code>char *</code> which gives you a
buffer in which to store the name; its length is as long as
<var>class_name</var>, <var>cat_name</var> and <var>sel_name</var> put together, plus
50 characters extra.
</p>
<p>The argument <var>is_inst</var> specifies whether the method is an instance
method or a class method; <var>class_name</var> is the name of the class;
<var>cat_name</var> is the name of the category (or <code>NULL</code> if the method is not
in a category); and <var>sel_name</var> is the name of the selector.
</p>
<p>On systems where the assembler can handle quoted names, you can use this
macro to provide more human-readable names.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Initialization.html#Initialization" accesskey="n" rel="next">Initialization</a>, Previous: <a href="Uninitialized-Data.html#Uninitialized-Data" accesskey="p" rel="prev">Uninitialized Data</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>
</div>
</body>
</html>