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

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