mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 02:44:48 +03:00
temporary
This commit is contained in:
parent
1f1c217d63
commit
6c3aacdf1a
3
main.cc
3
main.cc
@ -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
1
mold.h
@ -225,6 +225,7 @@ public:
|
||||
|
||||
StringRef name;
|
||||
uint64_t fileoff;
|
||||
bool page_align = false;
|
||||
ELF64LE::Shdr shdr = {};
|
||||
};
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user