]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdwfl: find_dynsym don't assume dynamic linker has adjusted DYNAMIC entries.
authorMark Wielaard <mjw@redhat.com>
Mon, 10 Nov 2014 13:49:20 +0000 (14:49 +0100)
committerMark Wielaard <mjw@redhat.com>
Thu, 13 Nov 2014 14:46:31 +0000 (15:46 +0100)
commit5691f86722e9c24169622e64e8e8f5e6a24ad3b0
tree587706de5d6bc30b261894d2df6970f99870c774
parentc50ddfca105a73f7567f3072831dcfbf49ad0567
libdwfl: find_dynsym don't assume dynamic linker has adjusted DYNAMIC entries.

commit 037505 "Fix resolving ELF symbols for live PIDs with deleted files"
changed find_dynsym to assume the PT_DYNAMIC entries had been adjusted by
the dynamic linker. That is often a correct assumption when the ELF image
comes from remote memory. But we cannot rely on that. In the case of the
vdso image the DYNAMIC segment has not been adjusted for example.

There is no good way to determine whether the DYNAMIC segment has or
hasn't been adjusted already to the load address by the dynamic linker.
So we just try twice. Once without and if the fails again with assuming
adjustments being applied.

Includes a new vdsosyms testcase that fails on i686 before and succeeds
after the fix.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/dwfl_module_getdwarf.c
tests/ChangeLog
tests/Makefile.am
tests/vdsosyms.c [new file with mode: 0644]