This fixes a bug as exposed by D77807.
Add tests for {--emit-relocs,-r} x {--discard-locals,--discard-all}. They add coverage for previously undertested cases:
- STT_SECTION associated to GCed sections (gc)
- STT_SECTION associated to retained sections (text)
- STT_SECTION associated to non-SHF_ALLOC sections (.comment)
- STB_LOCAL in GCed sections (unused_gc)
You may use config->copyRelocs, it is the same.