Skip to content

Commit

Permalink
ld.elf_so: memset mmaped BSS pages to zero
Browse files Browse the repository at this point in the history
JIRA: RTOS-644
  • Loading branch information
badochov committed Oct 31, 2024
1 parent cc3d77d commit 7bdb54f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ld.elf_so/map_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ _rtld_map_object(const char *path, int fd, const struct stat *sb)
goto error;
}

printf("%s: %p [%x]\n", path, mapbase, 0x00105704 - (__u32)mapbase);

/* Unmap additional space. */
if (alignment_overmap != 0) {
front_alignment_overmap = (base_alignment - (((Elf_Addr)mapbase) & (base_alignment - 1))) & (base_alignment - 1);
Expand Down Expand Up @@ -435,6 +437,10 @@ _rtld_map_object(const char *path, int fd, const struct stat *sb)
path, xstrerror(errno));
goto error;
}
#ifdef phoenix
/* On phoenix pages from MAP_ANON are not zero. */
memset(bss_addr, 0, bss_vlimit - bss_vaddr);
#endif
}
}

Expand Down

0 comments on commit 7bdb54f

Please sign in to comment.