gas/ELF: allow "inheriting" section attributes and type
authorJan Beulich <jbeulich@suse.com>
Fri, 25 Aug 2023 12:55:12 +0000 (14:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Aug 2023 12:55:12 +0000 (14:55 +0200)
commitcefaa117f7675ce690c0ec38c353e7e4195dedcb
tree70932f74748ffb22d3dde9f13a5667acc2064c30
parent7b793987b5e1f35a6a8a442da24ebd3f7dbf08f3
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.
gas/config/obj-elf.c
gas/doc/as.texi
gas/testsuite/gas/elf/elf.exp
gas/testsuite/gas/elf/section30.d [new file with mode: 0644]
gas/testsuite/gas/elf/section30.s [new file with mode: 0644]