LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

What are the main x86_64 relocation types?

Two PC-relative kinds (R_X86_64_PC32 for nearby code/data, PLT32 for calls routed through the PLT) and two absolute kinds (32[S] and the full 64-bit 64).

Relocation type tree: PC-relative (PC32 for nearby object, PLT32 for PLT entry) versus absolute (32[S] 4-byte, 64 full 8-byte address)

* The split that matters: PC-relative types encode an offset from the instruction pointer, absolute types encode the address directly. *

Relocation Type Addressing Formula
R_X86_64_PC32 PC-relative PC + 4-byte offset → object
R_X86_64_PLT32 PC-relative PC + 4-byte offset → PLT entry
R_X86_64_32[S] Absolute 4-byte address → object
R_X86_64_64 Absolute 8-byte address → object

PC-relative (most common):

  • Address = current_PC + encoded_offset
  • Used for function calls and nearby data
  • Works within ±2GB (small code model)

Absolute:

  • Address is directly encoded
  • Used for global data pointers
  • R_X86_64_32S: sign-extended 32-bit
  • R_X86_64_64: full 64-bit address

PLT (Procedure Linkage Table):

  • Used for calls that go through the PLT — external functions, including those in shared libraries
  • Enables lazy binding (resolve on first call) for dynamically-linked calls

Go deeper:

From Quiz: REVE1 / Program Execution | Updated: Jul 14, 2026