How to get the GOT address from a PLT stub using GDB
rafaelbeirigo.github.io·13h·
Discuss: Hacker News
Flag this post

1 November 2025

by Rafael Beirigo

Table of Contents

  1. Overview
  2. Source code for the test program
  3. Dynamic analysis with gdb
  4. Summary

Overview

When we

  1. Use functions from shared libraries, like the puts,
  2. Opt for dynamic linking, and
  3. Opt for lazy binding,

the object code for puts is not included in the binary, but instead is linked at runtime. The linker adds a placeholder that will be patched at runtime with the real address of puts. That address is obtained by the dynamic linker from the shared library libc.so. But this is only done after the first call to puts (thus the lazy binding).

Moreover, when the program calls puts, it does so via a “trampoline”, in the form …

Similar Posts

Loading similar posts...