This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch 1/4] unwinder: New base address based dwfl_report_elf_baseaddr


On Tue, 2012-11-13 at 21:30 +0100, Jan Kratochvil wrote:
> Current dwfl_report_elf function has parameter "GElf_Addr base" but it means
> bias, not the base address.

If the documentation is wrong/misleading in libdwfl.h we really should
also fix/clarify that.

I admit that I always get a little confused myself. If I got it right
then the bias should refer to the offset from the p_vaddr of an ELF
segment. And the base should refer the low address of the Dwfl_Module,
which is fixed for the main ET_EXEC and ET_CORE at the lowest p_vaddr in
the ELF file, but dynamic for ET_DYN (and the kernel).

Even if I got the above right I might still get confused about the
meaning of the terms for ET_REL (there are no p_hdrs, so the terms don't
really make sense there do they?). So please do correct me if I seem
wrong/confused.

>   Some applications (such as Linux kernel perf)
> cannot easily find out the bias but they know the base address.
> I tried to implement it without this function but I could not.

Is using dwfl_report_elf () vs dwfl_report_elf_baseaddr () only
different for ET_DYN files, or does it also change things for reporting
other ELF files?

Thanks,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]