2014년 1월 31일 금요일

함수 호출시 plt / got 정리 [ How plt&got works when fuction call ]

plt : procedure linkage table
got : global offset table

=====function call=====
1. function call (ex:printf)
2. goto plt
3. jmp *funcaddr(got)
4. in got there is addr for plt's push
5. restart plt
6. _dl_runtime_resolve() call
7. _dl_runtime_resolve() function will call _dl_fixed func and insert real function(printf)'s addr to got
8. real function addr is saved in got and jump to real function addr by got


=====second function call=======
1. function call(ex:printf)
2. goto plt
3. jump *funcaddr(got)
4. jump to function's real addr in got by got

댓글 없음:

댓글 쓰기