Next:How Initialization Functions Are Handled, Previous:Output of Uninitialized Variables, Up:Defining the Output Assembler Language [Contents][Index]
This is about outputting labels.
A C statement (sans semicolon) to output to the stdio streamstream the assembler definition of a label namedname.Use the expressionassemble_name (stream,name) tooutput the name itself; before and after that, output the additionalassembler syntax for defining the name, and a newline. A defaultdefinition of this macro is provided which is correct for most systems.
A C statement (sans semicolon) to output to the stdio streamstream the assembler definition of a label namedname ofa function.Use the expressionassemble_name (stream,name) tooutput the name itself; before and after that, output the additionalassembler syntax for defining the name, and a newline. A defaultdefinition of this macro is provided which is correct for most systems.
If this macro is not defined, then the function name is defined in theusual manner as a label (by means ofASM_OUTPUT_LABEL).
Identical toASM_OUTPUT_LABEL, except thatname is knownto refer to a compiler-generated label. The default definition usesassemble_name_raw, which is likeassemble_name exceptthat it is more efficient.
A C string containing the appropriate assembler directive to specify thesize of a symbol, without any arguments. On systems that use ELF, thedefault (inconfig/elfos.h) is ‘"\t.size\t"’; on othersystems, the default is not to define this macro.
Define this macro only if it is correct to use the default definitionsofASM_OUTPUT_SIZE_DIRECTIVE andASM_OUTPUT_MEASURED_SIZEfor your system. If you need your own custom definitions of thosemacros, or if you do not need explicit symbol sizes at all, do notdefine this macro.
A C statement (sans semicolon) to output to the stdio streamstream a directive telling the assembler that the size of thesymbolname issize.size is aHOST_WIDE_INT.If you defineSIZE_ASM_OP, a default definition of this macro isprovided.
A C statement (sans semicolon) to output to the stdio streamstream a directive telling the assembler to calculate the size ofthe symbolname by subtracting its address from the currentaddress.
If you defineSIZE_ASM_OP, a default definition of this macro isprovided. The default assumes that the assembler recognizes a special‘.’ symbol as referring to the current address, and can calculatethe difference between this and another symbol. If your assembler doesnot recognize ‘.’ or cannot do calculations with it, you will needto redefineASM_OUTPUT_MEASURED_SIZE to use some other technique.
Define this macro if the assembler does not accept the character‘$’ in label names. By default constructors and destructors inG++ have ‘$’ in the identifiers. If this macro is defined,‘.’ is used instead.
Define this macro if the assembler does not accept the character‘.’ in label names. By default constructors and destructors in G++have names that use ‘.’. If this macro is defined, these namesare rewritten to avoid ‘.’.
A C string containing the appropriate assembler directive to specify thetype of a symbol, without any arguments. On systems that use ELF, thedefault (inconfig/elfos.h) is ‘"\t.type\t"’; on othersystems, the default is not to define this macro.
Define this macro only if it is correct to use the default definition ofASM_OUTPUT_TYPE_DIRECTIVE for your system. If you need your owncustom definition of this macro, or if you do not need explicit symboltypes at all, do not define this macro.
A C string which specifies (usingprintf syntax) the format ofthe second operand toTYPE_ASM_OP. On systems that use ELF, thedefault (inconfig/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 ofASM_OUTPUT_TYPE_DIRECTIVE for your system. If you need your owncustom definition of this macro, or if you do not need explicit symboltypes at all, do not define this macro.
A C statement (sans semicolon) to output to the stdio streamstream a directive telling the assembler that the type of thesymbolname istype.type is a C string; currently,that string is always either ‘"function"’ or ‘"object"’, butyou should not count on this.
If you defineTYPE_ASM_OP andTYPE_OPERAND_FMT, a defaultdefinition of this macro is provided.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for declaring the namename of afunction which is being defined. This macro is responsible foroutputting the label definition (perhaps usingASM_OUTPUT_FUNCTION_LABEL). The argumentdecl is theFUNCTION_DECL tree node representing the function.
If this macro is not defined, then the function name is defined in theusual manner as a label (by means ofASM_OUTPUT_FUNCTION_LABEL).
You may wish to useASM_OUTPUT_TYPE_DIRECTIVE in the definitionof this macro.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for declaring the size of a functionwhich is being defined. The argumentname is the name of thefunction. The argumentdecl is theFUNCTION_DECL tree noderepresenting the function.
If this macro is not defined, then the function size is not defined.
You may wish to useASM_OUTPUT_MEASURED_SIZE in the definitionof this macro.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for declaring the namename of acold function partition which is being defined. This macro is responsiblefor outputting the label definition (perhaps usingASM_OUTPUT_FUNCTION_LABEL). The argumentdecl is theFUNCTION_DECL tree node representing the function.
If this macro is not defined, then the cold partition name is defined in theusual manner as a label (by means ofASM_OUTPUT_LABEL).
You may wish to useASM_OUTPUT_TYPE_DIRECTIVE in the definitionof this macro.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for declaring the size of a cold functionpartition which is being defined. The argumentname is the name of thecold partition of the function. The argumentdecl is theFUNCTION_DECL tree node representing the function.
If this macro is not defined, then the partition size is not defined.
You may wish to useASM_OUTPUT_MEASURED_SIZE in the definitionof this macro.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for declaring the namename of aninitialized variable which is being defined. This macro must output thelabel definition (perhaps usingASM_OUTPUT_LABEL). The argumentdecl is theVAR_DECL tree node representing the variable.
If this macro is not defined, then the variable name is defined in theusual manner as a label (by means ofASM_OUTPUT_LABEL).
You may wish to useASM_OUTPUT_TYPE_DIRECTIVE and/orASM_OUTPUT_SIZE_DIRECTIVE in the definition of this macro.
voidTARGET_ASM_DECLARE_CONSTANT_NAME(FILE *file, const char *name, const_treeexpr, HOST_WIDE_INTsize) ¶A target hook to output to the stdio streamfile any text necessaryfor declaring the namename of a constant which is being defined. Thistarget hook is responsible for outputting the label definition (perhaps usingassemble_label). The argumentexp is the value of the constant,andsize is the size of the constant in bytes. Thenamewill be an internal label.
The default version of this target hook, define thename in theusual manner as a label (by means ofassemble_label).
You may wish to useASM_OUTPUT_TYPE_DIRECTIVE in this target hook.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for claiming a registerregnofor a global variabledecl with namename.
If you don’t define this macro, that is equivalent to defining it to donothing.
A C statement (sans semicolon) to finish up declaring a variable nameonce the compiler has processed its initializer fully and thus has had achance to determine the size of an array when controlled by aninitializer. This is used on systems where it’s necessary to declaresomething about the size of the object.
If you don’t define this macro, that is equivalent to defining it to donothing.
You may wish to useASM_OUTPUT_SIZE_DIRECTIVE and/orASM_OUTPUT_MEASURED_SIZE in the definition of this macro.
voidTARGET_ASM_GLOBALIZE_LABEL(FILE *stream, const char *name) ¶This target hook is a function to output to the stdio streamstream some commands that will make the labelname global;that is, available for reference from other files.
The default implementation relies on a proper definition ofGLOBAL_ASM_OP.
voidTARGET_ASM_GLOBALIZE_DECL_NAME(FILE *stream, treedecl) ¶This target hook is a function to output to the stdio streamstream some commands that will make the name associated withdeclglobal; that is, available for reference from other files.
The default implementation uses the TARGET_ASM_GLOBALIZE_LABEL target hook.
voidTARGET_ASM_ASSEMBLE_UNDEFINED_DECL(FILE *stream, const char *name, const_treedecl) ¶This target hook is a function to output to the stdio streamstream some commands that will declare the name associated withdecl which is not defined in the current translation unit. Mostassemblers do not require anything to be output in this case.
A C statement (sans semicolon) to output to the stdio streamstream some commands that will make the labelname weak;that is, available for reference from other files but only used ifno other definition is available. Use the expressionassemble_name (stream,name) to output the nameitself; before and after that, output the additional assembler syntaxfor making that name weak, and a newline.
If you don’t define this macro orASM_WEAKEN_DECL, GCC will notsupport weak symbols and you should not define theSUPPORTS_WEAKmacro.
Combines (and replaces) the function ofASM_WEAKEN_LABEL andASM_OUTPUT_WEAK_ALIAS, allowing access to the associated functionor variable decl. Ifvalue is notNULL, this C statementshould output to the stdio streamstream assembler code whichdefines (equates) the weak symbolname to have the valuevalue. Ifvalue isNULL, it should output commandsto makename weak.
Outputs a directive that enablesname to be used to refer tosymbolvalue with weak-symbol semantics.decl is thedeclaration ofname.
A preprocessor constant expression which evaluates to true if the targetsupports weak symbols.
If you don’t define this macro,defaults.h provides a defaultdefinition. If eitherASM_WEAKEN_LABEL orASM_WEAKEN_DECLis defined, the default definition is ‘1’; otherwise, it is ‘0’.
A C expression which evaluates to true if the target supports weak symbols.
If you don’t define this macro,defaults.h provides a defaultdefinition. The default definition is ‘(SUPPORTS_WEAK)’. Definethis macro if you want to control weak symbol support with a compilerflag such as-melf.
A C statement (sans semicolon) to markdecl to be emitted as apublic symbol such that extra copies in multiple translation units willbe discarded by the linker. Define this macro if your object fileformat provides support for this concept, such as the ‘COMDAT’section flags in the Microsoft Windows PE/COFF format, and this supportrequires changes todecl, such as putting it in a separate section.
A C expression which evaluates to true if the target supports one-onlysemantics.
If you don’t define this macro,varasm.cc provides a defaultdefinition. IfMAKE_DECL_ONE_ONLY is defined, the defaultdefinition is ‘1’; otherwise, it is ‘0’. Define this macro ifyou want to control one-only symbol support with a compiler flag, or ifsetting theDECL_ONE_ONLY flag is enough to mark a declaration tobe emitted as one-only.
voidTARGET_ASM_ASSEMBLE_VISIBILITY(treedecl, intvisibility) ¶This target hook is a function to output toasm_out_file somecommands that will make the symbol(s) associated withdecl havehidden, protected or internal visibility as specified byvisibility.
A C expression that evaluates to true if the target’s linker expectsthat weak symbols do not appear in a static archive’s table of contents.The default is0.
Leaving weak symbols out of an archive’s table of contents means that,if a symbol will only have a definition in one translation unit andwill have undefined references from other translation units, thatsymbol should not be weak. Defining this macro to be nonzero willthus have the effect that certain symbols that would normally be weak(explicit template instantiations, and vtables for polymorphic classeswith noninline key methods) will instead be nonweak.
The C++ ABI requires this macro to be zero. Define this macro fortargets where full C++ ABI compliance is impossible and where linkerrestrictions require weak symbols to be left out of a static archive’stable of contents.
A C statement (sans semicolon) to output to the stdio streamstream any text necessary for declaring the name of an externalsymbol namedname which is referenced in this compilation butnot defined. The value ofdecl is the tree node for thedeclaration.
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.
voidTARGET_ASM_EXTERNAL_LIBCALL(rtxsymref) ¶This target hook is a function to output toasm_out_file an assemblerpseudo-op to declare a library function name external. The name of thelibrary function is given bysymref, which is asymbol_ref.
voidTARGET_ASM_MARK_DECL_PRESERVED(const char *symbol) ¶This target hook is a function to output toasm_out_file an assemblerdirective to annotatesymbol as used. The Darwin target uses the.no_dead_code_strip directive.
A C statement (sans semicolon) to output to the stdio streamstream a reference in assembler syntax to a label namedname. This should add ‘_’ to the front of the name, if thatis customary on your operating system, as it is in most Berkeley Unixsystems. This macro is used inassemble_name.
treeTARGET_MANGLE_ASSEMBLER_NAME(const char *name) ¶Given a symbolname, perform same mangling asvarasm.cc’sassemble_name, but in memory rather than to a file stream, returningresult as anIDENTIFIER_NODE. Required for correct LTO symtabs. Thedefault implementation calls theTARGET_STRIP_NAME_ENCODING hook andthen prepends theUSER_LABEL_PREFIX, if any.
A C statement (sans semicolon) to output a reference toSYMBOL_REFsym. If not defined,assemble_namewill be used to output the name of the symbol. This macro may be usedto modify the way a symbol is referenced depending on informationencoded byTARGET_ENCODE_SECTION_INFO.
A C statement (sans semicolon) to output a reference tobuf, theresult ofASM_GENERATE_INTERNAL_LABEL. If not defined,assemble_name will be used to output the name of the symbol.This macro is not used byoutput_asm_label, or the%lspecifier that calls it; the intention is that this macro should be setwhen it is necessary to output a label differently when its address isbeing taken.
voidTARGET_ASM_INTERNAL_LABEL(FILE *stream, const char *prefix, unsigned longlabelno) ¶A function to output to the stdio streamstream a label whosename is made from the stringprefix and the numberlabelno.
It is absolutely essential that these labels be distinct from the labelsused for user-level functions and variables. Otherwise, certain programswill have name conflicts with internal labels.
It is desirable to exclude internal labels from the symbol table of theobject file. Most assemblers have a naming convention for labels thatshould be excluded; on many systems, the letter ‘L’ at thebeginning of a label has this effect. You should find out whatconvention your system uses, and follow it.
The default version of this function utilizesASM_GENERATE_INTERNAL_LABEL.
A C statement to output to the stdio streamstream a debug infolabel whose name is made from the stringprefix and the numbernum. This is useful for VLIW targets, where debug info labelsmay need to be treated differently than branch target labels. On somesystems, branch target labels must be at the beginning of instructionbundles, but debug info labels can occur in the middle of instructionbundles.
If this macro is not defined, then(*targetm.asm_out.internal_label) will beused.
A C statement to store into the stringstring a label whose nameis made from the stringprefix and the numbernum.
This string, when output subsequently byassemble_name, shouldproduce the output that(*targetm.asm_out.internal_label) would producewith the sameprefix andnum.
If the string begins with ‘*’, thenassemble_name willoutput the rest of the string unchanged. It is often convenient forASM_GENERATE_INTERNAL_LABEL to use ‘*’ in this way. If thestring doesn’t start with ‘*’, thenASM_OUTPUT_LABELREF getsto output the string, and may change it. (Of course,ASM_OUTPUT_LABELREF is also part of your machine description, soyou should know what it does on your machine.)
A C expression to assign tooutvar (which is a variable of typechar *) a newly allocated string made from the stringname and the numbernumber, with some suitable punctuationadded. Usealloca to get space for the string.
The string will be used as an argument toASM_OUTPUT_LABELREF toproduce an assembler label for an internal static variable whose name isname. Therefore, the string must be such as to result in validassembler code. The argumentnumber is different each time thismacro is executed; it prevents conflicts between similarly-namedinternal static variables in different scopes.
Ideally this string should not be a valid C identifier, to prevent anyconflict with the user’s own symbols. Most assemblers allow periodsor percent signs in assembler symbols; putting at least one of thesebetween the name and the number will suffice.
If this macro is not defined, a default definition will be providedwhich is correct for most systems.
A C statement to output to the stdio streamstream assembler codewhich defines (equates) the symbolname to have the valuevalue.
IfSET_ASM_OP is defined, a default definition is provided which iscorrect for most systems.
A C statement to output to the stdio streamstream assembler codewhich defines (equates) the symbol whose tree node isdecl_of_nameto have the value of the tree nodedecl_of_value. This macro willbe used in preference to ‘ASM_OUTPUT_DEF’ if it is defined and ifthe tree nodes are available.
IfSET_ASM_OP is defined, a default definition is provided which iscorrect for most systems.
A C statement that evaluates to true if the assembler code which defines(equates) the symbol whose tree node isdecl_of_name to have the valueof the tree nodedecl_of_value should be emitted near the end of thecurrent compilation unit. The default is to not defer output of defines.This macro affects defines output by ‘ASM_OUTPUT_DEF’ and‘ASM_OUTPUT_DEF_FROM_DECLS’.
A C statement to output to the stdio streamstream assembler codewhich defines (equates) the weak symbolname to have the valuevalue. Ifvalue isNULL, it definesname asan undefined weak symbol.
Define this macro if the target only supports weak aliases; defineASM_OUTPUT_DEF instead if possible.
Define this macro to override the default assembler names used forObjective-C methods.
The default name is a unique method number followed by the name of theclass (e.g. ‘_1_Foo’). For methods in categories, the name ofthe category is also included in the assembler name (e.g.‘_1_Foo_Bar’).
These names are safe on most systems, but make debugging difficult sincethe method’s selector is not present in the name. Therefore, particularsystems define other ways of computing names.
buf is an expression of typechar * which gives you abuffer in which to store the name; its length is as long asclass_name,cat_name andsel_name put together, plus50 characters extra.
The argumentis_inst specifies whether the method is an instancemethod or a class method;class_name is the name of the class;cat_name is the name of the category (orNULL if the method is notin a category); andsel_name is the name of the selector.
On systems where the assembler can handle quoted names, you can use thismacro to provide more human-readable names.
Next:How Initialization Functions Are Handled, Previous:Output of Uninitialized Variables, Up:Defining the Output Assembler Language [Contents][Index]