[ELF] Add section group/COMDAT support.
authorShankar Easwaran <shankare@codeaurora.org>
Mon, 23 Feb 2015 00:30:00 +0000 (00:30 +0000)
committerShankar Easwaran <shankare@codeaurora.org>
Mon, 23 Feb 2015 00:30:00 +0000 (00:30 +0000)
commit9e07346679663cfa971ee1b6ed2ab6adcd919541
treed1208f3d20c68609234b2af10403468705d7ba30
parentde4a31909f32c1ccc07e03943476c6c7be583f9a
[ELF] Add section group/COMDAT support.

SHF_GROUP: Group Member Sections
----------------------------------
A section which is part of a group, and is to be retained or discarded with the
group as a whole, is identified by a new section header attribute: SHF_GROUP
This section is a member (perhaps the only one) of a group of sections, and the
linker should retain or discard all or none of the members. This section must be
referenced in a SHT_GROUP section. This attribute flag may be set in any section
header, and no other modification or indication is made in the grouped sections.
All additional information is contained in the associated SHT_GROUP section.

SHT_GROUP: Section Group Definition
-------------------------------------
Represents a group section.

The section group's sh_link field identifies a symbol table section, and its
sh_info field the index of a symbol in that section. The name of that symbol is
treated as the identifier of the section group.

More information: https://mentorembedded.github.io/cxx-abi/abi/prop-72-comdat.html

Added a lot of extensive tests, that tests functionality.

llvm-svn: 230195
15 files changed:
lld/lib/ReaderWriter/ELF/Atoms.h
lld/lib/ReaderWriter/ELF/DefaultLayout.h
lld/lib/ReaderWriter/ELF/ELFFile.h
lld/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
lld/lib/ReaderWriter/ELF/Layout.h
lld/lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
lld/lib/ReaderWriter/ELF/OutputELFWriter.h
lld/lib/ReaderWriter/ELF/SectionChunks.h
lld/test/elf/sectionGroups/sectiongroup-new-members.test [new file with mode: 0644]
lld/test/elf/sectionGroups/sectiongroup-simple.test [new file with mode: 0644]
lld/test/elf/sectionGroups/sectiongroup-undef-member-other.test [new file with mode: 0644]
lld/test/elf/sectionGroups/sectiongroup-undef-member.test [new file with mode: 0644]
lld/test/elf/sectionGroups/sectiongroup-with-globalsymbols.test [new file with mode: 0644]
lld/test/elf/sectionGroups/sectiongroup-with-undef-external-reference.test [new file with mode: 0644]
lld/test/elf/sectionGroups/sectiongroup-with-undef-signature.test [new file with mode: 0644]