mirror of
git://repo.or.cz/tinycc.git
synced 2026-06-17 15:44:18 +08:00
elf: Set ph sizes only if ph was allocated
This commit is contained in:
parent
78e5e690a2
commit
7479a5c21a
6
tccelf.c
6
tccelf.c
@ -2419,8 +2419,10 @@ static int layout_sections(TCCState *s1, int *sec_order, struct dyn_inf *d)
|
||||
if (s->sh_type != SHT_NOBITS)
|
||||
file_offset += s->sh_size;
|
||||
|
||||
ph->p_filesz = file_offset - ph->p_offset;
|
||||
ph->p_memsz = addr - ph->p_vaddr;
|
||||
if (ph) {
|
||||
ph->p_filesz = file_offset - ph->p_offset;
|
||||
ph->p_memsz = addr - ph->p_vaddr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fill other headers */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user