summaryrefslogtreecommitdiffstats
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog16
-rw-r--r--ld/Makefile.am12
-rw-r--r--ld/Makefile.in12
-rw-r--r--ld/configure.tgt7
-rw-r--r--ld/emulparams/elf32ebmipvxworks.sh11
-rw-r--r--ld/emulparams/elf32elmipvxworks.sh11
-rw-r--r--ld/testsuite/ChangeLog9
-rw-r--r--ld/testsuite/ld-mips-elf/mips-elf.exp28
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1-lib.dd50
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1-lib.nd9
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1-lib.rd18
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1-lib.s52
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1-static.d4
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1.dd51
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1.ld32
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1.rd32
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks1.s27
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks2-static.sd9
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks2.s5
-rw-r--r--ld/testsuite/ld-mips-elf/vxworks2.sd13
20 files changed, 405 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 9005e8f2d7..3918cc0d20 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,19 @@
+2006-03-22 Richard Sandiford <richard@codesourcery.com>
+ Daniel Jacobowitz <dan@codesourcery.com>
+ Phil Edwards <phil@codesourcery.com>
+ Zack Weinberg <zack@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+
+ * configure.tgt (mips*el-*-vxworks*, mips*-*-vxworks*): Use
+ separate VxWorks emulations.
+ * emulparams/elf32ebmipvxworks.sh: New file.
+ * emulparams/elf32elmipvxworks.sh: New file.
+ * Makefile.am (ALL_EMULATIONS): Add eelf32ebmipvxworks.o and
+ eelf32elmipvxworks.o.
+ (eelf32ebmipvxworks.c, eelf32elmipvxworks.c): New rules.
+ * Makefile.in: Regenerate.
+
2006-03-16 Alan Modra <amodra@bigpond.net.au>
PR 2434
diff --git a/ld/Makefile.am b/ld/Makefile.am
index db64da4d96..d59d73498a 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -158,7 +158,9 @@ ALL_EMULATIONS = \
eelf32ltsmip.o \
eelf32ltsmipn32.o \
eelf32ebmip.o \
+ eelf32ebmipvxworks.o \
eelf32elmip.o \
+ eelf32elmipvxworks.o \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
@@ -725,10 +727,20 @@ eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
$(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
+ $(srcdir)/emulparams/elf32ebmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
+ $(srcdir)/emulparams/elf32elmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
$(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/ld/Makefile.in b/ld/Makefile.in
index dff417394d..fde6f7c73a 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -381,7 +381,9 @@ ALL_EMULATIONS = \
eelf32ltsmip.o \
eelf32ltsmipn32.o \
eelf32ebmip.o \
+ eelf32ebmipvxworks.o \
eelf32elmip.o \
+ eelf32elmipvxworks.o \
eelf32fr30.o \
eelf32frv.o \
eelf32i370.o \
@@ -1531,10 +1533,20 @@ eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
$(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
+eelf32ebmipvxworks.c: $(srcdir)/emulparams/elf32ebmipvxworks.sh \
+ $(srcdir)/emulparams/elf32ebmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32ebmipvxworks "$(tdir_elf32ebmipvxworks)"
eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
$(srcdir)/emulparams/elf32lmip.sh $(srcdir)/emulparams/elf32bmip.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
+eelf32elmipvxworks.c: $(srcdir)/emulparams/elf32elmipvxworks.sh \
+ $(srcdir)/emulparams/elf32elmip.sh $(srcdir)/emulparams/vxworks.sh \
+ $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/vxworks.em \
+ $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} elf32elmipvxworks "$(tdir_elf32elmipvxworks)"
eelf32bmipn32.c: $(srcdir)/emulparams/elf32bmipn32.sh \
$(srcdir)/emultempl/irix.em \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
diff --git a/ld/configure.tgt b/ld/configure.tgt
index 56e1ae4755..9511666104 100644
--- a/ld/configure.tgt
+++ b/ld/configure.tgt
@@ -324,9 +324,10 @@ mips*vr5000-*-elf*) targ_emul=elf32b4300 ;;
mips*el-*-elf*) targ_emul=elf32elmip ;;
mips*-*-elf*) targ_emul=elf32ebmip ;;
mips*-*-rtems*) targ_emul=elf32ebmip ;;
-mips*el-*-vxworks*) targ_emul=elf32elmip ;;
-mips*-*-vxworks*) targ_emul=elf32ebmip
- targ_extra_emuls="elf32elmip" ;;
+mips*el-*-vxworks*) targ_emul=elf32elmipvxworks
+ targ_extra_emuls="elf32ebmipvxworks" ;;
+mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
+ targ_extra_emuls="elf32elmipvxworks" ;;
mips*-*-windiss) targ_emul=elf32mipswindiss ;;
mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
diff --git a/ld/emulparams/elf32ebmipvxworks.sh b/ld/emulparams/elf32ebmipvxworks.sh
new file mode 100644
index 0000000000..4145488ae2
--- /dev/null
+++ b/ld/emulparams/elf32ebmipvxworks.sh
@@ -0,0 +1,11 @@
+. ${srcdir}/emulparams/elf32bmip.sh
+
+OUTPUT_FORMAT="elf32-bigmips-vxworks"
+BIG_OUTPUT_FORMAT="elf32-bigmips-vxworks"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips-vxworks"
+unset OTHER_GOT_SYMBOLS
+SHLIB_TEXT_START_ADDR=0
+unset TEXT_DYNAMIC
+unset DATA_ADDR
+
+. ${srcdir}/emulparams/vxworks.sh
diff --git a/ld/emulparams/elf32elmipvxworks.sh b/ld/emulparams/elf32elmipvxworks.sh
new file mode 100644
index 0000000000..c1239441c4
--- /dev/null
+++ b/ld/emulparams/elf32elmipvxworks.sh
@@ -0,0 +1,11 @@
+. ${srcdir}/emulparams/elf32bmip.sh
+
+OUTPUT_FORMAT="elf32-littlemips-vxworks"
+BIG_OUTPUT_FORMAT="elf32-bigmips-vxworks"
+LITTLE_OUTPUT_FORMAT="elf32-littlemips-vxworks"
+unset OTHER_GOT_SYMBOLS
+SHLIB_TEXT_START_ADDR=0
+unset TEXT_DYNAMIC
+unset DATA_ADDR
+
+. ${srcdir}/emulparams/vxworks.sh
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index f968b4ce17..763c325786 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2006-03-22 Richard Sandiford <richard@codesourcery.com>
+
+ * ld-mips/vxworks1.dd, ld-mips/vxworks1.ld, ld-mips/vxworks1-lib.dd,
+ * ld-mips/vxworks1-lib.nd, ld-mips/vxworks1-lib.rd,
+ * ld-mips/vxworks1-lib.s, ld-mips/vxworks1.rd, ld-mips/vxworks1.s,
+ * ld-mips/vxworks1-static.d, ld-mips/vxworks2.s, ld-mips/vxworks2.sd,
+ * ld-mips/vxworks2-static.sd: New tests.
+ * ld-mips/mips-elf.exp: Run them.
+
2006-03-17 Alexandre Oliva <aoliva@redhat.com>
* ld-powerpc/tls32.s: Verify that +32768 @plt addend is
diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp
index aac341894b..add2060acd 100644
--- a/ld/testsuite/ld-mips-elf/mips-elf.exp
+++ b/ld/testsuite/ld-mips-elf/mips-elf.exp
@@ -16,6 +16,34 @@
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
+if {[istarget "mips*-*-vxworks"]} {
+ set mipsvxtests {
+ {"VxWorks shared library test 1" "-shared -Tvxworks1.ld"
+ "-mips2" {vxworks1-lib.s}
+ {{readelf --relocs vxworks1-lib.rd} {objdump -dr vxworks1-lib.dd}
+ {readelf --symbols vxworks1-lib.nd}}
+ "libvxworks1.so"}
+ {"VxWorks executable test 1 (dynamic)" \
+ "tmpdir/libvxworks1.so -Tvxworks1.ld -q --force-dynamic"
+ "-mips2" {vxworks1.s}
+ {{readelf --relocs vxworks1.rd} {objdump -dr vxworks1.dd}}
+ "vxworks1"}
+ {"VxWorks executable test 2 (dynamic)" \
+ "-Tvxworks1.ld -q --force-dynamic"
+ "-mips2" {vxworks2.s}
+ {{readelf --segments vxworks2.sd}}
+ "vxworks2"}
+ {"VxWorks executable test 2 (static)"
+ "-Tvxworks1.ld"
+ "-mips2" {vxworks2.s}
+ {{readelf --segments vxworks2-static.sd}}
+ "vxworks2"}
+ }
+ run_ld_link_tests $mipsvxtests
+ run_dump_test "vxworks1-static"
+ return
+}
+
if {![istarget mips*-*-*] || ![is_elf_format]} {
return
}
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.dd b/ld/testsuite/ld-mips-elf/vxworks1-lib.dd
new file mode 100644
index 0000000000..ab060d98dd
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.dd
@@ -0,0 +1,50 @@
+
+.*: file format .*
+
+Disassembly of section \.plt:
+
+00080800 <_PROCEDURE_LINKAGE_TABLE_>:
+ 80800: 8f990008 lw t9,8\(gp\)
+ 80804: 00000000 nop
+ 80808: 03200008 jr t9
+ 8080c: 00000000 nop
+ \.\.\.
+ 80818: 1000fff9 b 80800 <_PROCEDURE_LINKAGE_TABLE_>
+ 8081c: 24180000 li t8,0
+ 80820: 1000fff7 b 80800 <_PROCEDURE_LINKAGE_TABLE_>
+ 80824: 24180001 li t8,1
+Disassembly of section \.text:
+
+00080c00 <foo>:
+ 80c00: 27bdffe0 addiu sp,sp,-32
+ 80c04: afbf0000 sw ra,0\(sp\)
+ 80c08: afbc0004 sw gp,4\(sp\)
+ 80c0c: 3c1c0000 lui gp,0x0
+ 80c10: 8f9c0000 lw gp,0\(gp\)
+ 80c14: 8f9c0000 lw gp,0\(gp\)
+ 80c18: 8f820014 lw v0,20\(gp\)
+ 80c1c: 8c430000 lw v1,0\(v0\)
+ 80c20: 24630001 addiu v1,v1,1
+ 80c24: ac430000 sw v1,0\(v0\)
+ 80c28: 8f99000c lw t9,12\(gp\)
+ 80c2c: 0320f809 jalr t9
+ 80c30: 00000000 nop
+ 80c34: 8f99fff4 lw t9,-12\(gp\)
+ 80c38: 0320f809 jalr t9
+ 80c3c: 00000000 nop
+ 80c40: 8f99fff0 lw t9,-16\(gp\)
+ 80c44: 0320f809 jalr t9
+ 80c48: 00000000 nop
+ 80c4c: 8fbf0000 lw ra,0\(sp\)
+ 80c50: 8fbc0004 lw gp,4\(sp\)
+ 80c54: 03e00008 jr ra
+ 80c58: 27bd0020 addiu sp,sp,32
+
+00080c5c <slocal>:
+ 80c5c: 03e00008 jr ra
+ 80c60: 00000000 nop
+
+00080c64 <sglobal>:
+ 80c64: 03e00008 jr ra
+ 80c68: 00000000 nop
+#pass
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.nd b/ld/testsuite/ld-mips-elf/vxworks1-lib.nd
new file mode 100644
index 0000000000..adbf7d77a3
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.nd
@@ -0,0 +1,9 @@
+#...
+Symbol table '\.dynsym' .*:
+#...
+.*: 00081410 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
+#...
+Symbol table '\.symtab' .*:
+#...
+.*: 00081410 * 0 * OBJECT * GLOBAL * DEFAULT * [0-9]+ _GLOBAL_OFFSET_TABLE_
+#pass
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.rd b/ld/testsuite/ld-mips-elf/vxworks1-lib.rd
new file mode 100644
index 0000000000..9a8b35e780
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.rd
@@ -0,0 +1,18 @@
+
+Relocation section '\.rela\.dyn' at offset .* contains .* entries:
+ Offset Info Type Sym\.Value Sym\. Name \+ Addend
+00080c0c .*05 R_MIPS_HI16 00000000 __GOTT_BASE__ \+ 0
+00080c10 .*06 R_MIPS_LO16 00000000 __GOTT_BASE__ \+ 0
+00080c14 .*01 R_MIPS_16 00000000 __GOTT_INDEX__ \+ 0
+0008141c .*02 R_MIPS_32 00080c00 \.text \+ 5c
+00081c00 00000002 R_MIPS_32 00080c5c
+00081c04 00000002 R_MIPS_32 00081c00
+00081c08 .*02 R_MIPS_32 00081c08 dglobal \+ 0
+00081c0c .*02 R_MIPS_32 00000000 dexternal \+ 0
+00081424 .*02 R_MIPS_32 00081800 x \+ 0
+00000000 00000000 R_MIPS_NONE 00000000
+#...
+Relocation section '\.rela\.plt' at offset .* contains 2 entries:
+ Offset Info Type Sym\.Value Sym\. Name \+ Addend
+00081400 .*7f R_MIPS_JUMP_SLOT 00000000 sexternal \+ 0
+00081404 .*7f R_MIPS_JUMP_SLOT 00080c64 sglobal \+ 0
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-lib.s b/ld/testsuite/ld-mips-elf/vxworks1-lib.s
new file mode 100644
index 0000000000..827332c0c1
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-lib.s
@@ -0,0 +1,52 @@
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ addiu $sp,$sp,-32
+ sw $31,($sp)
+ sw $28,4($sp)
+ lui $28,%hi(__GOTT_BASE__)
+ lw $28,%lo(__GOTT_BASE__)($28)
+ lw $28,%half(__GOTT_INDEX__)($28)
+ lw $2,%got(x)($28)
+ lw $3,($2)
+ addiu $3,$3,1
+ sw $3,($2)
+ lw $25,%got(slocal)($gp)
+ jalr $25
+ lw $25,%call16(sglobal)($gp)
+ jalr $25
+ lw $25,%call16(sexternal)($gp)
+ jalr $25
+ lw $31,($sp)
+ lw $28,4($sp)
+ addiu $sp,$sp,32
+ jr $31
+ .size foo, .-foo
+
+ .type slocal, @function
+slocal:
+ jr $31
+ .size slocal, .-slocal
+
+ .globl sglobal
+ .type sglobal, @function
+sglobal:
+ jr $31
+ .size sglobal, .-sglobal
+
+ .comm x,4,4
+
+ .data
+ .type dlocal, @object
+dlocal:
+ .word slocal
+ .word dlocal
+ .size dlocal, .-dlocal
+
+ .globl dglobal
+ .type dglobal, @object
+dglobal:
+ .word dglobal
+ .word dexternal
+ .size dglobal, .-dglobal
diff --git a/ld/testsuite/ld-mips-elf/vxworks1-static.d b/ld/testsuite/ld-mips-elf/vxworks1-static.d
new file mode 100644
index 0000000000..88c0baf1bb
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1-static.d
@@ -0,0 +1,4 @@
+#name: VxWorks executable test 1 (static)
+#source: vxworks1.s
+#ld: tmpdir/libvxworks1.so -Tvxworks1.ld
+#error: Dynamic sections created in non-dynamic link
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.dd b/ld/testsuite/ld-mips-elf/vxworks1.dd
new file mode 100644
index 0000000000..af9e354324
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.dd
@@ -0,0 +1,51 @@
+
+.*: file format .*
+
+Disassembly of section \.plt:
+
+00080800 <_PROCEDURE_LINKAGE_TABLE_>:
+ 80800: 3c190008 lui t9,0x8
+ 80800: R_MIPS_HI16 _GLOBAL_OFFSET_TABLE_
+ 80804: 27391410 addiu t9,t9,5136
+ 80804: R_MIPS_LO16 _GLOBAL_OFFSET_TABLE_
+ 80808: 8f390008 lw t9,8\(t9\)
+ 8080c: 00000000 nop
+ 80810: 03200008 jr t9
+ 80814: 00000000 nop
+ 80818: 1000fff9 b 80800 <_PROCEDURE_LINKAGE_TABLE_>
+ 8081c: 24180000 li t8,0
+ 80820: 3c190008 lui t9,0x8
+ 80820: R_MIPS_HI16 _GLOBAL_OFFSET_TABLE_\+0xfffffff0
+ 80824: 27391400 addiu t9,t9,5120
+ 80824: R_MIPS_LO16 _GLOBAL_OFFSET_TABLE_\+0xfffffff0
+ 80828: 8f390000 lw t9,0\(t9\)
+ 8082c: 00000000 nop
+ 80830: 03200008 jr t9
+ 80834: 00000000 nop
+ 80838: 1000fff1 b 80800 <_PROCEDURE_LINKAGE_TABLE_>
+ 8083c: 24180001 li t8,1
+ 80840: 3c190008 lui t9,0x8
+ 80840: R_MIPS_HI16 _GLOBAL_OFFSET_TABLE_\+0xfffffff4
+ 80844: 27391404 addiu t9,t9,5124
+ 80844: R_MIPS_LO16 _GLOBAL_OFFSET_TABLE_\+0xfffffff4
+ 80848: 8f390000 lw t9,0\(t9\)
+ 8084c: 00000000 nop
+ 80850: 03200008 jr t9
+ 80854: 00000000 nop
+Disassembly of section \.text:
+
+00080c00 <_start>:
+ 80c00: 0c020210 jal 80840 <_PROCEDURE_LINKAGE_TABLE_\+0x40>
+ 80c00: R_MIPS_26 \.plt\+0x40
+ 80c04: 00000000 nop
+ 80c08: 0c020306 jal 80c18 <sexternal>
+ 80c08: R_MIPS_26 sexternal
+ 80c0c: 00000000 nop
+ 80c10: 08020208 j 80820 <_PROCEDURE_LINKAGE_TABLE_\+0x20>
+ 80c10: R_MIPS_26 \.plt\+0x20
+ 80c14: 00000000 nop
+
+00080c18 <sexternal>:
+ 80c18: 03e00008 jr ra
+ 80c1c: 00000000 nop
+#pass
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.ld b/ld/testsuite/ld-mips-elf/vxworks1.ld
new file mode 100644
index 0000000000..74e2c2612a
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.ld
@@ -0,0 +1,32 @@
+SECTIONS
+{
+ . = 0x80000;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+
+ . = ALIGN (0x400);
+ .rela.dyn : { *(.rela.dyn) }
+ .rela.plt : { *(.rela.plt) }
+
+ . = ALIGN (0x400);
+ .plt : { *(.plt) }
+
+ . = ALIGN (0x400);
+ .text : { *(.text) }
+
+ . = ALIGN (0x1000);
+ .dynamic : { *(.dynamic) }
+
+ . = ALIGN (0x400);
+ .got : { *(.got.plt) *(.got) }
+
+ . = ALIGN (0x400);
+ .bss : { *(.bss) *(.dynbss) }
+
+ . = ALIGN (0x400);
+ .data : { *(.data) }
+
+ /DISCARD/ : { *(.reginfo) }
+}
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.rd b/ld/testsuite/ld-mips-elf/vxworks1.rd
new file mode 100644
index 0000000000..f4793a22e0
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.rd
@@ -0,0 +1,32 @@
+
+Relocation section '\.rela\.dyn' at offset .* contains 1 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+00081800 .*7e R_MIPS_COPY 00081800 dglobal \+ 0
+
+Relocation section '\.rela\.plt' at offset .* contains 2 entries:
+ Offset Info Type Sym\.Value Sym\. Name \+ Addend
+00081400 .*7f R_MIPS_JUMP_SLOT 00080820 sglobal \+ 0
+00081404 .*7f R_MIPS_JUMP_SLOT 00080840 foo \+ 0
+
+Relocation section '\.rela\.text' at offset .* contains 3 entries:
+ Offset Info Type Sym\.Value Sym\. Name \+ Addend
+00080c00 .*04 R_MIPS_26 00080800 \.plt \+ 40
+00080c08 .*04 R_MIPS_26 00080c18 sexternal \+ 0
+00080c10 .*04 R_MIPS_26 00080800 \.plt \+ 20
+
+Relocation section '\.rela\.data' at offset .* contains 3 entries:
+ Offset Info Type Sym.Value Sym. Name \+ Addend
+00081c00 .*02 R_MIPS_32 00081c00 .data \+ 0
+00081c04 .*02 R_MIPS_32 00081800 .bss \+ 0
+00081c08 .*02 R_MIPS_32 00081c04 dexternal \+ 0
+
+Relocation section '\.rela\.plt\.unloaded' at offset .* contains 8 entries:
+ Offset Info Type Sym\.Value Sym\. Name \+ Addend
+00080800 .*05 R_MIPS_HI16 00081410 _GLOBAL_OFFSET_TABLE_ \+ 0
+00080804 .*06 R_MIPS_LO16 00081410 _GLOBAL_OFFSET_TABLE_ \+ 0
+00081400 .*02 R_MIPS_32 00080800 _PROCEDURE_LINKAGE_TAB.* \+ 18
+00080820 .*05 R_MIPS_HI16 00081410 _GLOBAL_OFFSET_TABLE_ \+ fffffff0
+00080824 .*06 R_MIPS_LO16 00081410 _GLOBAL_OFFSET_TABLE_ \+ fffffff0
+00081404 .*02 R_MIPS_32 00080800 _PROCEDURE_LINKAGE_TAB.* \+ 38
+00080840 .*05 R_MIPS_HI16 00081410 _GLOBAL_OFFSET_TABLE_ \+ fffffff4
+00080844 .*06 R_MIPS_LO16 00081410 _GLOBAL_OFFSET_TABLE_ \+ fffffff4
diff --git a/ld/testsuite/ld-mips-elf/vxworks1.s b/ld/testsuite/ld-mips-elf/vxworks1.s
new file mode 100644
index 0000000000..33a247f7f6
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks1.s
@@ -0,0 +1,27 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ jal foo
+ jal sexternal
+ j sglobal
+ .size _start, .-_start
+
+ .globl sexternal
+ .type sexternal, @function
+sexternal:
+ jr $31
+ .size sexternal, .-sexternal
+
+ .data
+ .type dlocal, @object
+dlocal:
+ .word dlocal
+ .size dlocal, .-dlocal
+
+ .globl dexternal
+ .type dexternal, @object
+dexternal:
+ .word dglobal
+ .word dexternal
+ .size dexternal, .-dexternal
diff --git a/ld/testsuite/ld-mips-elf/vxworks2-static.sd b/ld/testsuite/ld-mips-elf/vxworks2-static.sd
new file mode 100644
index 0000000000..912755bc47
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks2-static.sd
@@ -0,0 +1,9 @@
+#...
+Elf file type is EXEC \(Executable file\)
+Entry point 0x80000
+#...
+Program Headers:
+ Type .*
+ LOAD .* 0x00080000 0x00080000 .* R E 0x1000
+
+#...
diff --git a/ld/testsuite/ld-mips-elf/vxworks2.s b/ld/testsuite/ld-mips-elf/vxworks2.s
new file mode 100644
index 0000000000..25f078e8ac
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks2.s
@@ -0,0 +1,5 @@
+ .globl _start
+ .type _start, @function
+_start:
+ jr $31
+ .size _start, .-_start
diff --git a/ld/testsuite/ld-mips-elf/vxworks2.sd b/ld/testsuite/ld-mips-elf/vxworks2.sd
new file mode 100644
index 0000000000..5ff87d3bef
--- /dev/null
+++ b/ld/testsuite/ld-mips-elf/vxworks2.sd
@@ -0,0 +1,13 @@
+#...
+Elf file type is EXEC \(Executable file\)
+Entry point 0x80400
+#...
+Program Headers:
+ Type .*
+ PHDR .*
+#...
+ LOAD .* 0x00080000 0x00080000 .* R E 0x1000
+ LOAD .* 0x00081000 0x00081000 .* RW 0x1000
+ DYNAMIC .*
+
+#...
OpenPOWER on IntegriCloud