aboutsummaryrefslogtreecommitdiff
path: root/bfd/merge.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-10-04 10:19:26 +0000
committerNick Clifton <nickc@redhat.com>2003-10-04 10:19:26 +0000
commit27c630ba7ac51b2fb7e3fc346e5187dc71bbeddb (patch)
tree55126218f8900c53e99810b9ff54e14ea1c0bd64 /bfd/merge.c
parent78be41558181ebed1b03f4e5b766ad7fe73a857c (diff)
downloadgdb-27c630ba7ac51b2fb7e3fc346e5187dc71bbeddb.zip
gdb-27c630ba7ac51b2fb7e3fc346e5187dc71bbeddb.tar.gz
gdb-27c630ba7ac51b2fb7e3fc346e5187dc71bbeddb.tar.bz2
Set SEC_EXCLUDE flag on sections which become empty after merging.
Diffstat (limited to 'bfd/merge.c')
-rw-r--r--bfd/merge.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/merge.c b/bfd/merge.c
index aa8b334..0371bd0 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;