This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] xstormy16 12-bit relocs
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: DJ Delorie <dj at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 18 Dec 2002 11:50:04 +1030
- Subject: Re: [patch] xstormy16 12-bit relocs
- References: <200212180004.gBI04IY25112@greed.delorie.com>
On Tue, Dec 17, 2002 at 07:04:18PM -0500, DJ Delorie wrote:
> + /* A 12 bit absolute relocation. */
> + HOWTO (R_XSTORMY16_12, /* type */
> + 0, /* rightshift */
> + 1, /* size (0 = byte, 1 = short, 2 = long) */
> + 12, /* bitsize */
> + FALSE, /* pc_relative */
> + 0, /* bitpos */
> + complain_overflow_signed, /* complain_on_overflow */
> + bfd_elf_generic_reloc, /* special_function */
> + "R_XSTORMY16_12", /* name */
> + FALSE, /* partial_inplace */
> + 0xf000, /* src_mask */
> + 0x0fff, /* dst_mask */
> + FALSE), /* pcrel_offset */
I think all ELF RELA targets should have src_mask zero. The value you
have here isn't exactly wrong since src_make & dst_mask == 0, but it's
somewhat dodgy.
This is one area where the bfd reloc processing is weird. If you look
at bfd_perform_relocation, you'll see that what is written into the
field specified by dst_mask has two possible sources of addend, one
via the reloc addend, and one picked out of the section contents via
src_mask. This probably came about when RELA type reloc support was
added, but it makes the code confusing and the comments about src_mask
and dst_mask wrong.
--
Alan Modra
IBM OzLabs - Linux Technology Centre