What are the semantics of ADRP and ADRL instructions in ARM assembly?

ADR ADR is a simple PC-relative address calculation: you give it an immediate offset, and it stores in the register the address relative to the current PC. For example, if the following ADR instruction is placed at position 0x4000 in memory: adr x0, #1 then after this instruction is executed x0 now contains the value … Read more

Why does GCC create a shared object instead of an executable binary according to file?

What am I doing wrong? Nothing. It sounds like your GCC is configured to build -pie binaries by default. These binaries really are shared libraries (of type ET_DYN), except they run just like a normal executable would. So your should just run your binary, and (if it works) not worry about it. Or you could … Read more

What is the -fPIE option for position-independent executables in gcc and ld?

PIE is to support address space layout randomization (ASLR) in executable files. Before the PIE mode was created, the program’s executable could not be placed at a random address in memory, only position independent code (PIC) dynamic libraries could be relocated to a random offset. It works very much like what PIC does for dynamic … Read more