Crazy shit linkers do: Relaxation

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Linker relaxation is an optimization technique where the linker transforms indirect function calls through the Global Offset Table (GOT) into more efficient direct calls when building static binaries. The R_X86_64_GOTPCRELX relocation type signals to the linker that it can safely replace a 6-byte indirect call instruction with a 5-byte direct call plus a 1-byte padding (either nop or addr32 prefix). This optimization eliminates unnecessary memory loads and improves performance by allowing the CPU to jump directly to the target address when all function locations are known at link time.

5m read timeFrom fzakaria.com
Post cover image

Sort: