Set SEC_EXCLUDE flag on sections which become empty after merging.

This commit is contained in:
Nick Clifton 2003-10-04 10:19:26 +00:00
parent 78be415581
commit 27c630ba7a
2 changed files with 10 additions and 2 deletions

View 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> 2003-09-30 Jakub Jelinek <jakub@redhat.com>
* elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB, * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB,

View file

@ -787,11 +787,14 @@ _bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, void *xsinfo,
secinfo->sec->_cooked_size = size; 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. */ the hash table at all. */
for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next)
if (secinfo->first == NULL) if (secinfo->first == NULL)
{
secinfo->sec->_cooked_size = 0; secinfo->sec->_cooked_size = 0;
secinfo->sec->flags |= SEC_EXCLUDE;
}
} }
return TRUE; return TRUE;