[ELF] Add .gnu.linkonce support.
authorShankar Easwaran <shankare@codeaurora.org>
Mon, 23 Feb 2015 00:04:49 +0000 (00:04 +0000)
committerShankar Easwaran <shankare@codeaurora.org>
Mon, 23 Feb 2015 00:04:49 +0000 (00:04 +0000)
commitde4a31909f32c1ccc07e03943476c6c7be583f9a
tree55ee9b34e116156b7074306ff533e39ac9b343fa
parent8d22abdd59b1bf7cc3e7a45891f7a96dca0c18d6
[ELF] Add .gnu.linkonce support.

When the GNU linker sees two input sections with the same name, and the name
starts with ".gnu.linkonce.", the linker will only keep one copy and discard the
other. Any section whose name starts with “.gnu.linkonce.” is a COMDAT section.

Some architectures like Hexagon use this section to store floating point constants,
that need be deduped.

This patch adds gnu.linkonce functionality to the ELFReader.

llvm-svn: 230194
lld/lib/ReaderWriter/ELF/Atoms.h
lld/lib/ReaderWriter/ELF/ELFFile.h
lld/lib/ReaderWriter/ELF/SectionChunks.h
lld/lib/ReaderWriter/ELF/TODO.txt
lld/test/elf/gnulinkonce/gnulinkonce-report-discarded-reference.test [new file with mode: 0644]
lld/test/elf/gnulinkonce/gnulinkonce-report-undef.test [new file with mode: 0644]
lld/test/elf/gnulinkonce/gnulinkonce.test [new file with mode: 0644]