I guess this isn't the physical page size, but some notional 4k page,
which may or may not correspond to the real page size?

I think we should use sysconf(3) with _SC_PAGESIZE or p_align in ELF PHDR.

+            // Align page size
+            ph->core->dynamic_addr = auxv->a_un.a_val & ~(uintptr_t)0xfff;

We cannot access ELF PHDR of executable.
So I think we can use sysconf(3) to get page size.

Should I change it and upload new webrev?


Yasumasa


On 2017/02/09 23:49, Andrew Haley wrote:
On 09/02/17 14:40, Yasumasa Suenaga wrote:
Hi Andrew,

I checked with GDB, readelf and libsaproc debug message.
I found that we should calculate .dynamic address from entry point in ELF.

I uploaded webrev. This patch works fine on JDK 9 and JDK 10.

   http://cr.openjdk.java.net/~ysuenaga/JDK-8173941/webrev.00/

Very cool, thanks!

One clarification:

+            // Align page size
+            ph->core->dynamic_addr = auxv->a_un.a_val & ~(uintptr_t)0xfff;

I guess this isn't the physical page size, but some notional 4k page,
which may or may not correspond to the real page size?

Thanks,

Andrew.

Reply via email to