This puts us at parity with bfd, which could already gc this case.
I noticed the sections not being gced when linking a modified freebsd kernel. A section that was not gced and not mentioned in the linker script would end up breaking the expected layout. Since fixing the gc is relatively simple and an improvement, that seems better than trying to hack the orphan placement code.
There are 173 input section in the entire link whose names are valid C identifiers, so a std::vector is probably better than a multimap.
Can you .reset() this at beginning of markLive() so that markLive is safe to run more than once.
Maybe DenseSet instead of a vector? It is a set of strings, so a set seems more natural.