This is about outputting labels.
ASM_OUTPUT_LABEL (
stream,
name)
assemble_name (
stream,
name)
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.
SIZE_ASM_OP
config/elfos.h
) is "\t.size\t"
; on other
systems, the default is not to define this macro.
Define this macro only if it is correct to use the default definitions
of ASM_OUTPUT_SIZE_DIRECTIVE
and ASM_OUTPUT_MEASURED_SIZE
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.
ASM_OUTPUT_SIZE_DIRECTIVE (
stream,
name,
size)
HOST_WIDE_INT
.
If you define SIZE_ASM_OP
, a default definition of this macro is
provided.
ASM_OUTPUT_MEASURED_SIZE (
stream,
name)
If you define SIZE_ASM_OP
, a default definition of this macro is
provided. The default assumes that the assembler recognizes a special
.
symbol as referring to the current address, and can calculate
the difference between this and another symbol. If your assembler does
not recognize .
or cannot do calculations with it, you will need
to redefine ASM_OUTPUT_MEASURED_SIZE
to use some other technique.
TYPE_ASM_OP
config/elfos.h
) is "\t.type\t"
; on other
systems, the default is not to define this macro.
Define this macro only if it is correct to use the default definition of
ASM_OUTPUT_TYPE_DIRECTIVE
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.
TYPE_OPERAND_FMT
printf
syntax) the format of
the second operand to TYPE_ASM_OP
. On systems that use ELF, the
default (in config/elfos.h
) is "@%s"
; on other systems,
the default is not to define this macro.
Define this macro only if it is correct to use the default definition of
ASM_OUTPUT_TYPE_DIRECTIVE
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.
ASM_OUTPUT_TYPE_DIRECTIVE (
stream,
type)
"function"
or "object"
, but
you should not count on this.
If you define TYPE_ASM_OP
and TYPE_OPERAND_FMT
, a default
definition of this macro is provided.
ASM_DECLARE_FUNCTION_NAME (
stream,
name,
decl)
ASM_OUTPUT_LABEL
). The argument decl is the
FUNCTION_DECL
tree node representing the function.
If this macro is not defined, then the function name is defined in the
usual manner as a label (by means of ASM_OUTPUT_LABEL
).
You may wish to use ASM_OUTPUT_TYPE_DIRECTIVE
in the definition
of this macro.
ASM_DECLARE_FUNCTION_SIZE (
stream,
name,
decl)
FUNCTION_DECL
tree node
representing the function.
If this macro is not defined, then the function size is not defined.
You may wish to use ASM_OUTPUT_MEASURED_SIZE
in the definition
of this macro.
ASM_DECLARE_OBJECT_NAME (
stream,
name,
decl)
ASM_OUTPUT_LABEL
). The argument
decl is the VAR_DECL
tree node representing the variable.
If this macro is not defined, then the variable name is defined in the
usual manner as a label (by means of ASM_OUTPUT_LABEL
).
You may wish to use ASM_OUTPUT_TYPE_DIRECTIVE
and/or
ASM_OUTPUT_SIZE_DIRECTIVE
in the definition of this macro.
ASM_DECLARE_REGISTER_GLOBAL (
stream,
decl,
regno,
name)
If you don't define this macro, that is equivalent to defining it to do
nothing.
ASM_FINISH_DECLARE_OBJECT (
stream,
decl,
toplevel,
atend)
If you don't define this macro, that is equivalent to defining it to do nothing.
You may wish to use ASM_OUTPUT_SIZE_DIRECTIVE
and/or
ASM_OUTPUT_MEASURED_SIZE
in the definition of this macro.
void TARGET_ASM_GLOBALIZE_LABEL (FILE *stream, const char *name) | Target Hook |
This target hook is a function to output to the stdio stream
stream some commands that will make the label name global;
that is, available for reference from other files.
The default implementation relies on a proper definition of
|
ASM_WEAKEN_LABEL (
stream,
name)
assemble_name (
stream,
name)
to output the name
itself; before and after that, output the additional assembler syntax
for making that name weak, and a newline.
If you don't define this macro or ASM_WEAKEN_DECL
, GCC will not
support weak symbols and you should not define the SUPPORTS_WEAK
macro.
ASM_WEAKEN_DECL (
stream,
decl,
name,
value)
ASM_WEAKEN_LABEL
and
ASM_OUTPUT_WEAK_ALIAS
, allowing access to the associated function
or variable decl. If value is not NULL
, this C statement
should output to the stdio stream stream assembler code which
defines (equates) the weak symbol name to have the value
value. If value is NULL
, it should output commands
to make name weak.
SUPPORTS_WEAK
If you don't define this macro, defaults.h
provides a default
definition. If either ASM_WEAKEN_LABEL
or ASM_WEAKEN_DECL
is defined, the default definition is 1
; otherwise, it is
0
. Define this macro if you want to control weak symbol support
with a compiler flag such as -melf
.
MAKE_DECL_ONE_ONLY
COMDAT
section flags in the Microsoft Windows PE/COFF format, and this support
requires changes to decl, such as putting it in a separate section.
SUPPORTS_ONE_ONLY
If you don't define this macro, varasm.c
provides a default
definition. If MAKE_DECL_ONE_ONLY
is defined, the default
definition is 1
; otherwise, it is 0
. Define this macro if
you want to control one-only symbol support with a compiler flag, or if
setting the DECL_ONE_ONLY
flag is enough to mark a declaration to
be emitted as one-only.
void TARGET_ASM_ASSEMBLE_VISIBILITY (tree decl, const char *visibility) | Target Hook |
This target hook is a function to output to asm_out_file some commands that will make the symbol(s) associated with decl have hidden, protected or internal visibility as specified by visibility. |
ASM_OUTPUT_EXTERNAL (
stream,
decl,
name)
This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
ASM_OUTPUT_EXTERNAL_LIBCALL (
stream,
symref)
rtx
and
is a symbol_ref
.
This macro need not be defined if it does not need to output anything.
The GNU assembler and most Unix assemblers don't require anything.
ASM_OUTPUT_LABELREF (
stream,
name)
_
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 assemble_name
.
ASM_OUTPUT_SYMBOL_REF (
stream,
sym)
SYMBOL_REF
sym. If not defined, assemble_name
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 TARGET_ENCODE_SECTION_INFO
.
ASM_OUTPUT_LABEL_REF (
stream,
buf)
ASM_GENERATE_INTERNAL_LABEL
. If not defined,
assemble_name
will be used to output the name of the symbol.
This macro is not used by output_asm_label
, or the %l
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.
void TARGET_ASM_INTERNAL_LABEL (FILE *stream, const char *prefix, unsigned long labelno) | Target Hook |
A function to output to the stdio stream stream a label whose
name is made from the string prefix and the number labelno.
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. 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 The default version of this function utilizes ASM_GENERATE_INTERNAL_LABEL. |
ASM_OUTPUT_DEBUG_LABEL (
stream,
prefix,
num)
If this macro is not defined, then (*targetm.asm_out.internal_label)
will be
used.
ASM_GENERATE_INTERNAL_LABEL (
string,
prefix,
num)
This string, when output subsequently by assemble_name
, should
produce the output that (*targetm.asm_out.internal_label)
would produce
with the same prefix and num.
If the string begins with *
, then assemble_name
will
output the rest of the string unchanged. It is often convenient for
ASM_GENERATE_INTERNAL_LABEL
to use *
in this way. If the
string doesn't start with *
, then ASM_OUTPUT_LABELREF
gets
to output the string, and may change it. (Of course,
ASM_OUTPUT_LABELREF
is also part of your machine description, so
you should know what it does on your machine.)
ASM_FORMAT_PRIVATE_NAME (
outvar,
name,
number)
char *
) a newly allocated string made from the string
name and the number number, with some suitable punctuation
added. Use alloca
to get space for the string.
The string will be used as an argument to ASM_OUTPUT_LABELREF
to
produce an assembler label for an internal static variable whose name is
name. Therefore, the string must be such as to result in valid
assembler code. The argument number is different each time this
macro is executed; it prevents conflicts between similarly-named
internal static variables in different scopes.
Ideally this string should not be a valid C identifier, to prevent any conflict with the user'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.
If this macro is not defined, a default definition will be provided
which is correct for most systems.
ASM_OUTPUT_DEF (
stream,
name,
value)
If SET_ASM_OP
is defined, a default definition is provided which is
correct for most systems.
ASM_OUTPUT_DEF_FROM_DECLS (
stream,
decl_of_name,
decl_of_value)
ASM_OUTPUT_DEF
if it is defined and if
the tree nodes are available.
If SET_ASM_OP
is defined, a default definition is provided which is
correct for most systems.
ASM_OUTPUT_WEAK_ALIAS (
stream,
name,
value)
NULL
, it defines name as
an undefined weak symbol.
Define this macro if the target only supports weak aliases; define
ASM_OUTPUT_DEF
instead if possible.
OBJC_GEN_METHOD_LABEL (
buf,
is_inst,
class_name,
cat_name,
sel_name)
The default name is a unique method number followed by the name of the
class (e.g. _1_Foo
). For methods in categories, the name of
the category is also included in the assembler name (e.g.
_1_Foo_Bar
).
These names are safe on most systems, but make debugging difficult since the method's selector is not present in the name. Therefore, particular systems define other ways of computing names.
buf is an expression of type char *
which gives you a
buffer in which to store the name; its length is as long as
class_name, cat_name and sel_name put together, plus
50 characters extra.
The argument is_inst specifies whether the method is an instance
method or a class method; class_name is the name of the class;
cat_name is the name of the category (or NULL
if the method is not
in a category); and sel_name is the name of the selector.
On systems where the assembler can handle quoted names, you can use this
macro to provide more human-readable names.
ASM_DECLARE_CLASS_REFERENCE (
stream,
name)
ASM_DECLARE_UNRESOLVED_REFERENCE (
stream,
name)