Implement ELF function offset extraction function
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 27 Jun 2018 15:35:42 +0000 (11:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Aug 2018 19:32:29 +0000 (15:32 -0400)
commitd0927b411543c173c4fb83abf785fd71a9d29ed1
tree79409d8f37f7f8fb7f5ef05f938166406df22e5b
parent4b223a6755662f272f7db155ee380528728e5dd1
Implement ELF function offset extraction function

Add lttng_elf_get_symbol_offset function to compute the offset of
given symbol in a given binary.

This function parses the ELF file backing the file descriptor received.
We first find the symbol table section to cross-reference it with the
string table section to find the symbol with the name matching the named
received from the caller. Once we finds the symbol, we use its virtual
address to find the offset of the function from the beginning of the
file on disk.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/lttng-error.h
src/common/error.c
src/common/lttng-elf.c [new file with mode: 0644]
src/common/lttng-elf.h [new file with mode: 0644]
src/common/macros.h
This page took 0.025849 seconds and 4 git commands to generate.