Enhance GAS's .section directive so that it can take numeric values for the flags...
[deliverable/binutils-gdb.git] / gas / doc / as.texinfo
index 917781b1bedec129c918a0ad353a4dda21347bab..86b09fcadf9b253613f7a030a82aa28462d3fea0 100644 (file)
@@ -6375,8 +6375,22 @@ section is a member of a section group
 section is used for thread-local-storage
 @item ?
 section is a member of the previously-current section's group, if any
+@item @var{number}
+a numeric value indicating the bits to be set in the ELF section header's flags
+field.  Note - if one or more of the alphabetic characters described above is
+also included in the flags field, their bit values will be ORed into the
+resulting value.
+@item @{target specific}
+some targets extend this list with their own types
 @end table
 
+Note - once a section's flags have been set they cannot be changed.  There are
+a few exceptions to this rule however.  Processor and application specific
+flags can be added to an already defined section.  The @code{.interp},
+@code{.strtab} and @code{.symtab} sections can have the allocate flag
+(@code{a}) set after they are initially defined, and the @code{.note-GNU-stack}
+section may have the executable (@code(x)) flag added.
+
 The optional @var{type} argument may contain one of the following constants:
 @table @code
 @item @@progbits
@@ -6391,14 +6405,23 @@ section contains an array of pointers to init functions
 section contains an array of pointers to finish functions
 @item @@preinit_array
 section contains an array of pointers to pre-init functions
+@item @@@var{number}
+a numeric value to be set as the ELF section header's type field.
+@item @@@{target specific}
+some targets extend this list with their own types
 @end table
 
-Many targets only support the first three section types.
+Many targets only support the first three section types.  The type may be
+enclosed in double quotes if necessary.
 
 Note on targets where the @code{@@} character is the start of a comment (eg
 ARM) then another character is used instead.  For example the ARM port uses the
 @code{%} character.
 
+Note - some sections, eg @code{.text} and @code{.data} are considered to be
+special and have fixed types.  Any attempt to declare them with a different
+type will generate an error from the assembler.
+
 If @var{flags} contains the @code{M} symbol then the @var{type} argument must
 be specified as well as an extra argument---@var{entsize}---like this:
 
This page took 0.024333 seconds and 4 git commands to generate.