]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gas/config/obj-elf.c
ELF: Don't generate unused section symbols
[thirdparty/binutils-gdb.git] / gas / config / obj-elf.c
index bf79b05743d8546c20ef128fc2c3489dafb8c64e..6c0a6ae9ee215ee50ff090dc7d92cdc3e60ff018 100644 (file)
@@ -666,7 +666,9 @@ obj_elf_change_section (const char *name,
            }
        }
 
-      if (old_sec == NULL && ((attr & ~(SHF_MASKOS | SHF_MASKPROC))
+      if (old_sec == NULL && ((attr & ~(SHF_LINK_ORDER
+                                       | SHF_MASKOS
+                                       | SHF_MASKPROC))
                              & ~ssect->attr) != 0)
        {
          /* As a GNU extension, we permit a .note section to be
@@ -2839,6 +2841,9 @@ elf_adjust_symtab (void)
          symbol_table_insert (sy);
        }
       elf_group_id (s) = symbol_get_bfdsym (sy);
+      /* Mark the group signature symbol as used so that it will be
+        included in the symbol table.  */
+      symbol_mark_used_in_reloc (sy);
     }
 }