Set SEC_EXCLUDE flag on sections which become empty after merging.
authorNick Clifton <nickc@redhat.com>
Sat, 4 Oct 2003 10:19:26 +0000 (10:19 +0000)
committerNick Clifton <nickc@redhat.com>
Sat, 4 Oct 2003 10:19:26 +0000 (10:19 +0000)
bfd/ChangeLog
bfd/merge.c

index 4a04e9dcfc22d5457ba8d716b7c258cea63955f3..5a18c43e57784fed31733703b376b3c6740b88dd 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-04  Bryce McKinlay  <bryce@mckinlay.net.nz>
+
+       * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections
+       which become empty after merging.
+
 2003-09-30  Jakub Jelinek  <jakub@redhat.com>
 
        * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB,
index aa8b334cf1b00d9cf490ac4682743ab3a33134d4..0371bd0f4a0014030c4e0038d542b8a4c9589736 100644 (file)
@@ -787,11 +787,14 @@ _bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, void *xsinfo,
          secinfo->sec->_cooked_size = size;
        }
 
-       /* Finally shrink all input sections which have not made it into
+       /* Finally remove all input sections which have not made it into
           the hash table at all.  */
        for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
          if (secinfo->first == NULL)
-           secinfo->sec->_cooked_size = 0;
+           {
+             secinfo->sec->_cooked_size = 0;
+             secinfo->sec->flags |= SEC_EXCLUDE;
+           }
     }
 
   return TRUE;