public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix MIPS ELF64 relocation howtos
@ 2001-08-26 17:38 Thiemo Seufer
  2001-08-26 17:50 ` H . J . Lu
  2001-09-06 14:34 ` Thiemo Seufer
  0 siblings, 2 replies; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-26 17:38 UTC (permalink / raw)
  To: binutils

Hi All,

this changes the HOWTO definitions in elf64-mips.c to conform to
the MIPS ELF64 object file specification draft. Tested for
mips64el-elf and mips64-linux.


Thiemo


2001-08-27  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/bfd/ChangeLog
	* elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO
	definitions.
	(mips_elf64_howto_table_Rel): Likewise.


diff -BurpNX /bigdisk/src/binutils-exclude src-orig/bfd/elf64-mips.c src/bfd/elf64-mips.c
--- src-orig/bfd/elf64-mips.c	Sat Aug 18 21:47:22 2001
+++ src/bfd/elf64-mips.c	Sat Aug 25 04:44:47 2001
@@ -131,7 +170,7 @@ static reloc_howto_type mips_elf64_howto
 	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_32",		/* name */
 	 true,			/* partial_inplace */
@@ -146,7 +185,7 @@ static reloc_howto_type mips_elf64_howto
 	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_REL32",	/* name */
 	 true,			/* partial_inplace */
@@ -154,7 +193,7 @@ static reloc_howto_type mips_elf64_howto
 	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  /* 26 bit branch address.  */
+  /* 26 bit jump address.  */
   HOWTO (R_MIPS_26,		/* type */
 	 2,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -163,7 +202,7 @@ static reloc_howto_type mips_elf64_howto
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 				/* This needs complex overflow
-				   detection, because the upper four
+				   detection, because the upper 36
 				   bits must match the PC + 4.  */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_26",		/* name */
@@ -249,7 +289,7 @@ static reloc_howto_type mips_elf64_howto
 
   /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,		/* type */
-	 0,			/* rightshift */
+	 2,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
 	 16,			/* bitsize */
 	 true,			/* pc_relative */
@@ -336,7 +376,7 @@ static reloc_howto_type mips_elf64_howto
 	 64,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_64",		/* name */
 	 true,			/* partial_inplace */
@@ -352,10 +392,10 @@ static reloc_howto_type mips_elf64_howto
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_DISP",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0x0000ffff,		/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -368,10 +408,10 @@ static reloc_howto_type mips_elf64_howto
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_PAGE",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0x0000ffff,		/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -384,10 +424,10 @@ static reloc_howto_type mips_elf64_howto
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_OFST",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0x0000ffff,		/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -403,7 +443,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_HI16",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0x0000ffff,		/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -419,7 +459,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_LO16",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0x0000ffff,		/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -432,7 +472,7 @@ static reloc_howto_type mips_elf64_howto
 	 64,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_SUB",		/* name */
 	 true,			/* partial_inplace */
@@ -444,16 +484,16 @@ static reloc_howto_type mips_elf64_howto
   /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_INSERT_A,	/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_INSERT_A",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Insert the addend as an instruction, and change all relocations
@@ -461,36 +501,35 @@ static reloc_howto_type mips_elf64_howto
   /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_INSERT_B,	/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_INSERT_B",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Delete a 32 bit instruction.  */
   /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_DELETE,		/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_DELETE",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Get the higher value of a 64 bit addend.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_HIGHER,		/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -533,8 +571,8 @@ static reloc_howto_type mips_elf64_howto
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_CALL_HI16",	/* name */
 	 true,			/* partial_inplace */
-	 0x0000ffff,		/* src_mask */
-	 0x0000ffff,		/* dst_mask */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Low 16 bits of displacement in global offset table.  */
@@ -549,8 +587,8 @@ static reloc_howto_type mips_elf64_howto
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_CALL_LO16",	/* name */
 	 true,			/* partial_inplace */
-	 0x0000ffff,		/* src_mask */
-	 0x0000ffff,		/* dst_mask */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* I'm not sure what the remaining relocs are, but they are defined
@@ -558,79 +596,55 @@ static reloc_howto_type mips_elf64_howto
 
   HOWTO (R_MIPS_SCN_DISP,	/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_SCN_DISP",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   HOWTO (R_MIPS_REL16,		/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_dont, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_REL16",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
-	 false),		/* pcrel_offset */
-
-  HOWTO (R_MIPS_ADD_IMMEDIATE,	/* 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_ADD_IMMEDIATE", /* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 true,			/* partial_inplace */
+	 0xffff,		/* src_mask */
+	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  HOWTO (R_MIPS_PJUMP,		/* 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_PJUMP",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
-	 false),		/* pcrel_offset */
+  /* These two are obsolete.  */
+  EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE),
+  EMPTY_HOWTO (R_MIPS_PJUMP),
 
   HOWTO (R_MIPS_RELGOT,		/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_RELGOT",	/* name */
-	 false,			/* partial_inplace */
-	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 true,			/* partial_inplace */
+	 0xffffffff,		/* src_mask */
+	 0xffffffff,		/* 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) */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
 	 0,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
@@ -638,8 +652,8 @@ static reloc_howto_type mips_elf64_howto
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_JALR",	        /* name */
 	 false,			/* partial_inplace */
-	 0x00000000,		/* src_mask */
-	 0x00000000,		/* dst_mask */
+	 0,			/* src_mask */
+	 0,			/* dst_mask */
 	 false),		/* pcrel_offset */
 };
 
@@ -672,7 +686,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_bitfield, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_16",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -684,10 +698,10 @@ static reloc_howto_type mips_elf64_howto
 	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_32",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -699,15 +713,15 @@ static reloc_howto_type mips_elf64_howto
 	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_REL32",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  /* 26 bit branch address.  */
+  /* 26 bit jump address.  */
   HOWTO (R_MIPS_26,		/* type */
 	 2,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -716,11 +730,11 @@ static reloc_howto_type mips_elf64_howto
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 				/* This needs complex overflow
-				   detection, because the upper four
+				   detection, because the upper 36
 				   bits must match the PC + 4.  */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_26",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x3ffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -735,7 +749,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_HI16",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -750,7 +764,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_LO16",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -794,7 +808,7 @@ static reloc_howto_type mips_elf64_howto
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_signed, /* complain_on_overflow */
-	 bfd_elf_generic_reloc,	/* special_function */
+	 bfd_elf_generic_reloc, /* special_function */
 	 "R_MIPS_GOT16",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
@@ -803,7 +817,7 @@ static reloc_howto_type mips_elf64_howto
 
   /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,		/* type */
-	 0,			/* rightshift */
+	 2,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
 	 16,			/* bitsize */
 	 true,			/* pc_relative */
@@ -811,7 +825,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_PC16",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -861,7 +875,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_bitfield, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_SHIFT5",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x000007c0,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -878,7 +892,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_bitfield, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_SHIFT6",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x000007c4,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -890,10 +904,10 @@ static reloc_howto_type mips_elf64_howto
 	 64,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_64",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 MINUS_ONE,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -906,10 +920,10 @@ static reloc_howto_type mips_elf64_howto
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_DISP",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -922,10 +936,10 @@ static reloc_howto_type mips_elf64_howto
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_PAGE",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -938,10 +952,10 @@ static reloc_howto_type mips_elf64_howto
 	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_OFST",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -957,7 +971,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_HI16",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -973,7 +987,7 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_GOT_LO16",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0x0000ffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -986,10 +1000,10 @@ static reloc_howto_type mips_elf64_howto
 	 64,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_bitfield, /* complain_on_overflow */
+	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_SUB",		/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 MINUS_ONE,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -998,8 +1012,8 @@ static reloc_howto_type mips_elf64_howto
   /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_INSERT_A,	/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
@@ -1007,7 +1021,7 @@ static reloc_howto_type mips_elf64_howto
 	 "R_MIPS_INSERT_A",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Insert the addend as an instruction, and change all relocations
@@ -1015,8 +1029,8 @@ static reloc_howto_type mips_elf64_howto
   /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_INSERT_B,	/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
@@ -1024,15 +1038,15 @@ static reloc_howto_type mips_elf64_howto
 	 "R_MIPS_INSERT_B",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Delete a 32 bit instruction.  */
   /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_DELETE,		/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
@@ -1040,11 +1054,10 @@ static reloc_howto_type mips_elf64_howto
 	 "R_MIPS_DELETE",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Get the higher value of a 64 bit addend.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_HIGHER,		/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -1052,15 +1065,14 @@ static reloc_howto_type mips_elf64_howto
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
-	 bfd_elf_generic_reloc,	/* special_function */
+	 bfd_elf_generic_reloc, /* special_function */
 	 "R_MIPS_HIGHER",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Get the highest value of a 64 bit addend.  */
-  /* FIXME: Not handled correctly.  */
   HOWTO (R_MIPS_HIGHEST,	/* type */
 	 0,			/* rightshift */
 	 2,			/* size (0 = byte, 1 = short, 2 = long) */
@@ -1068,9 +1080,9 @@ static reloc_howto_type mips_elf64_howto
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
-	 bfd_elf_generic_reloc,	/* special_function */
+	 bfd_elf_generic_reloc, /* special_function */
 	 "R_MIPS_HIGHEST",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
@@ -1086,9 +1098,9 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_CALL_HI16",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0x0000ffff,		/* dst_mask */
+	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* Low 16 bits of displacement in global offset table.  */
@@ -1102,9 +1114,9 @@ static reloc_howto_type mips_elf64_howto
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_CALL_LO16",	/* name */
-	 true,			/* partial_inplace */
+	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0x0000ffff,		/* dst_mask */
+	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   /* I'm not sure what the remaining relocs are, but they are defined
@@ -1112,8 +1124,8 @@ static reloc_howto_type mips_elf64_howto
 
   HOWTO (R_MIPS_SCN_DISP,	/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
@@ -1121,81 +1133,57 @@ static reloc_howto_type mips_elf64_howto
 	 "R_MIPS_SCN_DISP",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
   HOWTO (R_MIPS_REL16,		/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
-	 complain_overflow_dont, /* complain_on_overflow */
+	 complain_overflow_signed, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
 	 "R_MIPS_REL16",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 0xffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  HOWTO (R_MIPS_ADD_IMMEDIATE,	/* type */
+  /* These two are obsolete.  */
+  EMPTY_HOWTO (R_MIPS_ADD_IMMEDIATE),
+  EMPTY_HOWTO (R_MIPS_PJUMP),
+
+  HOWTO (R_MIPS_RELGOT,		/* type */
 	 0,			/* rightshift */
-	 0,			/* size (0 = byte, 1 = short, 2 = long) */
-	 0,			/* bitsize */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 32,			/* bitsize */
 	 false,			/* pc_relative */
 	 0,			/* bitpos */
 	 complain_overflow_dont, /* complain_on_overflow */
 	 bfd_elf_generic_reloc,	/* special_function */
-	 "R_MIPS_ADD_IMMEDIATE", /* name */
+	 "R_MIPS_RELGOT",	/* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
-	 0,			/* dst_mask */
+	 0xffffffff,		/* dst_mask */
 	 false),		/* pcrel_offset */
 
-  HOWTO (R_MIPS_PJUMP,		/* type */
+  /* 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) */
+	 2,			/* 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_PJUMP",	/* name */
+	 "R_MIPS_JALR",	        /* name */
 	 false,			/* partial_inplace */
 	 0,			/* src_mask */
 	 0,			/* dst_mask */
 	 false),		/* pcrel_offset */
-
-  HOWTO (R_MIPS_RELGOT,		/* 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_RELGOT",	/* name */
-	 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.  */
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-26 17:38 [PATCH] Fix MIPS ELF64 relocation howtos Thiemo Seufer
@ 2001-08-26 17:50 ` H . J . Lu
  2001-08-26 18:02   ` Thiemo Seufer
  2001-09-06 14:34 ` Thiemo Seufer
  1 sibling, 1 reply; 16+ messages in thread
From: H . J . Lu @ 2001-08-26 17:50 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

On Mon, Aug 27, 2001 at 02:37:51AM +0200, Thiemo Seufer wrote:
> Hi All,
> 
> this changes the HOWTO definitions in elf64-mips.c to conform to
> the MIPS ELF64 object file specification draft. Tested for
> mips64el-elf and mips64-linux.
> 

Where can I find the the MIPS ELF64 spec draft? How different is it
from the SGI ELF64?

H.J.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-26 17:50 ` H . J . Lu
@ 2001-08-26 18:02   ` Thiemo Seufer
  2001-08-27 11:32     ` H . J . Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-26 18:02 UTC (permalink / raw)
  To: H . J . Lu; +Cc: binutils

H . J . Lu wrote:
> On Mon, Aug 27, 2001 at 02:37:51AM +0200, Thiemo Seufer wrote:
> > Hi All,
> > 
> > this changes the HOWTO definitions in elf64-mips.c to conform to
> > the MIPS ELF64 object file specification draft. Tested for
> > mips64el-elf and mips64-linux.
> > 
> 
> Where can I find the the MIPS ELF64 spec draft? How different is it
> from the SGI ELF64?

Don't worry, it's the same. The titlepage reads:
MIPS Technologies / Silicon Graphics Computer Systems.

AFAIK there is nothing newer than this draft.


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-26 18:02   ` Thiemo Seufer
@ 2001-08-27 11:32     ` H . J . Lu
  2001-08-27 11:44       ` Thiemo Seufer
  0 siblings, 1 reply; 16+ messages in thread
From: H . J . Lu @ 2001-08-27 11:32 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

On Mon, Aug 27, 2001 at 03:02:23AM +0200, Thiemo Seufer wrote:
> H . J . Lu wrote:
> > On Mon, Aug 27, 2001 at 02:37:51AM +0200, Thiemo Seufer wrote:
> > > Hi All,
> > > 
> > > this changes the HOWTO definitions in elf64-mips.c to conform to
> > > the MIPS ELF64 object file specification draft. Tested for
> > > mips64el-elf and mips64-linux.
> > > 
> > 
> > Where can I find the the MIPS ELF64 spec draft? How different is it
> > from the SGI ELF64?
> 
> Don't worry, it's the same. The titlepage reads:
> MIPS Technologies / Silicon Graphics Computer Systems.
> 
> AFAIK there is nothing newer than this draft.

I assume it is version 2.4. If it is the case, I am not sure if you can 
use the traditional 64bit MIPS ELF. On the other hand, since there is no
documented traditional 64bit MIPS ELF ABI, we can make a `traditional
64bit MIPS ELF ABI' such that it has the best of both worlds.


H.J.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 11:32     ` H . J . Lu
@ 2001-08-27 11:44       ` Thiemo Seufer
  2001-08-27 12:00         ` H . J . Lu
  0 siblings, 1 reply; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-27 11:44 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Thiemo Seufer, binutils

H . J . Lu wrote:
[snip]
> > Don't worry, it's the same. The titlepage reads:
> > MIPS Technologies / Silicon Graphics Computer Systems.
> > 
> > AFAIK there is nothing newer than this draft.
> 
> I assume it is version 2.4.

Version 2.4, Date 11/3/98.

> If it is the case, I am not sure if you can 
> use the traditional 64bit MIPS ELF. On the other hand, since there is no
> documented traditional 64bit MIPS ELF ABI, we can make a `traditional
> 64bit MIPS ELF ABI' such that it has the best of both worlds.

This means to use the specification as a guide as long as it's
reasonable for Linux. That's my intention, too. 


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 11:44       ` Thiemo Seufer
@ 2001-08-27 12:00         ` H . J . Lu
  2001-08-27 12:41           ` Thiemo Seufer
  2001-08-27 13:01           ` Andrew Cagney
  0 siblings, 2 replies; 16+ messages in thread
From: H . J . Lu @ 2001-08-27 12:00 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

On Mon, Aug 27, 2001 at 08:43:58PM +0200, Thiemo Seufer wrote:
> H . J . Lu wrote:
> [snip]
> > > Don't worry, it's the same. The titlepage reads:
> > > MIPS Technologies / Silicon Graphics Computer Systems.
> > > 
> > > AFAIK there is nothing newer than this draft.
> > 
> > I assume it is version 2.4.
> 
> Version 2.4, Date 11/3/98.
> 
> > If it is the case, I am not sure if you can 
> > use the traditional 64bit MIPS ELF. On the other hand, since there is no
> > documented traditional 64bit MIPS ELF ABI, we can make a `traditional
> > 64bit MIPS ELF ABI' such that it has the best of both worlds.
> 
> This means to use the specification as a guide as long as it's
> reasonable for Linux. That's my intention, too. 

Good. While we are on it, here are things I'd like to see in the new
`traditional 64bit MIPS ELF ABI':

1. Make gp callee-saved.
2. Use RELA relocation if all possible.
3. Use relocations in the SGI 64bit ABI when make senses to us.
4. Drop support for the MIPS/SGI quickstart.
5. Add support for the glibc prelink.

#1 is a gcc only issue. I think the change to gcc is minimum. That is
we make sure that we don't use o64 for gcc. #2, #3, #4 and #5 will
affect binutils.


H.J.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 12:00         ` H . J . Lu
@ 2001-08-27 12:41           ` Thiemo Seufer
  2001-08-27 12:49             ` H . J . Lu
  2001-08-27 13:13             ` Eric Christopher
  2001-08-27 13:01           ` Andrew Cagney
  1 sibling, 2 replies; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-27 12:41 UTC (permalink / raw)
  To: binutils

H . J . Lu wrote:
[snip]
> > This means to use the specification as a guide as long as it's
> > reasonable for Linux. That's my intention, too. 
> 
> Good. While we are on it, here are things I'd like to see in the new
> `traditional 64bit MIPS ELF ABI':
> 
> 1. Make gp callee-saved.

Ok. We should also use the rest of the NewABI calling conventions.

> 2. Use RELA relocation if all possible.

My private patch does so already, and since the ABI draft claims some
essential relocations to be unsupported for REL, this should be used
for all MIPS ELF64 variants. It's the only sane way AFAICS.

> 3. Use relocations in the SGI 64bit ABI when make senses to us.

Ok. I made some steps towards this in my private patch for the
_HIGHER and _HIGHEST relocations.

> 4. Drop support for the MIPS/SGI quickstart.

Since there is no support for quickstart in binutils: already done. :-)

> 5. Add support for the glibc prelink.

This will be an issue when we can do PIC.

> #1 is a gcc only issue.

No, we need to handle .cpsetup, .cpreturn and possibly .cplocal
as well as the resulting relocations. Even if we rely on gcc to
expand these .cp*, we have to handle %gp_rel() and %neg().

> I think the change to gcc is minimum. That is
> we make sure that we don't use o64 for gcc. #2, #3, #4 and #5 will
> affect binutils.

I doubt anybody actually uses o64. I found several places in
binutils where it is broken or only partially implemented.


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 12:41           ` Thiemo Seufer
@ 2001-08-27 12:49             ` H . J . Lu
  2001-08-27 13:13             ` Eric Christopher
  1 sibling, 0 replies; 16+ messages in thread
From: H . J . Lu @ 2001-08-27 12:49 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

On Mon, Aug 27, 2001 at 09:41:05PM +0200, Thiemo Seufer wrote:
> H . J . Lu wrote:
> [snip]
> > > This means to use the specification as a guide as long as it's
> > > reasonable for Linux. That's my intention, too. 
> > 
> > Good. While we are on it, here are things I'd like to see in the new
> > `traditional 64bit MIPS ELF ABI':
> > 
> > 1. Make gp callee-saved.
> 
> Ok. We should also use the rest of the NewABI calling conventions.

Yes. That makes senses since that is how gcc generates code for the
64bit MIPS ABI.

> 
> > 2. Use RELA relocation if all possible.
> 
> My private patch does so already, and since the ABI draft claims some
> essential relocations to be unsupported for REL, this should be used
> for all MIPS ELF64 variants. It's the only sane way AFAICS.
> 
> > 3. Use relocations in the SGI 64bit ABI when make senses to us.
> 
> Ok. I made some steps towards this in my private patch for the
> _HIGHER and _HIGHEST relocations.
> 
> > 4. Drop support for the MIPS/SGI quickstart.
> 
> Since there is no support for quickstart in binutils: already done. :-)

I think there are some strange stuffs in DT_xxxx and symbol tables,
which are only used for quickstart.

> 
> > 5. Add support for the glibc prelink.
> 
> This will be an issue when we can do PIC.

We should be prepared for that.

> 
> > #1 is a gcc only issue.
> 
> No, we need to handle .cpsetup, .cpreturn and possibly .cplocal
> as well as the resulting relocations. Even if we rely on gcc to
> expand these .cp*, we have to handle %gp_rel() and %neg().

I see.

> 
> > I think the change to gcc is minimum. That is
> > we make sure that we don't use o64 for gcc. #2, #3, #4 and #5 will
> > affect binutils.
> 
> I doubt anybody actually uses o64. I found several places in
> binutils where it is broken or only partially implemented.

I think o64 in gcc may be also broken since noone really tests it.


H.J.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 12:00         ` H . J . Lu
  2001-08-27 12:41           ` Thiemo Seufer
@ 2001-08-27 13:01           ` Andrew Cagney
  2001-08-27 13:45             ` Thiemo Seufer
  1 sibling, 1 reply; 16+ messages in thread
From: Andrew Cagney @ 2001-08-27 13:01 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Thiemo Seufer, binutils

> 
> Good. While we are on it, here are things I'd like to see in the new
> `traditional 64bit MIPS ELF ABI':


Really stupid question.  How can a ``new'' ABI be ``traditional''? 
Surely traditional is what ever the abi turned out to be as a 
consequence of history?

	Andrew


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 12:41           ` Thiemo Seufer
  2001-08-27 12:49             ` H . J . Lu
@ 2001-08-27 13:13             ` Eric Christopher
  2001-08-27 13:23               ` H . J . Lu
  2001-08-31 20:11               ` Thiemo Seufer
  1 sibling, 2 replies; 16+ messages in thread
From: Eric Christopher @ 2001-08-27 13:13 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

> I doubt anybody actually uses o64. I found several places in
> binutils where it is broken or only partially implemented.
> 

Actually, I believe that the mips64-elf compiler uses o64 by default. I
could verify, but not at the moment :)

-eric

-- 
Look out behind you!

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 13:13             ` Eric Christopher
@ 2001-08-27 13:23               ` H . J . Lu
  2001-08-31 20:11               ` Thiemo Seufer
  1 sibling, 0 replies; 16+ messages in thread
From: H . J . Lu @ 2001-08-27 13:23 UTC (permalink / raw)
  To: Eric Christopher; +Cc: Thiemo Seufer, binutils

On Mon, Aug 27, 2001 at 01:12:03PM -0700, Eric Christopher wrote:
> 
> > I doubt anybody actually uses o64. I found several places in
> > binutils where it is broken or only partially implemented.
> > 
> 
> Actually, I believe that the mips64-elf compiler uses o64 by default. I
> could verify, but not at the moment :)

It doesn't mean much. As far as I know, the most interesting stuff in
an ELF ABI is the dynamic binary support. In fact, an ELF ABI may not
even cover static binaries. I doubt mips64-elf supports the dynamic
binaries.


H.J.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 13:01           ` Andrew Cagney
@ 2001-08-27 13:45             ` Thiemo Seufer
  2001-08-27 14:06               ` Andrew Cagney
  0 siblings, 1 reply; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-27 13:45 UTC (permalink / raw)
  To: binutils

Andrew Cagney wrote:
> >
> >Good. While we are on it, here are things I'd like to see in the new
> >`traditional 64bit MIPS ELF ABI':
> 
> 
> Really stupid question.  How can a ``new'' ABI be ``traditional''? 
> Surely traditional is what ever the abi turned out to be as a 
> consequence of history?

It's "new" in the sense of having a different calling convention
and can make better use of the 64bit chips capabilities. It's
"traditional" since it doesn't do some weird features like
different symbol sorting as it was introduced by SGI when they
introduced NewABI.


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 13:45             ` Thiemo Seufer
@ 2001-08-27 14:06               ` Andrew Cagney
  2001-08-28  8:52                 ` Thiemo Seufer
  0 siblings, 1 reply; 16+ messages in thread
From: Andrew Cagney @ 2001-08-27 14:06 UTC (permalink / raw)
  To: Thiemo Seufer; +Cc: binutils

> 
> It's "new" in the sense of having a different calling convention
> and can make better use of the 64bit chips capabilities. It's
> "traditional" since it doesn't do some weird features like
> different symbol sorting as it was introduced by SGI when they
> introduced NewABI.

Ah!  In that case could I strongly encourage people to drop the terms 
``new'' and ``traditional'' and, instead, give it a name?  Hmm, 
NewTraditional64 (nt64) is probably not a good choice :-)

Is it safe for me to assume that a mips64-elf toolchain isn't suddenly 
going to start producing this as output?

	Andrew


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 14:06               ` Andrew Cagney
@ 2001-08-28  8:52                 ` Thiemo Seufer
  0 siblings, 0 replies; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-28  8:52 UTC (permalink / raw)
  To: binutils

Andrew Cagney wrote:
> >It's "new" in the sense of having a different calling convention
> >and can make better use of the 64bit chips capabilities. It's
> >"traditional" since it doesn't do some weird features like
> >different symbol sorting as it was introduced by SGI when they
> >introduced NewABI.
> 
> Ah!  In that case could I strongly encourage people to drop the terms 
> ``new'' and ``traditional'' and, instead, give it a name?  Hmm, 
> NewTraditional64 (nt64) is probably not a good choice :-)

I don't have a good name for it, too.

> Is it safe for me to assume that a mips64-elf toolchain isn't suddenly 
> going to start producing this as output?

Switching from REL to RELA as default will also affect mips64-elf.


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-27 13:13             ` Eric Christopher
  2001-08-27 13:23               ` H . J . Lu
@ 2001-08-31 20:11               ` Thiemo Seufer
  1 sibling, 0 replies; 16+ messages in thread
From: Thiemo Seufer @ 2001-08-31 20:11 UTC (permalink / raw)
  To: binutils

Eric Christopher wrote:
> 
> > I doubt anybody actually uses o64. I found several places in
> > binutils where it is broken or only partially implemented.
> > 
> 
> Actually, I believe that the mips64-elf compiler uses o64 by default. I
> could verify, but not at the moment :)

mips64el-elf uses o32 with mips3 ISA, and it doesn't accept any
-mabi=FOO options.


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Fix MIPS ELF64 relocation howtos
  2001-08-26 17:38 [PATCH] Fix MIPS ELF64 relocation howtos Thiemo Seufer
  2001-08-26 17:50 ` H . J . Lu
@ 2001-09-06 14:34 ` Thiemo Seufer
  1 sibling, 0 replies; 16+ messages in thread
From: Thiemo Seufer @ 2001-09-06 14:34 UTC (permalink / raw)
  To: binutils

Thiemo Seufer wrote:
[snip]
> 	/bfd/ChangeLog
> 	* elf64-mips.c (mips_elf64_howto_table_rel): Fix relocation HOWTO
> 	definitions.
> 	(mips_elf64_howto_table_Rel): Likewise.

I checked in a slightly modified patch which does _not_ declare
R_MIPS_PC16 as rightshifted. This relocation is actually defined
to span a offset of 16 bit, while the hardware could do 18.


Thiemo

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2001-09-06 14:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-26 17:38 [PATCH] Fix MIPS ELF64 relocation howtos Thiemo Seufer
2001-08-26 17:50 ` H . J . Lu
2001-08-26 18:02   ` Thiemo Seufer
2001-08-27 11:32     ` H . J . Lu
2001-08-27 11:44       ` Thiemo Seufer
2001-08-27 12:00         ` H . J . Lu
2001-08-27 12:41           ` Thiemo Seufer
2001-08-27 12:49             ` H . J . Lu
2001-08-27 13:13             ` Eric Christopher
2001-08-27 13:23               ` H . J . Lu
2001-08-31 20:11               ` Thiemo Seufer
2001-08-27 13:01           ` Andrew Cagney
2001-08-27 13:45             ` Thiemo Seufer
2001-08-27 14:06               ` Andrew Cagney
2001-08-28  8:52                 ` Thiemo Seufer
2001-09-06 14:34 ` Thiemo Seufer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).