Combuster wrote:it's rather the -fPIC option that gets you into that mess because it means "individual sections can be moved" rather than the app as a whole which makes it rather braindead for your purposes. It also implies the need for a runtime linker
Although this is IMO exactly what I need, I now have a problem with constants. Constants are defined in the .text segment.
Gcc creates assembly code that is position dependent now, which is good, but when it needs constants, it doesn't know about the start address I am passing to the linker.
So, I have a constant "Hello" at address 0x136, but the code is loaded at 0x1a00 and the linker knows that (but I don't think he has to know anymore), but then the constant is at 0x1b36 while the code is still looking at 0x136.
The options-list of gcc is so huge, I have searched, but have not found, can I tell gcc the start-address of the code?