WCU / Cybersecurity
~/CSC 472/Class 08/KP 04
Class 08 · KP 04 / 20

Lazy Binding: The GOT Is Resolved On Demand

  • By default (partial RELRO) the GOT is resolved lazily: a function's real address is looked up the first time it is called, not at startup.
  • First call to printf:
  • call printf@plt jumps to the PLT stub.
  • The stub jumps to whatever the GOT entry points to — initially back into the resolver.
  • The resolver finds the real printf in libc and writes that address into the GOT entry.
  • Every later call: PLT stub reads the GOT entry, which now points straight at libc — fast path.
Key Takeaway

Because the GOT is writable data that the CPU indirectly jumps through, an attacker who can write to it controls where a call goes.