Do not place symbols into a discarded .dynsym
[deliverable/binutils-gdb.git] / bfd / elflink.c
index 02618bed8fea01db1f3e24d92b53aaa6aac1ff4f..78d8c543412125ecc36117bf6441c8a2fa16d621 100644 (file)
@@ -10024,9 +10024,10 @@ elf_link_output_extsym (struct bfd_hash_entry *bh, void *data)
   /* If this symbol should be put in the .dynsym section, then put it
      there now.  We already know the symbol index.  We also fill in
      the entry in the .hash section.  */
-  if (elf_hash_table (flinfo->info)->dynsym != NULL
-      && h->dynindx != -1
-      && elf_hash_table (flinfo->info)->dynamic_sections_created)
+  if (h->dynindx != -1
+      && elf_hash_table (flinfo->info)->dynamic_sections_created
+      && elf_hash_table (flinfo->info)->dynsym != NULL
+      && !discarded_section (elf_hash_table (flinfo->info)->dynsym))
     {
       bfd_byte *esym;
 
This page took 0.024277 seconds and 4 git commands to generate.