It turns out our code that handles unused synthetic sections is
a bit overcomplicated.
I think we set output section Live bit too early and do things in
removeUnusedSyntheticSections that we can skip.
I suggest to set Live bit of output section early only if it is
known that it is live. Then we can update this flag after we get
final information about synthetic section status (empty/non-empty).
For input sections that are empty we could just disable them,
setting their Live flag to false.
Approach I am suggesting is implemented in this patch.