It is based on discussions in "[llvm-dev] [RFC] - Deduplication of debug information in linkers (LLD)." thread.
DWARF5 specification (http://dwarfstd.org/doc/DWARF5.pdf) mentions it can be one or more of debug sections.
For example:
- p366 says objects may have multiple .debug_abrev, .debug_info, .debug_line sections for DWARF elimination.
- p376 says multiple .debug_info section could be used for deduplication of type units.
It is unclear that we will want to support the optimizations above and in both cases LLD would work incorrectly now
(as we do not expect multiple of above sections) for cases when we are trying to work with DWARF sections.
It is error reporting case and --gdb-index generation case.
So for both safety and simplicity of implementation I suggest to error out when LLDDwarfObj meets object with
any multiple debug sections with the same name.