This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
st_value in Elf32_Sym
- From: "Carlos Barros" <barros001 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 20 Feb 2006 18:07:44 -0300
- Subject: st_value in Elf32_Sym
Hello list, I'm not sure if this is the right list to ask, but didn't
find any other, so....
In the .dynsym, if you take one symbol and dump the contents of the
Elf32_Sym, for some symbols you have the the address of the PLT entry
in the st_value, but for others you get a NULL pointer. One example
can be seen in the sshd binary:
carlos@zaphod:~$ readelf -s /usr/sbin/sshd | grep EVP
3: 00000000 68 FUNC GLOBAL DEFAULT UND EVP_DigestInit
5: 0804b854 18 FUNC GLOBAL DEFAULT UND EVP_enc_null
As can be seen, st_value for the symbol EVP_enc_null is 0x0804b854 (it
PLT entry) but for the symbol EVP_DigestInit it is NULL
Another example is a simple printf("Hello world");
carlos@zaphod:~$ readelf -s t| grep printf
2: 00000000 57 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.0 (2)
97: 00000000 57 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.0
it is still NULL and it is SURE that printf has you own PLT entry.
Can anyone explain me the exact meaning of the st_value for a external
symbol and why some symbols have it pointing to its PLT entry and
others have it pointing to NULL
thanks in advance
Carlos Barros