Treat sections that are part of a group as a unit in GC. This effectively makes ELF section groups behave as associative comdats in COFF.
The current implementation uses section groups for selection (i.e. discard duplicate definitions), but then ignores them in GC, potentially discarding parts of a section group.
- The new implementation matches the BFD linker behavior, while the current implementation matches Gold.
This is also necessary for proper GC of globals in AddressSanitizer. To give some context, ASan emits a "metadata global" for each application global, and needs to iterate over them at runtime. Metadata globals should not affect the liveness of original globals, and they need to be preserved if and only if the corresponding global is preserved.
Revert these cosmetic changes.