Object Files: Difference between revisions

m
no edit summary
[unchecked revision][unchecked revision]
(Categorisation)
mNo edit summary
Line 22:
 
=== Relocating code ===
When an executable is created, it will be set to use a specific address by default. This can be a problem when you need several object files in the same address space and they may overlap, or you want to perform address space randomisationrandomization, you might find relocating an executable an option.
 
Since relocations are only needed to build an executable, but not when you run it, they normally aren't present in a linked file. Instead you need to specifically tell the linker to emit relocations when necessary. For the [[GCC Cross-Compiler]], this can be done with the <tt>-q</tt> switch. Note that the <tt>-i</tt> and <tt>-r</tt> switches have a similar description, but cause the linker to yield an object file rather than an executable.
Anonymous user