This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: bfd_perform_relocation() and split fields
Date: Wed, 17 Nov 1999 08:49:20 -0600
From: Eric DeVolder <devolder@evsx.com>
> 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.
Just do all that stuff in your special_function code. You won't need
most of it anyhow; most of what bfd_perform_relocation does is pretty
bogus.
I would not accept a patch which added a new hook when you could just
use the existing special_function hook instead.
> 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?
See the top of bfd/linker.c.
Ian