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

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