Search code examples
assemblyintelx86-64elfrelocation

with RIP-addressing, why x86-64 still need relocations?


So x86-64 has the RIP-relative addressings which makes PIC codes easy to write and relocations needed much less. Why is relocations still needed then on x86-64? For what features? I can try to explore with objdump but what C/C++ code patterns to compile to see?


Solution

  • This article explains it better than I can, but basically global variables in a shared library.