From 27c630ba7ac51b2fb7e3fc346e5187dc71bbeddb Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Sat, 4 Oct 2003 10:19:26 +0000 Subject: [PATCH] Set SEC_EXCLUDE flag on sections which become empty after merging. --- bfd/ChangeLog | 5 +++++ bfd/merge.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4a04e9dcfc2..5a18c43e577 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2003-10-04 Bryce McKinlay + + * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections + which become empty after merging. + 2003-09-30 Jakub Jelinek * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB, diff --git a/bfd/merge.c b/bfd/merge.c index aa8b334cf1b..0371bd0f4a0 100644 --- a/bfd/merge.c +++ b/bfd/merge.c @@ -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; -- 2.30.2