I'm trying to write a C program for a machine with no virtual memory(or O.S. to be more precise), and I'm running into some difficulties with the .rodata section, or more precisely the stuff that goes there. The problem arises that although the sections are positioned at well defined addresses during linking, when the program goes into execution, it is being relocated.
e.g.: Let's say that my program starts is linked to start at 0x1000, when it is being executed it what should be at 0x1000 is relocated at 0xff1000.
These being said, my problem is that the stuff that usually goes into .rodata are "hardcoded" by the compiler(gcc), and i kinda lose said .rodata constants in memory because of the relocation and the gcc hardcoding their addresses so that they get an absolute offset instead of a relative one.
Is there a way that I can get the .rodata constants to have a relative offset instead of an absolute one. And by relative, I mean relative to any active process registers?