This is the mail archive of the
mailing list for the binutils project.
Re: what's difference between "relocatable link" and "final link"?
A relocateable link is what the linker does when you use the -r
A final link is what the linker does when you do not use the -r
To expand on Ian's answer, a relocatable link is one where only some of
the relocations in the input files are resolved. Any relocations that
cannot be resolved are preserved and recorded in the output file.
A final link is one where all(1) of the relocations in the input files
are resolved. If a relocation cannot be resolved the linker will
produce an error message.
The purpose of a relocatable link is to create an object file where some
of the relocation work has already been done. Thus when this file is
included in a final link, the linker will take less time to complete its
(1) Really we are talking about static relocations here. Dynamic
relocations (against symbols in dynamic libraries) are not completely
rresolved by the linker even during a final link. They have to be
resolved by the dynamic loader when the executable starts running.