This is the mail archive of the binutils@sourceware.cygnus.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]

PATCH to handle R_MIPS_JALR



Our MIPS howto tables were all missing entries for R_MIPS_JALR.  This
meant that processing such a relocation resulting in rather
unpredictable behavior.  Here's a patch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

1999-06-02  Mark Mitchell  <Mark Mitchell <mark@codesourcery.com>>

	* elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR.
	* elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
	(mips_elf64_howto_table_rela): Likewise.

Index: elf32-mips.c
===================================================================
RCS file: /usr/local/Repository/binutils/bfd/elf32-mips.c,v
retrieving revision 1.1.1.1.2.1
diff -c -p -r1.1.1.1.2.1 elf32-mips.c
*** elf32-mips.c	1999/06/02 03:28:45	1.1.1.1.2.1
--- elf32-mips.c	1999/06/02 23:20:56
*************** static reloc_howto_type elf_mips_howto_t
*** 702,708 ****
    { R_MIPS_REL16 },
    { R_MIPS_ADD_IMMEDIATE },
    { R_MIPS_PJUMP },
!   { R_MIPS_RELGOT }
  };
  
  /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link.  This
--- 702,724 ----
    { R_MIPS_REL16 },
    { R_MIPS_ADD_IMMEDIATE },
    { R_MIPS_PJUMP },
!   { R_MIPS_RELGOT },
! 
!   /* Protected jump conversion.  This is an optimization hint.  No 
!      relocation is required for correctness.  */
!   HOWTO (R_MIPS_JALR,	        /* type */
! 	 0,			/* rightshift */
! 	 0,			/* size (0 = byte, 1 = short, 2 = long) */
! 	 0,			/* bitsize */
! 	 false,			/* pc_relative */
! 	 0,			/* bitpos */
! 	 complain_overflow_dont, /* complain_on_overflow */
! 	 bfd_elf_generic_reloc,	/* special_function */
! 	 "R_MIPS_JALR",	        /* name */
! 	 false,			/* partial_inplace */
! 	 0x00000000,		/* src_mask */
! 	 0x00000000,		/* dst_mask */
! 	 false),		/* pcrel_offset */
  };
  
  /* The reloc used for BFD_RELOC_CTOR when doing a 64 bit link.  This
Index: elf64-mips.c
===================================================================
RCS file: /usr/local/Repository/binutils/bfd/elf64-mips.c,v
retrieving revision 1.1.1.1.2.1
diff -c -p -r1.1.1.1.2.1 elf64-mips.c
*** elf64-mips.c	1999/06/02 03:28:45	1.1.1.1.2.1
--- elf64-mips.c	1999/06/02 23:20:57
*************** static reloc_howto_type mips_elf64_howto
*** 614,620 ****
  	 false,			/* partial_inplace */
  	 0,			/* src_mask */
  	 0,			/* dst_mask */
! 	 false)			/* pcrel_offset */
  };
  
  /* The relocation table used for SHT_RELA sections.  */
--- 614,636 ----
  	 false,			/* partial_inplace */
  	 0,			/* src_mask */
  	 0,			/* dst_mask */
! 	 false),		/* pcrel_offset */
! 
!   /* Protected jump conversion.  This is an optimization hint.  No 
!      relocation is required for correctness.  */
!   HOWTO (R_MIPS_JALR,	        /* type */
! 	 0,			/* rightshift */
! 	 0,			/* size (0 = byte, 1 = short, 2 = long) */
! 	 0,			/* bitsize */
! 	 false,			/* pc_relative */
! 	 0,			/* bitpos */
! 	 complain_overflow_dont, /* complain_on_overflow */
! 	 bfd_elf_generic_reloc,	/* special_function */
! 	 "R_MIPS_JALR",	        /* name */
! 	 false,			/* partial_inplace */
! 	 0x00000000,		/* src_mask */
! 	 0x00000000,		/* dst_mask */
! 	 false),		/* pcrel_offset */
  };
  
  /* The relocation table used for SHT_RELA sections.  */
*************** static reloc_howto_type mips_elf64_howto
*** 1152,1158 ****
  	 false,			/* partial_inplace */
  	 0,			/* src_mask */
  	 0,			/* dst_mask */
! 	 false)			/* pcrel_offset */
  };
  
  /* Swap in a MIPS 64-bit Rel reloc.  */
--- 1168,1190 ----
  	 false,			/* partial_inplace */
  	 0,			/* src_mask */
  	 0,			/* dst_mask */
! 	 false),		/* pcrel_offset */
! 
!   /* Protected jump conversion.  This is an optimization hint.  No 
!      relocation is required for correctness.  */
!   HOWTO (R_MIPS_JALR,	        /* type */
! 	 0,			/* rightshift */
! 	 0,			/* size (0 = byte, 1 = short, 2 = long) */
! 	 0,			/* bitsize */
! 	 false,			/* pc_relative */
! 	 0,			/* bitpos */
! 	 complain_overflow_dont, /* complain_on_overflow */
! 	 bfd_elf_generic_reloc,	/* special_function */
! 	 "R_MIPS_JALR",	        /* name */
! 	 false,			/* partial_inplace */
! 	 0x00000000,		/* src_mask */
! 	 0x00000000,		/* dst_mask */
! 	 false),		/* pcrel_offset */
  };
  
  /* Swap in a MIPS 64-bit Rel reloc.  */

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