aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-09-26 21:43:26 +0000
committerIan Lance Taylor <ian@airs.com>1994-09-26 21:43:26 +0000
commitfbc83deff8e6e47b8352185d988036745ed24daa (patch)
tree50d913360a8defb9e971bc7118a950549c77ed55
parent80cbf870229e5d5f7559f857a9d3eea992883b06 (diff)
downloadgdb-fbc83deff8e6e47b8352185d988036745ed24daa.zip
gdb-fbc83deff8e6e47b8352185d988036745ed24daa.tar.gz
gdb-fbc83deff8e6e47b8352185d988036745ed24daa.tar.bz2
* gas/mips: Add test cases for PIC code, both SVR4 style and
-membedded-pic style.
-rw-r--r--gas/testsuite/gas/mips/.Sanitize21
-rw-r--r--gas/testsuite/gas/mips/jal-empic.d26
-rw-r--r--gas/testsuite/gas/mips/jal-svr4pic.d39
-rw-r--r--gas/testsuite/gas/mips/jal-svr4pic.s14
-rw-r--r--gas/testsuite/gas/mips/la-empic.d105
-rw-r--r--gas/testsuite/gas/mips/la-empic.s57
-rw-r--r--gas/testsuite/gas/mips/lb-empic.d102
-rw-r--r--gas/testsuite/gas/mips/lb-pic.s52
-rw-r--r--gas/testsuite/gas/mips/ld-empic.d186
-rw-r--r--gas/testsuite/gas/mips/ld-pic.s54
-rw-r--r--gas/testsuite/gas/mips/lif-empic.d21
-rw-r--r--gas/testsuite/gas/mips/ulh-empic.d91
-rw-r--r--gas/testsuite/gas/mips/ulh-pic.s29
13 files changed, 794 insertions, 3 deletions
diff --git a/gas/testsuite/gas/mips/.Sanitize b/gas/testsuite/gas/mips/.Sanitize
index cea0618..603005b 100644
--- a/gas/testsuite/gas/mips/.Sanitize
+++ b/gas/testsuite/gas/mips/.Sanitize
@@ -1,6 +1,4 @@
-# Sanitize.in for devo.
-# $Id$
-#
+# .Sanitize for devo/gas/testsuite/gas/mips.
# Each directory to survive it's way into a release will need a file
# like this one called "./.Sanitize". All keyword lines must exist,
@@ -44,16 +42,30 @@ bltu.d
bltu.s
div.d
div.s
+jal-empic.d
+jal-svr4pic.d
+jal-svr4pic.s
jal.d
jal.s
+la-empic.d
+la-empic.s
+la-svr4pic.d
la.d
la.s
+lb-empic.d
+lb-pic.s
+lb-svr4pic.d
lb.d
lb.s
ld.d
ld.s
+ld-empic.d
+ld-pic.s
+ld-svr4pic.d
li.d
li.s
+lif-empic.d
+lif-svr4pic.d
lifloat.d
lifloat.s
mips.exp
@@ -65,6 +77,9 @@ sb.d
sb.s
trunc.d
trunc.s
+ulh-empic.d
+ulh-pic.s
+ulh-svr4pic.d
ulh.d
ulh.s
ulw.d
diff --git a/gas/testsuite/gas/mips/jal-empic.d b/gas/testsuite/gas/mips/jal-empic.d
new file mode 100644
index 0000000..808be95
--- /dev/null
+++ b/gas/testsuite/gas/mips/jal-empic.d
@@ -0,0 +1,26 @@
+#objdump: -dr
+#name: jal-empic
+#as: -mips1 -membedded-pic
+#source: jal.s
+
+# Test the jal macro with -membedded-pic.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> jalr \$t9
+...
+0+0008 <[^>]*> jalr \$a0,\$t9
+...
+0+0010 <[^>]*> bal 0+0000 <text_label>
+[ ]*RELOC: 0+0010 PCREL16 .text
+...
+0+0018 <[^>]*> bal 0+0018 <text_label\+18>
+[ ]*RELOC: 0+0018 PCREL16 external_text_label
+...
+0+0020 <[^>]*> b 0+0000 <text_label>
+[ ]*RELOC: 0+0020 PCREL16 .text
+...
+0+0028 <[^>]*> b 0+0028 <text_label\+28>
+[ ]*RELOC: 0+0028 PCREL16 external_text_label
+...
diff --git a/gas/testsuite/gas/mips/jal-svr4pic.d b/gas/testsuite/gas/mips/jal-svr4pic.d
new file mode 100644
index 0000000..206e662
--- /dev/null
+++ b/gas/testsuite/gas/mips/jal-svr4pic.d
@@ -0,0 +1,39 @@
+#objdump: -dr
+#name: jal-svr4pic
+#as: -mips1 -KPIC
+
+# Test the jal macro with -KPIC.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lui \$gp,0
+[ ]*RELOC: 0+0000 R_MIPS_HI16 _gp_disp
+0+0004 <[^>]*> addiu \$gp,\$gp,0
+[ ]*RELOC: 0+0004 R_MIPS_LO16 _gp_disp
+0+0008 <[^>]*> addu \$gp,\$gp,\$t9
+0+000c <[^>]*> sw \$gp,0\(\$sp\)
+0+0010 <[^>]*> jalr \$t9
+...
+0+0018 <[^>]*> lw \$gp,0\(\$sp\)
+0+001c <[^>]*> jalr \$a0,\$t9
+...
+0+0024 <[^>]*> lw \$gp,0\(\$sp\)
+...
+0+002c <[^>]*> lw \$t9,0\(\$gp\)
+[ ]*RELOC: 0+002c R_MIPS_GOT16 .text
+...
+0+0034 <[^>]*> addiu \$t9,\$t9,0
+[ ]*RELOC: 0+0034 R_MIPS_LO16 .text
+0+0038 <[^>]*> jalr \$t9
+...
+0+0040 <[^>]*> lw \$gp,0\(\$sp\)
+...
+0+0048 <[^>]*> lw \$t9,0\(\$gp\)
+[ ]*RELOC: 0+0048 R_MIPS_CALL16 external_text_label
+...
+0+0050 <[^>]*> jalr \$t9
+...
+0+0058 <[^>]*> lw \$gp,0\(\$sp\)
+0+005c <[^>]*> b 00000000 <text_label>
+...
diff --git a/gas/testsuite/gas/mips/jal-svr4pic.s b/gas/testsuite/gas/mips/jal-svr4pic.s
new file mode 100644
index 0000000..59208a4
--- /dev/null
+++ b/gas/testsuite/gas/mips/jal-svr4pic.s
@@ -0,0 +1,14 @@
+# Source file used to test the jal macro with -KPIC code.
+
+text_label:
+ .set noreorder
+ .cpload $25
+ .set reorder
+ .cprestore 0
+ jal $25
+ jal $4,$25
+ jal text_label
+ jal external_text_label
+
+# Test j as well
+ j text_label
diff --git a/gas/testsuite/gas/mips/la-empic.d b/gas/testsuite/gas/mips/la-empic.d
new file mode 100644
index 0000000..ceae655
--- /dev/null
+++ b/gas/testsuite/gas/mips/la-empic.d
@@ -0,0 +1,105 @@
+#objdump: -dr
+#name: la-empic
+#as: -mips1 -membedded-pic
+
+# Test the la macro with -membedded-pic.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> li \$a0,0
+0+0004 <[^>]*> li \$a0,1
+0+0008 <[^>]*> li \$a0,32768
+0+000c <[^>]*> li \$a0,-32768
+0+0010 <[^>]*> lui \$a0,1
+0+0014 <[^>]*> lui \$a0,1
+0+0018 <[^>]*> ori \$a0,\$a0,42405
+0+001c <[^>]*> li \$a0,0
+0+0020 <[^>]*> addu \$a0,\$a0,\$a1
+0+0024 <[^>]*> li \$a0,1
+0+0028 <[^>]*> addu \$a0,\$a0,\$a1
+0+002c <[^>]*> li \$a0,32768
+0+0030 <[^>]*> addu \$a0,\$a0,\$a1
+0+0034 <[^>]*> li \$a0,-32768
+0+0038 <[^>]*> addu \$a0,\$a0,\$a1
+0+003c <[^>]*> lui \$a0,1
+0+0040 <[^>]*> addu \$a0,\$a0,\$a1
+0+0044 <[^>]*> lui \$a0,1
+0+0048 <[^>]*> ori \$a0,\$a0,42405
+0+004c <[^>]*> addu \$a0,\$a0,\$a1
+0+0050 <[^>]*> addiu \$a0,\$gp,-16384
+[ ]*RELOC: 0+0050 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0054 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+0054 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+0058 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+0058 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+005c <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+005c [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+0060 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+0060 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0064 <[^>]*> addiu \$a0,\$gp,-16384
+[ ]*RELOC: 0+0064 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0068 <[^>]*> addiu \$a0,\$gp,-15384
+[ ]*RELOC: 0+0068 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+006c <[^>]*> addiu \$a0,\$gp,-16383
+[ ]*RELOC: 0+006c [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0070 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+0074 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+0074 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0078 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+0078 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+007c <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+007c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0080 <[^>]*> addiu \$a0,\$gp,-16383
+[ ]*RELOC: 0+0080 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0084 <[^>]*> addiu \$a0,\$gp,-15383
+[ ]*RELOC: 0+0084 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0088 <[^>]*> addiu \$a0,\$gp,-16384
+[ ]*RELOC: 0+0088 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+008c <[^>]*> addu \$a0,\$a0,\$a1
+0+0090 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+0090 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+0094 <[^>]*> addu \$a0,\$a0,\$a1
+0+0098 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+0098 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+009c <[^>]*> addu \$a0,\$a0,\$a1
+0+00a0 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+00a0 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00a4 <[^>]*> addu \$a0,\$a0,\$a1
+0+00a8 <[^>]*> addiu \$a0,\$gp,0
+[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00ac <[^>]*> addu \$a0,\$a0,\$a1
+0+00b0 <[^>]*> addiu \$a0,\$gp,-16384
+[ ]*RELOC: 0+00b0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00b4 <[^>]*> addu \$a0,\$a0,\$a1
+0+00b8 <[^>]*> addiu \$a0,\$gp,-15384
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00bc <[^>]*> addu \$a0,\$a0,\$a1
+0+00c0 <[^>]*> addiu \$a0,\$gp,-16383
+[ ]*RELOC: 0+00c0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+00c4 <[^>]*> addu \$a0,\$a0,\$a1
+0+00c8 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+00c8 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+00cc <[^>]*> addu \$a0,\$a0,\$a1
+0+00d0 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+00d0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00d4 <[^>]*> addu \$a0,\$a0,\$a1
+0+00d8 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+00d8 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00dc <[^>]*> addu \$a0,\$a0,\$a1
+0+00e0 <[^>]*> addiu \$a0,\$gp,1
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00e4 <[^>]*> addu \$a0,\$a0,\$a1
+0+00e8 <[^>]*> addiu \$a0,\$gp,-16383
+[ ]*RELOC: 0+00e8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00ec <[^>]*> addu \$a0,\$a0,\$a1
+0+00f0 <[^>]*> addiu \$a0,\$gp,-15383
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00f4 <[^>]*> addu \$a0,\$a0,\$a1
+0+00f8 <[^>]*> lui \$a0,0
+[ ]*RELOC: 0+00f8 RELHI external_text_label
+0+00fc <[^>]*> addiu \$a0,\$a0,252
+[ ]*RELOC: 0+00fc RELLO external_text_label
+0+0100 <[^>]*> li \$a0,248
+...
diff --git a/gas/testsuite/gas/mips/la-empic.s b/gas/testsuite/gas/mips/la-empic.s
new file mode 100644
index 0000000..c6df5e3
--- /dev/null
+++ b/gas/testsuite/gas/mips/la-empic.s
@@ -0,0 +1,57 @@
+# Source file used to test the la macro with -membedded-pic
+
+ .data
+data_label:
+ .extern big_external_data_label,1000
+ .extern small_external_data_label,1
+ .comm big_external_common,1000
+ .comm small_external_common,1
+ .lcomm big_local_common,1000
+ .lcomm small_local_common,1
+
+ .text
+text_label:
+ la $4,0
+ la $4,1
+ la $4,0x8000
+ la $4,-0x8000
+ la $4,0x10000
+ la $4,0x1a5a5
+ la $4,0($5)
+ la $4,1($5)
+ la $4,0x8000($5)
+ la $4,-0x8000($5)
+ la $4,0x10000($5)
+ la $4,0x1a5a5($5)
+ la $4,data_label
+ la $4,big_external_data_label
+ la $4,small_external_data_label
+ la $4,big_external_common
+ la $4,small_external_common
+ la $4,big_local_common
+ la $4,small_local_common
+ la $4,data_label+1
+ la $4,big_external_data_label+1
+ la $4,small_external_data_label+1
+ la $4,big_external_common+1
+ la $4,small_external_common+1
+ la $4,big_local_common+1
+ la $4,small_local_common+1
+ la $4,data_label($5)
+ la $4,big_external_data_label($5)
+ la $4,small_external_data_label($5)
+ la $4,big_external_common($5)
+ la $4,small_external_common($5)
+ la $4,big_local_common($5)
+ la $4,small_local_common($5)
+ la $4,data_label+1($5)
+ la $4,big_external_data_label+1($5)
+ la $4,small_external_data_label+1($5)
+ la $4,big_external_common+1($5)
+ la $4,small_external_common+1($5)
+ la $4,big_local_common+1($5)
+ la $4,small_local_common+1($5)
+
+second_text_label:
+ la $4,external_text_label - text_label
+ la $4,second_text_label - text_label
diff --git a/gas/testsuite/gas/mips/lb-empic.d b/gas/testsuite/gas/mips/lb-empic.d
new file mode 100644
index 0000000..db4127f
--- /dev/null
+++ b/gas/testsuite/gas/mips/lb-empic.d
@@ -0,0 +1,102 @@
+#objdump: -dr
+#name: lb-empic
+#as: -mips1 -membedded-pic
+#source: lb-pic.s
+
+# Test the lb macro with -membedded-pic.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lb \$a0,0\(\$zero\)
+0+0004 <[^>]*> lb \$a0,1\(\$zero\)
+0+0008 <[^>]*> lui \$a0,1
+0+000c <[^>]*> lb \$a0,-32768\(\$a0\)
+0+0010 <[^>]*> lb \$a0,-32768\(\$zero\)
+0+0014 <[^>]*> lui \$a0,1
+0+0018 <[^>]*> lb \$a0,0\(\$a0\)
+0+001c <[^>]*> lui \$a0,2
+0+0020 <[^>]*> lb \$a0,-23131\(\$a0\)
+0+0024 <[^>]*> lb \$a0,0\(\$a1\)
+0+0028 <[^>]*> lb \$a0,1\(\$a1\)
+0+002c <[^>]*> lui \$a0,1
+0+0030 <[^>]*> addu \$a0,\$a0,\$a1
+0+0034 <[^>]*> lb \$a0,-32768\(\$a0\)
+0+0038 <[^>]*> lb \$a0,-32768\(\$a1\)
+0+003c <[^>]*> lui \$a0,1
+0+0040 <[^>]*> addu \$a0,\$a0,\$a1
+0+0044 <[^>]*> lb \$a0,0\(\$a0\)
+0+0048 <[^>]*> lui \$a0,2
+0+004c <[^>]*> addu \$a0,\$a0,\$a1
+0+0050 <[^>]*> lb \$a0,-23131\(\$a0\)
+0+0054 <[^>]*> lb \$a0,-16384\(\$gp\)
+[ ]*RELOC: 0+0054 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0058 <[^>]*> lb \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0058 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+005c <[^>]*> lb \$a0,0\(\$gp\)
+[ ]*RELOC: 0+005c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+0060 <[^>]*> lb \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0060 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+0064 <[^>]*> lb \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0064 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0068 <[^>]*> lb \$a0,-16384\(\$gp\)
+[ ]*RELOC: 0+0068 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+006c <[^>]*> lb \$a0,-15384\(\$gp\)
+[ ]*RELOC: 0+006c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0070 <[^>]*> lb \$a0,-16383\(\$gp\)
+[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0074 <[^>]*> lb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+0074 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+0078 <[^>]*> lb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+0078 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+007c <[^>]*> lb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+007c [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+0080 <[^>]*> lb \$a0,1\(\$gp\)
+[ ]*RELOC: 0+0080 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0084 <[^>]*> lb \$a0,-16383\(\$gp\)
+[ ]*RELOC: 0+0084 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0088 <[^>]*> lb \$a0,-15383\(\$gp\)
+[ ]*RELOC: 0+0088 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+008c <[^>]*> addu \$a0,\$a1,\$gp
+0+0090 <[^>]*> lb \$a0,-16384\(\$a0\)
+[ ]*RELOC: 0+0090 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0094 <[^>]*> addu \$a0,\$a1,\$gp
+0+0098 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+0098 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+009c <[^>]*> addu \$a0,\$a1,\$gp
+0+00a0 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00a0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00a4 <[^>]*> addu \$a0,\$a1,\$gp
+0+00a8 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00ac <[^>]*> addu \$a0,\$a1,\$gp
+0+00b0 <[^>]*> lb \$a0,0\(\$a0\)
+[ ]*RELOC: 0+00b0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00b4 <[^>]*> addu \$a0,\$a1,\$gp
+0+00b8 <[^>]*> lb \$a0,-16384\(\$a0\)
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00bc <[^>]*> addu \$a0,\$a1,\$gp
+0+00c0 <[^>]*> lb \$a0,-15384\(\$a0\)
+[ ]*RELOC: 0+00c0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00c4 <[^>]*> addu \$a0,\$a1,\$gp
+0+00c8 <[^>]*> lb \$a0,-16383\(\$a0\)
+[ ]*RELOC: 0+00c8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+00cc <[^>]*> addu \$a0,\$a1,\$gp
+0+00d0 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+00d0 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+00d4 <[^>]*> addu \$a0,\$a1,\$gp
+0+00d8 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+00d8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00dc <[^>]*> addu \$a0,\$a1,\$gp
+0+00e0 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00e4 <[^>]*> addu \$a0,\$a1,\$gp
+0+00e8 <[^>]*> lb \$a0,1\(\$a0\)
+[ ]*RELOC: 0+00e8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00ec <[^>]*> addu \$a0,\$a1,\$gp
+0+00f0 <[^>]*> lb \$a0,-16383\(\$a0\)
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00f4 <[^>]*> addu \$a0,\$a1,\$gp
+0+00f8 <[^>]*> lb \$a0,-15383\(\$a0\)
+[ ]*RELOC: 0+00f8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+...
diff --git a/gas/testsuite/gas/mips/lb-pic.s b/gas/testsuite/gas/mips/lb-pic.s
new file mode 100644
index 0000000..08a2d76
--- /dev/null
+++ b/gas/testsuite/gas/mips/lb-pic.s
@@ -0,0 +1,52 @@
+# Source file used to test the lb macro with PIC code.
+
+ .data
+data_label:
+ .extern big_external_data_label,1000
+ .extern small_external_data_label,1
+ .comm big_external_common,1000
+ .comm small_external_common,1
+ .lcomm big_local_common,1000
+ .lcomm small_local_common,1
+
+ .text
+ lb $4,0
+ lb $4,1
+ lb $4,0x8000
+ lb $4,-0x8000
+ lb $4,0x10000
+ lb $4,0x1a5a5
+ lb $4,0($5)
+ lb $4,1($5)
+ lb $4,0x8000($5)
+ lb $4,-0x8000($5)
+ lb $4,0x10000($5)
+ lb $4,0x1a5a5($5)
+ lb $4,data_label
+ lb $4,big_external_data_label
+ lb $4,small_external_data_label
+ lb $4,big_external_common
+ lb $4,small_external_common
+ lb $4,big_local_common
+ lb $4,small_local_common
+ lb $4,data_label+1
+ lb $4,big_external_data_label+1
+ lb $4,small_external_data_label+1
+ lb $4,big_external_common+1
+ lb $4,small_external_common+1
+ lb $4,big_local_common+1
+ lb $4,small_local_common+1
+ lb $4,data_label($5)
+ lb $4,big_external_data_label($5)
+ lb $4,small_external_data_label($5)
+ lb $4,big_external_common($5)
+ lb $4,small_external_common($5)
+ lb $4,big_local_common($5)
+ lb $4,small_local_common($5)
+ lb $4,data_label+1($5)
+ lb $4,big_external_data_label+1($5)
+ lb $4,small_external_data_label+1($5)
+ lb $4,big_external_common+1($5)
+ lb $4,small_external_common+1($5)
+ lb $4,big_local_common+1($5)
+ lb $4,small_local_common+1($5)
diff --git a/gas/testsuite/gas/mips/ld-empic.d b/gas/testsuite/gas/mips/ld-empic.d
new file mode 100644
index 0000000..7b49a0c
--- /dev/null
+++ b/gas/testsuite/gas/mips/ld-empic.d
@@ -0,0 +1,186 @@
+#objdump: -dr
+#name: ld-empic
+#as: -mips1 -membedded-pic
+#source: ld-pic.s
+
+# Test the ld macro with -membedded-pic.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> lw \$a0,0\(\$zero\)
+0+0004 <[^>]*> lw \$a1,4\(\$zero\)
+0+0008 <[^>]*> lw \$a0,1\(\$zero\)
+0+000c <[^>]*> lw \$a1,5\(\$zero\)
+0+0010 <[^>]*> lui \$at,1
+0+0014 <[^>]*> lw \$a0,-32768\(\$at\)
+0+0018 <[^>]*> lw \$a1,-32764\(\$at\)
+0+001c <[^>]*> lw \$a0,-32768\(\$zero\)
+0+0020 <[^>]*> lw \$a1,-32764\(\$zero\)
+0+0024 <[^>]*> lui \$at,1
+0+0028 <[^>]*> lw \$a0,0\(\$at\)
+0+002c <[^>]*> lw \$a1,4\(\$at\)
+0+0030 <[^>]*> lui \$at,2
+0+0034 <[^>]*> lw \$a0,-23131\(\$at\)
+0+0038 <[^>]*> lw \$a1,-23127\(\$at\)
+...
+0+0040 <[^>]*> lw \$a0,0\(\$a1\)
+0+0044 <[^>]*> lw \$a1,4\(\$a1\)
+...
+0+004c <[^>]*> lw \$a0,1\(\$a1\)
+0+0050 <[^>]*> lw \$a1,5\(\$a1\)
+0+0054 <[^>]*> lui \$at,1
+0+0058 <[^>]*> addu \$at,\$a1,\$at
+0+005c <[^>]*> lw \$a0,-32768\(\$at\)
+0+0060 <[^>]*> lw \$a1,-32764\(\$at\)
+...
+0+0068 <[^>]*> lw \$a0,-32768\(\$a1\)
+0+006c <[^>]*> lw \$a1,-32764\(\$a1\)
+0+0070 <[^>]*> lui \$at,1
+0+0074 <[^>]*> addu \$at,\$a1,\$at
+0+0078 <[^>]*> lw \$a0,0\(\$at\)
+0+007c <[^>]*> lw \$a1,4\(\$at\)
+0+0080 <[^>]*> lui \$at,2
+0+0084 <[^>]*> addu \$at,\$a1,\$at
+0+0088 <[^>]*> lw \$a0,-23131\(\$at\)
+0+008c <[^>]*> lw \$a1,-23127\(\$at\)
+0+0090 <[^>]*> lw \$a0,-16384\(\$gp\)
+[ ]*RELOC: 0+0090 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0094 <[^>]*> lw \$a1,-16380\(\$gp\)
+[ ]*RELOC: 0+0094 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0098 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+0098 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+009c <[^>]*> lw \$a1,4\(\$gp\)
+[ ]*RELOC: 0+009c [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+00a0 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00a0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00a4 <[^>]*> lw \$a1,4\(\$gp\)
+[ ]*RELOC: 0+00a4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00a8 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00a8 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00ac <[^>]*> lw \$a1,4\(\$gp\)
+[ ]*RELOC: 0+00ac [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00b0 <[^>]*> lw \$a0,0\(\$gp\)
+[ ]*RELOC: 0+00b0 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00b4 <[^>]*> lw \$a1,4\(\$gp\)
+[ ]*RELOC: 0+00b4 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00b8 <[^>]*> lw \$a0,-16384\(\$gp\)
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00bc <[^>]*> lw \$a1,-16380\(\$gp\)
+[ ]*RELOC: 0+00bc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00c0 <[^>]*> lw \$a0,-15384\(\$gp\)
+[ ]*RELOC: 0+00c0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00c4 <[^>]*> lw \$a1,-15380\(\$gp\)
+[ ]*RELOC: 0+00c4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00c8 <[^>]*> lw \$a0,-16383\(\$gp\)
+[ ]*RELOC: 0+00c8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+00cc <[^>]*> lw \$a1,-16379\(\$gp\)
+[ ]*RELOC: 0+00cc [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+00d0 <[^>]*> lw \$a0,1\(\$gp\)
+[ ]*RELOC: 0+00d0 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+00d4 <[^>]*> lw \$a1,5\(\$gp\)
+[ ]*RELOC: 0+00d4 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+00d8 <[^>]*> lw \$a0,1\(\$gp\)
+[ ]*RELOC: 0+00d8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00dc <[^>]*> lw \$a1,5\(\$gp\)
+[ ]*RELOC: 0+00dc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00e0 <[^>]*> lw \$a0,1\(\$gp\)
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00e4 <[^>]*> lw \$a1,5\(\$gp\)
+[ ]*RELOC: 0+00e4 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00e8 <[^>]*> lw \$a0,1\(\$gp\)
+[ ]*RELOC: 0+00e8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00ec <[^>]*> lw \$a1,5\(\$gp\)
+[ ]*RELOC: 0+00ec [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00f0 <[^>]*> lw \$a0,-16383\(\$gp\)
+[ ]*RELOC: 0+00f0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00f4 <[^>]*> lw \$a1,-16379\(\$gp\)
+[ ]*RELOC: 0+00f4 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00f8 <[^>]*> lw \$a0,-15383\(\$gp\)
+[ ]*RELOC: 0+00f8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00fc <[^>]*> lw \$a1,-15379\(\$gp\)
+[ ]*RELOC: 0+00fc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+...
+0+0104 <[^>]*> addu \$at,\$a1,\$gp
+0+0108 <[^>]*> lw \$a0,-16384\(\$at\)
+[ ]*RELOC: 0+0108 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+010c <[^>]*> lw \$a1,-16380\(\$at\)
+[ ]*RELOC: 0+010c [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+...
+0+0114 <[^>]*> addu \$at,\$a1,\$gp
+0+0118 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0118 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+011c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+011c [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+...
+0+0124 <[^>]*> addu \$at,\$a1,\$gp
+0+0128 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0128 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+012c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+012c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+...
+0+0134 <[^>]*> addu \$at,\$a1,\$gp
+0+0138 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0138 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+013c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+013c [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+...
+0+0144 <[^>]*> addu \$at,\$a1,\$gp
+0+0148 <[^>]*> lw \$a0,0\(\$at\)
+[ ]*RELOC: 0+0148 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+014c <[^>]*> lw \$a1,4\(\$at\)
+[ ]*RELOC: 0+014c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+...
+0+0154 <[^>]*> addu \$at,\$a1,\$gp
+0+0158 <[^>]*> lw \$a0,-16384\(\$at\)
+[ ]*RELOC: 0+0158 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+015c <[^>]*> lw \$a1,-16380\(\$at\)
+[ ]*RELOC: 0+015c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+...
+0+0164 <[^>]*> addu \$at,\$a1,\$gp
+0+0168 <[^>]*> lw \$a0,-15384\(\$at\)
+[ ]*RELOC: 0+0168 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+016c <[^>]*> lw \$a1,-15380\(\$at\)
+[ ]*RELOC: 0+016c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+...
+0+0174 <[^>]*> addu \$at,\$a1,\$gp
+0+0178 <[^>]*> lw \$a0,-16383\(\$at\)
+[ ]*RELOC: 0+0178 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+017c <[^>]*> lw \$a1,-16379\(\$at\)
+[ ]*RELOC: 0+017c [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+...
+0+0184 <[^>]*> addu \$at,\$a1,\$gp
+0+0188 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0188 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+018c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+018c [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+...
+0+0194 <[^>]*> addu \$at,\$a1,\$gp
+0+0198 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+0198 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+019c <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+019c [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+...
+0+01a4 <[^>]*> addu \$at,\$a1,\$gp
+0+01a8 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+01a8 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+01ac <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+01ac [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+...
+0+01b4 <[^>]*> addu \$at,\$a1,\$gp
+0+01b8 <[^>]*> lw \$a0,1\(\$at\)
+[ ]*RELOC: 0+01b8 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+01bc <[^>]*> lw \$a1,5\(\$at\)
+[ ]*RELOC: 0+01bc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+...
+0+01c4 <[^>]*> addu \$at,\$a1,\$gp
+0+01c8 <[^>]*> lw \$a0,-16383\(\$at\)
+[ ]*RELOC: 0+01c8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01cc <[^>]*> lw \$a1,-16379\(\$at\)
+[ ]*RELOC: 0+01cc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+...
+0+01d4 <[^>]*> addu \$at,\$a1,\$gp
+0+01d8 <[^>]*> lw \$a0,-15383\(\$at\)
+[ ]*RELOC: 0+01d8 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+01dc <[^>]*> lw \$a1,-15379\(\$at\)
+[ ]*RELOC: 0+01dc [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
diff --git a/gas/testsuite/gas/mips/ld-pic.s b/gas/testsuite/gas/mips/ld-pic.s
new file mode 100644
index 0000000..178f8f0
--- /dev/null
+++ b/gas/testsuite/gas/mips/ld-pic.s
@@ -0,0 +1,54 @@
+# Source file used to test the ld macro with PIC code.
+
+ .set mips1
+
+ .data
+data_label:
+ .extern big_external_data_label,1000
+ .extern small_external_data_label,1
+ .comm big_external_common,1000
+ .comm small_external_common,1
+ .lcomm big_local_common,1000
+ .lcomm small_local_common,1
+
+ .text
+ ld $4,0
+ ld $4,1
+ ld $4,0x8000
+ ld $4,-0x8000
+ ld $4,0x10000
+ ld $4,0x1a5a5
+ ld $4,0($5)
+ ld $4,1($5)
+ ld $4,0x8000($5)
+ ld $4,-0x8000($5)
+ ld $4,0x10000($5)
+ ld $4,0x1a5a5($5)
+ ld $4,data_label
+ ld $4,big_external_data_label
+ ld $4,small_external_data_label
+ ld $4,big_external_common
+ ld $4,small_external_common
+ ld $4,big_local_common
+ ld $4,small_local_common
+ ld $4,data_label+1
+ ld $4,big_external_data_label+1
+ ld $4,small_external_data_label+1
+ ld $4,big_external_common+1
+ ld $4,small_external_common+1
+ ld $4,big_local_common+1
+ ld $4,small_local_common+1
+ ld $4,data_label($5)
+ ld $4,big_external_data_label($5)
+ ld $4,small_external_data_label($5)
+ ld $4,big_external_common($5)
+ ld $4,small_external_common($5)
+ ld $4,big_local_common($5)
+ ld $4,small_local_common($5)
+ ld $4,data_label+1($5)
+ ld $4,big_external_data_label+1($5)
+ ld $4,small_external_data_label+1($5)
+ ld $4,big_external_common+1($5)
+ ld $4,small_external_common+1($5)
+ ld $4,big_local_common+1($5)
+ ld $4,small_local_common+1($5)
diff --git a/gas/testsuite/gas/mips/lif-empic.d b/gas/testsuite/gas/mips/lif-empic.d
new file mode 100644
index 0000000..393eca0
--- /dev/null
+++ b/gas/testsuite/gas/mips/lif-empic.d
@@ -0,0 +1,21 @@
+#objdump: -dr
+#name: lifloat-empic
+#as: -mips1 -membedded-pic
+#source: lifloat.s
+
+# Test the li.d and li.s macros with -membedded-pic.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> addiu \$at,\$gp,-16384
+[ ]*RELOC: 0+0000 [A-Z0-9_]*GPREL[A-Z0-9_]* .rdata.*
+0+0004 <[^>]*> lw \$a0,0\(\$at\)
+0+0008 <[^>]*> lw \$a1,4\(\$at\)
+0+000c <[^>]*> lwc1 \$f5,-16368\(\$gp\)
+[ ]*RELOC: 0+000c [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.*
+0+0010 <[^>]*> lwc1 \$f4,-16364\(\$gp\)
+[ ]*RELOC: 0+0010 [A-Z0-9_]*LITERAL[A-Z0-9_]* .lit8.*
+0+0014 <[^>]*> lui \$a0,16256
+0+0018 <[^>]*> lui \$at,16256
+0+001c <[^>]*> mtc1 \$at,\$f4
diff --git a/gas/testsuite/gas/mips/ulh-empic.d b/gas/testsuite/gas/mips/ulh-empic.d
new file mode 100644
index 0000000..3fc23c2
--- /dev/null
+++ b/gas/testsuite/gas/mips/ulh-empic.d
@@ -0,0 +1,91 @@
+#objdump: -dr
+#name: ulh-empic
+#as: -mips1 -membedded-pic
+#source: ulh-pic.s
+
+# Test the ulh macro with -membedded-pic.
+
+.*: +file format .*mips.*
+
+Disassembly of section .text:
+0+0000 <[^>]*> addiu \$at,\$gp,-16384
+[ ]*RELOC: 0+0000 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0004 <[^>]*> lb \$a0,0\(\$at\)
+0+0008 <[^>]*> lbu \$at,1\(\$at\)
+0+000c <[^>]*> sll \$a0,\$a0,0x8
+0+0010 <[^>]*> or \$a0,\$a0,\$at
+0+0014 <[^>]*> addiu \$at,\$gp,0
+[ ]*RELOC: 0+0014 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+0018 <[^>]*> lbu \$a0,0\(\$at\)
+0+001c <[^>]*> lbu \$at,1\(\$at\)
+0+0020 <[^>]*> sll \$a0,\$a0,0x8
+0+0024 <[^>]*> or \$a0,\$a0,\$at
+0+0028 <[^>]*> addiu \$at,\$gp,0
+[ ]*RELOC: 0+0028 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+002c <[^>]*> lwl \$a0,0\(\$at\)
+0+0030 <[^>]*> lwr \$a0,3\(\$at\)
+0+0034 <[^>]*> addiu \$at,\$gp,0
+[ ]*RELOC: 0+0034 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+0038 <[^>]*> sb \$a0,1\(\$at\)
+0+003c <[^>]*> srl \$a0,\$a0,0x8
+0+0040 <[^>]*> sb \$a0,0\(\$at\)
+0+0044 <[^>]*> lbu \$at,1\(\$at\)
+0+0048 <[^>]*> sll \$a0,\$a0,0x8
+0+004c <[^>]*> or \$a0,\$a0,\$at
+0+0050 <[^>]*> addiu \$at,\$gp,0
+[ ]*RELOC: 0+0050 [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+0054 <[^>]*> swl \$a0,0\(\$at\)
+0+0058 <[^>]*> swr \$a0,3\(\$at\)
+0+005c <[^>]*> addiu \$at,\$gp,-16384
+[ ]*RELOC: 0+005c [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0060 <[^>]*> lb \$a0,0\(\$at\)
+0+0064 <[^>]*> lbu \$at,1\(\$at\)
+0+0068 <[^>]*> sll \$a0,\$a0,0x8
+0+006c <[^>]*> or \$a0,\$a0,\$at
+0+0070 <[^>]*> addiu \$at,\$gp,-15384
+[ ]*RELOC: 0+0070 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+0074 <[^>]*> lbu \$a0,0\(\$at\)
+0+0078 <[^>]*> lbu \$at,1\(\$at\)
+0+007c <[^>]*> sll \$a0,\$a0,0x8
+0+0080 <[^>]*> or \$a0,\$a0,\$at
+0+0084 <[^>]*> addiu \$at,\$gp,-16383
+[ ]*RELOC: 0+0084 [A-Z0-9_]*GPREL[A-Z0-9_]* .sdata.*
+0+0088 <[^>]*> lwl \$a0,0\(\$at\)
+0+008c <[^>]*> lwr \$a0,3\(\$at\)
+0+0090 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+0090 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_data_label
+0+0094 <[^>]*> sb \$a0,1\(\$at\)
+0+0098 <[^>]*> srl \$a0,\$a0,0x8
+0+009c <[^>]*> sb \$a0,0\(\$at\)
+0+00a0 <[^>]*> lbu \$at,1\(\$at\)
+0+00a4 <[^>]*> sll \$a0,\$a0,0x8
+0+00a8 <[^>]*> or \$a0,\$a0,\$at
+0+00ac <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00ac [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_data_label
+0+00b0 <[^>]*> swl \$a0,0\(\$at\)
+0+00b4 <[^>]*> swr \$a0,3\(\$at\)
+0+00b8 <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00b8 [A-Z0-9_]*GPREL[A-Z0-9_]* big_external_common
+0+00bc <[^>]*> lb \$a0,0\(\$at\)
+0+00c0 <[^>]*> lbu \$at,1\(\$at\)
+0+00c4 <[^>]*> sll \$a0,\$a0,0x8
+0+00c8 <[^>]*> or \$a0,\$a0,\$at
+0+00cc <[^>]*> addiu \$at,\$gp,1
+[ ]*RELOC: 0+00cc [A-Z0-9_]*GPREL[A-Z0-9_]* small_external_common
+0+00d0 <[^>]*> lbu \$a0,0\(\$at\)
+0+00d4 <[^>]*> lbu \$at,1\(\$at\)
+0+00d8 <[^>]*> sll \$a0,\$a0,0x8
+0+00dc <[^>]*> or \$a0,\$a0,\$at
+0+00e0 <[^>]*> addiu \$at,\$gp,-16383
+[ ]*RELOC: 0+00e0 [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00e4 <[^>]*> lwl \$a0,0\(\$at\)
+0+00e8 <[^>]*> lwr \$a0,3\(\$at\)
+0+00ec <[^>]*> addiu \$at,\$gp,-15383
+[ ]*RELOC: 0+00ec [A-Z0-9_]*GPREL[A-Z0-9_]* .sbss.*
+0+00f0 <[^>]*> sb \$a0,1\(\$at\)
+0+00f4 <[^>]*> srl \$a0,\$a0,0x8
+0+00f8 <[^>]*> sb \$a0,0\(\$at\)
+0+00fc <[^>]*> lbu \$at,1\(\$at\)
+0+0100 <[^>]*> sll \$a0,\$a0,0x8
+0+0104 <[^>]*> or \$a0,\$a0,\$at
+...
diff --git a/gas/testsuite/gas/mips/ulh-pic.s b/gas/testsuite/gas/mips/ulh-pic.s
new file mode 100644
index 0000000..51c458c
--- /dev/null
+++ b/gas/testsuite/gas/mips/ulh-pic.s
@@ -0,0 +1,29 @@
+# Test unaligned load and store macros with PIC code. We don't bother
+# to test most cases. The actual loads and stores are tested by the
+# non-PIC test case. We just want to check that the initial address
+# is loaded correctly.
+
+ .data
+data_label:
+ .extern big_external_data_label,1000
+ .extern small_external_data_label,1
+ .comm big_external_common,1000
+ .comm small_external_common,1
+ .lcomm big_local_common,1000
+ .lcomm small_local_common,1
+
+ .text
+ ulh $4,data_label
+ ulhu $4,big_external_data_label
+ ulw $4,small_external_data_label
+ ush $4,big_external_common
+ usw $4,small_external_common
+ ulh $4,big_local_common
+ ulhu $4,small_local_common
+ ulw $4,data_label+1
+ ush $4,big_external_data_label+1
+ usw $4,small_external_data_label+1
+ ulh $4,big_external_common+1
+ ulhu $4,small_external_common+1
+ ulw $4,big_local_common+1
+ ush $4,small_local_common+1