[lld] r300675 - Rename CompressedHeader ZDebugHeader.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 19 04:32:13 PDT 2017
Author: ruiu
Date: Wed Apr 19 06:32:13 2017
New Revision: 300675
URL: http://llvm.org/viewvc/llvm-project?rev=300675&view=rev
Log:
Rename CompressedHeader ZDebugHeader.
`CompressedHeader` is a header for compressed data, and the header
itself is not compressed. So the previous name was confusing.
Modified:
lld/trunk/ELF/OutputSections.cpp
lld/trunk/ELF/OutputSections.h
Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=300675&r1=300674&r2=300675&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Apr 19 06:32:13 2017
@@ -94,8 +94,8 @@ template <class ELFT> void OutputSection
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
// 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;
}
Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=300675&r1=300674&r2=300675&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Wed Apr 19 06:32:13 2017
@@ -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;
More information about the llvm-commits
mailing list