mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
Set ELF header's p_paddr
On Unix, p_paddr values (segment physical addresss) don't matter, but GNU linkers set them to the same value as p_vaddr. We should set the same values for compatibility with programs that make the wrong assumption.
This commit is contained in:
parent
b0b2406d84
commit
507ee38975
@ -120,6 +120,7 @@ std::vector<ElfPhdr<E>> create_phdr(Context<E> &ctx) {
|
||||
phdr.p_filesz =
|
||||
(chunk->shdr.sh_type == SHT_NOBITS) ? 0 : chunk->shdr.sh_size;
|
||||
phdr.p_vaddr = chunk->shdr.sh_addr;
|
||||
phdr.p_paddr = chunk->shdr.sh_addr;
|
||||
phdr.p_memsz = chunk->shdr.sh_size;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user