home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 4 / FreshFish_May-June1994.bin / bbs / gnu / gcc-2.5.8-bin.lha / info / gcc.info-21 (.txt) < prev    next >
GNU Info File  |  1994-02-21  |  37KB  |  658 lines

  1. This is Info file gcc.info, produced by Makeinfo-1.55 from the input
  2. file gcc.texi.
  3.    This file documents the use and the internals of the GNU compiler.
  4.    Published by the Free Software Foundation 675 Massachusetts Avenue
  5. Cambridge, MA 02139 USA
  6.    Copyright (C) 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.    Permission is granted to copy and distribute modified versions of
  11. this manual under the conditions for verbatim copying, provided also
  12. that the sections entitled "GNU General Public License" and "Protect
  13. Your Freedom--Fight `Look And Feel'" are included exactly as in the
  14. original, and provided that the entire resulting derived work is
  15. distributed under the terms of a permission notice identical to this
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that the sections entitled "GNU General Public
  19. License" and "Protect Your Freedom--Fight `Look And Feel'", and this
  20. permission notice, may be included in translations approved by the Free
  21. Software Foundation instead of in the original English.
  22. File: gcc.info,  Node: Macros for Initialization,  Next: Instruction Output,  Prev: Initialization,  Up: Assembler Format
  23. Macros Controlling Initialization Routines
  24. ------------------------------------------
  25.    Here are the macros that control how the compiler handles
  26. initialization and termination functions:
  27. `INIT_SECTION_ASM_OP'
  28.      If defined, a C string constant for the assembler operation to
  29.      identify the following data as initialization code.  If not
  30.      defined, GNU CC will assume such a section does not exist.  When
  31.      you are using special sections for initialization and termination
  32.      functions, this macro also controls how `crtstuff.c' and
  33.      `libgcc2.c' arrange to run the initialization functions.
  34. `ASM_OUTPUT_CONSTRUCTOR (STREAM, NAME)'
  35.      Define this macro as a C statement to output on the stream STREAM
  36.      the assembler code to arrange to call the function named NAME at
  37.      initialization time.
  38.      Assume that NAME is the name of a C function generated
  39.      automatically by the compiler.  This function takes no arguments.
  40.      Use the function `assemble_name' to output the name NAME; this
  41.      performs any system-specific syntactic transformations such as
  42.      adding an underscore.
  43.      If you don't define this macro, nothing special is output to
  44.      arrange to call the function.  This is correct when the function
  45.      will be called in some other manner--for example, by means of the
  46.      `collect2' program, which looks through the symbol table to find
  47.      these functions by their names.
  48. `ASM_OUTPUT_DESTRUCTOR (STREAM, NAME)'
  49.      This is like `ASM_OUTPUT_CONSTRUCTOR' but used for termination
  50.      functions rather than initialization functions.
  51.    If your system uses `collect2' as the means of processing
  52. constructors, then that program normally uses `nm' to scan an object
  53. file for constructor functions to be called.  On certain kinds of
  54. systems, you can define these macros to make `collect2' work faster
  55. (and, in some cases, make it work at all):
  56. `OBJECT_FORMAT_COFF'
  57.      Define this macro if the system uses COFF (Common Object File
  58.      Format) object files, so that `collect2' can assume this format
  59.      and scan object files directly for dynamic constructor/destructor
  60.      functions.
  61. `OBJECT_FORMAT_ROSE'
  62.      Define this macro if the system uses ROSE format object files, so
  63.      that `collect2' can assume this format and scan object files
  64.      directly for dynamic constructor/destructor functions.
  65.    These macros are effective only in a native compiler; `collect2' as
  66. part of a cross compiler always uses `nm'.
  67. `REAL_NM_FILE_NAME'
  68.      Define this macro as a C string constant containing the file name
  69.      to use to execute `nm'.  The default is to search the path
  70.      normally for `nm'.
  71. File: gcc.info,  Node: Instruction Output,  Next: Dispatch Tables,  Prev: Macros for Initialization,  Up: Assembler Format
  72. Output of Assembler Instructions
  73. --------------------------------
  74. `REGISTER_NAMES'
  75.      A C initializer containing the assembler's names for the machine
  76.      registers, each one as a C string constant.  This is what
  77.      translates register numbers in the compiler into assembler
  78.      language.
  79. `ADDITIONAL_REGISTER_NAMES'
  80.      If defined, a C initializer for an array of structures containing
  81.      a name and a register number.  This macro defines additional names
  82.      for hard registers, thus allowing the `asm' option in declarations
  83.      to refer to registers using alternate names.
  84. `ASM_OUTPUT_OPCODE (STREAM, PTR)'
  85.      Define this macro if you are using an unusual assembler that
  86.      requires different names for the machine instructions.
  87.      The definition is a C statement or statements which output an
  88.      assembler instruction opcode to the stdio stream STREAM.  The
  89.      macro-operand PTR is a variable of type `char *' which points to
  90.      the opcode name in its "internal" form--the form that is written
  91.      in the machine description.  The definition should output the
  92.      opcode name to STREAM, performing any translation you desire, and
  93.      increment the variable PTR to point at the end of the opcode so
  94.      that it will not be output twice.
  95.      In fact, your macro definition may process less than the entire
  96.      opcode name, or more than the opcode name; but if you want to
  97.      process text that includes `%'-sequences to substitute operands,
  98.      you must take care of the substitution yourself.  Just be sure to
  99.      increment PTR over whatever text should not be output normally.
  100.      If you need to look at the operand values, they can be found as the
  101.      elements of `recog_operand'.
  102.      If the macro definition does nothing, the instruction is output in
  103.      the usual way.
  104. `FINAL_PRESCAN_INSN (INSN, OPVEC, NOPERANDS)'
  105.      If defined, a C statement to be executed just prior to the output
  106.      of assembler code for INSN, to modify the extracted operands so
  107.      they will be output differently.
  108.      Here the argument OPVEC is the vector containing the operands
  109.      extracted from INSN, and NOPERANDS is the number of elements of
  110.      the vector which contain meaningful data for this insn.  The
  111.      contents of this vector are what will be used to convert the insn
  112.      template into assembler code, so you can change the assembler
  113.      output by changing the contents of the vector.
  114.      This macro is useful when various assembler syntaxes share a single
  115.      file of instruction patterns; by defining this macro differently,
  116.      you can cause a large class of instructions to be output
  117.      differently (such as with rearranged operands).  Naturally,
  118.      variations in assembler syntax affecting individual insn patterns
  119.      ought to be handled by writing conditional output routines in
  120.      those patterns.
  121.      If this macro is not defined, it is equivalent to a null statement.
  122. `PRINT_OPERAND (STREAM, X, CODE)'
  123.      A C compound statement to output to stdio stream STREAM the
  124.      assembler syntax for an instruction operand X.  X is an RTL
  125.      expression.
  126.      CODE is a value that can be used to specify one of several ways of
  127.      printing the operand.  It is used when identical operands must be
  128.      printed differently depending on the context.  CODE comes from the
  129.      `%' specification that was used to request printing of the
  130.      operand.  If the specification was just `%DIGIT' then CODE is 0;
  131.      if the specification was `%LTR DIGIT' then CODE is the ASCII code
  132.      for LTR.
  133.      If X is a register, this macro should print the register's name.
  134.      The names can be found in an array `reg_names' whose type is `char
  135.      *[]'.  `reg_names' is initialized from `REGISTER_NAMES'.
  136.      When the machine description has a specification `%PUNCT' (a `%'
  137.      followed by a punctuation character), this macro is called with a
  138.      null pointer for X and the punctuation character for CODE.
  139. `PRINT_OPERAND_PUNCT_VALID_P (CODE)'
  140.      A C expres