Hi Florian, On Sat, Sep 16, 2017 at 10:15:19AM +0200, Florian Weimer wrote: > On 09/16/2017 05:00 PM, Yubin Ruan wrote: > >diff --git a/man3/dl_iterate_phdr.3 b/man3/dl_iterate_phdr.3 > >index b5b75e8..35107da 100644 > >--- a/man3/dl_iterate_phdr.3 > >+++ b/man3/dl_iterate_phdr.3 > >@@ -121,10 +121,9 @@ header files.) > > .PP > > The > > .I dlpi_addr > >-field indicates the base address of the shared object > >-(i.e., the difference between the virtual memory address of > >-the shared object and the offset of that object in the file > >-from which it was loaded). > >+field indicates the base address that is mapped at runtime. > >+For an executable this field is always 0 and for a shared > >+object it is the address where the shared object is mapped. > > The part about executables is not true. The most common case probably is > PIE executables. You see this if you compile the modified test program with > -fpie -pie on a recent enough toolchain. -fpie only affect address of PT_LOAD. The one inidcated by `dlpi_addr' is always 0 for an executable. Yes there is indeed some confusion, see [1]. Yubin [1]: https://stackoverflow.com/questions/8875876/getting-the-elf-header-of-the-main-executable -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html