This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] xstormy16 12-bit relocs


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]