Relocations on branches
DJ Delorie
dj@redhat.com
Thu Apr 16 01:40:00 GMT 2009
"Daniel P. Volpato" <danielpvolpato@gmail.com> writes:
> I am doing some experiments with binutils and have a doubt. Is it
> possible to create PC-relative relocations for branches, so that
> these can be resolved at link time?
Whether a branch uses absolute or pc-rel addressing depends entirely
on the chip, not binutils. Just because binutils has internal
relocation types for pc-rel doesn't mean the chip supports them.
However, in your example, you're missing a point - the chip *does*
support pc-rel addressing, but the address has already been resolved
by the *assembler*, which is why there's no relocation record in the
object.
If the chip you're using supports linker relaxation, try enabling it -
that often causes such relocations to be deferred to the linker, so
you can see what they are.
More information about the Binutils
mailing list