Skip to content

Commit 4c32a58

Browse files
committed
Cleanup
1 parent d832ce9 commit 4c32a58

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kos/src/libdl/builtin.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,11 +3005,12 @@ libdl_dlauxctrl(NCX DlModule *self, unsigned int cmd, ...)
30053005
/* Search for the lowest program header with the correct flags. */
30063006
for (result = (void *)-1, i = 0; i < self->dm_elf.de_phnum; ++i) {
30073007
uintptr_t hdraddr;
3008-
if (self->dm_elf.de_phdr[i].p_type != PT_LOAD)
3008+
ElfW(Phdr) const *phdr = &self->dm_elf.de_phdr[i];
3009+
if (phdr->p_type != PT_LOAD)
30093010
continue;
3010-
if ((self->dm_elf.de_phdr[i].p_flags & (PF_R | PF_W | PF_X)) != rwx)
3011+
if ((phdr->p_flags & (PF_R | PF_W | PF_X)) != rwx)
30113012
continue;
3012-
hdraddr = self->dm_loadaddr + self->dm_elf.de_phdr[i].p_vaddr;
3013+
hdraddr = self->dm_loadaddr + phdr->p_vaddr;
30133014
if ((uintptr_t)result > hdraddr)
30143015
result = (void *)hdraddr;
30153016
}

0 commit comments

Comments
 (0)