diff --git a/sched/misc/coredump.c b/sched/misc/coredump.c index cc1d2ddcac..b90efd7661 100644 --- a/sched/misc/coredump.c +++ b/sched/misc/coredump.c @@ -554,7 +554,6 @@ static void elf_emit_tcb_phdr(FAR struct elf_dumpinfo_s *cinfo, phdr->p_paddr = phdr->p_vaddr; phdr->p_memsz = phdr->p_filesz; phdr->p_flags = PF_X | PF_W | PF_R; - phdr->p_align = ELF_PAGESIZE; *offset += ROUNDUP(phdr->p_memsz, ELF_PAGESIZE); elf_emit(cinfo, phdr, sizeof(*phdr)); @@ -585,6 +584,7 @@ static void elf_emit_phdr(FAR struct elf_dumpinfo_s *cinfo, elf_emit(cinfo, &phdr, sizeof(phdr)); + phdr.p_align = ELF_PAGESIZE; if (cinfo->pid == INVALID_PROCESS_ID) { for (i = 0; i < g_npidhash; i++) @@ -612,7 +612,6 @@ static void elf_emit_phdr(FAR struct elf_dumpinfo_s *cinfo, phdr.p_filesz = cinfo->regions[i].end - cinfo->regions[i].start; phdr.p_memsz = phdr.p_filesz; phdr.p_flags = cinfo->regions[i].flags; - phdr.p_align = ELF_PAGESIZE; offset += ROUNDUP(phdr.p_memsz, ELF_PAGESIZE); elf_emit(cinfo, &phdr, sizeof(phdr)); }