This is a rework of r210240 to do it in the right way. Previously
it depended on dead-stripping pass to remove unneeded atoms, so
if the pass is not enabled it wouldn't work. This patch does not
depends on dead-stripping pass.
Background:
COFF supports a feature similar to ELF's section groups. This
patch implements it.
In ELF, section groups are identified by their names, and they are
treated somewhat differently from regular symbols. In COFF, the
feature is realized in a more straightforward way. A section can
have an annotation saying "if Nth section is linked, link this
section too." The annotation type is SELECT_ASSOCIATE.
Design:
A new method associate() is added to DefinedAtom. The new method
is supposed to return a list of atoms with SELECT_ASSOCIATE. The
Resolver adds live atom's associates() return values to the live
atom list. By default, assocaites() returns an empty list, so the
default behavior is the same as before.
Caveats:
The reason why I added a new member function associate() to
DefinedAtom, rather than adding a new reference type is mainly
performance. In order to collect all references of some type,
we have to scan all references of all atoms, which is more
costly than calling a member function on all atoms.