mirror of
https://github.com/rui314/mold.git
synced 2024-09-17 16:09:43 +03:00
Feat: use accumulate address on sections with SHT_ALLOC
This commit is contained in:
parent
25351379ab
commit
8c99dd0f2c
@ -2457,6 +2457,8 @@ static i64 set_file_offsets(Context<E> &ctx) {
|
||||
}
|
||||
|
||||
if (first.shdr.sh_type == SHT_NOBITS) {
|
||||
fileoff = align_to(fileoff, first.shdr.sh_addralign);
|
||||
first.shdr.sh_offset = fileoff;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
@ -2497,8 +2499,11 @@ static i64 set_file_offsets(Context<E> &ctx) {
|
||||
|
||||
while (i < chunks.size() &&
|
||||
(chunks[i]->shdr.sh_flags & SHF_ALLOC) &&
|
||||
chunks[i]->shdr.sh_type == SHT_NOBITS)
|
||||
chunks[i]->shdr.sh_type == SHT_NOBITS) {
|
||||
fileoff = align_to(fileoff, chunks[i]->shdr.sh_addralign);
|
||||
chunks[i]->shdr.sh_offset = fileoff;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
return fileoff;
|
||||
|
Loading…
Reference in New Issue
Block a user