* doc/as.texinfo (Overview): Add Xtensa --rename-section option.
[deliverable/binutils-gdb.git] / gas / doc / as.texinfo
index 2cc40aa4481250c15bb2d64da2e061e7270a4dab..5d426ee01cb9283c6efa1491eb675d2b86c22291 100644 (file)
@@ -189,6 +189,9 @@ section entitled ``GNU Free Documentation License''.
 * Symbols::                     Symbols
 * Expressions::                 Expressions
 * Pseudo Ops::                  Assembler Directives
+@ifset ELF
+* Object Attributes::           Object Attributes
+@end ifset
 * Machine Dependencies::        Machine Dependent Features
 * Reporting Bugs::              Reporting Bugs
 * Acknowledgements::            Who Did What
@@ -226,6 +229,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}.
 @smallexample
 @c man begin SYNOPSIS
 @value{AS} [@b{-a}[@b{cdhlns}][=@var{file}]] [@b{--alternate}] [@b{-D}]
+ [@b{--debug-prefix-map} @var{old}=@var{new}]
  [@b{--defsym} @var{sym}=@var{val}] [@b{-f}] [@b{-g}] [@b{--gstabs}]
  [@b{--gstabs+}] [@b{--gdwarf-2}] [@b{--help}] [@b{-I} @var{dir}] [@b{-J}]
  [@b{-K}] [@b{-L}] [@b{--listing-lhs-width}=@var{NUM}]
@@ -501,6 +505,10 @@ Begin in alternate macro mode.
 Ignored.  This option is accepted for script compatibility with calls to
 other assemblers.
 
+@item --debug-prefix-map @var{old}=@var{new}
+When assembling files in directory @file{@var{old}}, record debugging
+information describing them as in @file{@var{new}} instead.
+
 @item --defsym @var{sym}=@var{value}
 Define the symbol @var{sym} to be @var{value} before assembling the input file.
 @var{value} must be an integer constant.  As in C, a leading @samp{0x}
@@ -1177,6 +1185,10 @@ Enable or disable all assembler transformations of Xtensa instructions.
 The default is @option{--transform};
 @option{--no-transform} should be used only in the rare cases when the
 instructions must be exactly as specified in the assembly source.
+
+@item --rename-section @var{oldname}=@var{newname}
+When generating output sections, rename the @var{oldname} section to
+@var{newname}.
 @end table
 @end ifset
 
@@ -3771,7 +3783,7 @@ Some machine configurations provide additional directives.
 @menu
 * Abort::                       @code{.abort}
 @ifset COFF
-* ABORT (COFF)::                       @code{.ABORT}
+* ABORT (COFF)::                @code{.ABORT}
 @end ifset
 
 * Align::                       @code{.align @var{abs-expr} , @var{abs-expr}}
@@ -3823,6 +3835,7 @@ Some machine configurations provide additional directives.
 * Func::                        @code{.func}  
 * Global::                      @code{.global @var{symbol}}, @code{.globl @var{symbol}}
 @ifset ELF
+* Gnu_attribute::               @code{.gnu_attribute @var{tag},@var{value}}
 * Hidden::                      @code{.hidden @var{names}}
 @end ifset
 
@@ -3886,7 +3899,7 @@ Some machine configurations provide additional directives.
 * Scl::                         @code{.scl @var{class}}
 @end ifset
 @ifset COFF-ELF
-* Section::                     @code{.section @var{name}}
+* Section::                     @code{.section @var{name}[, @var{flags}]}
 @end ifset
 
 * Set::                         @code{.set @var{symbol}, @var{expression}}
@@ -3903,7 +3916,7 @@ Some machine configurations provide additional directives.
 * Stab::                        @code{.stabd, .stabn, .stabs}
 @end ifset
 
-* String::                      @code{.string "@var{str}"}
+* String::                      @code{.string "@var{str}"}, @code{.string8 "@var{str}"}, @code{.string16 "@var{str}"}, @code{.string32 "@var{str}"}, @code{.string64 "@var{str}"}
 * Struct::                     @code{.struct @var{expression}}
 @ifset ELF
 * SubSection::                  @code{.subsection}
@@ -4249,9 +4262,9 @@ state machine to @var{value}, which must be an unsigned integer.
 
 @end table
 
-@section @code{.loc_mark_blocks @var{enable}}
-@cindex @code{loc_mark_blocks} directive
-The @code{.loc_mark_blocks} directive makes the assembler emit an entry
+@section @code{.loc_mark_labels @var{enable}}
+@cindex @code{loc_mark_labels} directive
+The @code{.loc_mark_labels} directive makes the assembler emit an entry
 to the @code{.debug_line} line number matrix with the @code{basic_block}
 register in the state machine set whenever a code label is seen.
 The @var{enable} argument should be either 1 or 0, to enable or disable
@@ -4577,6 +4590,10 @@ partial programs.  You may need the HPPA-only @code{.EXPORT} directive as well.
 @end ifset
 
 @ifset ELF
+@node Gnu_attribute
+@section @code{.gnu_attribute @var{tag},@var{value}}
+Record a @sc{gnu} object attribute for this file.  @xref{Object Attributes}.
+
 @node Hidden
 @section @code{.hidden @var{names}}
 
@@ -5341,9 +5358,42 @@ This is one of the ELF section stack manipulation directives.  The others are
 (@pxref{PopSection}).
 
 This directive swaps the current section (and subsection) with most recently
-referenced section (and subsection) prior to this one.  Multiple
+referenced section/subsection pair prior to this one.  Multiple
 @code{.previous} directives in a row will flip between two sections (and their
-subsections).
+subsections).  For example:
+
+@smallexample
+.section A
+ .subsection 1
+  .word 0x1234
+ .subsection 2
+  .word 0x5678
+.previous
+ .word 0x9abc
+@end smallexample
+
+Will place 0x1234 and 0x9abc into subsection 1 and 0x5678 into subsection 2 of
+section A.  Whilst:
+
+@smallexample
+.section A
+.subsection 1
+  # Now in section A subsection 1
+  .word 0x1234
+.section B
+.subsection 0
+  # Now in section B subsection 0
+  .word 0x5678
+.subsection 1
+  # Now in section B subsection 1
+  .word 0x9abc
+.previous
+  # Now in section B subsection 0
+  .word 0xdef0
+@end smallexample
+
+Will place 0x1234 into section A, 0x5678 and 0xdef0 into subsection 0 of
+section B and 0x9abc into subsection 1 of section B.
 
 In terms of the section stack, this directive swaps the current section with
 the top section on the section stack.
@@ -5927,16 +5977,39 @@ All five fields are specified.
 @c end     have-stabs
 
 @node String
-@section @code{.string} "@var{str}"
+@section @code{.string} "@var{str}", @code{.string8} "@var{str}", @code{.string16}
+"@var{str}", @code{.string32} "@var{str}", @code{.string64} "@var{str}" 
 
 @cindex string, copying to object file
+@cindex string8, copying to object file
+@cindex string16, copying to object file
+@cindex string32, copying to object file
+@cindex string64, copying to object file
 @cindex @code{string} directive
+@cindex @code{string8} directive
+@cindex @code{string16} directive
+@cindex @code{string32} directive
+@cindex @code{string64} directive
 
 Copy the characters in @var{str} to the object file.  You may specify more than
 one string to copy, separated by commas.  Unless otherwise specified for a
 particular machine, the assembler marks the end of each string with a 0 byte.
 You can use any of the escape sequences described in @ref{Strings,,Strings}.
 
+The variants @code{string16}, @code{string32} and @code{string64} differ from 
+the @code{string} pseudo opcode in that each 8-bit character from @var{str} is
+copied and expanded to 16, 32 or 64 bits respectively.  The expanded characters
+are stored in target endianness byte order.
+
+Example:
+@smallexample
+       .string32 "BYE"
+expands to:
+       .string   "B\0\0\0Y\0\0\0E\0\0\0"  /* On little endian targets.  */
+       .string   "\0\0\0B\0\0\0Y\0\0\0E"  /* On big endian targets.  */
+@end smallexample
+
+
 @node Struct
 @section @code{.struct @var{expression}}
 
@@ -6130,21 +6203,35 @@ assemblers.
 The syntaxes supported are:
 
 @smallexample
-  .type <name> STT_FUNCTION
-  .type <name> STT_OBJECT
+  .type <name> STT_<TYPE_IN_UPPER_CASE>
+  .type <name>,#<type>
+  .type <name>,@@<type>
+  .type <name>,%>type>
+  .type <name>,"<type>"
+@end smallexample
 
-  .type <name>,#function
-  .type <name>,#object
+The types supported are:
 
-  .type <name>,@@function
-  .type <name>,@@object
+@table @gcctabopt
+@item STT_FUNC
+@itemx function
+Mark the symbol as being a function name.
+
+@item STT_OBJECT
+@itemx object
+Mark the symbol as being a data object.
+
+@item STT_TLS
+@itemx tls_object
+Mark the symbol as being a thead-local data object.
+
+@item STT_COMMON
+@itemx common
+Mark the symbol as being a common data object.
+@end table
+
+Note: Some targets support extra types in addition to those listed above.
 
-  .type <name>,%function
-  .type <name>,%object
-  
-  .type <name>,"function"
-  .type <name>,"object"
-@end smallexample
 @end ifset
 @end ifset
 
@@ -6318,6 +6405,140 @@ They are included for compatibility with older assemblers.
 @item .line
 @end table
 
+@ifset ELF
+@node Object Attributes
+@chapter Object Attributes
+@cindex object attributes
+
+@command{@value{AS}} assembles source files written for a specific architecture
+into object files for that architecture.  But not all object files are alike.
+Many architectures support incompatible variations.  For instance, floating
+point arguments might be passed in floating point registers if the object file
+requires hardware floating point support---or floating point arguments might be
+passed in integer registers if the object file supports processors with no
+hardware floating point unit.  Or, if two objects are built for different
+generations of the same architecture, the combination may require the
+newer generation at run-time.
+
+This information is useful during and after linking.  At link time,
+@command{@value{LD}} can warn about incompatible object files.  After link
+time, tools like @command{gdb} can use it to process the linked file
+correctly.
+
+Compatibility information is recorded as a series of object attributes.  Each
+attribute has a @dfn{vendor}, @dfn{tag}, and @dfn{value}.  The vendor is a
+string, and indicates who sets the meaning of the tag.  The tag is an integer,
+and indicates what property the attribute describes.  The value may be a string
+or an integer, and indicates how the property affects this object.  Missing
+attributes are the same as attributes with a zero value or empty string value.
+
+Object attributes were developed as part of the ABI for the ARM Architecture.
+The file format is documented in @cite{ELF for the ARM Architecture}.
+
+@menu
+* GNU Object Attributes::               @sc{gnu} Object Attributes
+* Defining New Object Attributes::      Defining New Object Attributes
+@end menu
+
+@node GNU Object Attributes
+@section @sc{gnu} Object Attributes
+
+The @code{.gnu_attribute} directive records an object attribute
+with vendor @samp{gnu}.
+
+Except for @samp{Tag_compatibility}, which has both an integer and a string for
+its value, @sc{gnu} attributes have a string value if the tag number is odd and
+an integer value if the tag number is even.  The second bit (@code{@var{tag} &
+2} is set for architecture-independent attributes and clear for
+architecture-dependent ones.
+
+@subsection Common @sc{gnu} attributes
+
+These attributes are valid on all architectures.
+
+@table @r
+@item Tag_compatibility (32)
+The compatibility attribute takes an integer flag value and a vendor name.  If
+the flag value is 0, the file is compatible with other toolchains.  If it is 1,
+then the file is only compatible with the named toolchain.  If it is greater
+than 1, the file can only be processed by other toolchains under some private
+arrangement indicated by the flag value and the vendor name.
+@end table
+
+@subsection MIPS Attributes
+
+@table @r
+@item Tag_GNU_MIPS_ABI_FP (4)
+The floating-point ABI used by this object file.  The value will be:
+
+@itemize @bullet
+@item
+0 for files not affected by the floating-point ABI.
+@item
+1 for files using the hardware floating-point with a standard double-precision
+FPU.
+@item
+2 for files using the hardware floating-point ABI with a single-precision FPU.
+@item
+3 for files using the software floating-point ABI.
+@end itemize
+@end table
+
+@subsection PowerPC Attributes
+
+@table @r
+@item Tag_GNU_Power_ABI_FP (4)
+The floating-point ABI used by this object file.  The value will be:
+
+@itemize @bullet
+@item
+0 for files not affected by the floating-point ABI.
+@item
+1 for files using the hardware floating-point ABI.
+@item
+2 for files using the software floating-point ABI.
+@end itemize
+
+@item Tag_GNU_Power_ABI_Vector (8)
+The vector ABI used by this object file.  The value will be:
+
+@itemize @bullet
+@item
+0 for files not affected by the vector ABI.
+@item
+1 for files using general purpose registers to pass vectors.
+@item
+2 for files using AltiVec registers to pass vectors.
+@item
+3 for files using SPE registers to pass vectors.
+@end itemize
+@end table
+
+@node Defining New Object Attributes
+@section Defining New Object Attributes
+
+If you want to define a new @sc{gnu} object attribute, here are the places you
+will need to modify.  New attributes should be discussed on the @samp{binutils}
+mailing list.
+
+@itemize @bullet
+@item
+This manual, which is the official register of attributes.
+@item
+The header for your architecture @file{include/elf}, to define the tag.
+@item
+The @file{bfd} support file for your architecture, to merge the attribute
+and issue any appropriate link warnings.
+@item
+Test cases in @file{ld/testsuite} for merging and link warnings.
+@item
+@file{binutils/readelf.c} to display your attribute.
+@item
+GCC, if you want the compiler to mark the attribute automatically.
+@end itemize
+
+@end ifset
+
 @ifset GENERIC
 @node Machine Dependencies
 @chapter Machine Dependent Features
@@ -6351,6 +6572,9 @@ subject, see the hardware manufacturer's manual.
 @ifset BFIN
 * BFIN-Dependent::             BFIN Dependent Features
 @end ifset
+@ifset CR16
+* CR16-Dependent::              CR16 Dependent Features
+@end ifset
 @ifset CRIS
 * CRIS-Dependent::              CRIS Dependent Features
 @end ifset
@@ -6472,6 +6696,10 @@ subject, see the hardware manufacturer's manual.
 @include c-bfin.texi
 @end ifset
 
+@ifset CR16
+@include c-cr16.texi
+@end ifset
+
 @ifset CRIS
 @include c-cris.texi
 @end ifset
This page took 0.0287 seconds and 4 git commands to generate.