Don't warn on .attach_to_group to same group

Alan Modra amodra@gmail.com
Wed Jul 26 00:43:56 GMT 2023


	* 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