mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
[yaml2elf] - Replace a loop with write_zeros(). NFC.
And apply clang-format to the method changed. llvm-svn: 359090
This commit is contained in:
parent
9aa6f61f53
commit
8af01e13a9
@ -503,17 +503,16 @@ void ELFState<ELFT>::addSymbols(ArrayRef<ELFYAML::Symbol> Symbols,
|
||||
}
|
||||
|
||||
template <class ELFT>
|
||||
void
|
||||
ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
|
||||
const ELFYAML::RawContentSection &Section,
|
||||
ContiguousBlobAccumulator &CBA) {
|
||||
void ELFState<ELFT>::writeSectionContent(
|
||||
Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section,
|
||||
ContiguousBlobAccumulator &CBA) {
|
||||
assert(Section.Size >= Section.Content.binary_size() &&
|
||||
"Section size and section content are inconsistent");
|
||||
raw_ostream &OS =
|
||||
CBA.getOSAndAlignedOffset(SHeader.sh_offset, SHeader.sh_addralign);
|
||||
Section.Content.writeAsBinary(OS);
|
||||
for (auto i = Section.Content.binary_size(); i < Section.Size; ++i)
|
||||
OS.write(0);
|
||||
OS.write_zeros(Section.Size - Section.Content.binary_size());
|
||||
|
||||
if (Section.EntSize)
|
||||
SHeader.sh_entsize = *Section.EntSize;
|
||||
else if (Section.Type == llvm::ELF::SHT_RELR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user