aboutsummaryrefslogtreecommitdiff
path: root/gas/doc/as.texi
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-08-25 14:55:12 +0200
committerJan Beulich <jbeulich@suse.com>2023-08-25 14:55:12 +0200
commitcefaa117f7675ce690c0ec38c353e7e4195dedcb (patch)
tree70932f74748ffb22d3dde9f13a5667acc2064c30 /gas/doc/as.texi
parent7b793987b5e1f35a6a8a442da24ebd3f7dbf08f3 (diff)
downloadbinutils-cefaa117f7675ce690c0ec38c353e7e4195dedcb.zip
binutils-cefaa117f7675ce690c0ec38c353e7e4195dedcb.tar.gz
binutils-cefaa117f7675ce690c0ec38c353e7e4195dedcb.tar.bz2
gas/ELF: allow "inheriting" section attributes and type
While --sectname-subst is nice, it isn't enough to e.g. mimic -f{function,data}-sections in assembly code, when such use is to be optional (e.g. dependent upon some configuration setting). Assign meaning to '+' and '-' as section attribute letters, allowing to inherit the prior section's attributes (and possibly type) along with adding or removing some. Note that documenting the interaction with '?' as undefined is a precautionary measure. While touching the function invocation, stop using |= on the result of obj_elf_parse_section_letters(): "attr" is firmly zero ahead of the call.
Diffstat (limited to 'gas/doc/as.texi')
-rw-r--r--gas/doc/as.texi12
1 files changed, 12 insertions, 0 deletions
diff --git a/gas/doc/as.texi b/gas/doc/as.texi
index 15867df..6a3e5ee 100644
--- a/gas/doc/as.texi
+++ b/gas/doc/as.texi
@@ -6818,6 +6818,12 @@ 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 +
+section inherits attributes and (unless explicitly specified) type from the
+previously-current section, adding other attributes as specified
+@item -
+section inherits attributes and (unless explicitly specified) type from the
+previously-current section, removing other attributes as specified
@item R
retained section (apply SHF_GNU_RETAIN to prevent linker garbage
collection, GNU ELF extension)
@@ -6839,6 +6845,12 @@ section may have the executable (@code{x}) flag added. Also note that the
@code{.attach_to_group} directive can be used to add a section to a group even
if the section was not originally declared to be part of that group.
+Note further that @code{+} and @code{-} need to come first and can only take
+the effect described here unless overridden by a target. The attributes
+inherited are those in effect at the time the directive is processed.
+Attributes added later (see above) will not be inherited. Using either
+together with @code{?} is undefined at this point.
+
The optional @var{type} argument may contain one of the following constants:
@table @code