Processing ELF relocations – understanding the relocs, symbols, section data, and how they work together

I stumbled across this question and thought it deserved an answer. Have elf.h handy. You can find it on the internet. Each RELA section contains an array of Elf32_Rela entries as you know, but is also tied to a certain other section. r_offset is an offset into that other section (in this case – it … Read more

How are variable names stored in memory in C?

Variable names don’t exist anymore after the compiler runs (barring special cases like exported globals in shared libraries or debug symbols). The entire act of compilation is intended to take those symbolic names and algorithms represented by your source code and turn them into native machine instructions. So yes, if you have a global variable_name, … Read more

What is a symbol table?

There are two common and related meaning of symbol tables here. First, there’s the symbol table in your object files. Usually, a C or C++ compiler compiles a single source file into an object file with a .obj or .o extension. This contains a collection of executable code and data that the linker can process … Read more

tech