Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8261431

SA: Add comments about load address of executable

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      I removed the comment about load address of executable in JDK-8248876, but it contained useful information for maintenance.

      So I re-add them, and add comment for the change in JDK-8248876.

      ```
      diff --git a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
      index dff4cb3eeca..9f7c4050ef2 100644
      --- a/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
      +++ b/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c
      @@ -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);
      ```

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ysuenaga Yasumasa Suenaga
              Reporter:
              ysuenaga Yasumasa Suenaga
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: