help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libelf-related question


From: Ling
Subject: libelf-related question
Date: Wed, 3 Jun 2009 13:25:18 -0500

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

[Prev in Thread] Current Thread [Next in Thread]