mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-04 18:24:38 +00:00
MC: Support multiple sections with the same name in the same comdat group
Code review by Eric Christopher and Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193209 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1298,10 +1298,12 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm,
|
||||
// Remove ".rel" and ".rela" prefixes.
|
||||
unsigned SecNameLen = (Section.getType() == ELF::SHT_REL) ? 4 : 5;
|
||||
StringRef SectionName = Section.getSectionName().substr(SecNameLen);
|
||||
StringRef GroupName =
|
||||
Section.getGroup() ? Section.getGroup()->getName() : "";
|
||||
|
||||
InfoSection = Asm.getContext().getELFSection(SectionName,
|
||||
ELF::SHT_PROGBITS, 0,
|
||||
SectionKind::getReadOnly());
|
||||
InfoSection = Asm.getContext().getELFSection(SectionName, ELF::SHT_PROGBITS,
|
||||
0, SectionKind::getReadOnly(),
|
||||
0, GroupName);
|
||||
sh_info = SectionIndexMap.lookup(InfoSection);
|
||||
break;
|
||||
}
|
||||
@ -1351,11 +1353,12 @@ void ELFObjectWriter::WriteSection(MCAssembler &Asm,
|
||||
ELF::SHF_EXECINSTR | ELF::SHF_ALLOC,
|
||||
SectionKind::getText()));
|
||||
} else if (SecName.startswith(".ARM.exidx")) {
|
||||
sh_link = SectionIndexMap.lookup(
|
||||
Asm.getContext().getELFSection(SecName.substr(sizeof(".ARM.exidx") - 1),
|
||||
ELF::SHT_PROGBITS,
|
||||
ELF::SHF_EXECINSTR | ELF::SHF_ALLOC,
|
||||
SectionKind::getText()));
|
||||
StringRef GroupName =
|
||||
Section.getGroup() ? Section.getGroup()->getName() : "";
|
||||
sh_link = SectionIndexMap.lookup(Asm.getContext().getELFSection(
|
||||
SecName.substr(sizeof(".ARM.exidx") - 1), ELF::SHT_PROGBITS,
|
||||
ELF::SHF_EXECINSTR | ELF::SHF_ALLOC, SectionKind::getText(), 0,
|
||||
GroupName));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user