Skip section symbols from sections being discarded
authorNick Clifton <nickc@redhat.com>
Tue, 3 Jul 2001 15:49:46 +0000 (15:49 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 3 Jul 2001 15:49:46 +0000 (15:49 +0000)
bfd/ChangeLog
bfd/cofflink.c

index c151aef83ee0c7d7df85be45dd8b91e7e1a91470..30df566ea0d38fd2c0c66bb2422e6bcb86b1b6ad 100644 (file)
@@ -1,3 +1,12 @@
+2001-07-03  Mark Elbrecht  <snowball3@softhome.net>
+
+       * cofflink.c (_bfd_coff_link_input_bfd): Skip section symbols from
+       sections being discarded.
+
+2001-07-03  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * cofflink.c (_bfd_coff_link_input_bfd): 
+
 2001-06-30  Alan Modra  <amodra@bigpond.net.au>
 
        * elfcore.h (elf_core_file_p): Call bfd_section_from_phdr directly
index 96b005bc89ada7aa9d5f7d1604c06b55ec1db745..47716ac2eaea8b0fcbacd6fb42568d57b8a98a02 100644 (file)
@@ -1501,6 +1501,21 @@ _bfd_coff_link_input_bfd (finfo, input_bfd)
            }
        }
 
+#ifndef COFF_WITH_PE
+      /* Skip section symbols for sections which are not going to be
+        emitted, or which belong to linkonce sections that are going
+        to be discarded.  */
+      if (!skip
+         && isym.n_sclass == C_STAT
+         && isym.n_type == T_NULL
+          && isym.n_numaux > 0)
+        {
+          if ((*secpp)->output_section == bfd_abs_section_ptr
+              || (*secpp)->kept_section)
+            skip = true;
+        }
+#endif
+
       /* If we stripping debugging symbols, and this is a debugging
          symbol, then skip it.  FIXME: gas sets the section to N_ABS
          for some types of debugging symbols; I don't know if this is