|
From: John R. <jr...@bi...> - 2015-05-01 22:17:56
|
> Since none of these functions were called by the program above,
Those functions are the dynamic linker adding libc.so to your process address space.
'main' is moderately far removed from the beginning of execution.
$ readelf --headers test | grep Entry
Entry point address: 0x400400
$ gdb test
(gdb) x/12i 0x400400
0x400400 <_start>: xor %ebp,%ebp
0x400402 <_start+2>: mov %rdx,%r9
0x400405 <_start+5>: pop %rsi
0x400406 <_start+6>: mov %rsp,%rdx
0x400409 <_start+9>: and $0xfffffffffffffff0,%rsp
0x40040d <_start+13>: push %rax
0x40040e <_start+14>: push %rsp
0x40040f <_start+15>: mov $0x400570,%r8
0x400416 <_start+22>: mov $0x400500,%rcx
0x40041d <_start+29>: mov $0x4004f0,%rdi
0x400424 <_start+36>: callq 0x4003e0 <__libc_start_main@plt>
0x400429 <_start+41>: hlt
(gdb) quit
$ LD_DEBUG=ALL ./test
5360:
5360: file=libc.so.6 [0]; needed by ./test [0]
5360: find library=libc.so.6 [0]; searching
5360: search cache=/etc/ld.so.cache
5360: trying file=/lib64/libc.so.6
5360:
5360: file=libc.so.6 [0]; generating link map
5360: dynamic: 0x0000003ef37b8b80 base: 0x0000000000000000 size: 0x00000000003bf260
5360: entry: 0x0000003ef3421c50 phdr: 0x0000003ef3400040 phnum: 10
5360:
5360: checking for version `GLIBC_2.2.5' in file /lib64/libc.so.6 [0] required by file ./test [0]
5360: checking for version `GLIBC_2.3' in file /lib64/ld-linux-x86-64.so.2 [0] required by file /lib64/libc.so.6 [0]
5360: checking for version `GLIBC_PRIVATE' in file /lib64/ld-linux-x86-64.so.2 [0] required by file /lib64/libc.so.6 [0]
5360:
5360: Initial object scopes
5360: object=./test [0]
5360: scope 0: ./a.out /lib64/libc.so.6 /lib64/ld-linux-x86-64.so.2
[[snip]]
|