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 | f5b1c5043de4d485ff17d8b2aad709c63a5a9ff3 (patch) | |
tree | 024aea140d04106e1a9d725fdb1a6d2bb2ac15dd /lib | |
parent | 75d13065fda4b470f272311520f5dfe6c11460ce (diff) | |
download | external_llvm-f5b1c5043de4d485ff17d8b2aad709c63a5a9ff3.zip external_llvm-f5b1c5043de4d485ff17d8b2aad709c63a5a9ff3.tar.gz external_llvm-f5b1c5043de4d485ff17d8b2aad709c63a5a9ff3.tar.bz2 |
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MC/ELFObjectWriter.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 4f66156..2db59ac 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/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); } |