Hello, experts

This is my first time to post the question in this mailing list. I have a
libelf-related question. Hope it's not off-topic for this list.

I am trying to extract information from ELF files which also links to a
shared library. I want to extract:

1. All function names in the shared library.
2. Virtual addresses (or offsets) of the function.

I can now get the function names from dynamic symbol table section (.dynsym)
via ((GElf_Shdr)shdr.sh_type == SHT_DYNSYM) and (elf_strptr(elf,
shdr.sh_link, sym.st_name)) where shdr is a GElf_Shdr type, sym is a
GElf_Sym type. By reading the ELF specification I know there is an object
called d_ptr which represents program virtual addresses, and there is a
DT_PLTGOT which refers to the address of the first entry in the global
offset table. But I don't know how to get the virtual address (offset) of
each function. Any suggestion on my question?

Thank you in advance!

Xueling

Reply via email to