summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Muellner <christoph.muellner@theobroma-systems.com>2019-10-10 18:02:23 +0200
committerErick Ochoa <erick.ochoa@theobroma-systems.com>2020-03-11 16:29:19 +0100
commitec4681b4ef6a36e4a4db5b128fe9e61f711c1b83 (patch)
tree747ec406881df4b3f1d0a1acdb082a5ed1e2aa50
parentd7f734bc7e9e5fb6c33b433973b57e1eed3a7e9f (diff)
Adding Fedora's binutils-attach-to-group.patch.binutils-2_34-ampbinutils-2_34-amp-branch
This patch adds the support for the pseudo instruction 'attach_to_group'. This is required in combination with RedHat's annobin GCC plugin. Information from the binutils.spec file: # Purpose: Add a .attach_to_group pseudo-op to the assembler for # use by the annobin gcc plugin. # Lifetime: Permanent. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r--gas/config/obj-elf.c23
-rw-r--r--gas/doc/as.texi7
2 files changed, 30 insertions, 0 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 7cf921c051..d70400cec1 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -78,9 +78,11 @@ static void obj_elf_gnu_attribute (int);
static void obj_elf_tls_common (int);
static void obj_elf_lcomm (int);
static void obj_elf_struct (int);
+static void obj_elf_attach_to_group (int);
static const pseudo_typeS elf_pseudo_table[] =
{
+ {"attach_to_group", obj_elf_attach_to_group, 0},
{"comm", obj_elf_common, 0},
{"common", obj_elf_common, 1},
{"ident", obj_elf_ident, 0},
@@ -1003,6 +1005,27 @@ obj_elf_section_name (void)
return name;
}
+static void
+obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED)
+{
+ const char * gname = obj_elf_section_name ();
+
+ if (gname == NULL)
+ {
+ as_warn ("group name not parseable");
+ return;
+ }
+
+ if (elf_group_name (now_seg))
+ {
+ as_warn ("already has a group");
+ return;
+ }
+
+ elf_group_name (now_seg) = xstrdup (gname);
+ elf_section_flags (now_seg) |= SHF_GROUP;
+}
+
void
obj_elf_section (int push)
{
diff --git a/gas/doc/as.texi b/gas/doc/as.texi
index fa15509615..9f5ca15b75 100644
--- a/gas/doc/as.texi
+++ b/gas/doc/as.texi
@@ -4359,6 +4359,7 @@ Some machine configurations provide additional directives.
* Altmacro:: @code{.altmacro}
* Ascii:: @code{.ascii "@var{string}"}@dots{}
* Asciz:: @code{.asciz "@var{string}"}@dots{}
+* Attach_to_group:: @code{.attach_to_group @var{name}}
* Balign:: @code{.balign [@var{abs-expr}[, @var{abs-expr}]]}
* Bundle directives:: @code{.bundle_align_mode @var{abs-expr}}, etc
* Byte:: @code{.byte @var{expressions}}
@@ -4656,6 +4657,12 @@ trailing zero byte) into consecutive addresses.
@code{.asciz} is just like @code{.ascii}, but each string is followed by
a zero byte. The ``z'' in @samp{.asciz} stands for ``zero''.
+@node Attach_to_group
+@section @code{.attach_to_group @var{name}}
+Attaches the current section to the named group. This is like declaring
+the section with the @code{G} attribute, but can be done after the section
+has been created.
+
@node Balign
@section @code{.balign[wl] [@var{abs-expr}[, @var{abs-expr}[, @var{abs-expr}]]]}