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