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

32-bit absolute addresses no longer allowed in x86-64 Linux?

Your distro configured gcc with –enable-default-pie, so it’s making position-independent executables by default, (allowing for ASLR of the executable as well as libraries). Most distros are doing that, these days. You actually are making a shared object: PIE executables are sort of a hack using a shared object with an entry-point. The dynamic linker already … Read more

What do R_X86_64_32S and R_X86_64_64 relocation mean?

The R_X86_64_32S and R_X86_64_64 are names of relocation types, for code compiled for the amd64 architecture. You can look all of them up in the amd64 ABI. According to it, R_X86_64_64 is broken down to: R_X86_64 – all names are prefixed with this 64 – Direct 64 bit relocation and R_X86_64_32S to: R_X86_64 – prefix … Read more

What do linkers do?

To understand linkers, it helps to first understand what happens “under the hood” when you convert a source file (such as a C or C++ file) into an executable file (an executable file is a file that can be executed on your machine or someone else’s machine running the same machine architecture). Under the hood, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)