mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-28 16:50:10 +00:00
8379454: SA still calculates end address with incorrect alignment
Reviewed-by: kevinw, cjplummer
This commit is contained in:
parent
22831cb0d8
commit
8ecb14cecf
@ -182,13 +182,14 @@ static bool fill_addr_info(lib_info* lib) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
lib->end = (uintptr_t)-1L;
|
||||
lib->exec_start = (uintptr_t)-1L;
|
||||
lib->exec_end = (uintptr_t)-1L;
|
||||
for (ph = phbuf, cnt = 0; cnt < ehdr.e_phnum; cnt++, ph++) {
|
||||
if (ph->p_type == PT_LOAD) {
|
||||
uintptr_t aligned_start = lib->base + align_down(ph->p_vaddr, ph->p_align);
|
||||
uintptr_t aligned_end = aligned_start + align_up(ph->p_memsz, ph->p_align);
|
||||
uintptr_t aligned_end = aligned_start + align_up(ph->p_memsz, page_size);
|
||||
if ((lib->end == (uintptr_t)-1L) || (lib->end < aligned_end)) {
|
||||
lib->end = aligned_end;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user