623c138
diff -rupN --no-dereference binutils-2.42/bfd/elf.c binutils-2.42-new/bfd/elf.c
623c138
--- binutils-2.42/bfd/elf.c	2024-01-29 01:00:00.000000000 +0100
623c138
+++ binutils-2.42-new/bfd/elf.c	2024-02-18 23:54:45.728777026 +0100
56bf910
@@ -827,7 +827,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd
Fabiano Fidêncio 067b825
 	}
Fabiano Fidêncio 067b825
     }
Fabiano Fidêncio 067b825
 
Fabiano Fidêncio 067b825
-  if (elf_group_name (newsect) == NULL)
Fabiano Fidêncio 067b825
+  if (elf_group_name (newsect) == NULL
Fabiano Fidêncio 067b825
+      /* OS specific sections might be in a group (eg ARM's ARM_EXIDX section)
Fabiano Fidêncio 067b825
+	 but they will not have been added to the group because they do not
Fabiano Fidêncio 067b825
+	 have contents that the ELF code in the BFD library knows how to
Fabiano Fidêncio 067b825
+	 process.  This is OK though - we rely upon the target backends to
Fabiano Fidêncio 067b825
+	 handle these sections for us.  */
Fabiano Fidêncio 067b825
+      && hdr->sh_type < SHT_LOOS)
Fabiano Fidêncio 067b825
     {
Fabiano Fidêncio 067b825
       /* xgettext:c-format */
Fabiano Fidêncio 067b825
       _bfd_error_handler (_("%pB: no group info for section '%pA'"),
56bf910
@@ -935,7 +941,8 @@ _bfd_elf_setup_sections (bfd *abfd)
Fabiano Fidêncio 067b825
 	  else if (idx->shdr->bfd_section)
Fabiano Fidêncio 067b825
 	    elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section;
Fabiano Fidêncio 067b825
 	  else if (idx->shdr->sh_type != SHT_RELA
Fabiano Fidêncio 067b825
-		   && idx->shdr->sh_type != SHT_REL)
Fabiano Fidêncio 067b825
+		   && idx->shdr->sh_type != SHT_REL
Fabiano Fidêncio 067b825
+		   && idx->shdr->sh_type < SHT_LOOS)
Fabiano Fidêncio 067b825
 	    {
Fabiano Fidêncio 067b825
 	      /* There are some unknown sections in the group.  */
Fabiano Fidêncio 067b825
 	      _bfd_error_handler