This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: bfd_perform_relocation() and split fields
Ian Lance Taylor wrote:
> Date: Tue, 16 Nov 1999 17:56:45 -0600
> From: Eric DeVolder <devolder@evsx.com>
>
> The function bfd_perform_relocation() is oriented for inserting a
> resolved relocation into a contiguous set of bits. I find myself in
> perhaps a rather unique situation in which I need a resolved relocation
> to appear in two non-contiguous fields within an instruction, i.e. the
> most-significant portion of the reloc appears in field A, and the
> least-significant portion of the reloc appears in field B, where other
> bits separate field A from field B.
>
> Function bfd_perform_relocation() as it stands today wont do this, so I
> have two options as I see it:
>
> * Generate two relocs, one for field A and one for field B
> * Add somekind of CPU-specific hook to bfd_perform_relocation()
>
> The CPU specific hook is already there: the special_function field in
> the howto structure. Just make that do whatever you need your
> relocation to do.
The call to special_function occurs way too early in bfd_perform_relocation().
There are several statements that perform calculations or modify reloc_entry
that would not be able to "preserve" a split-field value all the way thru to
where the bits are actually placed back into the insn. What I'm suggesting is
a hook right before the switch(howto-size) statement that gives you a chance
to munge the reloc value before it gets inserted.
> Note that in the ``new'' linker approach, bfd_perform_relocation is
> not used while linking.
I'm not familiar with this...is there a pointer available? or email thread?
>
>
> Ian