Blame SOURCES/binutils-attach-to-group.patch

a6dfc0
diff -rup binutils.orig/gas/config/obj-elf.c binutils-2.30/gas/config/obj-elf.c
a6dfc0
--- binutils.orig/gas/config/obj-elf.c	2018-09-24 17:50:06.974172867 +0100
a6dfc0
+++ binutils-2.30/gas/config/obj-elf.c	2018-09-25 15:19:33.559830794 +0100
a6dfc0
@@ -82,9 +82,11 @@ static void obj_elf_gnu_attribute (int);
a6dfc0
 static void obj_elf_tls_common (int);
a6dfc0
 static void obj_elf_lcomm (int);
a6dfc0
 static void obj_elf_struct (int);
a6dfc0
+static void obj_elf_attach_to_group (int);
a6dfc0
 
a6dfc0
 static const pseudo_typeS elf_pseudo_table[] =
a6dfc0
 {
a6dfc0
+  {"attach_to_group", obj_elf_attach_to_group, 0},
a6dfc0
   {"comm", obj_elf_common, 0},
a6dfc0
   {"common", obj_elf_common, 1},
a6dfc0
   {"ident", obj_elf_ident, 0},
a6dfc0
@@ -1007,6 +1009,27 @@ obj_elf_section_name (void)
a6dfc0
   return name;
a6dfc0
 }
a6dfc0
 
a6dfc0
+static void
a6dfc0
+obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED)
a6dfc0
+{
a6dfc0
+  const char * gname = obj_elf_section_name ();
a6dfc0
+
a6dfc0
+  if (gname == NULL)
a6dfc0
+    {
a6dfc0
+      as_warn ("group name not parseable");
a6dfc0
+      return;
a6dfc0
+    }
a6dfc0
+
a6dfc0
+  if (elf_group_name (now_seg))
a6dfc0
+    {
a6dfc0
+      as_warn ("already has a group");
a6dfc0
+      return;
a6dfc0
+    }
a6dfc0
+
a6dfc0
+  elf_group_name (now_seg) = xstrdup (gname);
a6dfc0
+  elf_section_flags (now_seg) |= SHF_GROUP;
a6dfc0
+}
a6dfc0
+
a6dfc0
 void
a6dfc0
 obj_elf_section (int push)
a6dfc0
 {
a6dfc0
diff -rup binutils.orig/gas/doc/as.texinfo binutils-2.30/gas/doc/as.texinfo
a6dfc0
--- binutils.orig/gas/doc/as.texi	2018-09-24 17:50:06.984172788 +0100
a6dfc0
+++ binutils-2.30/gas/doc/as.texi	2018-09-25 15:19:43.557748972 +0100
a6dfc0
@@ -4407,6 +4407,7 @@ Some machine configurations provide addi
a6dfc0
 * Altmacro::                    @code{.altmacro}
a6dfc0
 * Ascii::                       @code{.ascii "@var{string}"}@dots{}
a6dfc0
 * Asciz::                       @code{.asciz "@var{string}"}@dots{}
a6dfc0
+* Attach_to_group::             @code{.attach_to_group @var{name}}
a6dfc0
 * Balign::                      @code{.balign @var{abs-expr} , @var{abs-expr}}
a6dfc0
 * Bundle directives::           @code{.bundle_align_mode @var{abs-expr}}, etc
a6dfc0
 * Byte::                        @code{.byte @var{expressions}}
a6dfc0
@@ -4703,6 +4704,12 @@ trailing zero byte) into consecutive add
a6dfc0
 @code{.asciz} is just like @code{.ascii}, but each string is followed by
a6dfc0
 a zero byte.  The ``z'' in @samp{.asciz} stands for ``zero''.
a6dfc0
 
a6dfc0
+@node Attach_to_group
a6dfc0
+@section @code{.attach_to_group @var{name}}
a6dfc0
+Attaches the current section to the named group.  This is like declaring
a6dfc0
+the section with the @code{G} attribute, but can be done after the section
a6dfc0
+has been created.
a6dfc0
+
a6dfc0
 @node Balign
a6dfc0
 @section @code{.balign[wl] @var{abs-expr}, @var{abs-expr}, @var{abs-expr}}
a6dfc0
 
a6dfc0