This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [RFA] ARM OABI - pc-relative relocations
Alan,
Thank you for your quick answer.
Alan Modra (amodra@bigpond.net.au):
> On Fri, Dec 12, 2003 at 09:49:36PM +0100, Jerome Guitton wrote:
> > c: ebfffffb bl 0 <r>
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > Here is the problem. Even though arm-oabi uses RELA, an implicit addend
> > has been generated (-0xc). The relocation entry is:
>
> This shouldn't really matter. When applying a reloc, RELA targets are
> supposed to ignore the section contents in the field that the reloc
> replaces.
That would make sense; but that's not the way I understand the ARM ELF
specification (section 4.4: relocation types):
[...]
The table , ARM relocation types, below, describes the computation
performed by each type of ARM relocation directive, using the
following notation:
'A' denotes the addend used to compute the new value of the storage unit
being relocated.
- It is the value extracted from the storage unit being relocated
(relocation directives of sort SHT_REL) or the sum of that value and
the addend field of the relocation directive (sort SHT_RELA).
[...]
That is definitely what the binutils are doing for that target, and it is also
what Tornado's loader for VxWorks is doing.
(I must say I fail to see any advantage of using RELA on ARM
targets. The relocation record is bigger, and you still have to get
the implicit addend...)
> Ah! On looking at elfarm_oabi.c, I see that src_mask is non-zero on a
> number of reloc howtos. That's the real bug that needs fixing. See the
> description of src_mask in bfd/reloc.c.
Well, src_mask should be non-zero in this case, if I interpret
correctly the ARM ELF spec.
--
Jerome