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 14:26:14 +09:00
parent 1f1c217d63
commit 6c3aacdf1a
3 changed files with 4 additions and 2 deletions

View File

@ -313,7 +313,8 @@ int main(int argc, char **argv) {
{
MyTimer t("file_offset", before_copy);
for (OutputChunk *chunk : output_chunks) {
filesize = align_to(filesize, chunk->shdr.sh_addralign);
uint32_t align = chunk->page_align ? PAGE_SIZE : chunk->shdr.sh_addralign;
filesize = align_to(filesize, align);
chunk->set_fileoff(filesize);
filesize += chunk->get_size();
}

1
mold.h
View File

@ -225,6 +225,7 @@ public:
StringRef name;
uint64_t fileoff;
bool page_align = false;
ELF64LE::Shdr shdr = {};
};

View File

@ -89,7 +89,7 @@ void OutputPhdr::construct(std::vector<OutputChunk *> &chunks) {
}
for (Phdr &ent : entries)
ent.members.front()->shdr.sh_addralign = PAGE_SIZE;
ent.members.front()->page_align = true;
}
void OutputPhdr::copy_to(uint8_t *buf) {