gas: section name substitution sequence
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 10 Jun 2015 03:06:29 +0000 (23:06 -0400)
committerAlan Modra <amodra@gmail.com>
Tue, 16 Jun 2015 23:22:00 +0000 (08:52 +0930)
commit451133cefa839104aa127d230436fb609dbef37f
treeed44f5a6279f32143a205119e38748759873a699
parent4da680addb9f9c22f24f0294b8b9b9ca52cecd7f
gas: section name substitution sequence

This patch adds the ability to automatically construct a section name
based on the prior section.

When gas is invoked with --sectname-subst, the occurrence of %S in a
section name will be substituted by the name of the current section. For
example:

.macro exception_code
.pushsection %S.exception
[exception code here]
.popsection
.endm

.text
[code]
exception_code
[...]

.section .init
[init code]
exception_code
[...]

The first and second exception_code invocations create the
.text.exception and the .init.exception sections respectively.  This is
useful e.g. to discriminate between anciliary sections that are tied to
.init code and can be discarded at run time when initialization is over
vs anciliary sections tied to .text sections that need to stay resident.

* as.c (show_usage): Document --sectname-subst.
(parse_args): Add --sectname-subst.
* as.h (flag_sectname_subst): New.
* config/obj-elf.c (obj_elf_section_name): Add %S substitution.
* doc/as.texinfo: Document it.
gas/ChangeLog
gas/as.c
gas/as.h
gas/config/obj-elf.c
gas/doc/as.texinfo
This page took 0.026059 seconds and 4 git commands to generate.