aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-01-06 19:19:31 +0000
committerAlexandre Oliva <aoliva@redhat.com>2004-01-06 19:19:31 +0000
commita9a704fc4e60bc60d9c54f99f325adfdb2efe5f8 (patch)
tree8f3a89fdabd061a6458105d1c5ef62503f5d5def /ld
parent99d09cdbd43bd0ebc6079dba91d8a71dc12ee45e (diff)
downloadgdb-a9a704fc4e60bc60d9c54f99f325adfdb2efe5f8.zip
gdb-a9a704fc4e60bc60d9c54f99f325adfdb2efe5f8.tar.gz
gdb-a9a704fc4e60bc60d9c54f99f325adfdb2efe5f8.tar.bz2
* ld-frv: Update .d files with correct addresses displayed for
dynamic relocations. 2003-12-02 Alexandre Oliva <aoliva@redhat.com> * ld-frv/fdpic1.s (.D0): Move to separate data section. 2003-11-28 Alexandre Oliva <aoliva@redhat.com> * ld-frv/fdpic-static-1.d, ld-frv/fdpic-static-2.d, * ld-frv/fdpic-static-7.d, ld-frv/fdpic-static-8.d: Update to reflect EMBEDDED= change in linker script. 2003-11-27 Alexandre Oliva <aoliva@redhat.com> * ld-frv: Update .d files to reflect changes in the page size, the addition of a stack segment, the use of a NULL function descriptor for weakundef functions and the change in the lazy funcdesc_value in-place addend value. 2003-11-05 Alexandre Oliva <aoliva@redhat.com> * lib/ld-lib.exp (is_elf_format): Match frv-uclinux. 2003-10-06 Alexandre Oliva <aoliva@redhat.com> * ld-frv/fdpic-static-1.d, ld-frv/fdpic-static-2.d, ld-frv/fdpic-static-7.d, ld-frv/fdpic-static-8.d: Addresses are now _gp-based, not .rofixup-based. * ld-frv/fdpic-static-6.d: Likewise. Match warning about relocation to different section. 2003-09-30 Alexandre Oliva <aoliva@redhat.com> * ld-frv/fdpic.exp: Add -melf32frvfd to LDFLAGS. 2003-09-19 Alexandre Oliva <aoliva@redhat.com> * ld-frv/fdpic7.s, ld-frv/fdpic-static-7.d, ld-frv/fdpic-pie-7.d, ld-frv/fdpic-shared-7.d: New. * ld-frv/fdpic8.s, ld-frv/fdpic-static-8.d, ld-frv/fdpic-pie-8.d, ld-frv/fdpic-shared-8.d: New. * ld-frv/fdpic-pie-8-fail.d, ld-frv/fdpic-shared-8-fail.d: New. * ld-frv/fdpic.exp: Run them. * ld-frv/fdpic8.ldv, ld-frv/fdpic8min.ldv: New. 2003-09-18 Alexandre Oliva <aoliva@redhat.com> * ld-frv/fdpic5.s, ld-frv/fdpic-static-5.d, ld-frv/fdpic-pie-5.d, ld-frv/fdpic-shared-5.d: New. * ld-frv/fdpic6.s, ld-frv/fdpic-static-6.d, ld-frv/fdpic-pie-6.d, ld-frv/fdpic-shared-6.d: New. * ld-frv/fdpic.exp: Run them. * ld-frv/fdpic*.d: Add -mfdpic to assembler flags. Updated. * ld-frv/fdpic2min.ldv: New, used by fdpic-shared-2.d. * ld-frv/fdpic-shared-2-fail.d: New. * ld-frv/fdpic.exp: Run it. * ld-frv/fdpic4.s, ld-frv/fdpic-shared-4.d: New. * ld-frv/fdpic.exp: Add new test. * ld-frv/fdpic-pie-2.d: Remove unnecessary function descriptors. * ld-frv/fdpic-shared-local-2.d, ld-frv/fdpic2.ldv: New. * ld-frv/fdpic3.s, ld-frv/fdpic-shared-3.d: New. * ld-frv/fdpic.exp: Add new tests. * ld-frv/fdpic.exp, ld-frv/fdpic1.s, ld-frv/fdpic2.s, * ld-frv/fdpic-static-1.d, ld-frv/fdpic-static-2.d, * ld-frv/fdpic-pie-1.d, ld-frv/fdpic-pie-2.d, * ld-frv/fdpic-shared-1.d, ld-frv/fdpic-shared-2.d: Renamed from ucpic. 2003-09-15 Alexandre Oliva <aoliva@redhat.com> * ld-frv/ucpic.exp, ld-frv/ucpic1.s, ld-frv/ucpic2.s: New. * ld-frv/ucpic-static-1.d, ld-frv/ucpic-static-2.d: New. * ld-frv/ucpic-pie-1.d, ld-frv/ucpic-pie-2.d: New. * ld-frv/ucpic-shared-1.d, ld-frv/ucpic-shared-2.d: New.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog60
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-1.d58
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-2.d70
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-5.d6
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-6.d6
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-7.d58
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-8-fail.d6
-rw-r--r--ld/testsuite/ld-frv/fdpic-pie-8.d84
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-1.d58
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-2-fail.d5
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-2.d81
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-3.d84
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-4.d71
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-5.d83
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-6.d6
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-7.d58
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-8-fail.d6
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-8.d84
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-local-2.d84
-rw-r--r--ld/testsuite/ld-frv/fdpic-shared-local-8.d84
-rw-r--r--ld/testsuite/ld-frv/fdpic-static-1.d63
-rw-r--r--ld/testsuite/ld-frv/fdpic-static-2.d95
-rw-r--r--ld/testsuite/ld-frv/fdpic-static-5.d6
-rw-r--r--ld/testsuite/ld-frv/fdpic-static-6.d74
-rw-r--r--ld/testsuite/ld-frv/fdpic-static-7.d63
-rw-r--r--ld/testsuite/ld-frv/fdpic-static-8.d95
-rw-r--r--ld/testsuite/ld-frv/fdpic.exp57
-rw-r--r--ld/testsuite/ld-frv/fdpic1.s64
-rw-r--r--ld/testsuite/ld-frv/fdpic2.ldv1
-rw-r--r--ld/testsuite/ld-frv/fdpic2.s81
-rw-r--r--ld/testsuite/ld-frv/fdpic2min.ldv1
-rw-r--r--ld/testsuite/ld-frv/fdpic3.s99
-rw-r--r--ld/testsuite/ld-frv/fdpic4.s99
-rw-r--r--ld/testsuite/ld-frv/fdpic5.s38
-rw-r--r--ld/testsuite/ld-frv/fdpic6.s55
-rw-r--r--ld/testsuite/ld-frv/fdpic7.s63
-rw-r--r--ld/testsuite/ld-frv/fdpic8.ldv1
-rw-r--r--ld/testsuite/ld-frv/fdpic8.s81
-rw-r--r--ld/testsuite/ld-frv/fdpic8min.ldv1
-rw-r--r--ld/testsuite/lib/ld-lib.exp1
40 files changed, 2090 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 19f3c33..7889ca6 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,63 @@
+2004-01-06 Alexandre Oliva <aoliva@redhat.com>
+
+ * ld-frv: Update .d files with correct addresses displayed for
+ dynamic relocations.
+ 2003-12-02 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/fdpic1.s (.D0): Move to separate data section.
+ 2003-11-28 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/fdpic-static-1.d, ld-frv/fdpic-static-2.d,
+ * ld-frv/fdpic-static-7.d, ld-frv/fdpic-static-8.d: Update to
+ reflect EMBEDDED= change in linker script.
+ 2003-11-27 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv: Update .d files to reflect changes in the page size, the
+ addition of a stack segment, the use of a NULL function descriptor
+ for weakundef functions and the change in the lazy funcdesc_value
+ in-place addend value.
+ 2003-11-05 Alexandre Oliva <aoliva@redhat.com>
+ * lib/ld-lib.exp (is_elf_format): Match frv-uclinux.
+ 2003-10-06 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/fdpic-static-1.d, ld-frv/fdpic-static-2.d,
+ ld-frv/fdpic-static-7.d, ld-frv/fdpic-static-8.d: Addresses are
+ now _gp-based, not \.rofixup-based.
+ * ld-frv/fdpic-static-6.d: Likewise. Match warning about
+ relocation to different section.
+ 2003-09-30 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/fdpic.exp: Add -melf32frvfd to LDFLAGS.
+ 2003-09-19 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/fdpic7.s, ld-frv/fdpic-static-7.d, ld-frv/fdpic-pie-7.d,
+ ld-frv/fdpic-shared-7.d: New.
+ * ld-frv/fdpic8.s, ld-frv/fdpic-static-8.d, ld-frv/fdpic-pie-8.d,
+ ld-frv/fdpic-shared-8.d: New.
+ * ld-frv/fdpic-pie-8-fail.d, ld-frv/fdpic-shared-8-fail.d: New.
+ * ld-frv/fdpic.exp: Run them.
+ * ld-frv/fdpic8.ldv, ld-frv/fdpic8min.ldv: New.
+ 2003-09-18 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/fdpic5.s, ld-frv/fdpic-static-5.d, ld-frv/fdpic-pie-5.d,
+ ld-frv/fdpic-shared-5.d: New.
+ * ld-frv/fdpic6.s, ld-frv/fdpic-static-6.d, ld-frv/fdpic-pie-6.d,
+ ld-frv/fdpic-shared-6.d: New.
+ * ld-frv/fdpic.exp: Run them.
+ * ld-frv/fdpic*.d: Add -mfdpic to assembler flags. Updated.
+ * ld-frv/fdpic2min.ldv: New, used by fdpic-shared-2.d.
+ * ld-frv/fdpic-shared-2-fail.d: New.
+ * ld-frv/fdpic.exp: Run it.
+ * ld-frv/fdpic4.s, ld-frv/fdpic-shared-4.d: New.
+ * ld-frv/fdpic.exp: Add new test.
+ * ld-frv/fdpic-pie-2.d: Remove unnecessary function descriptors.
+ * ld-frv/fdpic-shared-local-2.d, ld-frv/fdpic2.ldv: New.
+ * ld-frv/fdpic3.s, ld-frv/fdpic-shared-3.d: New.
+ * ld-frv/fdpic.exp: Add new tests.
+ * ld-frv/fdpic.exp, ld-frv/fdpic1.s, ld-frv/fdpic2.s,
+ * ld-frv/fdpic-static-1.d, ld-frv/fdpic-static-2.d,
+ * ld-frv/fdpic-pie-1.d, ld-frv/fdpic-pie-2.d,
+ * ld-frv/fdpic-shared-1.d, ld-frv/fdpic-shared-2.d: Renamed from
+ ucpic.
+ 2003-09-15 Alexandre Oliva <aoliva@redhat.com>
+ * ld-frv/ucpic.exp, ld-frv/ucpic1.s, ld-frv/ucpic2.s: New.
+ * ld-frv/ucpic-static-1.d, ld-frv/ucpic-static-2.d: New.
+ * ld-frv/ucpic-pie-1.d, ld-frv/ucpic-pie-2.d: New.
+ * ld-frv/ucpic-shared-1.d, ld-frv/ucpic-shared-2.d: New.
+
2004-01-02 Alan Modra <amodra@bigpond.net.au>
* ld-selective/sel-dump.exp: Use is_elf_format, xfail assorted targets.
diff --git a/ld/testsuite/ld-frv/fdpic-pie-1.d b/ld/testsuite/ld-frv/fdpic-pie-1.d
new file mode 100644
index 0000000..da356ae
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-1.d
@@ -0,0 +1,58 @@
+#name: FRV uClinux PIC relocs to local symbols, pie linking
+#source: fdpic1.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+000003d0 <F1>:
+ 3d0: 80 3c 00 01 call 3d4 <\.F0>
+
+000003d4 <\.F0>:
+ 3d4: 80 40 f0 0c addi gr15,12,gr0
+ 3d8: 80 fc 00 0c setlos 0xc,gr0
+ 3dc: 80 f4 00 0c setlo 0xc,gr0
+ 3e0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 3e4: 80 40 f0 10 addi gr15,16,gr0
+ 3e8: 80 fc 00 10 setlos 0x10,gr0
+ 3ec: 80 f4 00 10 setlo 0x10,gr0
+ 3f0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 3f4: 80 40 ff f8 addi gr15,-8,gr0
+ 3f8: 80 fc ff f8 setlos 0xfffffff8,gr0
+ 3fc: 80 f4 ff f8 setlo 0xfff8,gr0
+ 400: 80 f8 ff ff sethi 0xffff,gr0
+ 404: 80 40 ff 74 addi gr15,-140,gr0
+ 408: 80 fc ff 74 setlos 0xffffff74,gr0
+ 40c: 80 f4 ff 74 setlo 0xff74,gr0
+ 410: 80 f8 ff ff sethi 0xffff,gr0
+ 414: 80 f4 00 14 setlo 0x14,gr0
+ 418: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010430 <D1>:
+ 10430: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10430: R_FRV_32 \.data
+
+00010434 <\.D0>:
+ 10434: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10434: R_FRV_32 \.got
+ 10438: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10438: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000104b8 <_GLOBAL_OFFSET_TABLE_-0x8>:
+ 104b8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 104b8: R_FRV_FUNCDESC_VALUE \.text
+ 104bc: 00 00 00 02 add\.p gr0,fp,gr0
+
+000104c0 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 104cc: 00 00 00 04 add\.p gr0,gr4,gr0
+ 104cc: R_FRV_32 \.text
+ 104d0: 00 00 00 00 add\.p gr0,gr0,gr0
+ 104d0: R_FRV_32 \.got
+ 104d4: 00 00 00 04 add\.p gr0,gr4,gr0
+ 104d4: R_FRV_32 \.data
diff --git a/ld/testsuite/ld-frv/fdpic-pie-2.d b/ld/testsuite/ld-frv/fdpic-pie-2.d
new file mode 100644
index 0000000..fb7691a
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-2.d
@@ -0,0 +1,70 @@
+#name: FRV uClinux PIC relocs to global symbols, pie linking
+#source: fdpic2.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+000005d0 <F2>:
+ 5d0: 80 3c 00 01 call 5d4 <GF0>
+
+000005d4 <GF0>:
+ 5d4: 80 40 f0 10 addi gr15,16,gr0
+ 5d8: 80 fc 00 24 setlos 0x24,gr0
+ 5dc: 80 f4 00 20 setlo 0x20,gr0
+ 5e0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5e4: 80 40 f0 0c addi gr15,12,gr0
+ 5e8: 80 fc 00 18 setlos 0x18,gr0
+ 5ec: 80 f4 00 14 setlo 0x14,gr0
+ 5f0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5f4: 80 40 ff f8 addi gr15,-8,gr0
+ 5f8: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 5fc: 80 f4 ff e8 setlo 0xffe8,gr0
+ 600: 80 f8 ff ff sethi 0xffff,gr0
+ 604: 80 40 ff 64 addi gr15,-156,gr0
+ 608: 80 fc ff 64 setlos 0xffffff64,gr0
+ 60c: 80 f4 ff 64 setlo 0xff64,gr0
+ 610: 80 f8 ff ff sethi 0xffff,gr0
+ 614: 80 f4 00 1c setlo 0x1c,gr0
+ 618: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010630 <D2>:
+ 10630: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10630: R_FRV_32 \.data
+
+00010634 <GD0>:
+ 10634: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10634: R_FRV_FUNCDESC GFb
+ 10638: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10638: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000106b8 <_GLOBAL_OFFSET_TABLE_-0x18>:
+ 106b8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106b8: R_FRV_FUNCDESC_VALUE \.text
+ 106bc: 00 00 00 02 add\.p gr0,fp,gr0
+ 106c0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106c0: R_FRV_FUNCDESC_VALUE \.text
+ 106c4: 00 00 00 02 add\.p gr0,fp,gr0
+ 106c8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106c8: R_FRV_FUNCDESC_VALUE \.text
+ 106cc: 00 00 00 02 add\.p gr0,fp,gr0
+
+000106d0 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 106dc: R_FRV_FUNCDESC GF4
+ 106e0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106e0: R_FRV_32 \.text
+ \.\.\.
+ 106e4: R_FRV_FUNCDESC GF6
+ 106e8: R_FRV_FUNCDESC GF5
+ 106ec: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106ec: R_FRV_32 \.data
+ 106f0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106f0: R_FRV_32 \.text
+ 106f4: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106f4: R_FRV_32 \.text
diff --git a/ld/testsuite/ld-frv/fdpic-pie-5.d b/ld/testsuite/ld-frv/fdpic-pie-5.d
new file mode 100644
index 0000000..b2678e1
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-5.d
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to undefined symbols, pie linking
+#source: fdpic5.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+#error: undefined reference
diff --git a/ld/testsuite/ld-frv/fdpic-pie-6.d b/ld/testsuite/ld-frv/fdpic-pie-6.d
new file mode 100644
index 0000000..eaca671
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-6.d
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to undefined symbols, pie linking
+#source: fdpic6.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+#error: different segments
diff --git a/ld/testsuite/ld-frv/fdpic-pie-7.d b/ld/testsuite/ld-frv/fdpic-pie-7.d
new file mode 100644
index 0000000..a3f0478
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-7.d
@@ -0,0 +1,58 @@
+#name: FRV uClinux PIC relocs to local symbols with addends, pie linking
+#source: fdpic7.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+000003d0 <F7>:
+ 3d0: 80 3c 00 02 call 3d8 <\.F0\+0x4>
+
+000003d4 <\.F0>:
+ 3d4: 80 40 f0 0c addi gr15,12,gr0
+ 3d8: 80 fc 00 0c setlos 0xc,gr0
+ 3dc: 80 f4 00 0c setlo 0xc,gr0
+ 3e0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 3e4: 80 40 f0 10 addi gr15,16,gr0
+ 3e8: 80 fc 00 10 setlos 0x10,gr0
+ 3ec: 80 f4 00 10 setlo 0x10,gr0
+ 3f0: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 3f4: 80 40 ff f8 addi gr15,-8,gr0
+ 3f8: 80 fc ff f8 setlos 0xfffffff8,gr0
+ 3fc: 80 f4 ff f8 setlo 0xfff8,gr0
+ 400: 80 f8 ff ff sethi 0xffff,gr0
+ 404: 80 40 ff 78 addi gr15,-136,gr0
+ 408: 80 fc ff 78 setlos 0xffffff78,gr0
+ 40c: 80 f4 ff 78 setlo 0xff78,gr0
+ 410: 80 f8 ff ff sethi 0xffff,gr0
+ 414: 80 f4 00 14 setlo 0x14,gr0
+ 418: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010430 <D7>:
+ 10430: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10430: R_FRV_32 \.data
+
+00010434 <\.D0>:
+ 10434: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10434: R_FRV_32 \.got
+ 10438: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10438: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000104b8 <_GLOBAL_OFFSET_TABLE_-0x8>:
+ 104b8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104b8: R_FRV_FUNCDESC_VALUE \.text
+ 104bc: 00 00 00 02 add\.p gr0,fp,gr0
+
+000104c0 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 104cc: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104cc: R_FRV_32 \.text
+ 104d0: 00 00 00 00 add\.p gr0,gr0,gr0
+ 104d0: R_FRV_32 \.got
+ 104d4: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104d4: R_FRV_32 \.data
diff --git a/ld/testsuite/ld-frv/fdpic-pie-8-fail.d b/ld/testsuite/ld-frv/fdpic-pie-8-fail.d
new file mode 100644
index 0000000..f797b6a
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-8-fail.d
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to global symbols with addends, failing pie linking
+#source: fdpic8.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie
+#error: nonzero addend
diff --git a/ld/testsuite/ld-frv/fdpic-pie-8.d b/ld/testsuite/ld-frv/fdpic-pie-8.d
new file mode 100644
index 0000000..882f816
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-pie-8.d
@@ -0,0 +1,84 @@
+#name: FRV uClinux PIC relocs to global symbols with addends, pie linking
+#source: fdpic8.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -pie --version-script fdpic8min.ldv
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00000498 <F8>:
+ 498: 80 3c 00 02 call 4a0 <GF1\+0x4>
+
+0000049c <GF1>:
+ 49c: 80 40 f0 10 addi gr15,16,gr0
+ 4a0: 80 fc 00 14 setlos 0x14,gr0
+ 4a4: 80 f4 00 24 setlo 0x24,gr0
+ 4a8: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 4ac: 80 40 f0 0c addi gr15,12,gr0
+ 4b0: 80 fc 00 1c setlos 0x1c,gr0
+ 4b4: 80 f4 00 18 setlo 0x18,gr0
+ 4b8: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 4bc: 80 40 ff f8 addi gr15,-8,gr0
+ 4c0: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 4c4: 80 f4 ff c8 setlo 0xffc8,gr0
+ 4c8: 80 f8 ff ff sethi 0xffff,gr0
+ 4cc: 80 40 ff 48 addi gr15,-184,gr0
+ 4d0: 80 fc ff 48 setlos 0xffffff48,gr0
+ 4d4: 80 f4 ff 48 setlo 0xff48,gr0
+ 4d8: 80 f8 ff ff sethi 0xffff,gr0
+ 4dc: 80 f4 00 20 setlo 0x20,gr0
+ 4e0: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+000104f8 <D8>:
+ 104f8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104f8: R_FRV_32 \.data
+
+000104fc <GD0>:
+ 104fc: 00 00 00 10 add\.p gr0,gr16,gr0
+ 104fc: R_FRV_32 \.got
+ 10500: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10500: R_FRV_32 \.text
+Disassembly of section \.got:
+
+00010580 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 10580: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10580: R_FRV_FUNCDESC_VALUE \.text
+ 10584: 00 00 00 02 add\.p gr0,fp,gr0
+ 10588: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10588: R_FRV_FUNCDESC_VALUE \.text
+ 1058c: 00 00 00 02 add\.p gr0,fp,gr0
+ 10590: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10590: R_FRV_FUNCDESC_VALUE \.text
+ 10594: 00 00 00 02 add\.p gr0,fp,gr0
+ 10598: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10598: R_FRV_FUNCDESC_VALUE \.text
+ 1059c: 00 00 00 02 add\.p gr0,fp,gr0
+ 105a0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105a0: R_FRV_FUNCDESC_VALUE \.text
+ 105a4: 00 00 00 02 add\.p gr0,fp,gr0
+ 105a8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105a8: R_FRV_FUNCDESC_VALUE \.text
+ 105ac: 00 00 00 02 add\.p gr0,fp,gr0
+ 105b0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105b0: R_FRV_FUNCDESC_VALUE \.text
+ 105b4: 00 00 00 02 add\.p gr0,fp,gr0
+
+000105b8 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 105c4: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105c4: R_FRV_32 \.got
+ 105c8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105c8: R_FRV_32 \.text
+ 105cc: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105cc: R_FRV_32 \.text
+ 105d0: 00 00 00 20 add\.p gr0,gr32,gr0
+ 105d0: R_FRV_32 \.got
+ 105d4: 00 00 00 18 add\.p gr0,gr24,gr0
+ 105d4: R_FRV_32 \.got
+ 105d8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105d8: R_FRV_32 \.data
+ 105dc: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105dc: R_FRV_32 \.text
diff --git a/ld/testsuite/ld-frv/fdpic-shared-1.d b/ld/testsuite/ld-frv/fdpic-shared-1.d
new file mode 100644
index 0000000..aeb3bc4
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-1.d
@@ -0,0 +1,58 @@
+#name: FRV uClinux PIC relocs to local symbols, shared linking
+#source: fdpic1.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+000003dc <F1>:
+ 3dc: 80 3c 00 01 call 3e0 <\.F0>
+
+000003e0 <\.F0>:
+ 3e0: 80 40 f0 0c addi gr15,12,gr0
+ 3e4: 80 fc 00 0c setlos 0xc,gr0
+ 3e8: 80 f4 00 0c setlo 0xc,gr0
+ 3ec: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 3f0: 80 40 f0 10 addi gr15,16,gr0
+ 3f4: 80 fc 00 10 setlos 0x10,gr0
+ 3f8: 80 f4 00 10 setlo 0x10,gr0
+ 3fc: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 400: 80 40 ff f8 addi gr15,-8,gr0
+ 404: 80 fc ff f8 setlos 0xfffffff8,gr0
+ 408: 80 f4 ff f8 setlo 0xfff8,gr0
+ 40c: 80 f8 ff ff sethi 0xffff,gr0
+ 410: 80 40 ff 78 addi gr15,-136,gr0
+ 414: 80 fc ff 78 setlos 0xffffff78,gr0
+ 418: 80 f4 ff 78 setlo 0xff78,gr0
+ 41c: 80 f8 ff ff sethi 0xffff,gr0
+ 420: 80 f4 00 14 setlo 0x14,gr0
+ 424: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+0001042c <D1>:
+ 1042c: 00 00 00 04 add\.p gr0,gr4,gr0
+ 1042c: R_FRV_32 \.data
+
+00010430 <\.D0>:
+ 10430: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10430: R_FRV_32 \.got
+ 10434: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10434: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000104b0 <_GLOBAL_OFFSET_TABLE_-0x8>:
+ 104b0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 104b0: R_FRV_FUNCDESC_VALUE \.text
+ 104b4: 00 00 00 00 add\.p gr0,gr0,gr0
+
+000104b8 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 104c4: 00 00 00 04 add\.p gr0,gr4,gr0
+ 104c4: R_FRV_32 \.text
+ 104c8: 00 00 00 00 add\.p gr0,gr0,gr0
+ 104c8: R_FRV_32 \.got
+ 104cc: 00 00 00 04 add\.p gr0,gr4,gr0
+ 104cc: R_FRV_32 \.data
diff --git a/ld/testsuite/ld-frv/fdpic-shared-2-fail.d b/ld/testsuite/ld-frv/fdpic-shared-2-fail.d
new file mode 100644
index 0000000..5840d4b
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-2-fail.d
@@ -0,0 +1,5 @@
+#name: FRV uClinux PIC relocs to global symbols, failing shared linking
+#source: fdpic2.s
+#as: -mfdpic
+#ld: -shared
+#error: relocations between different segments are not supported
diff --git a/ld/testsuite/ld-frv/fdpic-shared-2.d b/ld/testsuite/ld-frv/fdpic-shared-2.d
new file mode 100644
index 0000000..b506788
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-2.d
@@ -0,0 +1,81 @@
+#name: FRV uClinux PIC relocs to (mostly) global symbols, shared linking
+#source: fdpic2.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared --version-script fdpic2min.ldv
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.plt:
+
+000005c8 <\.plt>:
+ 5c8: 00 00 00 00 add\.p gr0,gr0,gr0
+ 5cc: c0 1a 00 06 bra 5e4 <F2-0x10>
+ 5d0: 00 00 00 10 add\.p gr0,gr16,gr0
+ 5d4: c0 1a 00 04 bra 5e4 <F2-0x10>
+ 5d8: 00 00 00 18 add\.p gr0,gr24,gr0
+ 5dc: c0 1a 00 02 bra 5e4 <F2-0x10>
+ 5e0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 5e4: 88 08 f1 40 ldd @\(gr15,gr0\),gr4
+ 5e8: 80 30 40 00 jmpl @\(gr4,gr0\)
+ 5ec: 9c cc ff f8 lddi @\(gr15,-8\),gr14
+ 5f0: 80 30 e0 00 jmpl @\(gr14,gr0\)
+Disassembly of section \.text:
+
+000005f4 <F2>:
+ 5f4: fe 3f ff fe call 5ec <F2-0x8>
+
+000005f8 <GF0>:
+ 5f8: 80 40 f0 10 addi gr15,16,gr0
+ 5fc: 80 fc 00 24 setlos 0x24,gr0
+ 600: 80 f4 00 20 setlo 0x20,gr0
+ 604: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 608: 80 40 f0 0c addi gr15,12,gr0
+ 60c: 80 fc 00 18 setlos 0x18,gr0
+ 610: 80 f4 00 14 setlo 0x14,gr0
+ 614: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 618: 80 40 ff f0 addi gr15,-16,gr0
+ 61c: 80 fc ff e8 setlos 0xffffffe8,gr0
+ 620: 80 f4 ff e0 setlo 0xffe0,gr0
+ 624: 80 f8 ff ff sethi 0xffff,gr0
+ 628: 80 40 ff 48 addi gr15,-184,gr0
+ 62c: 80 fc ff 48 setlos 0xffffff48,gr0
+ 630: 80 f4 ff 48 setlo 0xff48,gr0
+ 634: 80 f8 ff ff sethi 0xffff,gr0
+ 638: 80 f4 00 1c setlo 0x1c,gr0
+ 63c: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010644 <D2>:
+ 10644: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10644: R_FRV_32 GD0
+
+00010648 <GD0>:
+ \.\.\.
+ 10648: R_FRV_FUNCDESC GFb
+ 1064c: R_FRV_32 GFb
+Disassembly of section \.got:
+
+000106e0 <_GLOBAL_OFFSET_TABLE_-0x20>:
+ 106e0: 00 00 05 dc subxcc\.p gr0,gr28,gr0,icc1
+ 106e0: R_FRV_FUNCDESC_VALUE GF9
+ 106e4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106e8: 00 00 05 d4 subxcc\.p gr0,gr20,gr0,icc1
+ 106e8: R_FRV_FUNCDESC_VALUE GF8
+ 106ec: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106f0: 00 00 05 e4 subxcc\.p gr0,gr36,gr0,icc1
+ 106f0: R_FRV_FUNCDESC_VALUE GF7
+ 106f4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106f8: 00 00 05 cc subxcc\.p gr0,gr12,gr0,icc1
+ 106f8: R_FRV_FUNCDESC_VALUE GF0
+ 106fc: 00 00 00 00 add\.p gr0,gr0,gr0
+
+00010700 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 1070c: R_FRV_FUNCDESC GF4
+ 10710: R_FRV_32 GF1
+ 10714: R_FRV_FUNCDESC GF6
+ 10718: R_FRV_FUNCDESC GF5
+ 1071c: R_FRV_32 GD4
+ 10720: R_FRV_32 GF3
+ 10724: R_FRV_32 GF2
diff --git a/ld/testsuite/ld-frv/fdpic-shared-3.d b/ld/testsuite/ld-frv/fdpic-shared-3.d
new file mode 100644
index 0000000..625975b
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-3.d
@@ -0,0 +1,84 @@
+#name: FRV uClinux PIC relocs to hidden symbols, shared linking
+#source: fdpic3.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+0000042c <F3>:
+ 42c: 80 3c 00 01 call 430 <HF0>
+
+00000430 <HF0>:
+ 430: 80 40 f0 0c addi gr15,12,gr0
+ 434: 80 fc 00 18 setlos 0x18,gr0
+ 438: 80 f4 00 1c setlo 0x1c,gr0
+ 43c: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 440: 80 40 f0 10 addi gr15,16,gr0
+ 444: 80 fc 00 20 setlos 0x20,gr0
+ 448: 80 f4 00 14 setlo 0x14,gr0
+ 44c: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 450: 80 40 ff f8 addi gr15,-8,gr0
+ 454: 80 fc ff e8 setlos 0xffffffe8,gr0
+ 458: 80 f4 ff d8 setlo 0xffd8,gr0
+ 45c: 80 f8 ff ff sethi 0xffff,gr0
+ 460: 80 40 ff 48 addi gr15,-184,gr0
+ 464: 80 fc ff 48 setlos 0xffffff48,gr0
+ 468: 80 f4 ff 48 setlo 0xff48,gr0
+ 46c: 80 f8 ff ff sethi 0xffff,gr0
+ 470: 80 f4 00 24 setlo 0x24,gr0
+ 474: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+0001047c <D3>:
+ 1047c: 00 00 00 04 add\.p gr0,gr4,gr0
+ 1047c: R_FRV_32 \.data
+
+00010480 <HD0>:
+ 10480: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10480: R_FRV_32 \.got
+ 10484: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10484: R_FRV_32 \.text
+Disassembly of section \.got:
+
+00010500 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 10500: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10500: R_FRV_FUNCDESC_VALUE \.text
+ 10504: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10508: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10508: R_FRV_FUNCDESC_VALUE \.text
+ 1050c: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10510: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10510: R_FRV_FUNCDESC_VALUE \.text
+ 10514: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10518: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10518: R_FRV_FUNCDESC_VALUE \.text
+ 1051c: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10520: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10520: R_FRV_FUNCDESC_VALUE \.text
+ 10524: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10528: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10528: R_FRV_FUNCDESC_VALUE \.text
+ 1052c: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10530: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10530: R_FRV_FUNCDESC_VALUE \.text
+ 10534: 00 00 00 00 add\.p gr0,gr0,gr0
+
+00010538 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 10544: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10544: R_FRV_32 \.text
+ 10548: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10548: R_FRV_32 \.got
+ 1054c: 00 00 00 28 add\.p gr0,gr40,gr0
+ 1054c: R_FRV_32 \.got
+ 10550: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10550: R_FRV_32 \.text
+ 10554: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10554: R_FRV_32 \.text
+ 10558: 00 00 00 18 add\.p gr0,gr24,gr0
+ 10558: R_FRV_32 \.got
+ 1055c: 00 00 00 04 add\.p gr0,gr4,gr0
+ 1055c: R_FRV_32 \.data
diff --git a/ld/testsuite/ld-frv/fdpic-shared-4.d b/ld/testsuite/ld-frv/fdpic-shared-4.d
new file mode 100644
index 0000000..a441832
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-4.d
@@ -0,0 +1,71 @@
+#name: FRV uClinux PIC relocs to protected symbols, shared linking
+#source: fdpic4.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00000604 <F4>:
+ 604: 80 3c 00 01 call 608 <PF0>
+
+00000608 <PF0>:
+ 608: 80 40 f0 10 addi gr15,16,gr0
+ 60c: 80 fc 00 20 setlos 0x20,gr0
+ 610: 80 f4 00 1c setlo 0x1c,gr0
+ 614: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 618: 80 40 f0 0c addi gr15,12,gr0
+ 61c: 80 fc 00 24 setlos 0x24,gr0
+ 620: 80 f4 00 18 setlo 0x18,gr0
+ 624: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 628: 80 40 ff f8 addi gr15,-8,gr0
+ 62c: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 630: 80 f4 ff e8 setlo 0xffe8,gr0
+ 634: 80 f8 ff ff sethi 0xffff,gr0
+ 638: 80 40 ff 68 addi gr15,-152,gr0
+ 63c: 80 fc ff 68 setlos 0xffffff68,gr0
+ 640: 80 f4 ff 68 setlo 0xff68,gr0
+ 644: 80 f8 ff ff sethi 0xffff,gr0
+ 648: 80 f4 00 14 setlo 0x14,gr0
+ 64c: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010654 <D4>:
+ 10654: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10654: R_FRV_32 \.data
+
+00010658 <PD0>:
+ 10658: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10658: R_FRV_FUNCDESC PFb
+ 1065c: 00 00 00 04 add\.p gr0,gr4,gr0
+ 1065c: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000106d8 <_GLOBAL_OFFSET_TABLE_-0x18>:
+ 106d8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106d8: R_FRV_FUNCDESC_VALUE \.text
+ 106dc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106e0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106e0: R_FRV_FUNCDESC_VALUE \.text
+ 106e4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106e8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 106e8: R_FRV_FUNCDESC_VALUE \.text
+ 106ec: 00 00 00 00 add\.p gr0,gr0,gr0
+
+000106f0 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 106fc: R_FRV_FUNCDESC PF4
+ 10700: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10700: R_FRV_32 \.text
+ 10704: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10704: R_FRV_32 \.data
+ 10708: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10708: R_FRV_FUNCDESC PF6
+ 1070c: 00 00 00 04 add\.p gr0,gr4,gr0
+ 1070c: R_FRV_32 \.text
+ 10710: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10710: R_FRV_32 \.text
+ 10714: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10714: R_FRV_FUNCDESC PF5
diff --git a/ld/testsuite/ld-frv/fdpic-shared-5.d b/ld/testsuite/ld-frv/fdpic-shared-5.d
new file mode 100644
index 0000000..d0767f6
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-5.d
@@ -0,0 +1,83 @@
+#name: FRV uClinux PIC relocs to undefined symbols, shared linking
+#source: fdpic5.s
+#objdump: -DRz -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.plt:
+
+00000598 <\.plt>:
+ 598: 00 00 00 10 add\.p gr0,gr16,gr0
+ 59c: c0 1a 00 06 bra 5b4 <F5-0x10>
+ 5a0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 5a4: c0 1a 00 04 bra 5b4 <F5-0x10>
+ 5a8: 00 00 00 00 add\.p gr0,gr0,gr0
+ 5ac: c0 1a 00 02 bra 5b4 <F5-0x10>
+ 5b0: 00 00 00 18 add\.p gr0,gr24,gr0
+ 5b4: 88 08 f1 40 ldd @\(gr15,gr0\),gr4
+ 5b8: 80 30 40 00 jmpl @\(gr4,gr0\)
+ 5bc: 9c cc ff f0 lddi @\(gr15,-16\),gr14
+ 5c0: 80 30 e0 00 jmpl @\(gr14,gr0\)
+Disassembly of section \.text:
+
+000005c4 <F5>:
+ 5c4: fe 3f ff fe call 5bc <F5-0x8>
+ 5c8: 80 40 f0 0c addi gr15,12,gr0
+ 5cc: 80 fc 00 24 setlos 0x24,gr0
+ 5d0: 80 f4 00 20 setlo 0x20,gr0
+ 5d4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5d8: 80 40 f0 10 addi gr15,16,gr0
+ 5dc: 80 fc 00 1c setlos 0x1c,gr0
+ 5e0: 80 f4 00 18 setlo 0x18,gr0
+ 5e4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 5e8: 80 40 ff f8 addi gr15,-8,gr0
+ 5ec: 80 fc ff e8 setlos 0xffffffe8,gr0
+ 5f0: 80 f4 ff e0 setlo 0xffe0,gr0
+ 5f4: 80 f8 ff ff sethi 0xffff,gr0
+ 5f8: 80 f4 00 14 setlo 0x14,gr0
+ 5fc: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010604 <D5>:
+ 10604: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10604: R_FRV_32 UD0
+ 10608: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10608: R_FRV_FUNCDESC UFb
+ 1060c: 00 00 00 00 add\.p gr0,gr0,gr0
+ 1060c: R_FRV_32 UFb
+Disassembly of section \.got:
+
+000106a0 <_GLOBAL_OFFSET_TABLE_-0x20>:
+ 106a0: 00 00 05 b4 subx\.p gr0,gr52,gr0,icc1
+ 106a0: R_FRV_FUNCDESC_VALUE UF9
+ 106a4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106a8: 00 00 05 9c subx\.p gr0,gr28,gr0,icc1
+ 106a8: R_FRV_FUNCDESC_VALUE UF8
+ 106ac: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106b0: 00 00 05 ac subx\.p gr0,gr44,gr0,icc1
+ 106b0: R_FRV_FUNCDESC_VALUE UF0
+ 106b4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106b8: 00 00 05 a4 subx\.p gr0,gr36,gr0,icc1
+ 106b8: R_FRV_FUNCDESC_VALUE UF7
+ 106bc: 00 00 00 00 add\.p gr0,gr0,gr0
+
+000106c0 <_GLOBAL_OFFSET_TABLE_>:
+ 106c0: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106c4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106c8: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106cc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106cc: R_FRV_32 UF1
+ 106d0: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106d0: R_FRV_FUNCDESC UF4
+ 106d4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106d4: R_FRV_32 UD1
+ 106d8: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106d8: R_FRV_FUNCDESC UF6
+ 106dc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106dc: R_FRV_FUNCDESC UF5
+ 106e0: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106e0: R_FRV_32 UF3
+ 106e4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 106e4: R_FRV_32 UF2
diff --git a/ld/testsuite/ld-frv/fdpic-shared-6.d b/ld/testsuite/ld-frv/fdpic-shared-6.d
new file mode 100644
index 0000000..492fe1c
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-6.d
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to undefined symbols, shared linking
+#source: fdpic6.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+#error: different segments
diff --git a/ld/testsuite/ld-frv/fdpic-shared-7.d b/ld/testsuite/ld-frv/fdpic-shared-7.d
new file mode 100644
index 0000000..2b95623
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-7.d
@@ -0,0 +1,58 @@
+#name: FRV uClinux PIC relocs to local symbols with addends, shared linking
+#source: fdpic7.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+000003dc <F7>:
+ 3dc: 80 3c 00 02 call 3e4 <\.F0\+0x4>
+
+000003e0 <\.F0>:
+ 3e0: 80 40 f0 0c addi gr15,12,gr0
+ 3e4: 80 fc 00 0c setlos 0xc,gr0
+ 3e8: 80 f4 00 0c setlo 0xc,gr0
+ 3ec: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 3f0: 80 40 f0 10 addi gr15,16,gr0
+ 3f4: 80 fc 00 10 setlos 0x10,gr0
+ 3f8: 80 f4 00 10 setlo 0x10,gr0
+ 3fc: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 400: 80 40 ff f8 addi gr15,-8,gr0
+ 404: 80 fc ff f8 setlos 0xfffffff8,gr0
+ 408: 80 f4 ff f8 setlo 0xfff8,gr0
+ 40c: 80 f8 ff ff sethi 0xffff,gr0
+ 410: 80 40 ff 7c addi gr15,-132,gr0
+ 414: 80 fc ff 7c setlos 0xffffff7c,gr0
+ 418: 80 f4 ff 7c setlo 0xff7c,gr0
+ 41c: 80 f8 ff ff sethi 0xffff,gr0
+ 420: 80 f4 00 14 setlo 0x14,gr0
+ 424: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+0001042c <D7>:
+ 1042c: 00 00 00 08 add\.p gr0,gr8,gr0
+ 1042c: R_FRV_32 \.data
+
+00010430 <\.D0>:
+ 10430: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10430: R_FRV_32 \.got
+ 10434: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10434: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000104b0 <_GLOBAL_OFFSET_TABLE_-0x8>:
+ 104b0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104b0: R_FRV_FUNCDESC_VALUE \.text
+ 104b4: 00 00 00 00 add\.p gr0,gr0,gr0
+
+000104b8 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 104c4: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104c4: R_FRV_32 \.text
+ 104c8: 00 00 00 00 add\.p gr0,gr0,gr0
+ 104c8: R_FRV_32 \.got
+ 104cc: 00 00 00 08 add\.p gr0,gr8,gr0
+ 104cc: R_FRV_32 \.data
diff --git a/ld/testsuite/ld-frv/fdpic-shared-8-fail.d b/ld/testsuite/ld-frv/fdpic-shared-8-fail.d
new file mode 100644
index 0000000..7f16a42
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-8-fail.d
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to (mostly) global symbols with addends, failing shared linking
+#source: fdpic8.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared
+#error: nonzero addend
diff --git a/ld/testsuite/ld-frv/fdpic-shared-8.d b/ld/testsuite/ld-frv/fdpic-shared-8.d
new file mode 100644
index 0000000..fdeea73
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-8.d
@@ -0,0 +1,84 @@
+#name: FRV uClinux PIC relocs to (mostly) global symbols with addends, shared linking
+#source: fdpic8.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared --version-script fdpic8min.ldv
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+000004d4 <F8>:
+ 4d4: 80 3c 00 02 call 4dc <GF1\+0x4>
+
+000004d8 <GF1>:
+ 4d8: 80 40 f0 10 addi gr15,16,gr0
+ 4dc: 80 fc 00 14 setlos 0x14,gr0
+ 4e0: 80 f4 00 24 setlo 0x24,gr0
+ 4e4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 4e8: 80 40 f0 0c addi gr15,12,gr0
+ 4ec: 80 fc 00 1c setlos 0x1c,gr0
+ 4f0: 80 f4 00 18 setlo 0x18,gr0
+ 4f4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 4f8: 80 40 ff f8 addi gr15,-8,gr0
+ 4fc: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 500: 80 f4 ff c8 setlo 0xffc8,gr0
+ 504: 80 f8 ff ff sethi 0xffff,gr0
+ 508: 80 40 ff 4c addi gr15,-180,gr0
+ 50c: 80 fc ff 4c setlos 0xffffff4c,gr0
+ 510: 80 f4 ff 4c setlo 0xff4c,gr0
+ 514: 80 f8 ff ff sethi 0xffff,gr0
+ 518: 80 f4 00 20 setlo 0x20,gr0
+ 51c: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010524 <D8>:
+ 10524: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10524: R_FRV_32 GD0
+
+00010528 <GD0>:
+ 10528: 00 00 00 10 add\.p gr0,gr16,gr0
+ 10528: R_FRV_32 \.got
+ 1052c: 00 00 00 08 add\.p gr0,gr8,gr0
+ 1052c: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000105a8 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 105a8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105a8: R_FRV_FUNCDESC_VALUE \.text
+ 105ac: 00 00 00 00 add\.p gr0,gr0,gr0
+ 105b0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105b0: R_FRV_FUNCDESC_VALUE \.text
+ 105b4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 105b8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105b8: R_FRV_FUNCDESC_VALUE \.text
+ 105bc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 105c0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105c0: R_FRV_FUNCDESC_VALUE \.text
+ 105c4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 105c8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105c8: R_FRV_FUNCDESC_VALUE \.text
+ 105cc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 105d0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105d0: R_FRV_FUNCDESC_VALUE \.text
+ 105d4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 105d8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105d8: R_FRV_FUNCDESC_VALUE \.text
+ 105dc: 00 00 00 00 add\.p gr0,gr0,gr0
+
+000105e0 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 105ec: 00 00 00 08 add\.p gr0,gr8,gr0
+ 105ec: R_FRV_32 \.got
+ 105f0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 105f0: R_FRV_32 GF1
+ 105f4: 00 00 00 04 add\.p gr0,gr4,gr0
+ 105f4: R_FRV_32 GF2
+ 105f8: 00 00 00 20 add\.p gr0,gr32,gr0
+ 105f8: R_FRV_32 \.got
+ 105fc: 00 00 00 18 add\.p gr0,gr24,gr0
+ 105fc: R_FRV_32 \.got
+ 10600: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10600: R_FRV_32 GD4
+ 10604: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10604: R_FRV_32 GF3
diff --git a/ld/testsuite/ld-frv/fdpic-shared-local-2.d b/ld/testsuite/ld-frv/fdpic-shared-local-2.d
new file mode 100644
index 0000000..6f7b205
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-local-2.d
@@ -0,0 +1,84 @@
+#name: FRV uClinux PIC relocs to forced-local symbols, shared linking
+#source: fdpic2.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared --version-script fdpic2.ldv
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00000300 <F2>:
+ 300: 80 3c 00 01 call 304 <GF0>
+
+00000304 <GF0>:
+ 304: 80 40 f0 10 addi gr15,16,gr0
+ 308: 80 fc 00 24 setlos 0x24,gr0
+ 30c: 80 f4 00 20 setlo 0x20,gr0
+ 310: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 314: 80 40 f0 0c addi gr15,12,gr0
+ 318: 80 fc 00 18 setlos 0x18,gr0
+ 31c: 80 f4 00 14 setlo 0x14,gr0
+ 320: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 324: 80 40 ff f8 addi gr15,-8,gr0
+ 328: 80 fc ff d0 setlos 0xffffffd0,gr0
+ 32c: 80 f4 ff c8 setlo 0xffc8,gr0
+ 330: 80 f8 ff ff sethi 0xffff,gr0
+ 334: 80 40 ff 44 addi gr15,-188,gr0
+ 338: 80 fc ff 44 setlos 0xffffff44,gr0
+ 33c: 80 f4 ff 44 setlo 0xff44,gr0
+ 340: 80 f8 ff ff sethi 0xffff,gr0
+ 344: 80 f4 00 1c setlo 0x1c,gr0
+ 348: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010350 <D2>:
+ 10350: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10350: R_FRV_32 \.data
+
+00010354 <GD0>:
+ 10354: 00 00 00 18 add\.p gr0,gr24,gr0
+ 10354: R_FRV_32 \.got
+ 10358: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10358: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000103d8 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 103d8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 103d8: R_FRV_FUNCDESC_VALUE \.text
+ 103dc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103e0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 103e0: R_FRV_FUNCDESC_VALUE \.text
+ 103e4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103e8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 103e8: R_FRV_FUNCDESC_VALUE \.text
+ 103ec: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103f0: 00 00 00 04 add\.p gr0,gr4,gr0
+ 103f0: R_FRV_FUNCDESC_VALUE \.text
+ 103f4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103f8: 00 00 00 04 add\.p gr0,gr4,gr0
+ 103f8: R_FRV_FUNCDESC_VALUE \.text
+ 103fc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10400: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10400: R_FRV_FUNCDESC_VALUE \.text
+ 10404: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10408: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10408: R_FRV_FUNCDESC_VALUE \.text
+ 1040c: 00 00 00 00 add\.p gr0,gr0,gr0
+
+00010410 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 1041c: 00 00 00 10 add\.p gr0,gr16,gr0
+ 1041c: R_FRV_32 \.got
+ 10420: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10420: R_FRV_32 \.text
+ 10424: 00 00 00 28 add\.p gr0,gr40,gr0
+ 10424: R_FRV_32 \.got
+ 10428: 00 00 00 20 add\.p gr0,gr32,gr0
+ 10428: R_FRV_32 \.got
+ 1042c: 00 00 00 04 add\.p gr0,gr4,gr0
+ 1042c: R_FRV_32 \.data
+ 10430: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10430: R_FRV_32 \.text
+ 10434: 00 00 00 04 add\.p gr0,gr4,gr0
+ 10434: R_FRV_32 \.text
diff --git a/ld/testsuite/ld-frv/fdpic-shared-local-8.d b/ld/testsuite/ld-frv/fdpic-shared-local-8.d
new file mode 100644
index 0000000..7b12051
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-shared-local-8.d
@@ -0,0 +1,84 @@
+#name: FRV uClinux PIC relocs to forced-local symbols with addends, shared linking
+#source: fdpic8.s
+#objdump: -DR -j .text -j .data -j .got -j .plt
+#as: -mfdpic
+#ld: -shared --version-script fdpic8.ldv
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00000300 <F8>:
+ 300: 80 3c 00 02 call 308 <GF0\+0x4>
+
+00000304 <GF0>:
+ 304: 80 40 f0 10 addi gr15,16,gr0
+ 308: 80 fc 00 14 setlos 0x14,gr0
+ 30c: 80 f4 00 24 setlo 0x24,gr0
+ 310: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 314: 80 40 f0 0c addi gr15,12,gr0
+ 318: 80 fc 00 1c setlos 0x1c,gr0
+ 31c: 80 f4 00 18 setlo 0x18,gr0
+ 320: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 324: 80 40 ff f8 addi gr15,-8,gr0
+ 328: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 32c: 80 f4 ff c8 setlo 0xffc8,gr0
+ 330: 80 f8 ff ff sethi 0xffff,gr0
+ 334: 80 40 ff 48 addi gr15,-184,gr0
+ 338: 80 fc ff 48 setlos 0xffffff48,gr0
+ 33c: 80 f4 ff 48 setlo 0xff48,gr0
+ 340: 80 f8 ff ff sethi 0xffff,gr0
+ 344: 80 f4 00 20 setlo 0x20,gr0
+ 348: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.data:
+
+00010350 <D8>:
+ 10350: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10350: R_FRV_32 \.data
+
+00010354 <GD0>:
+ 10354: 00 00 00 10 add\.p gr0,gr16,gr0
+ 10354: R_FRV_32 \.got
+ 10358: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10358: R_FRV_32 \.text
+Disassembly of section \.got:
+
+000103d8 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 103d8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 103d8: R_FRV_FUNCDESC_VALUE \.text
+ 103dc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103e0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 103e0: R_FRV_FUNCDESC_VALUE \.text
+ 103e4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103e8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 103e8: R_FRV_FUNCDESC_VALUE \.text
+ 103ec: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103f0: 00 00 00 08 add\.p gr0,gr8,gr0
+ 103f0: R_FRV_FUNCDESC_VALUE \.text
+ 103f4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 103f8: 00 00 00 08 add\.p gr0,gr8,gr0
+ 103f8: R_FRV_FUNCDESC_VALUE \.text
+ 103fc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10400: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10400: R_FRV_FUNCDESC_VALUE \.text
+ 10404: 00 00 00 00 add\.p gr0,gr0,gr0
+ 10408: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10408: R_FRV_FUNCDESC_VALUE \.text
+ 1040c: 00 00 00 00 add\.p gr0,gr0,gr0
+
+00010410 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 1041c: 00 00 00 08 add\.p gr0,gr8,gr0
+ 1041c: R_FRV_32 \.got
+ 10420: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10420: R_FRV_32 \.text
+ 10424: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10424: R_FRV_32 \.text
+ 10428: 00 00 00 20 add\.p gr0,gr32,gr0
+ 10428: R_FRV_32 \.got
+ 1042c: 00 00 00 18 add\.p gr0,gr24,gr0
+ 1042c: R_FRV_32 \.got
+ 10430: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10430: R_FRV_32 \.data
+ 10434: 00 00 00 08 add\.p gr0,gr8,gr0
+ 10434: R_FRV_32 \.text
diff --git a/ld/testsuite/ld-frv/fdpic-static-1.d b/ld/testsuite/ld-frv/fdpic-static-1.d
new file mode 100644
index 0000000..246e24e
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-static-1.d
@@ -0,0 +1,63 @@
+#name: FRV uClinux PIC relocs to local symbols, static linking
+#source: fdpic1.s
+#objdump: -D
+#as: -mfdpic
+#ld: -static
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00010094 <F1>:
+ 10094: 80 3c 00 01 call 10098 <\.F0>
+
+00010098 <\.F0>:
+ 10098: 80 40 f0 0c addi gr15,12,gr0
+ 1009c: 80 fc 00 0c setlos 0xc,gr0
+ 100a0: 80 f4 00 0c setlo 0xc,gr0
+ 100a4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100a8: 80 40 f0 10 addi gr15,16,gr0
+ 100ac: 80 fc 00 10 setlos 0x10,gr0
+ 100b0: 80 f4 00 10 setlo 0x10,gr0
+ 100b4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100b8: 80 40 ff f8 addi gr15,-8,gr0
+ 100bc: 80 fc ff f8 setlos 0xfffffff8,gr0
+ 100c0: 80 f4 ff f8 setlo 0xfff8,gr0
+ 100c4: 80 f8 ff ff sethi 0xffff,gr0
+ 100c8: 80 40 ff f0 addi gr15,-16,gr0
+ 100cc: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 100d0: 80 f4 ff f0 setlo 0xfff0,gr0
+ 100d4: 80 f8 ff ff sethi 0xffff,gr0
+ 100d8: 80 f4 00 14 setlo 0x14,gr0
+ 100dc: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.rofixup:
+
+000100e0 <__ROFIXUP_LIST__>:
+ 100e0: 00 02 01 24 sub\.p gr32,gr36,gr0
+ 100e4: 00 02 01 28 sub\.p gr32,gr40,gr0
+ 100e8: 00 02 01 10 sub\.p gr32,gr16,gr0
+ 100ec: 00 02 01 14 sub\.p gr32,gr20,gr0
+ 100f0: 00 02 01 2c sub\.p gr32,gr44,gr0
+ 100f4: 00 02 01 04 sub\.p gr32,gr4,gr0
+ 100f8: 00 02 01 08 sub\.p gr32,gr8,gr0
+ 100fc: 00 02 01 0c sub\.p gr32,gr12,gr0
+ 10100: 00 02 01 18 sub\.p gr32,gr24,gr0
+Disassembly of section \.data:
+
+00020104 <D1>:
+ 20104: 00 02 01 08 sub\.p gr32,gr8,gr0
+
+00020108 <\.D0>:
+ 20108: 00 02 01 10 sub\.p gr32,gr16,gr0
+ 2010c: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+Disassembly of section \.got:
+
+00020110 <_GLOBAL_OFFSET_TABLE_-0x8>:
+ 20110: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 20114: 00 02 01 18 sub\.p gr32,gr24,gr0
+
+00020118 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 20124: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 20128: 00 02 01 10 sub\.p gr32,gr16,gr0
+ 2012c: 00 02 01 08 sub\.p gr32,gr8,gr0
diff --git a/ld/testsuite/ld-frv/fdpic-static-2.d b/ld/testsuite/ld-frv/fdpic-static-2.d
new file mode 100644
index 0000000..1c6b371
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-static-2.d
@@ -0,0 +1,95 @@
+#name: FRV uClinux PIC relocs to global symbols, static linking
+#source: fdpic2.s
+#objdump: -D
+#as: -mfdpic
+#ld: -static
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00010094 <F2>:
+ 10094: 80 3c 00 01 call 10098 <GF0>
+
+00010098 <GF0>:
+ 10098: 80 40 f0 10 addi gr15,16,gr0
+ 1009c: 80 fc 00 24 setlos 0x24,gr0
+ 100a0: 80 f4 00 20 setlo 0x20,gr0
+ 100a4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100a8: 80 40 f0 0c addi gr15,12,gr0
+ 100ac: 80 fc 00 18 setlos 0x18,gr0
+ 100b0: 80 f4 00 14 setlo 0x14,gr0
+ 100b4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100b8: 80 40 ff f8 addi gr15,-8,gr0
+ 100bc: 80 fc ff d0 setlos 0xffffffd0,gr0
+ 100c0: 80 f4 ff c8 setlo 0xffc8,gr0
+ 100c4: 80 f8 ff ff sethi 0xffff,gr0
+ 100c8: 80 40 ff c0 addi gr15,-64,gr0
+ 100cc: 80 fc ff c0 setlos 0xffffffc0,gr0
+ 100d0: 80 f4 ff c0 setlo 0xffc0,gr0
+ 100d4: 80 f8 ff ff sethi 0xffff,gr0
+ 100d8: 80 f4 00 1c setlo 0x1c,gr0
+ 100dc: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.rofixup:
+
+000100e0 <__ROFIXUP_LIST__>:
+ 100e0: 00 02 01 98 subx\.p gr32,gr24,gr0,icc0
+ 100e4: 00 02 01 ac subx\.p gr32,gr44,gr0,icc0
+ 100e8: 00 02 01 a8 subx\.p gr32,gr40,gr0,icc0
+ 100ec: 00 02 01 94 subx\.p gr32,gr20,gr0,icc0
+ 100f0: 00 02 01 60 subcc\.p gr32,gr32,gr0,icc0
+ 100f4: 00 02 01 64 subcc\.p gr32,gr36,gr0,icc0
+ 100f8: 00 02 01 a0 subx\.p gr32,gr32,gr0,icc0
+ 100fc: 00 02 01 70 subcc\.p gr32,gr48,gr0,icc0
+ 10100: 00 02 01 74 subcc\.p gr32,gr52,gr0,icc0
+ 10104: 00 02 01 9c subx\.p gr32,gr28,gr0,icc0
+ 10108: 00 02 01 78 subcc\.p gr32,gr56,gr0,icc0
+ 1010c: 00 02 01 7c subcc\.p gr32,gr60,gr0,icc0
+ 10110: 00 02 01 80 subx\.p gr32,gr0,gr0,icc0
+ 10114: 00 02 01 84 subx\.p gr32,gr4,gr0,icc0
+ 10118: 00 02 01 58 subcc\.p gr32,gr24,gr0,icc0
+ 1011c: 00 02 01 5c subcc\.p gr32,gr28,gr0,icc0
+ 10120: 00 02 01 50 subcc\.p gr32,gr16,gr0,icc0
+ 10124: 00 02 01 54 subcc\.p gr32,gr20,gr0,icc0
+ 10128: 00 02 01 a4 subx\.p gr32,gr36,gr0,icc0
+ 1012c: 00 02 01 44 subcc\.p gr32,gr4,gr0,icc0
+ 10130: 00 02 01 68 subcc\.p gr32,gr40,gr0,icc0
+ 10134: 00 02 01 6c subcc\.p gr32,gr44,gr0,icc0
+ 10138: 00 02 01 48 subcc\.p gr32,gr8,gr0,icc0
+ 1013c: 00 02 01 4c subcc\.p gr32,gr12,gr0,icc0
+ 10140: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+Disassembly of section \.data:
+
+00020144 <D2>:
+ 20144: 00 02 01 48 subcc\.p gr32,gr8,gr0,icc0
+
+00020148 <GD0>:
+ 20148: 00 02 01 68 subcc\.p gr32,gr40,gr0,icc0
+ 2014c: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+Disassembly of section \.got:
+
+00020150 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 20150: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 20154: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20158: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 2015c: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20160: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 20164: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20168: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 2016c: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20170: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 20174: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20178: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 2017c: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20180: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 20184: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+
+00020188 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 20194: 00 02 01 60 subcc\.p gr32,gr32,gr0,icc0
+ 20198: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 2019c: 00 02 01 78 subcc\.p gr32,gr56,gr0,icc0
+ 201a0: 00 02 01 70 subcc\.p gr32,gr48,gr0,icc0
+ 201a4: 00 02 01 48 subcc\.p gr32,gr8,gr0,icc0
+ 201a8: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
+ 201ac: 00 01 00 98 addx\.p gr16,gr24,gr0,icc0
diff --git a/ld/testsuite/ld-frv/fdpic-static-5.d b/ld/testsuite/ld-frv/fdpic-static-5.d
new file mode 100644
index 0000000..a14e19a
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-static-5.d
@@ -0,0 +1,6 @@
+#name: FRV uClinux PIC relocs to undefined symbols, static linking
+#source: fdpic5.s
+#objdump: -D
+#as: -mfdpic
+#ld: -static
+#error: undefined reference
diff --git a/ld/testsuite/ld-frv/fdpic-static-6.d b/ld/testsuite/ld-frv/fdpic-static-6.d
new file mode 100644
index 0000000..5b59947
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-static-6.d
@@ -0,0 +1,74 @@
+#name: FRV uClinux PIC relocs to undefined symbols, static linking
+#source: fdpic6.s
+#objdump: -D
+#as: -mfdpic
+#ld: -static
+#error: warn.*different segment
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00010000 <F6>:
+ 10000: fe 3f c0 00 call 0 <F6-0x10000>
+ 10004: 80 40 f0 0c addi gr15,12,gr0
+ 10008: 80 fc 00 24 setlos 0x24,gr0
+ 1000c: 80 f4 00 20 setlo 0x20,gr0
+ 10010: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 10014: 80 40 f0 10 addi gr15,16,gr0
+ 10018: 80 fc 00 18 setlos 0x18,gr0
+ 1001c: 80 f4 00 1c setlo 0x1c,gr0
+ 10020: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 10024: 80 40 ff f8 addi gr15,-8,gr0
+ 10028: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 1002c: 80 f4 ff e8 setlo 0xffe8,gr0
+ 10030: 80 f8 ff ff sethi 0xffff,gr0
+ 10034: 80 f4 ff 18 setlo 0xff18,gr0
+ 10038: 80 f8 ff fa sethi 0xfffa,gr0
+ 1003c: 80 f4 00 14 setlo 0x14,gr0
+ 10040: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.rofixup:
+
+00010044 <_gp\+0x800>:
+ 10044: 00 05 00 f4 orcc\.p gr16,gr52,gr0,icc0
+ 10048: 00 05 01 0c xor\.p gr16,gr12,gr0
+ 1004c: 00 05 01 08 xor\.p gr16,gr8,gr0
+ 10050: 00 05 00 f8 orcc\.p gr16,gr56,gr0,icc0
+ 10054: 00 05 00 c0 orcc\.p gr16,gr0,gr0,icc0
+ 10058: 00 05 00 c4 orcc\.p gr16,gr4,gr0,icc0
+ 1005c: 00 05 01 00 xor\.p gr16,gr0,gr0
+ 10060: 00 05 00 c8 orcc\.p gr16,gr8,gr0,icc0
+ 10064: 00 05 00 cc orcc\.p gr16,gr12,gr0,icc0
+ 10068: 00 05 01 04 xor\.p gr16,gr4,gr0
+ 1006c: 00 05 00 b8 or\.p gr16,gr56,gr0
+ 10070: 00 05 00 bc or\.p gr16,gr60,gr0
+ 10074: 00 05 00 e0 orcc\.p gr16,gr32,gr0,icc0
+ 10078: 00 05 00 e4 orcc\.p gr16,gr36,gr0,icc0
+ 1007c: 00 05 00 d8 orcc\.p gr16,gr24,gr0,icc0
+ 10080: 00 05 00 dc orcc\.p gr16,gr28,gr0,icc0
+ 10084: 00 05 00 d0 orcc\.p gr16,gr16,gr0,icc0
+ 10088: 00 05 00 d4 orcc\.p gr16,gr20,gr0,icc0
+ 1008c: 00 05 00 fc orcc\.p gr16,gr60,gr0,icc0
+ 10090: 00 05 00 a4 or\.p gr16,gr36,gr0
+ 10094: 00 05 00 b0 or\.p gr16,gr48,gr0
+ 10098: 00 05 00 b4 or\.p gr16,gr52,gr0
+ 1009c: 00 05 00 a8 or\.p gr16,gr40,gr0
+ 100a0: 00 05 00 ac or\.p gr16,gr44,gr0
+Disassembly of section \.data:
+
+000500a4 <D6>:
+ 500a4: 00 00 00 00 add\.p gr0,gr0,gr0
+ 500a8: 00 05 00 b0 or\.p gr16,gr48,gr0
+ 500ac: 00 00 00 00 add\.p gr0,gr0,gr0
+Disassembly of section \.got:
+
+000500b0 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ \.\.\.
+
+000500e8 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 500f8: 00 05 00 c0 orcc\.p gr16,gr0,gr0,icc0
+ 500fc: 00 00 00 00 add\.p gr0,gr0,gr0
+ 50100: 00 05 00 c8 orcc\.p gr16,gr8,gr0,icc0
+ 50104: 00 05 00 b8 or\.p gr16,gr56,gr0
+ \.\.\.
diff --git a/ld/testsuite/ld-frv/fdpic-static-7.d b/ld/testsuite/ld-frv/fdpic-static-7.d
new file mode 100644
index 0000000..b8eba61
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-static-7.d
@@ -0,0 +1,63 @@
+#name: FRV uClinux PIC relocs to local symbols with addends, static linking
+#source: fdpic7.s
+#objdump: -D
+#as: -mfdpic
+#ld: -static
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00010094 <F7>:
+ 10094: 80 3c 00 02 call 1009c <\.F0\+0x4>
+
+00010098 <\.F0>:
+ 10098: 80 40 f0 0c addi gr15,12,gr0
+ 1009c: 80 fc 00 0c setlos 0xc,gr0
+ 100a0: 80 f4 00 0c setlo 0xc,gr0
+ 100a4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100a8: 80 40 f0 10 addi gr15,16,gr0
+ 100ac: 80 fc 00 10 setlos 0x10,gr0
+ 100b0: 80 f4 00 10 setlo 0x10,gr0
+ 100b4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100b8: 80 40 ff f8 addi gr15,-8,gr0
+ 100bc: 80 fc ff f8 setlos 0xfffffff8,gr0
+ 100c0: 80 f4 ff f8 setlo 0xfff8,gr0
+ 100c4: 80 f8 ff ff sethi 0xffff,gr0
+ 100c8: 80 40 ff f4 addi gr15,-12,gr0
+ 100cc: 80 fc ff f4 setlos 0xfffffff4,gr0
+ 100d0: 80 f4 ff f4 setlo 0xfff4,gr0
+ 100d4: 80 f8 ff ff sethi 0xffff,gr0
+ 100d8: 80 f4 00 14 setlo 0x14,gr0
+ 100dc: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.rofixup:
+
+000100e0 <__ROFIXUP_LIST__>:
+ 100e0: 00 02 01 24 sub\.p gr32,gr36,gr0
+ 100e4: 00 02 01 28 sub\.p gr32,gr40,gr0
+ 100e8: 00 02 01 10 sub\.p gr32,gr16,gr0
+ 100ec: 00 02 01 14 sub\.p gr32,gr20,gr0
+ 100f0: 00 02 01 2c sub\.p gr32,gr44,gr0
+ 100f4: 00 02 01 04 sub\.p gr32,gr4,gr0
+ 100f8: 00 02 01 08 sub\.p gr32,gr8,gr0
+ 100fc: 00 02 01 0c sub\.p gr32,gr12,gr0
+ 10100: 00 02 01 18 sub\.p gr32,gr24,gr0
+Disassembly of section \.data:
+
+00020104 <D7>:
+ 20104: 00 02 01 0c sub\.p gr32,gr12,gr0
+
+00020108 <\.D0>:
+ 20108: 00 02 01 10 sub\.p gr32,gr16,gr0
+ 2010c: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+Disassembly of section \.got:
+
+00020110 <_GLOBAL_OFFSET_TABLE_-0x8>:
+ 20110: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 20114: 00 02 01 18 sub\.p gr32,gr24,gr0
+
+00020118 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 20124: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 20128: 00 02 01 10 sub\.p gr32,gr16,gr0
+ 2012c: 00 02 01 0c sub\.p gr32,gr12,gr0
diff --git a/ld/testsuite/ld-frv/fdpic-static-8.d b/ld/testsuite/ld-frv/fdpic-static-8.d
new file mode 100644
index 0000000..cbebb17
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic-static-8.d
@@ -0,0 +1,95 @@
+#name: FRV uClinux PIC relocs to global symbols with addends, static linking
+#source: fdpic8.s
+#objdump: -D
+#as: -mfdpic
+#ld: -static
+
+.*: file format elf.*frv.*
+
+Disassembly of section \.text:
+
+00010094 <F8>:
+ 10094: 80 3c 00 02 call 1009c <GF0\+0x4>
+
+00010098 <GF0>:
+ 10098: 80 40 f0 10 addi gr15,16,gr0
+ 1009c: 80 fc 00 14 setlos 0x14,gr0
+ 100a0: 80 f4 00 24 setlo 0x24,gr0
+ 100a4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100a8: 80 40 f0 0c addi gr15,12,gr0
+ 100ac: 80 fc 00 1c setlos 0x1c,gr0
+ 100b0: 80 f4 00 18 setlo 0x18,gr0
+ 100b4: 80 f8 00 00 sethi hi\(0x0\),gr0
+ 100b8: 80 40 ff f8 addi gr15,-8,gr0
+ 100bc: 80 fc ff f0 setlos 0xfffffff0,gr0
+ 100c0: 80 f4 ff c8 setlo 0xffc8,gr0
+ 100c4: 80 f8 ff ff sethi 0xffff,gr0
+ 100c8: 80 40 ff c4 addi gr15,-60,gr0
+ 100cc: 80 fc ff c4 setlos 0xffffffc4,gr0
+ 100d0: 80 f4 ff c4 setlo 0xffc4,gr0
+ 100d4: 80 f8 ff ff sethi 0xffff,gr0
+ 100d8: 80 f4 00 20 setlo 0x20,gr0
+ 100dc: 80 f8 00 00 sethi hi\(0x0\),gr0
+Disassembly of section \.rofixup:
+
+000100e0 <__ROFIXUP_LIST__>:
+ 100e0: 00 02 01 98 subx\.p gr32,gr24,gr0,icc0
+ 100e4: 00 02 01 9c subx\.p gr32,gr28,gr0,icc0
+ 100e8: 00 02 01 ac subx\.p gr32,gr44,gr0,icc0
+ 100ec: 00 02 01 94 subx\.p gr32,gr20,gr0,icc0
+ 100f0: 00 02 01 58 subcc\.p gr32,gr24,gr0,icc0
+ 100f4: 00 02 01 5c subcc\.p gr32,gr28,gr0,icc0
+ 100f8: 00 02 01 a4 subx\.p gr32,gr36,gr0,icc0
+ 100fc: 00 02 01 68 subcc\.p gr32,gr40,gr0,icc0
+ 10100: 00 02 01 6c subcc\.p gr32,gr44,gr0,icc0
+ 10104: 00 02 01 a0 subx\.p gr32,gr32,gr0,icc0
+ 10108: 00 02 01 70 subcc\.p gr32,gr48,gr0,icc0
+ 1010c: 00 02 01 74 subcc\.p gr32,gr52,gr0,icc0
+ 10110: 00 02 01 80 subx\.p gr32,gr0,gr0,icc0
+ 10114: 00 02 01 84 subx\.p gr32,gr4,gr0,icc0
+ 10118: 00 02 01 78 subcc\.p gr32,gr56,gr0,icc0
+ 1011c: 00 02 01 7c subcc\.p gr32,gr60,gr0,icc0
+ 10120: 00 02 01 50 subcc\.p gr32,gr16,gr0,icc0
+ 10124: 00 02 01 54 subcc\.p gr32,gr20,gr0,icc0
+ 10128: 00 02 01 a8 subx\.p gr32,gr40,gr0,icc0
+ 1012c: 00 02 01 44 subcc\.p gr32,gr4,gr0,icc0
+ 10130: 00 02 01 60 subcc\.p gr32,gr32,gr0,icc0
+ 10134: 00 02 01 64 subcc\.p gr32,gr36,gr0,icc0
+ 10138: 00 02 01 48 subcc\.p gr32,gr8,gr0,icc0
+ 1013c: 00 02 01 4c subcc\.p gr32,gr12,gr0,icc0
+ 10140: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+Disassembly of section \.data:
+
+00020144 <D8>:
+ 20144: 00 02 01 4c subcc\.p gr32,gr12,gr0,icc0
+
+00020148 <GD0>:
+ 20148: 00 02 01 60 subcc\.p gr32,gr32,gr0,icc0
+ 2014c: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+Disassembly of section \.got:
+
+00020150 <_GLOBAL_OFFSET_TABLE_-0x38>:
+ 20150: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 20154: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20158: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 2015c: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20160: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 20164: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20168: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 2016c: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20170: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 20174: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20178: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 2017c: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+ 20180: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 20184: 00 02 01 88 subx\.p gr32,gr8,gr0,icc0
+
+00020188 <_GLOBAL_OFFSET_TABLE_>:
+ \.\.\.
+ 20194: 00 02 01 58 subcc\.p gr32,gr24,gr0,icc0
+ 20198: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 2019c: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
+ 201a0: 00 02 01 70 subcc\.p gr32,gr48,gr0,icc0
+ 201a4: 00 02 01 68 subcc\.p gr32,gr40,gr0,icc0
+ 201a8: 00 02 01 4c subcc\.p gr32,gr12,gr0,icc0
+ 201ac: 00 01 00 9c addx\.p gr16,gr28,gr0,icc0
diff --git a/ld/testsuite/ld-frv/fdpic.exp b/ld/testsuite/ld-frv/fdpic.exp
new file mode 100644
index 0000000..dc06d4e
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic.exp
@@ -0,0 +1,57 @@
+# Expect script for FRV FDPIC linker tests
+# Copyright 2003 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+
+if {![istarget frv*-*-*] || ![is_elf_format]} {
+ return
+}
+
+global LDFLAGS
+set LDFLAGS "$LDFLAGS -melf32frvfd"
+
+run_dump_test "fdpic-static-1"
+run_dump_test "fdpic-pie-1"
+run_dump_test "fdpic-shared-1"
+
+run_dump_test "fdpic-static-2"
+run_dump_test "fdpic-pie-2"
+run_dump_test "fdpic-shared-2-fail"
+run_dump_test "fdpic-shared-2"
+run_dump_test "fdpic-shared-local-2"
+
+run_dump_test "fdpic-shared-3"
+
+run_dump_test "fdpic-shared-4"
+
+run_dump_test "fdpic-static-5"
+run_dump_test "fdpic-pie-5"
+run_dump_test "fdpic-shared-5"
+
+run_dump_test "fdpic-static-6"
+run_dump_test "fdpic-pie-6"
+run_dump_test "fdpic-shared-6"
+
+run_dump_test "fdpic-static-7"
+run_dump_test "fdpic-pie-7"
+run_dump_test "fdpic-shared-7"
+
+run_dump_test "fdpic-static-8"
+run_dump_test "fdpic-pie-8-fail"
+run_dump_test "fdpic-pie-8"
+run_dump_test "fdpic-shared-8-fail"
+run_dump_test "fdpic-shared-8"
+run_dump_test "fdpic-shared-local-8"
diff --git a/ld/testsuite/ld-frv/fdpic1.s b/ld/testsuite/ld-frv/fdpic1.s
new file mode 100644
index 0000000..29f7fff
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic1.s
@@ -0,0 +1,64 @@
+ .text
+ .weak _start
+_start:
+ .global F1
+ .type F1,@function
+F1:
+ call .F0
+
+.F0:
+.F1:
+.F2:
+.F3:
+.F4:
+.F5:
+.F6:
+.F7:
+.F8:
+.F9:
+.Fa:
+.Fb:
+.Fc:
+ addi gr15, #got12(.F1), gr0
+
+ setlos #gotlo(.F2), gr0
+
+ setlo #gotlo(.F3), gr0
+ sethi #gothi(.F3), gr0
+
+ addi gr15, #gotfuncdesc12(.F4), gr0
+
+ setlos #gotfuncdesclo(.F5), gr0
+
+ setlo #gotfuncdesclo(.F6), gr0
+ sethi #gotfuncdeschi(.F6), gr0
+
+ addi gr15, #gotofffuncdesc12(.F7), gr0
+
+ setlos #gotofffuncdesclo(.F8), gr0
+
+ setlo #gotofffuncdesclo(.F9), gr0
+ sethi #gotofffuncdeschi(.F9), gr0
+
+ addi gr15, #gotoff12(.D1), gr0
+
+ setlos #gotofflo(.D2), gr0
+
+ setlo #gotofflo(.D3), gr0
+ sethi #gotoffhi(.D3), gr0
+
+ setlo #gotlo(.D4), gr0
+ sethi #gothi(.D4), gr0
+
+ .data
+ .global D1
+D1:
+ .word .D0
+ .section .data.rel.local
+.D0:
+.D1:
+.D2:
+.D3:
+.D4:
+ .picptr funcdesc(.Fb)
+ .word .Fb
diff --git a/ld/testsuite/ld-frv/fdpic2.ldv b/ld/testsuite/ld-frv/fdpic2.ldv
new file mode 100644
index 0000000..b5aad4f
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic2.ldv
@@ -0,0 +1 @@
+{ global: _start; F2; D2; local: *; };
diff --git a/ld/testsuite/ld-frv/fdpic2.s b/ld/testsuite/ld-frv/fdpic2.s
new file mode 100644
index 0000000..2987643
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic2.s
@@ -0,0 +1,81 @@
+ .text
+ .weak _start
+_start:
+ .global F2
+ .type F2,@function
+F2:
+ call GF0
+ .global GF0
+ .global GF1
+ .global GF2
+ .global GF3
+ .global GF4
+ .global GF5
+ .global GF6
+ .global GF7
+ .global GF8
+ .global GF9
+ .global GFa
+ .global GFb
+ .global GFc
+GF0:
+GF1:
+GF2:
+GF3:
+GF4:
+GF5:
+GF6:
+GF7:
+GF8:
+GF9:
+GFa:
+GFb:
+GFc:
+ addi gr15, #got12(GF1), gr0
+
+ setlos #gotlo(GF2), gr0
+
+ setlo #gotlo(GF3), gr0
+ sethi #gothi(GF3), gr0
+
+ addi gr15, #gotfuncdesc12(GF4), gr0
+
+ setlos #gotfuncdesclo(GF5), gr0
+
+ setlo #gotfuncdesclo(GF6), gr0
+ sethi #gotfuncdeschi(GF6), gr0
+
+ addi gr15, #gotofffuncdesc12(GF7), gr0
+
+ setlos #gotofffuncdesclo(GF8), gr0
+
+ setlo #gotofffuncdesclo(GF9), gr0
+ sethi #gotofffuncdeschi(GF9), gr0
+
+ addi gr15, #gotoff12(GD1), gr0
+
+ setlos #gotofflo(GD2), gr0
+
+ setlo #gotofflo(GD3), gr0
+ sethi #gotoffhi(GD3), gr0
+
+ setlo #gotlo(GD4), gr0
+ sethi #gothi(GD4), gr0
+
+ .data
+ .global D2
+D2:
+ .word GD0
+
+ .global GD0
+ .global GD1
+ .global GD2
+ .global GD3
+ .global GD4
+GD0:
+GD1:
+GD2:
+GD3:
+GD4:
+ .picptr funcdesc(GFb)
+ .word GFb
diff --git a/ld/testsuite/ld-frv/fdpic2min.ldv b/ld/testsuite/ld-frv/fdpic2min.ldv
new file mode 100644
index 0000000..2804526
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic2min.ldv
@@ -0,0 +1 @@
+{ global: _start; F*; GF*; D2; GD0; GD4; local: GD1; GD2; GD3; };
diff --git a/ld/testsuite/ld-frv/fdpic3.s b/ld/testsuite/ld-frv/fdpic3.s
new file mode 100644
index 0000000..f867b93
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic3.s
@@ -0,0 +1,99 @@
+ .text
+ .weak _start
+_start:
+ .global F3
+ .type F3,@function
+F3:
+ call HF0
+ .global HF0
+ .hidden HF0
+ .global HF1
+ .hidden HF1
+ .global HF2
+ .hidden HF2
+ .global HF3
+ .hidden HF3
+ .global HF4
+ .hidden HF4
+ .global HF5
+ .hidden HF5
+ .global HF6
+ .hidden HF6
+ .global HF7
+ .hidden HF7
+ .global HF8
+ .hidden HF8
+ .global HF9
+ .hidden HF9
+ .global HFa
+ .hidden HFa
+ .global HFb
+ .hidden HFb
+ .global HFc
+ .hidden HFc
+HF0:
+HF1:
+HF2:
+HF3:
+HF4:
+HF5:
+HF6:
+HF7:
+HF8:
+HF9:
+HFa:
+HFb:
+HFc:
+ addi gr15, #got12(HF1), gr0
+
+ setlos #gotlo(HF2), gr0
+
+ setlo #gotlo(HF3), gr0
+ sethi #gothi(HF3), gr0
+
+ addi gr15, #gotfuncdesc12(HF4), gr0
+
+ setlos #gotfuncdesclo(HF5), gr0
+
+ setlo #gotfuncdesclo(HF6), gr0
+ sethi #gotfuncdeschi(HF6), gr0
+
+ addi gr15, #gotofffuncdesc12(HF7), gr0
+
+ setlos #gotofffuncdesclo(HF8), gr0
+
+ setlo #gotofffuncdesclo(HF9), gr0
+ sethi #gotofffuncdeschi(HF9), gr0
+
+ addi gr15, #gotoff12(HD1), gr0
+
+ setlos #gotofflo(HD2), gr0
+
+ setlo #gotofflo(HD3), gr0
+ sethi #gotoffhi(HD3), gr0
+
+ setlo #gotlo(HD4), gr0
+ sethi #gothi(HD4), gr0
+
+ .data
+ .global D3
+D3:
+ .word HD0
+
+ .global HD0
+ .hidden HD0
+ .global HD1
+ .hidden HD1
+ .global HD2
+ .hidden HD2
+ .global HD3
+ .hidden HD3
+ .global HD4
+ .hidden HD4
+HD0:
+HD1:
+HD2:
+HD3:
+HD4:
+ .picptr funcdesc(HFb)
+ .word HFb
diff --git a/ld/testsuite/ld-frv/fdpic4.s b/ld/testsuite/ld-frv/fdpic4.s
new file mode 100644
index 0000000..795ae45
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic4.s
@@ -0,0 +1,99 @@
+ .text
+ .weak _start
+_start:
+ .global F4
+ .type F4,@function
+F4:
+ call PF0
+ .global PF0
+ .protected PF0
+ .global PF1
+ .protected PF1
+ .global PF2
+ .protected PF2
+ .global PF3
+ .protected PF3
+ .global PF4
+ .protected PF4
+ .global PF5
+ .protected PF5
+ .global PF6
+ .protected PF6
+ .global PF7
+ .protected PF7
+ .global PF8
+ .protected PF8
+ .global PF9
+ .protected PF9
+ .global PFa
+ .protected PFa
+ .global PFb
+ .protected PFb
+ .global PFc
+ .protected PFc
+PF0:
+PF1:
+PF2:
+PF3:
+PF4:
+PF5:
+PF6:
+PF7:
+PF8:
+PF9:
+PFa:
+PFb:
+PFc:
+ addi gr15, #got12(PF1), gr0
+
+ setlos #gotlo(PF2), gr0
+
+ setlo #gotlo(PF3), gr0
+ sethi #gothi(PF3), gr0
+
+ addi gr15, #gotfuncdesc12(PF4), gr0
+
+ setlos #gotfuncdesclo(PF5), gr0
+
+ setlo #gotfuncdesclo(PF6), gr0
+ sethi #gotfuncdeschi(PF6), gr0
+
+ addi gr15, #gotofffuncdesc12(PF7), gr0
+
+ setlos #gotofffuncdesclo(PF8), gr0
+
+ setlo #gotofffuncdesclo(PF9), gr0
+ sethi #gotofffuncdeschi(PF9), gr0
+
+ addi gr15, #gotoff12(PD1), gr0
+
+ setlos #gotofflo(PD2), gr0
+
+ setlo #gotofflo(PD3), gr0
+ sethi #gotoffhi(PD3), gr0
+
+ setlo #gotlo(PD4), gr0
+ sethi #gothi(PD4), gr0
+
+ .data
+ .global D4
+D4:
+ .word PD0
+
+ .global PD0
+ .protected PD0
+ .global PD1
+ .protected PD1
+ .global PD2
+ .protected PD2
+ .global PD3
+ .protected PD3
+ .global PD4
+ .protected PD4
+PD0:
+PD1:
+PD2:
+PD3:
+PD4:
+ .picptr funcdesc(PFb)
+ .word PFb
diff --git a/ld/testsuite/ld-frv/fdpic5.s b/ld/testsuite/ld-frv/fdpic5.s
new file mode 100644
index 0000000..f4d466a
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic5.s
@@ -0,0 +1,38 @@
+ .text
+ .weak _start
+_start:
+ .global F5
+ .type F5,@function
+F5:
+ call UF0
+ addi gr15, #got12(UF1), gr0
+
+ setlos #gotlo(UF2), gr0
+
+ setlo #gotlo(UF3), gr0
+ sethi #gothi(UF3), gr0
+
+ addi gr15, #gotfuncdesc12(UF4), gr0
+
+ setlos #gotfuncdesclo(UF5), gr0
+
+ setlo #gotfuncdesclo(UF6), gr0
+ sethi #gotfuncdeschi(UF6), gr0
+
+ addi gr15, #gotofffuncdesc12(UF7), gr0
+
+ setlos #gotofffuncdesclo(UF8), gr0
+
+ setlo #gotofffuncdesclo(UF9), gr0
+ sethi #gotofffuncdeschi(UF9), gr0
+
+ setlo #gotlo(UD1), gr0
+ sethi #gothi(UD1), gr0
+
+ .data
+ .global D5
+D5:
+ .word UD0
+
+ .picptr funcdesc(UFb)
+ .word UFb
diff --git a/ld/testsuite/ld-frv/fdpic6.s b/ld/testsuite/ld-frv/fdpic6.s
new file mode 100644
index 0000000..cd8e1d0
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic6.s
@@ -0,0 +1,55 @@
+ .text
+ .weak _start
+_start:
+ .weak WF0
+ .weak WF1
+ .weak WF2
+ .weak WF3
+ .weak WF4
+ .weak WF5
+ .weak WF6
+ .weak WF7
+ .weak WF8
+ .weak WF9
+ .weak WFb
+ .weak WD0
+ .weak WD1
+ .weak WD2
+ .global F6
+ .type F6,@function
+F6:
+ call WF0
+ addi gr15, #got12(WF1), gr0
+
+ setlos #gotlo(WF2), gr0
+
+ setlo #gotlo(WF3), gr0
+ sethi #gothi(WF3), gr0
+
+ addi gr15, #gotfuncdesc12(WF4), gr0
+
+ setlos #gotfuncdesclo(WF5), gr0
+
+ setlo #gotfuncdesclo(WF6), gr0
+ sethi #gotfuncdeschi(WF6), gr0
+
+ addi gr15, #gotofffuncdesc12(WF7), gr0
+
+ setlos #gotofffuncdesclo(WF8), gr0
+
+ setlo #gotofffuncdesclo(WF9), gr0
+ sethi #gotofffuncdeschi(WF9), gr0
+
+ setlo #gotofflo(WD1), gr0
+ sethi #gotoffhi(WD1), gr0
+
+ setlo #gotlo(WD2), gr0
+ sethi #gothi(WD2), gr0
+
+ .data
+ .global D6
+D6:
+ .word WD0
+
+ .picptr funcdesc(WFb)
+ .word WFb
diff --git a/ld/testsuite/ld-frv/fdpic7.s b/ld/testsuite/ld-frv/fdpic7.s
new file mode 100644
index 0000000..ceac5fc
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic7.s
@@ -0,0 +1,63 @@
+ .text
+ .weak _start
+_start:
+ .global F7
+ .type F7,@function
+F7:
+ call .F0+4
+
+.F0:
+.F1:
+.F2:
+.F3:
+.F4:
+.F5:
+.F6:
+.F7:
+.F8:
+.F9:
+.Fa:
+.Fb:
+.Fc:
+ addi gr15, #got12(.F1+4), gr0
+
+ setlos #gotlo(.F2+4), gr0
+
+ setlo #gotlo(.F3+4), gr0
+ sethi #gothi(.F3+4), gr0
+
+ addi gr15, #gotfuncdesc12(.F4+4), gr0
+
+ setlos #gotfuncdesclo(.F5+4), gr0
+
+ setlo #gotfuncdesclo(.F6+4), gr0
+ sethi #gotfuncdeschi(.F6+4), gr0
+
+ addi gr15, #gotofffuncdesc12(.F7+4), gr0
+
+ setlos #gotofffuncdesclo(.F8+4), gr0
+
+ setlo #gotofffuncdesclo(.F9+4), gr0
+ sethi #gotofffuncdeschi(.F9+4), gr0
+
+ addi gr15, #gotoff12(.D1+4), gr0
+
+ setlos #gotofflo(.D2+4), gr0
+
+ setlo #gotofflo(.D3+4), gr0
+ sethi #gotoffhi(.D3+4), gr0
+
+ setlo #gotlo(.D4+4), gr0
+ sethi #gothi(.D4+4), gr0
+
+ .data
+ .global D7
+D7:
+ .word .D0+4
+.D0:
+.D1:
+.D2:
+.D3:
+.D4:
+ .picptr funcdesc(.Fb+4)
+ .word .Fb+4
diff --git a/ld/testsuite/ld-frv/fdpic8.ldv b/ld/testsuite/ld-frv/fdpic8.ldv
new file mode 100644
index 0000000..d258f96
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic8.ldv
@@ -0,0 +1 @@
+{ global: _start; F8; D8; local: *; };
diff --git a/ld/testsuite/ld-frv/fdpic8.s b/ld/testsuite/ld-frv/fdpic8.s
new file mode 100644
index 0000000..037250f
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic8.s
@@ -0,0 +1,81 @@
+ .text
+ .weak _start
+_start:
+ .global F8
+ .type F8,@function
+F8:
+ call GF0+4
+ .global GF0
+ .global GF1
+ .global GF2
+ .global GF3
+ .global GF4
+ .global GF5
+ .global GF6
+ .global GF7
+ .global GF8
+ .global GF9
+ .global GFa
+ .global GFb
+ .global GFc
+GF0:
+GF1:
+GF2:
+GF3:
+GF4:
+GF5:
+GF6:
+GF7:
+GF8:
+GF9:
+GFa:
+GFb:
+GFc:
+ addi gr15, #got12(GF1+4), gr0
+
+ setlos #gotlo(GF2+4), gr0
+
+ setlo #gotlo(GF3+4), gr0
+ sethi #gothi(GF3+4), gr0
+
+ addi gr15, #gotfuncdesc12(GF4+4), gr0
+
+ setlos #gotfuncdesclo(GF5+4), gr0
+
+ setlo #gotfuncdesclo(GF6+4), gr0
+ sethi #gotfuncdeschi(GF6+4), gr0
+
+ addi gr15, #gotofffuncdesc12(GF7+4), gr0
+
+ setlos #gotofffuncdesclo(GF8+4), gr0
+
+ setlo #gotofffuncdesclo(GF9+4), gr0
+ sethi #gotofffuncdeschi(GF9+4), gr0
+
+ addi gr15, #gotoff12(GD1+4), gr0
+
+ setlos #gotofflo(GD2+4), gr0
+
+ setlo #gotofflo(GD3+4), gr0
+ sethi #gotoffhi(GD3+4), gr0
+
+ setlo #gotlo(GD4+4), gr0
+ sethi #gothi(GD4+4), gr0
+
+ .data
+ .global D8
+D8:
+ .word GD0+4
+
+ .global GD0
+ .global GD1
+ .global GD2
+ .global GD3
+ .global GD4
+GD0:
+GD1:
+GD2:
+GD3:
+GD4:
+ .picptr funcdesc(GFb+4)
+ .word GFb+4
diff --git a/ld/testsuite/ld-frv/fdpic8min.ldv b/ld/testsuite/ld-frv/fdpic8min.ldv
new file mode 100644
index 0000000..aeadb79
--- /dev/null
+++ b/ld/testsuite/ld-frv/fdpic8min.ldv
@@ -0,0 +1 @@
+{ global: _start; F8; GF1; GF2; GF3; D8; GD0; GD4; local: GF0; GF4; GF5; GF6; GF7; GF8; GF9; GFb; GD1; GD2; GD3; };
diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp
index 92d0a87..acb7a5d 100644
--- a/ld/testsuite/lib/ld-lib.exp
+++ b/ld/testsuite/lib/ld-lib.exp
@@ -363,6 +363,7 @@ proc is_elf_format {} {
&& ![istarget *-*-eabi*] \
&& ![istarget hppa*64*-*-hpux*] \
&& ![istarget *-*-linux*] \
+ && ![istarget frv-*-uclinux*] \
&& ![istarget *-*-irix5*] \
&& ![istarget *-*-irix6*] \
&& ![istarget *-*-netbsd*] \