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

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