Reproduced with: $ gcc -o piedie -fpie -pie -xc <(echo 'main(){abort();}') $ ./piedie Aborted (core dumped) $ eu-unstrip -n --core=core.28229 eu-unstrip: No modules recognized in core file
In dwfl_link_map_report it looks at the ELF of the main (pie) binary, and reads dyn_vaddr. That's value like 0x2009f8, which is outside all reported segments. I think the problem is that we don't account for bias as we do when reporting segments.
The "value like" bit was meant to mean "small value", as opposed to values like 0x7f6a0d996000 for addresses where the libraries are mapped".
(In reply to comment #5) > I think the problem is that we don't account for bias ... which I don't know how to obtain. I thought AT_BASE would hold the bias for the main binary, but that doesn't seem to be it. There is a number with roughly the right magnitude, but it's still too small for bias (in my test case it's 0x7f35fe376000, the binary was mapped to 0x7f6a0d996000). We know the address of PHDR block, but not of EHDR (then we could do AT_ENTRY - e_entry). I'm not sure if we can assume anything about the size of EHDR, the presence of e_phoff implies that more fields could be added to the end of EHDR, there could be padding, or whatnot. Hmm, what about looking sizeof (EHDR) bytes back, checking if the magic holds, and if not, scanning back for magic "reasonably far"?
Fixed upstream.
elfutils-0.148-1.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/elfutils-0.148-1.fc12
elfutils-0.148-1.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/elfutils-0.148-1.fc13
elfutils-0.148-1.fc13 has been pushed to the Fedora 13 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update elfutils'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/elfutils-0.148-1.fc13
elfutils-0.148-1.fc12 has been pushed to the Fedora 12 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update elfutils'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/elfutils-0.148-1.fc12
Using the reproducer in comment#1, the reported problem does not occur with elfutils-0.148-1.fc13. $ gcc -o piedie -fpie -pie -xc <(echo 'main(){abort();}') /proc/self/fd/63: In function ‘main’: /proc/self/fd/63:1: warning: incompatible implicit declaration of built-in function ‘abort’ $ ./piedie $ ulimit -c unlimited $ eu-unstrip -n --core core.9471 0x7f27472a1000+0x201000 586b9b81baedc58dcdd34f630856e401f0f08032@0x7f27472a124c - - [pie] 0x7fff509ff000+0x1000 9eef3c8dabad1ba6746e5fef74878ba17e416e38@0x7fff509ff2f8 . - linux-vdso.so.1 0x7f2746d01000+0x37f000 f855edf9e7f0567206e280428d6d405f30a5b3f9@0x7f2746d01280 /lib64/libc.so.6 - libc.so.6 0x7f2747080000+0x221000 f9554ea901052eaee919938a843d292b129532db@0x7f27470801d8 /lib64/ld-linux-x86-64.so.2 - ld-linux-x86-64.so.2
elfutils-0.148-1.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.
elfutils-0.148-1.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.