Unlike shared objects that are loaded into an existing adress space, I suppose that nothing would prevent an executable from gettings its segments loaded at their desired adresses. But is this guaranteed by the OS ?
Asked
Active
Viewed 189 times
1
-
1Yes, non-PIE ELF executables don't have relocation metadata for every absolute address, so loading them at any other address would not be possible. – Peter Cordes Dec 06 '21 at 19:13
-
1Almost a duplicate of [Is there an ELF equivalent of PE base relocations?](https://stackoverflow.com/q/56531710) which explains that there's no metadata for doing the text relocations that would be necessary to even ASLR within the low 31 bits of virtual address space that "small" memory model non-PIEs can assume for static code/data. – Peter Cordes Dec 06 '21 at 20:21
-
@PeterCordes The real question I had on mind was the "why non-pic code etc", glad it already exists and answered. – Aaa Bbb Dec 06 '21 at 20:40