[lld] r244694 - Be a bit more consistent about using uintX_t for offsets and sizes. NFC.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 11 16:14:13 PDT 2015
Author: rafael
Date: Tue Aug 11 18:14:13 2015
New Revision: 244694
URL: http://llvm.org/viewvc/llvm-project?rev=244694&view=rev
Log:
Be a bit more consistent about using uintX_t for offsets and sizes. NFC.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=244694&r1=244693&r2=244694&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Aug 11 18:14:13 2015
@@ -44,8 +44,8 @@ private:
llvm::SpecificBumpPtrAllocator<OutputSection> CAlloc;
std::vector<OutputSection *> OutputSections;
- uint64_t FileSize;
- uint64_t SizeOfHeaders;
+ uintX_t FileSize;
+ uintX_t SizeOfHeaders;
uintX_t SectionHeaderOff;
std::vector<std::unique_ptr<Chunk>> Chunks;
@@ -116,9 +116,11 @@ void OutputSection::setFileOffset(uint64
template <class ELFT>
void OutputSection::addSectionChunk(SectionChunk<ELFT> *C) {
+ typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
+
Chunks.push_back(C);
C->setOutputSection(this);
- uint64_t Off = Header.sh_size;
+ uintX_t Off = Header.sh_size;
Off = RoundUpToAlignment(Off, C->getAlign());
C->setVA(Off);
C->setFileOff(Off);
@@ -162,8 +164,8 @@ template <class ELFT> void Writer<ELFT>:
// file offsets.
template <class ELFT> void Writer<ELFT>::assignAddresses() {
SizeOfHeaders = RoundUpToAlignment(sizeof(Elf_Ehdr_Impl<ELFT>), PageSize);
- uint64_t VA = 0x1000; // The first page is kept unmapped.
- uint64_t FileOff = SizeOfHeaders;
+ uintX_t VA = 0x1000; // The first page is kept unmapped.
+ uintX_t FileOff = SizeOfHeaders;
for (OutputSection *Sec : OutputSections) {
Sec->setVA(VA);
Sec->setFileOffset(FileOff);
More information about the llvm-commits
mailing list