0

I was following the liveoverflow course about binary exploitation, when i got trouble following a part of his video. In the video is shown a binary linked to a library which calls the function puts, on the video is shown that before executing for the first time the function the GOT was empty and there was no way for the binary to know where the function lived, when i compiled my ELF binary i found out that before the _start function is even called those addreses were filled with the address of puts. I really can't understand why such thing happens.

  • The dynamic loader `ld.so` does it when loading your binary I think. – fuz Dec 19 '20 at 23:40
  • See also `man ld.so`, in particular, _"LD_BIND_NOW If set to a nonempty string, causes the dynamic linker to resolve all symbols at program startup instead of deferring function call resolution to the point when they are first referenced. This is useful when using a debugger."_ – Jester Dec 19 '20 at 23:43
  • In what file is this environment variable set? I personally couldn't find any info. – risbis58 Dec 20 '20 at 00:59
  • It may be set anywhere, or depending on how you are looking at the GOT the functionality may be enabled by the debugger. – Jester Dec 20 '20 at 01:20

0 Answers0