mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Remove uses of MCSectionData from ELFObjectWriter. NFC.
llvm-svn: 238317
This commit is contained in:
parent
2ada7efad8
commit
687afbf70a
@ -231,7 +231,7 @@ class ELFObjectWriter : public MCObjectWriter {
|
|||||||
const SectionIndexMapTy &SectionIndexMap,
|
const SectionIndexMapTy &SectionIndexMap,
|
||||||
const SectionOffsetsTy &SectionOffsets);
|
const SectionOffsetsTy &SectionOffsets);
|
||||||
|
|
||||||
void writeSectionData(const MCAssembler &Asm, const MCSectionData &SD,
|
void writeSectionData(const MCAssembler &Asm, MCSection &Sec,
|
||||||
const MCAsmLayout &Layout);
|
const MCAsmLayout &Layout);
|
||||||
|
|
||||||
void WriteSecHdrEntry(uint32_t Name, uint32_t Type, uint64_t Flags,
|
void WriteSecHdrEntry(uint32_t Name, uint32_t Type, uint64_t Flags,
|
||||||
@ -1139,10 +1139,9 @@ prependCompressionHeader(uint64_t Size,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ELFObjectWriter::writeSectionData(const MCAssembler &Asm,
|
void ELFObjectWriter::writeSectionData(const MCAssembler &Asm, MCSection &Sec,
|
||||||
const MCSectionData &SD,
|
|
||||||
const MCAsmLayout &Layout) {
|
const MCAsmLayout &Layout) {
|
||||||
MCSectionELF &Section = static_cast<MCSectionELF &>(SD.getSection());
|
MCSectionELF &Section = static_cast<MCSectionELF &>(Sec);
|
||||||
StringRef SectionName = Section.getSectionName();
|
StringRef SectionName = Section.getSectionName();
|
||||||
|
|
||||||
// Compressing debug_frame requires handling alignment fragments which is
|
// Compressing debug_frame requires handling alignment fragments which is
|
||||||
@ -1155,7 +1154,7 @@ void ELFObjectWriter::writeSectionData(const MCAssembler &Asm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gather the uncompressed data from all the fragments.
|
// Gather the uncompressed data from all the fragments.
|
||||||
const MCSectionData::FragmentListType &Fragments = SD.getFragmentList();
|
const MCSectionData::FragmentListType &Fragments = Section.getFragmentList();
|
||||||
SmallVector<char, 128> UncompressedData =
|
SmallVector<char, 128> UncompressedData =
|
||||||
getUncompressedData(Layout, Fragments);
|
getUncompressedData(Layout, Fragments);
|
||||||
|
|
||||||
@ -1343,9 +1342,8 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
SectionOffsetsTy SectionOffsets;
|
SectionOffsetsTy SectionOffsets;
|
||||||
std::vector<MCSectionELF *> Groups;
|
std::vector<MCSectionELF *> Groups;
|
||||||
std::vector<MCSectionELF *> Relocations;
|
std::vector<MCSectionELF *> Relocations;
|
||||||
for (const MCSection &Sec : Asm) {
|
for (MCSection &Sec : Asm) {
|
||||||
const MCSectionELF &Section = static_cast<const MCSectionELF &>(Sec);
|
MCSectionELF &Section = static_cast<MCSectionELF &>(Sec);
|
||||||
const MCSectionData &SD = Section.getSectionData();
|
|
||||||
|
|
||||||
uint64_t Padding = OffsetToAlignment(OS.tell(), Section.getAlignment());
|
uint64_t Padding = OffsetToAlignment(OS.tell(), Section.getAlignment());
|
||||||
WriteZeros(Padding);
|
WriteZeros(Padding);
|
||||||
@ -1354,7 +1352,7 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm,
|
|||||||
uint64_t SecStart = OS.tell();
|
uint64_t SecStart = OS.tell();
|
||||||
|
|
||||||
const MCSymbol *SignatureSymbol = Section.getGroup();
|
const MCSymbol *SignatureSymbol = Section.getGroup();
|
||||||
writeSectionData(Asm, SD, Layout);
|
writeSectionData(Asm, Section, Layout);
|
||||||
|
|
||||||
uint64_t SecEnd = OS.tell();
|
uint64_t SecEnd = OS.tell();
|
||||||
SectionOffsets[&Section] = std::make_pair(SecStart, SecEnd);
|
SectionOffsets[&Section] = std::make_pair(SecStart, SecEnd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user