home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
gnu
/
info
/
gcc.info-21
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-02-20
|
37KB
|
658 lines
This is Info file gcc.info, produced by Makeinfo-1.55 from the input
file gcc.texi.
This file documents the use and the internals of the GNU compiler.
Published by the Free Software Foundation 675 Massachusetts Avenue
Cambridge, MA 02139 USA
Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the sections entitled "GNU General Public License" and "Protect
Your Freedom--Fight `Look And Feel'" are included exactly as in the
original, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the sections entitled "GNU General Public
License" and "Protect Your Freedom--Fight `Look And Feel'", and this
permission notice, may be included in translations approved by the Free
Software Foundation instead of in the original English.
File: gcc.info, Node: Macros for Initialization, Next: Instruction Output, Prev: Initialization, Up: Assembler Format
Macros Controlling Initialization Routines
------------------------------------------
Here are the macros that control how the compiler handles
initialization and termination functions:
`INIT_SECTION_ASM_OP'
If defined, a C string constant for the assembler operation to
identify the following data as initialization code. If not
defined, GNU CC will assume such a section does not exist. When
you are using special sections for initialization and termination
functions, this macro also controls how `crtstuff.c' and
`libgcc2.c' arrange to run the initialization functions.
`ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
Define this macro as a C statement to output on the stream STREAM
the assembler code to arrange to call the function named NAME at
initialization time.
Assume that NAME is the name of a C function generated
automatically by the compiler. This function takes no arguments.
Use the function `assemble_name' to output the name NAME; this
performs any system-specific syntactic transformations such as
adding an underscore.
If you don't define this macro, nothing special is output to
arrange to call the function. This is correct when the function
will be called in some other manner--for example, by means of the
`collect2' program, which looks through the symbol table to find
these functions by their names.
`ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
functions rather than initialization functions.
If your system uses `collect2' as the means of processing
constructors, then that program normally uses `nm' to scan an object
file for constructor functions to be called. On certain kinds of
systems, you can define these macros to make `collect2' work faster
(and, in some cases, make it work at all):
`OBJECT_FORMAT_COFF'
Define this macro if the system uses COFF (Common Object File
Format) object files, so that `collect2' can assume this format
and scan object files directly for dynamic constructor/destructor
functions.
`OBJECT_FORMAT_ROSE'
Define this macro if the system uses ROSE format object files, so
that `collect2' can assume this format and scan object files
directly for dynamic constructor/destructor functions.
These macros are effective only in a native compiler; `collect2' as
part of a cross compiler always uses `nm'.
`REAL_NM_FILE_NAME'
Define this macro as a C string constant containing the file name
to use to execute `nm'. The default is to search the path
normally for `nm'.
File: gcc.info, Node: Instruction Output, Next: Dispatch Tables, Prev: Macros for Initialization, Up: Assembler Format
Output of Assembler Instructions
--------------------------------
`REGISTER_NAMES'
A C initializer containing the assembler's names for the machine
registers, each one as a C string constant. This is what
translates register numbers in the compiler into assembler
language.
`ADDITIONAL_REGISTER_NAMES'
If defined, a C initializer for an array of structures containing
a name and a register number. This macro defines additional names
for hard registers, thus allowing the `asm' option in declarations
to refer to registers using alternate names.
`ASM_OUTPUT_OPCODE (STREAM, PTR)'
Define this macro if you are using an unusual assembler that
requires different names for the machine instructions.
The definition is a C statement or statements which output an
assembler instruction opcode to the stdio stream STREAM. The
macro-operand PTR is a variable of type `char *' which points to
the opcode name in its "internal" form--the form that is written
in the machine description. The definition should output the
opcode name to STREAM, performing any translation you desire, and
increment the variable PTR to point at the end of the opcode so
that it will not be output twice.
In fact, your macro definition may process less than the entire
opcode name, or more than the opcode name; but if you want to
process text that includes `%'-sequences to substitute operands,
you must take care of the substitution yourself. Just be sure to
increment PTR over whatever text should not be output normally.
If you need to look at the operand values, they can be found as the
elements of `recog_operand'.
If the macro definition does nothing, the instruction is output in
the usual way.
`FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
If defined, a C statement to be executed just prior to the output
of assembler code for INSN, to modify the extracted operands so
they will be output differently.
Here the argument OPVEC is the vector containing the operands
extracted from INSN, and NOPERANDS is the number of elements of
the vector which contain meaningful data for this insn. The
contents of this vector are what will be used to convert the insn
template into assembler code, so you can change the assembler
output by changing the contents of the vector.
This macro is useful when various assembler syntaxes share a single
file of instruction patterns; by defining this macro differently,
you can cause a large class of instructions to be output
differently (such as with rearranged operands). Naturally,
variations in assembler syntax affecting individual insn patterns
ought to be handled by writing conditional output routines in
those patterns.
If this macro is not defined, it is equivalent to a null statement.
`PRINT_OPERAND (STREAM, X, CODE)'
A C compound statement to output to stdio stream STREAM the
assembler syntax for an instruction operand X. X is an RTL
expression.
CODE is a value that can be used to specify one of several ways of
printing the operand. It is used when identical operands must be
printed differently depending on the context. CODE comes from the
`%' specification that was used to request printing of the
operand. If the specification was just `%DIGIT' then CODE is 0;
if the specification was `%LTR DIGIT' then CODE is the ASCII code
for LTR.
If X is a register, this macro should print the register's name.
The names can be found in an array `reg_names' whose type is `char
*[]'. `reg_names' is initialized from `REGISTER_NAMES'.
When the machine description has a specification `%PUNCT' (a `%'
followed by a punctuation character), this macro is called with a
null pointer for X and the punctuation character for CODE.
`PRINT_OPERAND_PUNCT_VALID_P (CODE)'
A C expres