Page 3 of 3

Re: Relocatable ELF Object Help

Posted: Fri Aug 06, 2021 3:34 pm
by bloodline
Since position independent executables do work when using C code, but I can’t get the linker to output relocation information,my solution is to use gcc’s variable __attribute__ ( (section(.reloc))) tag to place the pointer I want to relocate into its own ELF section, this is obviously easy for my Loader to locate and then write the correct value to.

This feels a little hacky, but it works really well.