[PATCH 0/1] gas: add new command line option --no-group-check

Alan Modra amodra@gmail.com
Fri Jul 21 22:55:35 GMT 2023


On Fri, Jul 21, 2023 at 11:14:20PM +0800, Tan Yuan wrote:
> Hi, list
> 
> This patch introduces a new option that allows suppressing the warning
> when attaching a group to a section that already belongs to a group.

Is this alternative patch sufficient for the kernel usage?

	* config/obj-elf.c (obj_elf_attach_to_group): Don't warn if
	group name matches current group for section.

diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index 753a929fb14..dc05b35ee99 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1088,8 +1088,9 @@ obj_elf_attach_to_group (int dummy ATTRIBUTE_UNUSED)
 
   if (elf_group_name (now_seg))
     {
-      as_warn (_("section %s already has a group (%s)"),
-	       bfd_section_name (now_seg), elf_group_name (now_seg));
+      if (strcmp (elf_group_name (now_seg), gname) != 0)
+	as_warn (_("section %s already has a group (%s)"),
+		 bfd_section_name (now_seg), elf_group_name (now_seg));
       return;
     }
 


-- 
Alan Modra
Australia Development Lab, IBM


More information about the Binutils mailing list