diff options
author | Tim Northover <tnorthover@apple.com> | 2013-07-10 20:58:17 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-07-10 20:58:17 +0000 |
commit | a630fb0b67fc4a877ad319a311e9d1fa03e51f91 (patch) | |
tree | 26413d09501dea39fa46ac6cb94e19e826e134aa /llvm/lib/MC/ELFObjectWriter.cpp | |
parent | fb6ab540008a418aaadd929ae0e5a6e41c80d324 (diff) | |
download | bcm5719-llvm-a630fb0b67fc4a877ad319a311e9d1fa03e51f91.tar.gz bcm5719-llvm-a630fb0b67fc4a877ad319a311e9d1fa03e51f91.zip |
Put ELF COMDAT relocations into the relevant COMDAT group.
Patch from Игорь Пашев (I do hope we support utf-8 commit messages; I
also hope he'll forgive me for transliterating it as Igor Pashev in
case things go horribly wrong).
llvm-svn: 186034
Diffstat (limited to 'llvm/lib/MC/ELFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/ELFObjectWriter.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 4f66156f6de..2db59acd504 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -1002,11 +1002,18 @@ void ELFObjectWriter::CreateRelocationSections(MCAssembler &Asm, else EntrySize = is64Bit() ? sizeof(ELF::Elf64_Rel) : sizeof(ELF::Elf32_Rel); + unsigned Flags = 0; + StringRef Group = ""; + if (Section.getFlags() & ELF::SHF_GROUP) { + Flags = ELF::SHF_GROUP; + Group = Section.getGroup()->getName(); + } + const MCSectionELF *RelaSection = Ctx.getELFSection(RelaSectionName, hasRelocationAddend() ? - ELF::SHT_RELA : ELF::SHT_REL, 0, + ELF::SHT_RELA : ELF::SHT_REL, Flags, SectionKind::getReadOnly(), - EntrySize, ""); + EntrySize, Group); RelMap[&Section] = RelaSection; Asm.getOrCreateSectionData(*RelaSection); } |