Skip to content

Commit

Permalink
8261431: SA: Add comments about load address of executable
Browse files Browse the repository at this point in the history
Reviewed-by: sspitsyn, kevinw
  • Loading branch information
YaSuenag committed Feb 11, 2021
1 parent 4a72cea commit c342323
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
Expand Up @@ -507,7 +507,11 @@ static uintptr_t read_exec_segments(struct ps_prochandle* ph, ELF_EHDR* exec_ehd
result = exec_php->p_vaddr;
ph->core->dynamic_addr = exec_php->p_vaddr;
} else { // ET_DYN
// Base address of executable is based on entry point (AT_ENTRY).
result = ph->core->dynamic_addr - exec_ehdr->e_entry;

// dynamic_addr has entry point of executable.
// Thus we should subtract it.
ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry;
}
print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr);
Expand Down

1 comment on commit c342323

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.