This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Re: dwfl_link_map_report() on a core file with sysroot? Opens the wrong solibs?
- From: Luke Diamand <luke at diamand dot org>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: elfutils-devel at sourceware dot org
- Date: Fri, 14 Dec 2018 13:44:17 +0000
- Subject: Re: dwfl_link_map_report() on a core file with sysroot? Opens the wrong solibs?
- References: <CAE5ih7_VNLQ4C8GKgt4vZL0CGeCyoxOqsbkfYZhV4QNii2C6Pw@mail.gmail.com> <CAORpzuOC4yGnrbtYjD=kxhJ-ytfJ0tQ3+iDq1NPZ9g8jenVi0g@mail.gmail.com>
On Thu, 13 Dec 2018 at 22:37, Roland McGrath <roland@hack.frob.com> wrote:
>
> I think it's just missing. The hardest part is just deciding how the configuration should work.
Thanks. My current attempt adds a new function call,
dwfl_set_sysroot(), which works, but feels a bit clunky. I might see
if I can just use the find_elf callback instead.
>
> On Thu, Dec 13, 2018, 12:27 Luke Diamand <luke@diamand.org wrote:
>>
>> I'm trying to get callstacks out of a core file using libdwfl where
>> the ELF files live in a sysroot (and are from a different
>> architecture, ARM).
>>
>> I'm possibly doing something stupid as I find that
>> dwfl_link_map_report() opens /lib/libpthread.so on the *host* rather
>> than the libpthread.so from my sysroot. It obviously doesn't then get
>> very far.
>>
>> I called elf_begin(), dwfl_begin() and then dwfl_core_file_report(),
>> passing in the path to the executable (in the sysroot).
>>
>> There's a comment in link_map.c around line 390 which says:
>>
>> // XXX hook for sysroot
>>
>> So inspired by this, I hacked in some code to open files relative to
>> my sysroot and it all started working.
>>
>> Am I just missing some obvious setup, or is this just missing sysroot support?
>>
>> Thanks!
>> Luke
>>
> --
>
>
> Thanks,
> Roland