Add support for allowing us to create uniquely identified "COMDAT" or "ELF
Group" sections while lowering. In particular, for ELF sections this is useful for creating function-specific groups that get merged into the same named section. Also use const Twine& instead of StringRef for the getELF functions while we're here. Differential Revision: http://reviews.llvm.org/D21743 llvm-svn: 274336
This commit is contained in:
@@ -69,11 +69,9 @@ void TargetLoweringObjectFileELF::emitPersonalityValue(
|
||||
cast<MCSymbolELF>(getContext().getOrCreateSymbol(NameData));
|
||||
Streamer.EmitSymbolAttribute(Label, MCSA_Hidden);
|
||||
Streamer.EmitSymbolAttribute(Label, MCSA_Weak);
|
||||
StringRef Prefix = ".data.";
|
||||
NameData.insert(NameData.begin(), Prefix.begin(), Prefix.end());
|
||||
unsigned Flags = ELF::SHF_ALLOC | ELF::SHF_WRITE | ELF::SHF_GROUP;
|
||||
MCSection *Sec = getContext().getELFSection(NameData, ELF::SHT_PROGBITS,
|
||||
Flags, 0, Label->getName());
|
||||
MCSection *Sec = getContext().getELFNamedSection(".data", Label->getName(),
|
||||
ELF::SHT_PROGBITS, Flags, 0);
|
||||
unsigned Size = DL.getPointerSize();
|
||||
Streamer.SwitchSection(Sec);
|
||||
Streamer.EmitValueToAlignment(DL.getPointerABIAlignment());
|
||||
|
||||
Reference in New Issue
Block a user