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

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