Fix copyright notices
[deliverable/binutils-gdb.git] / gas / doc / internals.texi
index 2806fc641631052d0f8a25222fa0ee7db1eb1640..eebb9bbc6534dbf07bc7f5a7959792cc8faf5c00 100644 (file)
@@ -1,4 +1,7 @@
 \input texinfo
+@c  Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+@c  2001
+@c  Free Software Foundation, Inc.
 @setfilename internals.info
 @node Top
 @top Assembler Internals
@@ -463,7 +466,7 @@ the other fields; see the definition in @file{expr.h} for the possibilities.
 
 An @code{operatorT} value of @code{O_big} indicates either a floating point
 number, stored in the global variable @code{generic_floating_point_number}, or
-an integer to large to store in an @code{offsetT} type, stored in the global
+an integer too large to store in an @code{offsetT} type, stored in the global
 array @code{generic_bignum}.  This rather inflexible approach makes it
 impossible to use floating point numbers or large expressions in complex
 expressions.
@@ -644,7 +647,7 @@ The variable characters are to be repeated @code{fr_offset} times.  If
 have this type.
 
 @item rs_leb128
-This state is used to implement the DWARF ``little endian base 128'' 
+This state is used to implement the DWARF ``little endian base 128''
 variable length number format.  The @code{fr_symbol} is always an expression
 symbol, as constant expressions are emitted directly.  The @code{fr_offset}
 field is used during relaxation to hold the previous size of the number so
@@ -773,6 +776,12 @@ variable.  Normally the default value of @samp{generic} is fine.  The
 configuration process will create a file named @file{targ-env.h} in the build
 directory which includes @file{te-@var{em}.h}.
 
+There is a special case for COFF. For historical reason, the GNU COFF
+assembler doesn't follow the documented behavior on certain debug symbols for
+the compatibility with other COFF assemblers. A port can define
+@code{STRICTCOFF} in the configure script to make the GNU COFF assembler
+to follow the documented behavior.
+
 Porting GAS to a new CPU requires writing the @file{tc-@var{CPU}} files.
 Porting GAS to a new object file format requires writing the
 @file{obj-@var{fmt}} files.  There is sometimes some interaction between these
@@ -883,7 +892,7 @@ pseudo-ops which are specific to the CPU.
 If this macro is defined, GAS will call it with a @code{pseudo_typeS} argument.
 It should return non-zero if the pseudo-op is a conditional which controls
 whether code is assembled, such as @samp{.if}.  GAS knows about the normal
-conditional pseudo-ops,and you should normally not have to define this macro.
+conditional pseudo-ops, and you should normally not have to define this macro.
 
 @item comment_chars
 @cindex comment_chars
@@ -964,7 +973,7 @@ default value is @code{LEX_NAME | LEX_BEGIN_NAME}.
 @item NUMBERS_WITH_SUFFIX
 @cindex NUMBERS_WITH_SUFFIX
 When this macro is defined to be non-zero, the parser allows the radix of a
-constant to be indicated with a suffix.  Valid suffixes are binary (B), 
+constant to be indicated with a suffix.  Valid suffixes are binary (B),
 octal (Q), and hexadecimal (H).  Case is not significant.
 
 @item SINGLE_QUOTE_STRINGS
@@ -991,6 +1000,7 @@ If you define this macro, GAS will assume that any text at the start of a line
 is a label, even if it does not have a colon.
 
 @item TC_START_LABEL
+@itemx TC_START_LABEL_WITHOUT_COLON
 @cindex TC_START_LABEL
 You may define this macro to control what GAS considers to be a label.  The
 default definition is to accept any name followed by a colon character.
@@ -998,7 +1008,7 @@ default definition is to accept any name followed by a colon character.
 @item TC_START_LABEL_WITHOUT_COLON
 @cindex TC_START_LABEL_WITHOUT_COLON
 Same as TC_START_LABEL, but should be used instead of TC_START_LABEL when
-LABELS_WITHOUT_COLONS is defined. 
+LABELS_WITHOUT_COLONS is defined.
 
 @item NO_PSEUDO_DOT
 @cindex NO_PSEUDO_DOT
@@ -1159,9 +1169,10 @@ relocations.
 
 @item md_relax_frag
 @cindex md_relax_frag
-This macro may be defined to relax a frag.  GAS will call this with the frag
-and the change in size of all previous frags; @code{md_relax_frag} should
-return the change in size of the frag.  @xref{Relaxation}.
+This macro may be defined to relax a frag.  GAS will call this with the
+segment, the frag, and the change in size of all previous frags;
+@code{md_relax_frag} should return the change in size of the frag.
+@xref{Relaxation}.
 
 @item TC_GENERIC_RELAX_TABLE
 @cindex TC_GENERIC_RELAX_TABLE
@@ -1182,6 +1193,15 @@ If you define this macro, and the global variable @samp{linkrelax} is set
 @samp{.align} directive will cause extra space to be allocated.  The linker can
 then discard this space when relaxing the section.
 
+@item TC_LINKRELAX_FIXUP (@var{segT})
+@cindex TC_LINKRELAX_FIXUP
+If defined, this macro allows control over whether fixups for a
+given section will be processed when the @var{linkrelax} variable is
+set.  The macro is given the N_TYPE bits for the section in its
+@var{segT} argument.  If the macro evaluates to a non-zero value
+then the fixups will be converted into relocs, otherwise they will
+be passed to @var{md_apply_fix3} as normal.
+
 @item md_convert_frag
 @cindex md_convert_frag
 GAS will call this for each rs_machine_dependent fragment.
@@ -1256,7 +1276,7 @@ size.
 @cindex md_macro_start
 If defined, GAS will call this macro when it starts to include a macro
 expansion.  @code{macro_nest} indicates the current macro nesting level, which
-includes the one being expanded. 
+includes the one being expanded.
 
 @item md_macro_info
 @cindex md_macro_info
@@ -1268,7 +1288,7 @@ macro (macro_entry *), which includes expansion of the formal arguments.
 @item md_macro_end
 @cindex md_macro_end
 Complement to md_macro_start.  If defined, it is called when finished
-processing an inserted macro expansion, just before decrementing macro_nest. 
+processing an inserted macro expansion, just before decrementing macro_nest.
 
 @item DOUBLEBAR_PARALLEL
 @cindex DOUBLEBAR_PARALLEL
@@ -1337,6 +1357,13 @@ source line.  The default value is 4.
 @item LISTING_RHS_WIDTH
 The maximum number of characters to print from one line of the input file.  The
 default value is 100.
+
+@item TC_COFF_SECTION_DEFAULT_ATTRIBUTES
+@cindex TC_COFF_SECTION_DEFAULT_ATTRIBUTES
+The COFF @code{.section} directive will use the value of this macro to set
+a new section's attributes when a directive has no valid flags or when the
+flag is @code{w}. The default value of the macro is @code{SEC_LOAD | SEC_DATA}.
+
 @end table
 
 @node Object format backend
@@ -1578,6 +1605,16 @@ called to convert the frag to an @code{rs_fill} frag with no variant part.
 Sometimes changing addressing modes may also require rewriting the instruction.
 It can be accessed via @code{fr_opcode} or @code{fr_fix}.
 
+If you generate frags separately for the basic insn opcode and any relaxable
+operands, do not call @code{fix_new} thinking you can emit fixups for the
+opcode field from the relaxable frag.  It is not garanteed to be the same frag.
+If you need to emit fixups for the opcode field from inspection of the
+relaxable frag, then you need to generate a common frag for both the basic
+opcode and relaxable fields, or you need to provide the frag for the opcode to
+pass to @code{fix_new}.  The latter can be done for example by defining
+@code{TC_FRAG_TYPE} to include a pointer to it and defining @code{TC_FRAG_INIT}
+to set the pointer.
+
 Sometimes @code{fr_var} is increased instead, and @code{frag_wane} is not
 called.  I'm not sure, but I think this is to keep @code{fr_fix} referring to
 an earlier byte, and @code{fr_subtype} set to @code{rs_machine_dependent} so
This page took 0.02578 seconds and 4 git commands to generate.