Created attachment 879776 [details] dladdr.c Without PIE, I get this output: [fweimer@oldenburg tmp]$ gcc dladdr.c -ldl [fweimer@oldenburg tmp]$ ./a.out open: 0x4006f0 dli_fname: ./a.out dli_fbase: 0x400000 dli_sname: open dli_saddr: 0x4006f0 chdir: 0x400670 dli_fname: ./a.out dli_fbase: 0x400000 dli_sname: chdir dli_saddr: 0x400670 fstat: 0x400990 dli_fname: ./a.out dli_fbase: 0x400000 dli_sname: (null) dli_saddr: (nil) fstat64: 0x4009a0 dli_fname: ./a.out dli_fbase: 0x400000 dli_sname: (null) dli_saddr: (nil) dlsym: 0x400700 dli_fname: ./a.out dli_fbase: 0x400000 dli_sname: dlsym dli_saddr: 0x400700 But if I activate PIE, the output for "open" changes: [fweimer@oldenburg tmp]$ gcc -fpie -pie dladdr.c -ldl [fweimer@oldenburg tmp]$ ./a.out open: 0x7fefe5263580 dli_fname: /lib64/libc.so.6 dli_fbase: 0x7fefe517d000 dli_sname: __open64 dli_saddr: 0x7fefe5263580 chdir: 0x7fefe5263fd0 dli_fname: /lib64/libc.so.6 dli_fbase: 0x7fefe517d000 dli_sname: chdir dli_saddr: 0x7fefe5263fd0 fstat: 0x7fefe5962c30 dli_fname: ./a.out dli_fbase: 0x7fefe5962000 dli_sname: (null) dli_saddr: (nil) fstat64: 0x7fefe5962c40 dli_fname: ./a.out dli_fbase: 0x7fefe5962000 dli_sname: (null) dli_saddr: (nil) dlsym: 0x7fefe553d150 dli_fname: /lib64/libdl.so.2 dli_fbase: 0x7fefe553c000 dli_sname: dlsym dli_saddr: 0x7fefe553d150 It would be nice if I could get consistent output in all cases. The resolution for fstat and fstat64 is missing as well, which is somewhat annoying. (I use dladdr to obtain function names for error messages in a C++ wrapper, to avoid the need for a separate string constant with the function name.)
This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle. Changing version to '23'. (As we did not run this process for some time, it could affect also pre-Fedora 23 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
If a function is aliased, it the name returned by dladdr is not deterministic. The missing symbols come from libc_nonshared.a, so this is expected as well.