1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 02:44:48 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-10-25 15:26:36 +09:00
parent 9ca7e0e774
commit 551b52df9e
3 changed files with 5 additions and 10 deletions

View File

@ -14,7 +14,6 @@ InputSection::InputSection(ObjectFile *file, const ELF64LE::Shdr &shdr, StringRe
error(toString(file) + ": section sh_addralign is too large");
if (__builtin_popcount(align) != 1)
error(toString(file) + ": section sh_addralign is not a power of two");
this->alignment = align;
}
uint64_t InputSection::get_size() const {

View File

@ -252,7 +252,7 @@ int main(int argc, char **argv) {
continue;
OutputSection *osec = isec->output_section;
osec->shdr.sh_addralign =
std::max<uint32_t>(osec->shdr.sh_addralign, isec->alignment);
std::max<uint32_t>(osec->shdr.sh_addralign, isec->shdr.sh_addralign);
osec->chunks.push_back(isec);
}
}
@ -321,7 +321,6 @@ int main(int argc, char **argv) {
}
}
#if 0
{
MyTimer t("vaddr", before_copy);
uint64_t vaddr = 0x200000;
@ -332,11 +331,10 @@ int main(int argc, char **argv) {
vaddr += chunk->get_fileoff() % PAGE_SIZE;
}
chunk->vaddr = vaddr;
vaddr += chunk->shdr.sh_size;
chunk->set_vaddr(vaddr);
vaddr += chunk->get_memsz();
}
}
#endif
// Fill section header.
fill_shdrs(output_chunks);

6
mold.h
View File

@ -203,10 +203,7 @@ public:
StringRef name;
uint64_t addr;
int64_t offset = -1;
uint64_t flags;
uint32_t type;
uint32_t alignment = 1;
uint64_t offset;
};
std::string toString(InputSection *isec);
@ -234,6 +231,7 @@ public:
uint64_t get_vaddr() const { return shdr.sh_addr; }
virtual uint64_t get_filesz() const = 0;
uint64_t get_memsz() { return shdr.sh_size; }
StringRef name;
uint64_t vaddr;