forked from OSchip/llvm-project
parent
cde251370a
commit
25f51850a4
|
@ -37,10 +37,8 @@ public:
|
|||
virtual void writeTo(uint8_t *Buf) = 0;
|
||||
|
||||
// The writer sets and uses the addresses.
|
||||
uint64_t getVA() { return VA; }
|
||||
uint64_t getFileOff() { return FileOff; }
|
||||
uint32_t getAlign() { return Align; }
|
||||
void setVA(uint64_t V) { VA = V; }
|
||||
void setFileOff(uint64_t V) { FileOff = V; }
|
||||
|
||||
// Returns the section name if this is a section chunk.
|
||||
|
@ -48,9 +46,6 @@ public:
|
|||
virtual StringRef getSectionName() const = 0;
|
||||
|
||||
protected:
|
||||
// The VA of this chunk in the output. The writer sets a value.
|
||||
uint64_t VA = 0;
|
||||
|
||||
// The offset from beginning of the output file. The writer sets a value.
|
||||
uint64_t FileOff = 0;
|
||||
|
||||
|
|
|
@ -114,8 +114,6 @@ template <class ELFT> void Writer<ELFT>::run() {
|
|||
|
||||
template <class ELFT> void OutputSection<ELFT>::setVA(uintX_t VA) {
|
||||
Header.sh_addr = VA;
|
||||
for (Chunk *C : Chunks)
|
||||
C->setVA(C->getVA() + VA);
|
||||
}
|
||||
|
||||
template <class ELFT> void OutputSection<ELFT>::setFileOffset(uintX_t Off) {
|
||||
|
@ -131,7 +129,6 @@ void OutputSection<ELFT>::addSectionChunk(SectionChunk<ELFT> *C) {
|
|||
Chunks.push_back(C);
|
||||
uintX_t Off = Header.sh_size;
|
||||
Off = RoundUpToAlignment(Off, C->getAlign());
|
||||
C->setVA(Off);
|
||||
C->setFileOff(Off);
|
||||
Off += C->getSize();
|
||||
Header.sh_size = Off;
|
||||
|
|
Loading…
Reference in New Issue