forked from OSchip/llvm-project
Rename CompressedHeader ZDebugHeader.
`CompressedHeader` is a header for compressed data, and the header itself is not compressed. So the previous name was confusing. llvm-svn: 300675
This commit is contained in:
parent
066c4ab9fe
commit
07c62c1174
|
@ -94,8 +94,8 @@ template <class ELFT> void OutputSection::maybeCompress() {
|
|||
return;
|
||||
|
||||
// Create a section header.
|
||||
CompressedHeader.resize(sizeof(Elf_Chdr));
|
||||
auto *Hdr = reinterpret_cast<Elf_Chdr *>(CompressedHeader.data());
|
||||
ZDebugHeader.resize(sizeof(Elf_Chdr));
|
||||
auto *Hdr = reinterpret_cast<Elf_Chdr *>(ZDebugHeader.data());
|
||||
Hdr->ch_type = ELFCOMPRESS_ZLIB;
|
||||
Hdr->ch_size = Size;
|
||||
Hdr->ch_addralign = Alignment;
|
||||
|
@ -276,9 +276,9 @@ template <class ELFT> void OutputSection::writeTo(uint8_t *Buf) {
|
|||
// We may have already rendered compressed content when using
|
||||
// -compress-debug-sections option. Write it together with header.
|
||||
if (!CompressedData.empty()) {
|
||||
memcpy(Buf, CompressedHeader.data(), CompressedHeader.size());
|
||||
Buf += CompressedHeader.size();
|
||||
memcpy(Buf, CompressedData.data(), CompressedData.size());
|
||||
memcpy(Buf, ZDebugHeader.data(), ZDebugHeader.size());
|
||||
memcpy(Buf + ZDebugHeader.size(), CompressedData.data(),
|
||||
CompressedData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -89,8 +89,8 @@ public:
|
|||
std::vector<InputSection *> Sections;
|
||||
|
||||
// Used for implementation of --compress-debug-sections option.
|
||||
std::vector<uint8_t> ZDebugHeader;
|
||||
llvm::SmallVector<char, 1> CompressedData;
|
||||
std::vector<uint8_t> CompressedHeader;
|
||||
|
||||
// Location in the output buffer.
|
||||
uint8_t *Loc = nullptr;
|
||||
|
|
Loading…
Reference in New Issue