Reputation: 161
I have an elf binary which has the following dynsym
symbol table as output by readelf
:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __libc_start_main@GLIBC_2.2.5 (2)
2: 0000000000000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
3: 0000000000400440 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.2.5 (2)
4: 0000000000400460 0 FUNC GLOBAL DEFAULT UND fgets@GLIBC_2.2.5 (2)
What does the value
column mean? Since this table has 400440
for printf
, does that mean that the dynamic linker has to map printf
at that address? If yes, how is this value decided? Is it random?
EDIT: Also, this is linux x86-64 with gcc
Upvotes: 2
Views: 1360
Reputation: 93107
It appears that the value of undefined dynamic symbols of function types is just the address of their entry in the PLT. Likewise, the values of entries for variables is probably just their entry in the GOT.
Upvotes: 5