[binutils-gdb] microMIPS/BFD: Add missing NewABI TLS and miscellaneous relocations

Maciej W.Rozycki macro@sourceware.org
Mon Jul 2 22:59:00 GMT 2018


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=156f2c001e22dfeee69c92bdb380d5eb28a3de78

commit 156f2c001e22dfeee69c92bdb380d5eb28a3de78
Author: Maciej W. Rozycki <macro@mips.com>
Date:   Mon Jul 2 23:57:22 2018 +0100

    microMIPS/BFD: Add missing NewABI TLS and miscellaneous relocations
    
    Complement commit df58fc944dbc ("MIPS: microMIPS ASE support"),
    <https://sourceware.org/ml/binutils/2011-07/msg00198.html>, and add TLS
    and a few miscellaneous relocations to NewABI microMIPS support, fixing
    GAS assertion failures:
    
    .../gas/testsuite/gas/mips/elf-rel28.s: Assembler messages:
    .../gas/testsuite/gas/mips/elf-rel28.s:19: Internal error in append_insn at .../gas/config/tc-mips.c:7660.
    Please report this bug.
    
    observed if an attempt is made to assemble the `elf-rel28.s' test case
    to microMIPS code.  The relocations are the same as with o32 support,
    except for `partial_inplace' and `src_mask' updates for the respective
    RELA variants.
    
    	bfd/
    	* elf64-mips.c (micromips_elf64_howto_table_rel): Add
    	R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
    	R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
    	R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
    	R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
    	R_MICROMIPS_PC23_S2 relocation entries.
    	(micromips_elf64_howto_table_rela): Likewise.
    	(micromips_reloc_map): Likewise.
    	* elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
    	(elf_micromips_howto_table_rela): Likewise.
    	(micromips_reloc_map): Likewise.
    
    	gas/
    	* testsuite/gas/mips/elf-rel28-micromips-n32.d: New test.
    	* testsuite/gas/mips/elf-rel28-micromips-n64.d: New test.
    	* testsuite/gas/mips/mips.exp: Run the new tests.

Diff:
---
 bfd/ChangeLog                                    |  14 +
 bfd/elf64-mips.c                                 | 335 +++++++++++++++++++++++
 bfd/elfn32-mips.c                                | 335 +++++++++++++++++++++++
 gas/ChangeLog                                    |   6 +
 gas/testsuite/gas/mips/elf-rel28-micromips-n32.d |  96 +++++++
 gas/testsuite/gas/mips/elf-rel28-micromips-n64.d | 180 ++++++++++++
 gas/testsuite/gas/mips/mips.exp                  |   2 +
 7 files changed, 968 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 5fc2fec..c53d14d 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,17 @@
+2018-07-02  Maciej W. Rozycki  <macro@mips.com>
+
+	* elf64-mips.c (micromips_elf64_howto_table_rel): Add
+	R_MICROMIPS_HI0_LO16, R_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_LDM,
+	R_MICROMIPS_TLS_DTPREL_HI16, R_MICROMIPS_TLS_DTPREL_LO16,
+	R_MICROMIPS_TLS_GOTTPREL, R_MICROMIPS_TLS_TPREL_HI16,
+	R_MICROMIPS_TLS_TPREL_LO16, R_MICROMIPS_GPREL7_S2 and
+	R_MICROMIPS_PC23_S2 relocation entries.
+	(micromips_elf64_howto_table_rela): Likewise.
+	(micromips_reloc_map): Likewise.
+	* elfn32-mips.c (elf_micromips_howto_table_rel): Likewise.
+	(elf_micromips_howto_table_rela): Likewise.
+	(micromips_reloc_map): Likewise.
+
 2018-07-02  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR ld/23324
diff --git a/bfd/elf64-mips.c b/bfd/elf64-mips.c
index 4b9fdf6..7c9916f 100644
--- a/bfd/elf64-mips.c
+++ b/bfd/elf64-mips.c
@@ -2421,6 +2421,166 @@ static reloc_howto_type micromips_elf64_howto_table_rel[] =
 	 0,			/* src_mask */
 	 0x00000000,		/* dst_mask */
 	 FALSE),		/* pcrel_offset */
+
+  /* Low 16 bits of symbol value.  Note that the high 16 bits of symbol values
+     must be zero.  This is used for relaxation.  */
+  HOWTO (R_MICROMIPS_HI0_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_HI0_LO16",/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (158),
+  EMPTY_HOWTO (159),
+  EMPTY_HOWTO (160),
+  EMPTY_HOWTO (161),
+
+  /* TLS general dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_GD,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GD",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_LDM,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_LDM",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_HI16",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_LO16",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_GOTTPREL,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GOTTPREL",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (167),
+  EMPTY_HOWTO (168),
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_HI16", /* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_LO16", /* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (171),
+
+  /* GP- and PC-relative relocations.  */
+  HOWTO (R_MICROMIPS_GPREL7_S2,	/* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 7,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf32_gprel16_reloc, /* special_function */
+	 "R_MICROMIPS_GPREL7_S2",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000007f,		/* src_mask */
+	 0x0000007f,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_MICROMIPS_PC23_S2,	/* type */
+	 2,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 23,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_PC23_S2",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x007fffff,		/* src_mask */
+	 0x007fffff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
 };
 
 static reloc_howto_type micromips_elf64_howto_table_rela[] =
@@ -2763,6 +2923,166 @@ static reloc_howto_type micromips_elf64_howto_table_rela[] =
 	 0,			/* src_mask */
 	 0x00000000,		/* dst_mask */
 	 FALSE),		/* pcrel_offset */
+
+  /* Low 16 bits of symbol value.  Note that the high 16 bits of symbol values
+     must be zero.  This is used for relaxation.  */
+  HOWTO (R_MICROMIPS_HI0_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_HI0_LO16",/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (158),
+  EMPTY_HOWTO (159),
+  EMPTY_HOWTO (160),
+  EMPTY_HOWTO (161),
+
+  /* TLS general dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_GD,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GD",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_LDM,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_LDM",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_HI16",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_LO16",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_GOTTPREL,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GOTTPREL",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (167),
+  EMPTY_HOWTO (168),
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_HI16", /* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_LO16", /* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (171),
+
+  /* GP- and PC-relative relocations.  */
+  HOWTO (R_MICROMIPS_GPREL7_S2,	/* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 7,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf32_gprel16_reloc, /* special_function */
+	 "R_MICROMIPS_GPREL7_S2",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000007f,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_MICROMIPS_PC23_S2,	/* type */
+	 2,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 23,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_PC23_S2",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x007fffff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
 };
 
 /* GNU extension to record C++ vtable hierarchy */
@@ -3463,6 +3783,21 @@ static const struct elf_reloc_map micromips_reloc_map[] =
   { BFD_RELOC_MICROMIPS_CALL_LO16, R_MICROMIPS_CALL_LO16 - R_MICROMIPS_min },
   { BFD_RELOC_MICROMIPS_SCN_DISP, R_MICROMIPS_SCN_DISP - R_MICROMIPS_min },
   { BFD_RELOC_MICROMIPS_JALR, R_MICROMIPS_JALR - R_MICROMIPS_min },
+  /* There is no BFD reloc for R_MICROMIPS_HI0_LO16.  */
+  { BFD_RELOC_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_GD - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_LDM, R_MICROMIPS_TLS_LDM - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
+    R_MICROMIPS_TLS_DTPREL_HI16 - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
+    R_MICROMIPS_TLS_DTPREL_LO16 - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
+    R_MICROMIPS_TLS_GOTTPREL - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
+    R_MICROMIPS_TLS_TPREL_HI16 - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
+    R_MICROMIPS_TLS_TPREL_LO16 - R_MICROMIPS_min },
+  /* There is no BFD reloc for R_MICROMIPS_GPREL7_S2.  */
+  /* There is no BFD reloc for R_MICROMIPS_PC23_S2.  */
 };
 /* Given a BFD reloc type, return a howto structure.  */
 
diff --git a/bfd/elfn32-mips.c b/bfd/elfn32-mips.c
index 99c14e7..10e10bf 100644
--- a/bfd/elfn32-mips.c
+++ b/bfd/elfn32-mips.c
@@ -2399,6 +2399,166 @@ static reloc_howto_type elf_micromips_howto_table_rel[] =
 	 0,			/* src_mask */
 	 0x00000000,		/* dst_mask */
 	 FALSE),		/* pcrel_offset */
+
+  /* Low 16 bits of symbol value.  Note that the high 16 bits of symbol values
+     must be zero.  This is used for relaxation.  */
+  HOWTO (R_MICROMIPS_HI0_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_HI0_LO16",/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (158),
+  EMPTY_HOWTO (159),
+  EMPTY_HOWTO (160),
+  EMPTY_HOWTO (161),
+
+  /* TLS general dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_GD,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GD",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_LDM,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_LDM",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_HI16",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_LO16",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_GOTTPREL,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GOTTPREL",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (167),
+  EMPTY_HOWTO (168),
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_HI16", /* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_LO16", /* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000ffff,		/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (171),
+
+  /* GP- and PC-relative relocations.  */
+  HOWTO (R_MICROMIPS_GPREL7_S2,	/* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 7,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf32_gprel16_reloc, /* special_function */
+	 "R_MICROMIPS_GPREL7_S2",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x0000007f,		/* src_mask */
+	 0x0000007f,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_MICROMIPS_PC23_S2,	/* type */
+	 2,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 23,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_PC23_S2",	/* name */
+	 TRUE,			/* partial_inplace */
+	 0x007fffff,		/* src_mask */
+	 0x007fffff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
 };
 
 static reloc_howto_type elf_micromips_howto_table_rela[] =
@@ -2741,6 +2901,166 @@ static reloc_howto_type elf_micromips_howto_table_rela[] =
 	 0,			/* src_mask */
 	 0x00000000,		/* dst_mask */
 	 FALSE),		/* pcrel_offset */
+
+  /* Low 16 bits of symbol value.  Note that the high 16 bits of symbol values
+     must be zero.  This is used for relaxation.  */
+  HOWTO (R_MICROMIPS_HI0_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_dont, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_HI0_LO16",/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (158),
+  EMPTY_HOWTO (159),
+  EMPTY_HOWTO (160),
+  EMPTY_HOWTO (161),
+
+  /* TLS general dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_GD,		/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GD",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic variable reference.  */
+  HOWTO (R_MICROMIPS_TLS_LDM,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_LDM",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_HI16",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS local dynamic offset.  */
+  HOWTO (R_MICROMIPS_TLS_DTPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_DTPREL_LO16",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_GOTTPREL,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_GOTTPREL",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (167),
+  EMPTY_HOWTO (168),
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_HI16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_HI16", /* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  /* TLS thread pointer offset.  */
+  HOWTO (R_MICROMIPS_TLS_TPREL_LO16,	/* type */
+	 0,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 16,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_TLS_TPREL_LO16", /* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000ffff,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  EMPTY_HOWTO (171),
+
+  /* GP- and PC-relative relocations.  */
+  HOWTO (R_MICROMIPS_GPREL7_S2,	/* type */
+	 2,			/* rightshift */
+	 1,			/* size (0 = byte, 1 = short, 2 = long) */
+	 7,			/* bitsize */
+	 FALSE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf32_gprel16_reloc, /* special_function */
+	 "R_MICROMIPS_GPREL7_S2",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x0000007f,		/* dst_mask */
+	 FALSE),		/* pcrel_offset */
+
+  HOWTO (R_MICROMIPS_PC23_S2,	/* type */
+	 2,			/* rightshift */
+	 2,			/* size (0 = byte, 1 = short, 2 = long) */
+	 23,			/* bitsize */
+	 TRUE,			/* pc_relative */
+	 0,			/* bitpos */
+	 complain_overflow_signed, /* complain_on_overflow */
+	 _bfd_mips_elf_generic_reloc, /* special_function */
+	 "R_MICROMIPS_PC23_S2",	/* name */
+	 FALSE,			/* partial_inplace */
+	 0,			/* src_mask */
+	 0x007fffff,		/* dst_mask */
+	 TRUE),			/* pcrel_offset */
 };
 
 /* GNU extension to record C++ vtable hierarchy */
@@ -3291,6 +3611,21 @@ static const struct elf_reloc_map micromips_reloc_map[] =
   { BFD_RELOC_MICROMIPS_CALL_LO16, R_MICROMIPS_CALL_LO16 - R_MICROMIPS_min },
   { BFD_RELOC_MICROMIPS_SCN_DISP, R_MICROMIPS_SCN_DISP - R_MICROMIPS_min },
   { BFD_RELOC_MICROMIPS_JALR, R_MICROMIPS_JALR - R_MICROMIPS_min },
+  /* There is no BFD reloc for R_MICROMIPS_HI0_LO16.  */
+  { BFD_RELOC_MICROMIPS_TLS_GD, R_MICROMIPS_TLS_GD - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_LDM, R_MICROMIPS_TLS_LDM - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16,
+    R_MICROMIPS_TLS_DTPREL_HI16 - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16,
+    R_MICROMIPS_TLS_DTPREL_LO16 - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_GOTTPREL,
+    R_MICROMIPS_TLS_GOTTPREL - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_TPREL_HI16,
+    R_MICROMIPS_TLS_TPREL_HI16 - R_MICROMIPS_min },
+  { BFD_RELOC_MICROMIPS_TLS_TPREL_LO16,
+    R_MICROMIPS_TLS_TPREL_LO16 - R_MICROMIPS_min },
+  /* There is no BFD reloc for R_MICROMIPS_GPREL7_S2.  */
+  /* There is no BFD reloc for R_MICROMIPS_PC23_S2.  */
 };
 
 /* Given a BFD reloc type, return a howto structure.  */
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 47fa7ae..bf5368c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-02  Maciej W. Rozycki  <macro@mips.com>
+
+	* testsuite/gas/mips/elf-rel28-micromips-n32.d: New test.
+	* testsuite/gas/mips/elf-rel28-micromips-n64.d: New test.
+	* testsuite/gas/mips/mips.exp: Run the new tests.
+
 2018-07-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
 	* config/tc-arm.c (cpu_arch_ver): Use symbolic TAG_CPU_ARCH macros
diff --git a/gas/testsuite/gas/mips/elf-rel28-micromips-n32.d b/gas/testsuite/gas/mips/elf-rel28-micromips-n32.d
new file mode 100644
index 0000000..a5a504e
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel28-micromips-n32.d
@@ -0,0 +1,96 @@
+#source: elf-rel28.s
+#as: -march=from-abi -mmicromips -n32
+#objdump: -dr
+#name: MIPS ELF reloc 28 (microMIPS, n32)
+
+.*:     file format .*
+
+
+Disassembly of section \.text:
+
+.* <foo>:
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_HI16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_LO16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_DISP	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_PAGE	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_OFST	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_HI16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_LO16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GPREL16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MIPS_16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHEST	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHER	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_SUB	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GD	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_LDM	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_HI16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_LO16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_HI16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_LO16	bar
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GOTTPREL	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_HI16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_LO16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_DISP	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_PAGE	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_OFST	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_HI16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_LO16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GPREL16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MIPS_16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHEST	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHER	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_SUB	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GD	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_LDM	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_HI16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_LO16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_HI16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_LO16	bar
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GOTTPREL	bar
+	\.\.\.
diff --git a/gas/testsuite/gas/mips/elf-rel28-micromips-n64.d b/gas/testsuite/gas/mips/elf-rel28-micromips-n64.d
new file mode 100644
index 0000000..5d96ebb
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel28-micromips-n64.d
@@ -0,0 +1,180 @@
+#source: elf-rel28.s
+#as: -march=from-abi -mmicromips -64
+#objdump: -dr
+#name: MIPS ELF reloc 28 (microMIPS, n64)
+
+.*:     file format .*
+
+
+Disassembly of section \.text:
+
+.* <foo>:
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_DISP	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_PAGE	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_OFST	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_GPREL16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MIPS_16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHEST	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHER	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_SUB	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GD	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_LDM	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	dc84 0000 	ld	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GOTTPREL	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_CALL16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_DISP	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_PAGE	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_OFST	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GOT16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_GPREL16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MIPS_16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHEST	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_HIGHER	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_SUB	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GD	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_LDM	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_DTPREL_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_HI16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_TPREL_LO16	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+.*:	d884 0000 	sd	a0,0\(a0\)
+			.*: R_MICROMIPS_TLS_GOTTPREL	bar
+			.*: R_MIPS_NONE	\*ABS\*
+			.*: R_MIPS_NONE	\*ABS\*
+	\.\.\.
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 786168d..49b4386 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -1221,7 +1221,9 @@ if { [istarget mips*-*-vxworks*] } {
 
     if $has_newabi {
 	run_dump_test "elf-rel28-n32"
+	run_dump_test "elf-rel28-micromips-n32"
 	run_dump_test "elf-rel28-n64"
+	run_dump_test "elf-rel28-micromips-n64"
 	run_dump_test_arches "elf-rel29" [mips_arch_list_matching mips3]
     }
     run_list_test_arches "elf-rel30" "-32" [mips_arch_list_all]



More information about the Binutils-cvs mailing list