[fpc-pascal] Building trunk
evvke at hotmail.com
Mon Nov 26 04:33:51 CET 2018
On 25/11/2018 14:58, Jonas Maebe wrote:
> On 25/11/18 13:51, Florian Klämpfl wrote:
>> I am not aware that somewhere a fixed offset is applied. All info is
>> read from the auxiliary data and the header.
> You can have a load address offset in case there is a PT_PHDR. From
> http://www.gabriel.urdhr.fr/2015/01/22/elf-linking/ :
> // Simplified code from the GNU dynamic linker source code:
> for (ph = phdr; ph < &phdr[phnum]; ++ph)
> if (ph->p_type == PT_PHDR)
> main_map->l_addr = (ElfW(Addr)) phdr - ph->p_vaddr;
> There doesn't seem to be one in Colin's program though.
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
Somehow this thread reminds my one open bug :
I have found out that you need to have either linked against libc or
have small binary stub generated from assembler source (like 64-bit
pascal programs/libraries have that doesn't link against libc) linked
against your 32-bit program so it can access PHDR structure without
crashing on access violation exception.
More information about the fpc-pascal