aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pe
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-pe')
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def-i386.d8
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d8
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-embedded-i386.d8
-rw-r--r--ld/testsuite/ld-pe/exclude-symbols-embedded-x86_64.d8
-rw-r--r--ld/testsuite/ld-pe/pdb-strings.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-syms1-globals.d73
-rw-r--r--ld/testsuite/ld-pe/pdb-syms1-records.d4
-rw-r--r--ld/testsuite/ld-pe/pdb-syms1-symbols1.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-syms1-symbols2.d26
-rw-r--r--ld/testsuite/ld-pe/pdb-syms1a.s1
-rw-r--r--ld/testsuite/ld-pe/pdb-syms2-symbols1.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types1-hashlist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types1-skiplist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types1-typelist.d5
-rw-r--r--ld/testsuite/ld-pe/pdb-types1b.s20
-rw-r--r--ld/testsuite/ld-pe/pdb-types2-hashlist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types2-skiplist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types2-typelist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types3-hashlist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types3-skiplist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb-types3-typelist.d2
-rw-r--r--ld/testsuite/ld-pe/pdb.exp2
-rw-r--r--ld/testsuite/ld-pe/pdb1-publics.d2
-rw-r--r--ld/testsuite/ld-pe/pdb1-sym-record.d2
-rw-r--r--ld/testsuite/ld-pe/pdb2-section-contrib.d2
-rw-r--r--ld/testsuite/ld-pe/pdb3-c13-info1.d2
-rw-r--r--ld/testsuite/ld-pe/pdb3-c13-info2.d2
-rw-r--r--ld/testsuite/ld-pe/pdb3-source-info.d2
-rw-r--r--ld/testsuite/ld-pe/pe.exp15
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s17
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d21
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-exports-ld.d20
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s25
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d27
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d26
-rw-r--r--ld/testsuite/ld-pe/symbols-ordinals-hints.def9
36 files changed, 273 insertions, 84 deletions
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def-i386.d b/ld/testsuite/ld-pe/exclude-symbols-def-i386.d
index 91426c5..512b9ab 100644
--- a/ld/testsuite/ld-pe/exclude-symbols-def-i386.d
+++ b/ld/testsuite/ld-pe/exclude-symbols-def-i386.d
@@ -4,7 +4,9 @@
#objdump: -p
#...
-.*\[[ ]*0\].*sym1
-.*\[[ ]*1\].*sym3
-.*\[[ ]*2\].*sym5
+.* Ordinal Hint Name
+.*\+base\[ 1\] 0000 sym1
+.*\+base\[ 2\] 0001 sym3
+.*\+base\[ 3\] 0002 sym5
+
#pass
diff --git a/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d b/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d
index e3f0698..d17de41 100644
--- a/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d
+++ b/ld/testsuite/ld-pe/exclude-symbols-def-x86_64.d
@@ -4,7 +4,9 @@
#objdump: -p
#...
-.*\[[ ]*0\].*sym1
-.*\[[ ]*1\].*sym3
-.*\[[ ]*2\].*sym5
+.* Ordinal Hint Name
+.*\+base\[ 1\] 0000 sym1
+.*\+base\[ 2\] 0001 sym3
+.*\+base\[ 3\] 0002 sym5
+
#pass
diff --git a/ld/testsuite/ld-pe/exclude-symbols-embedded-i386.d b/ld/testsuite/ld-pe/exclude-symbols-embedded-i386.d
index fd79a7c..89ca6e6 100644
--- a/ld/testsuite/ld-pe/exclude-symbols-embedded-i386.d
+++ b/ld/testsuite/ld-pe/exclude-symbols-embedded-i386.d
@@ -4,7 +4,9 @@
#objdump: -p
#...
-.*\[[ ]*0\].*sym1
-.*\[[ ]*1\].*sym3
-.*\[[ ]*2\].*sym5
+.* Ordinal Hint Name
+.*\+base\[ 1\] 0000 sym1
+.*\+base\[ 2\] 0001 sym3
+.*\+base\[ 3\] 0002 sym5
+
#pass
diff --git a/ld/testsuite/ld-pe/exclude-symbols-embedded-x86_64.d b/ld/testsuite/ld-pe/exclude-symbols-embedded-x86_64.d
index 780482e..5bbda0f 100644
--- a/ld/testsuite/ld-pe/exclude-symbols-embedded-x86_64.d
+++ b/ld/testsuite/ld-pe/exclude-symbols-embedded-x86_64.d
@@ -4,7 +4,9 @@
#objdump: -p
#...
-.*\[[ ]*0\].*sym1
-.*\[[ ]*1\].*sym3
-.*\[[ ]*2\].*sym5
+.* Ordinal Hint Name
+.*\+base\[ 1\] 0000 sym1
+.*\+base\[ 2\] 0001 sym3
+.*\+base\[ 3\] 0002 sym5
+
#pass
diff --git a/ld/testsuite/ld-pe/pdb-strings.d b/ld/testsuite/ld-pe/pdb-strings.d
index 8be853e..2c9cd2e 100644
--- a/ld/testsuite/ld-pe/pdb-strings.d
+++ b/ld/testsuite/ld-pe/pdb-strings.d
@@ -7,4 +7,4 @@ Contents of section .data:
0020 7578000c 00000001 0000000a 00000000 ux..............
0030 00000000 00000000 00000012 00000000 ................
0040 00000000 00000002 00000006 00000000 ................
- 0050 0000000e 00000006 000000 ........... \ No newline at end of file
+ 0050 0000000e 00000006 000000 ...........
diff --git a/ld/testsuite/ld-pe/pdb-syms1-globals.d b/ld/testsuite/ld-pe/pdb-syms1-globals.d
index 356c5de..59f067b 100644
--- a/ld/testsuite/ld-pe/pdb-syms1-globals.d
+++ b/ld/testsuite/ld-pe/pdb-syms1-globals.d
@@ -2,20 +2,20 @@
*: file format binary
Contents of section .data:
- 0000 ffffffff 1a092ff1 d0000000 64020000 ....../.....d...
- 0010 fd000000 01000000 35010000 01000000 ........5.......
- 0020 15000000 01000000 19010000 01000000 ................
- 0030 c1000000 01000000 b9010000 01000000 ................
- 0040 d5000000 01000000 61010000 01000000 ........a.......
- 0050 e9000000 01000000 11020000 01000000 ................
- 0060 e9010000 01000000 d5010000 01000000 ................
- 0070 49010000 01000000 a5010000 01000000 I...............
- 0080 99010000 01000000 85000000 01000000 ................
- 0090 01000000 01000000 99000000 01000000 ................
- 00a0 7d010000 01000000 ad000000 01000000 }...............
- 00b0 5d000000 01000000 49000000 01000000 ].......I.......
- 00c0 21000000 02000000 35000000 01000000 !.......5.......
- 00d0 fd010000 01000000 71000000 01000000 ........q.......
+ 0000 ffffffff 1a092ff1 d0000000 60020000 ....../.....`...
+ 0010 15000000 01000000 b9010000 01000000 ................
+ 0020 a5010000 01000000 fd000000 01000000 ................
+ 0030 11020000 01000000 71000000 01000000 ........q.......
+ 0040 fd010000 01000000 5d000000 01000000 ........].......
+ 0050 d5010000 01000000 e9010000 01000000 ................
+ 0060 21000000 02000000 35000000 01000000 !.......5.......
+ 0070 49000000 01000000 7d010000 01000000 I.......}.......
+ 0080 99010000 01000000 19010000 01000000 ................
+ 0090 35010000 01000000 d5000000 01000000 5...............
+ 00a0 c1000000 01000000 e9000000 01000000 ................
+ 00b0 85000000 01000000 ad000000 01000000 ................
+ 00c0 49010000 01000000 01000000 01000000 I...............
+ 00d0 99000000 01000000 61010000 01000000 ........a.......
00e0 00000000 00000000 00000000 00000000 ................
00f0 00000000 00000000 00000000 00000000 ................
0100 00000000 00000000 00000000 00000000 ................
@@ -23,35 +23,34 @@ Contents of section .data:
0120 00000000 00000000 00000000 00000000 ................
0130 00000000 00000000 00000000 00000000 ................
0140 00000000 00000000 00000000 00000000 ................
- 0150 00000002 00000000 00000000 00000000 ................
+ 0150 00000000 00000000 00000000 00000000 ................
0160 00000000 00000000 00000000 00000000 ................
- 0170 00000000 00020000 00000000 00000000 ................
- 0180 00000000 00000000 00000000 00000000 ................
- 0190 00000000 00000001 00000000 00000000 ................
- 01a0 00000000 00000000 00000000 00000000 ................
+ 0170 00000000 00000000 00000000 00000000 ................
+ 0180 00000001 00100040 00000000 00000000 .......@........
+ 0190 00000000 00000000 00000000 00000000 ................
+ 01a0 00000004 00000000 00000000 00000000 ................
01b0 00000000 00000000 00000000 00000000 ................
01c0 00000000 00000000 00000000 00000000 ................
01d0 00000000 00000000 00000000 00000000 ................
- 01e0 08001000 00000000 00000000 00000040 ...............@
- 01f0 04002000 00000000 00000000 00000000 .. .............
- 0200 00000000 00000001 00000000 00000000 ................
+ 01e0 00000000 0000b499 00000000 00000000 ................
+ 01f0 00000000 00000000 00000000 00000000 ................
+ 0200 00000000 00000000 00000000 00000000 ................
0210 00000000 00000000 00000000 00000000 ................
0220 00000000 00000000 00000000 00000000 ................
- 0230 00000000 00000000 00080000 00004000 ..............@.
- 0240 00000000 00000000 00100010 00000000 ................
- 0250 40000000 00000000 00000000 00000000 @...............
- 0260 00000000 00000800 00000000 00000000 ................
- 0270 00000008 00000000 00000000 00000000 ................
- 0280 00000000 02004000 00000000 00000000 ......@.........
- 0290 00000000 00008000 00000000 00000000 ................
- 02a0 00000000 00000000 10000000 00000000 ................
- 02b0 00000000 00000000 00000000 00800000 ................
- 02c0 00000000 00000000 00002000 00010000 .......... .....
- 02d0 00000000 00000000 00000000 00000040 ...............@
+ 0230 00000001 00000000 00000000 00000000 ................
+ 0240 01000000 00000000 00000000 00000000 ................
+ 0250 00000000 00000000 00000000 00000000 ................
+ 0260 00000000 00000000 00000000 00000000 ................
+ 0270 00000001 00000000 00000000 10db0000 ................
+ 0280 00000000 00000000 00000000 00000000 ................
+ 0290 00000001 00000000 00000000 00000000 ................
+ 02a0 00000000 00000000 00000000 00000000 ................
+ 02b0 00000000 00000000 00000000 00000000 ................
+ 02c0 00000000 00000000 00000000 00000000 ................
+ 02d0 00000000 00000000 00000000 00000000 ................
02e0 00000000 00000000 0c000000 18000000 ................
02f0 24000000 30000000 3c000000 48000000 $...0...<...H...
0300 54000000 60000000 6c000000 78000000 T...`...l...x...
- 0310 84000000 90000000 9c000000 a8000000 ................
- 0320 b4000000 c0000000 d8000000 e4000000 ................
- 0330 f0000000 fc000000 08010000 20010000 ............ ...
- 0340 2c010000 ,... \ No newline at end of file
+ 0310 90000000 9c000000 a8000000 b4000000 ................
+ 0320 c0000000 cc000000 d8000000 e4000000 ................
+ 0330 f0000000 fc000000 14010000 2c010000 ............,...
diff --git a/ld/testsuite/ld-pe/pdb-syms1-records.d b/ld/testsuite/ld-pe/pdb-syms1-records.d
index bbf6d7f..a0852ec 100644
--- a/ld/testsuite/ld-pe/pdb-syms1-records.d
+++ b/ld/testsuite/ld-pe/pdb-syms1-records.d
@@ -27,7 +27,7 @@ Contents of section .data:
0160 1a002711 00000000 98020000 0200666f ..'...........fo
0170 6f3a3a6d 6574686f 64330000 1a002711 o::method3....'.
0180 00000000 d0020000 0200666f 6f3a3a6d ..........foo::m
- 0190 6574686f 64340000 0a000811 0a100000 ethod4..........
+ 0190 6574686f 64340000 0a000811 09100000 ethod4..........
01a0 666f6f00 12000711 75000000 2a00616e foo.....u...*.an
01b0 73776572 00f3f2f1 1a000711 23000000 swer........#...
01c0 0a80efcd ab896745 2301616e 73776572 ......gE#.answer
@@ -58,4 +58,4 @@ Contents of section .data:
0350 1c000000 02006776 61723300 12000e11 ......gvar3.....
0360 00000000 08000000 03006776 61723400 ..........gvar4.
0370 12000e11 02000000 00000000 01006d61 ..............ma
- 0380 696e0000 in.. \ No newline at end of file
+ 0380 696e0000 in..
diff --git a/ld/testsuite/ld-pe/pdb-syms1-symbols1.d b/ld/testsuite/ld-pe/pdb-syms1-symbols1.d
index 4de22ac..4c56508 100644
--- a/ld/testsuite/ld-pe/pdb-syms1-symbols1.d
+++ b/ld/testsuite/ld-pe/pdb-syms1-symbols1.d
@@ -5,4 +5,4 @@ Contents of section .data:
0000 04000000 2e001011 00000000 34000000 ............4...
0010 00000000 01000000 00000000 00000000 ................
0020 02100000 06000000 01000070 726f6332 ...........proc2
- 0030 00f3f2f1 02000600 00000000 ............ \ No newline at end of file
+ 0030 00f3f2f1 02000600 00000000 ............
diff --git a/ld/testsuite/ld-pe/pdb-syms1-symbols2.d b/ld/testsuite/ld-pe/pdb-syms1-symbols2.d
index f134637..22c2f30 100644
--- a/ld/testsuite/ld-pe/pdb-syms1-symbols2.d
+++ b/ld/testsuite/ld-pe/pdb-syms1-symbols2.d
@@ -9,48 +9,48 @@ Contents of section .data:
0040 12000c11 00100000 00000000 03006c76 ..............lv
0050 61723200 2e001011 00000000 84000000 ar2.............
0060 00000000 01000000 00000000 00000000 ................
- 0070 05100000 0c000000 03000070 726f6331 ...........proc1
+ 0070 02100000 0c000000 03000070 726f6331 ...........proc1
0080 00f3f2f1 02000600 2e001011 00000000 ................
0090 ec000000 00000000 01000000 00000000 ................
- 00a0 00000000 05100000 06000000 01000070 ...............p
+ 00a0 00000000 02100000 06000000 01000070 ...............p
00b0 726f6332 00f3f2f1 0a000811 04100000 roc2............
00c0 62617200 12000c11 00100000 10000000 bar.............
00d0 02006c76 61723300 12001211 00100000 ..lvar3.........
00e0 14000000 02006c76 61723400 02000600 ......lvar4.....
00f0 2e000f11 00000000 20010000 00000000 ........ .......
- 0100 01000000 00000000 00000000 05100000 ................
+ 0100 01000000 00000000 00000000 02100000 ................
0110 0d000000 03000070 726f6333 00f3f2f1 .......proc3....
0120 02000600 2e000f11 00000000 54010000 ............T...
0130 00000000 01000000 00000000 00000000 ................
- 0140 05100000 07000000 01000070 726f6334 ...........proc4
+ 0140 02100000 07000000 01000070 726f6334 ...........proc4
0150 00f3f2f1 02000600 2e001011 00000000 ................
0160 88010000 00000000 01000000 00000000 ................
- 0170 00000000 05100000 0e000000 03000070 ...............p
+ 0170 00000000 02100000 0e000000 03000070 ...............p
0180 726f6335 00f3f2f1 02000600 2e001011 roc5............
0190 00000000 bc010000 00000000 01000000 ................
- 01a0 00000000 00000000 05100000 08000000 ................
+ 01a0 00000000 00000000 02100000 08000000 ................
01b0 01000070 726f6336 00f3f2f1 02000600 ...proc6........
01c0 32001011 00000000 f4010000 00000000 2...............
- 01d0 01000000 00000000 00000000 05100000 ................
+ 01d0 01000000 00000000 00000000 02100000 ................
01e0 0f000000 03000066 6f6f3a3a 6d657468 .......foo::meth
01f0 6f6400f1 02000600 32001011 00000000 od......2.......
0200 2c020000 00000000 01000000 00000000 ,...............
- 0210 00000000 05100000 09000000 01000066 ...............f
+ 0210 00000000 02100000 09000000 01000066 ...............f
0220 6f6f3a3a 6d657468 6f643200 02000600 oo::method2.....
0230 2e000f11 00000000 60020000 00000000 ........`.......
- 0240 01000000 00000000 00000000 05100000 ................
+ 0240 01000000 00000000 00000000 02100000 ................
0250 10000000 03000070 726f6339 00f3f2f1 .......proc9....
0260 02000600 2e001011 00000000 94020000 ................
0270 00000000 01000000 00000000 00000000 ................
- 0280 05100000 0a000000 01000070 726f6331 ...........proc1
+ 0280 02100000 0a000000 01000070 726f6331 ...........proc1
0290 3000f2f1 02000600 32000f11 00000000 0.......2.......
02a0 cc020000 00000000 01000000 00000000 ................
- 02b0 00000000 05100000 11000000 03000066 ...............f
+ 02b0 00000000 02100000 11000000 03000066 ...............f
02c0 6f6f3a3a 6d657468 6f643300 02000600 oo::method3.....
02d0 32000f11 00000000 04030000 00000000 2...............
- 02e0 01000000 00000000 00000000 05100000 ................
+ 02e0 01000000 00000000 00000000 02100000 ................
02f0 0b000000 01000066 6f6f3a3a 6d657468 .......foo::meth
0300 6f643400 02000600 12001211 00100000 od4.............
0310 20000000 02006c76 61723500 12001211 .....lvar5.....
0320 00100000 12000000 03006c76 61723600 ..........lvar6.
- 0330 00000000 .... \ No newline at end of file
+ 0330 00000000 ....
diff --git a/ld/testsuite/ld-pe/pdb-syms1a.s b/ld/testsuite/ld-pe/pdb-syms1a.s
index d076bbc..c947676 100644
--- a/ld/testsuite/ld-pe/pdb-syms1a.s
+++ b/ld/testsuite/ld-pe/pdb-syms1a.s
@@ -1,6 +1,7 @@
.equ CV_SIGNATURE_C13, 4
.equ DEBUG_S_SYMBOLS, 0xf1
+.equ T_VOID, 0x0003
.equ T_UINT4, 0x0075
.equ LF_MODIFIER, 0x1001
diff --git a/ld/testsuite/ld-pe/pdb-syms2-symbols1.d b/ld/testsuite/ld-pe/pdb-syms2-symbols1.d
index 34132d1..028545b 100644
--- a/ld/testsuite/ld-pe/pdb-syms2-symbols1.d
+++ b/ld/testsuite/ld-pe/pdb-syms2-symbols1.d
@@ -35,4 +35,4 @@ Contents of section .data:
01e0 02000600 1e000211 48000000 04020000 ........H.......
01f0 00000000 06000000 01000100 00746875 .............thu
0200 6e6b00f1 02000600 0e005e11 04000000 nk........^.....
- 0210 01000100 02100000 02000600 00000000 ................ \ No newline at end of file
+ 0210 01000100 02100000 02000600 00000000 ................
diff --git a/ld/testsuite/ld-pe/pdb-types1-hashlist.d b/ld/testsuite/ld-pe/pdb-types1-hashlist.d
index 7d314ed..f9d8a74 100644
--- a/ld/testsuite/ld-pe/pdb-types1-hashlist.d
+++ b/ld/testsuite/ld-pe/pdb-types1-hashlist.d
@@ -12,4 +12,4 @@ Contents of section .data:
0070 4d5e0200 8a940200 4b710300 6aa90300 *
0080 0a2c0300 67e10300 4a3d0300 fa460300 *
0090 db020200 ec4e0100 131e0300 fb120300 *
- 00a0 aece0200 1db70100 99a30000 a8010100 * \ No newline at end of file
+ 00a0 aece0200 1db70100 99a30000 a8010100 *
diff --git a/ld/testsuite/ld-pe/pdb-types1-skiplist.d b/ld/testsuite/ld-pe/pdb-types1-skiplist.d
index 52c10fa..f13b1d8 100644
--- a/ld/testsuite/ld-pe/pdb-types1-skiplist.d
+++ b/ld/testsuite/ld-pe/pdb-types1-skiplist.d
@@ -2,4 +2,4 @@
*: file format binary
Contents of section .data:
- 0000 00100000 00000000 * \ No newline at end of file
+ 0000 00100000 00000000 *
diff --git a/ld/testsuite/ld-pe/pdb-types1-typelist.d b/ld/testsuite/ld-pe/pdb-types1-typelist.d
index 248dda5..1caa074 100644
--- a/ld/testsuite/ld-pe/pdb-types1-typelist.d
+++ b/ld/testsuite/ld-pe/pdb-types1-typelist.d
@@ -77,4 +77,7 @@ Contents of section .data:
0480 3a001d15 2a100000 00000000 00000000 :...*...........
0490 27000000 49556e6b 6e6f776e 00517565 '...IUnknown.Que
04a0 7279496e 74657266 61636500 41646452 ryInterface.AddR
- 04b0 65660052 656c6561 736500f1 ef.Release.. \ No newline at end of file
+ 04b0 65660052 656c6561 736500f1 02000312 ef.Release......
+ 04c0 22000515 00000000 2c100000 00000000 ".......,.......
+ 04d0 00000000 0100656d 7074795f 73747275 ......empty_stru
+ 04e0 637400f1 ct..
diff --git a/ld/testsuite/ld-pe/pdb-types1b.s b/ld/testsuite/ld-pe/pdb-types1b.s
index e26b190..8bfc973 100644
--- a/ld/testsuite/ld-pe/pdb-types1b.s
+++ b/ld/testsuite/ld-pe/pdb-types1b.s
@@ -593,7 +593,7 @@
/* Type 102a, virtual function table */
.vftable1:
-.short .types_end - .vftable1 - 2
+.short .fieldlist12 - .vftable1 - 2
.short LF_VFTABLE
.long 0x1029 /* type */
.long 0 /* base vftable */
@@ -607,4 +607,22 @@
.vftable1_names_end:
.byte 0xf1 /* padding */
+/* Type 102b, empty LF_FIELDLIST */
+.fieldlist12:
+.short .struct7 - .fieldlist12 - 2
+.short LF_FIELDLIST
+
+/* Type 102c, empty struct */
+.struct7:
+.short .types_end - .struct7 - 2
+.short LF_STRUCTURE
+.short 0 /* no. members */
+.short 0 /* property */
+.long 0x102b /* field list */
+.long 0 /* type derived from */
+.long 0 /* type of vshape table */
+.short 1 /* size */
+.asciz "empty_struct" /* name */
+.byte 0xf1 /* padding */
+
.types_end:
diff --git a/ld/testsuite/ld-pe/pdb-types2-hashlist.d b/ld/testsuite/ld-pe/pdb-types2-hashlist.d
index 71d9045..d09fb3e 100644
--- a/ld/testsuite/ld-pe/pdb-types2-hashlist.d
+++ b/ld/testsuite/ld-pe/pdb-types2-hashlist.d
@@ -5,4 +5,4 @@ Contents of section .data:
0000 75cf0100 8d660300 f2a20300 aea00000 *
0010 ef990300 223d0000 d6b60000 24070100 *
0020 7f220100 f6d10200 16100200 010a0300 *
- 0030 0b4f0300 12690300 a56d0300 * \ No newline at end of file
+ 0030 0b4f0300 12690300 a56d0300 *
diff --git a/ld/testsuite/ld-pe/pdb-types2-skiplist.d b/ld/testsuite/ld-pe/pdb-types2-skiplist.d
index 52c10fa..f13b1d8 100644
--- a/ld/testsuite/ld-pe/pdb-types2-skiplist.d
+++ b/ld/testsuite/ld-pe/pdb-types2-skiplist.d
@@ -2,4 +2,4 @@
*: file format binary
Contents of section .data:
- 0000 00100000 00000000 * \ No newline at end of file
+ 0000 00100000 00000000 *
diff --git a/ld/testsuite/ld-pe/pdb-types2-typelist.d b/ld/testsuite/ld-pe/pdb-types2-typelist.d
index d0fd26e..d8a36cc 100644
--- a/ld/testsuite/ld-pe/pdb-types2-typelist.d
+++ b/ld/testsuite/ld-pe/pdb-types2-typelist.d
@@ -17,4 +17,4 @@ Contents of section .data:
00c0 6500f2f1 12000116 00000000 01100000 e...............
00d0 66756e63 3100f2f1 12000116 0b100000 func1...........
00e0 01100000 66756e63 3200f2f1 12000216 ....func2.......
- 00f0 02100000 04100000 6d657468 6f6400f1 ........method.. \ No newline at end of file
+ 00f0 02100000 04100000 6d657468 6f6400f1 ........method..
diff --git a/ld/testsuite/ld-pe/pdb-types3-hashlist.d b/ld/testsuite/ld-pe/pdb-types3-hashlist.d
index 4a3775b..eda23d7 100644
--- a/ld/testsuite/ld-pe/pdb-types3-hashlist.d
+++ b/ld/testsuite/ld-pe/pdb-types3-hashlist.d
@@ -2,4 +2,4 @@
*: file format binary
Contents of section .data:
- 0000 d4d90000 0c1c0000 * \ No newline at end of file
+ 0000 d4d90000 0c1c0000 *
diff --git a/ld/testsuite/ld-pe/pdb-types3-skiplist.d b/ld/testsuite/ld-pe/pdb-types3-skiplist.d
index 52c10fa..f13b1d8 100644
--- a/ld/testsuite/ld-pe/pdb-types3-skiplist.d
+++ b/ld/testsuite/ld-pe/pdb-types3-skiplist.d
@@ -2,4 +2,4 @@
*: file format binary
Contents of section .data:
- 0000 00100000 00000000 * \ No newline at end of file
+ 0000 00100000 00000000 *
diff --git a/ld/testsuite/ld-pe/pdb-types3-typelist.d b/ld/testsuite/ld-pe/pdb-types3-typelist.d
index d6ffaad..48d7dbd 100644
--- a/ld/testsuite/ld-pe/pdb-types3-typelist.d
+++ b/ld/testsuite/ld-pe/pdb-types3-typelist.d
@@ -4,4 +4,4 @@
Contents of section .data:
0000 0e000516 00000000 666f6f2e 6800f2f1 ........foo.h...
0010 10000716 01100000 01000000 2a000000 ............*...
- 0020 0100 .. \ No newline at end of file
+ 0020 0100 ..
diff --git a/ld/testsuite/ld-pe/pdb.exp b/ld/testsuite/ld-pe/pdb.exp
index 1247651..b583e87 100644
--- a/ld/testsuite/ld-pe/pdb.exp
+++ b/ld/testsuite/ld-pe/pdb.exp
@@ -1036,7 +1036,7 @@ proc test5 { } {
binary scan $data i end_type
# end_type is one greater than the last type in the stream
- if { $end_type != 0x102c } {
+ if { $end_type != 0x102e } {
fail "Incorrect end type value in TPI stream."
} else {
pass "Correct end type value in TPI stream."
diff --git a/ld/testsuite/ld-pe/pdb1-publics.d b/ld/testsuite/ld-pe/pdb1-publics.d
index f7df2d9..0882f1b 100644
--- a/ld/testsuite/ld-pe/pdb1-publics.d
+++ b/ld/testsuite/ld-pe/pdb1-publics.d
@@ -38,4 +38,4 @@ Contents of section .data:
0210 00000000 00000000 00000000 00000000 ................
0220 00000000 00000000 00000000 00000000 ................
0230 00000000 00000000 00000000 00000000 ................
- 0240 00000000 0c000000 00000000 14000000 ................ \ No newline at end of file
+ 0240 00000000 0c000000 00000000 14000000 ................
diff --git a/ld/testsuite/ld-pe/pdb1-sym-record.d b/ld/testsuite/ld-pe/pdb1-sym-record.d
index 2078a5e..88cc21e 100644
--- a/ld/testsuite/ld-pe/pdb1-sym-record.d
+++ b/ld/testsuite/ld-pe/pdb1-sym-record.d
@@ -4,4 +4,4 @@
Contents of section .data:
0000 12000e11 02000000 08000000 0100666f ..............fo
0010 6f000000 12000e11 00000000 04000000 o...............
- 0020 02006261 72000000 ..bar... \ No newline at end of file
+ 0020 02006261 72000000 ..bar...
diff --git a/ld/testsuite/ld-pe/pdb2-section-contrib.d b/ld/testsuite/ld-pe/pdb2-section-contrib.d
index 65ed76d..5b1df9f 100644
--- a/ld/testsuite/ld-pe/pdb2-section-contrib.d
+++ b/ld/testsuite/ld-pe/pdb2-section-contrib.d
@@ -9,4 +9,4 @@ Contents of section .data:
0040 00000000 3d000000 40000040 00000000 ....=...@..@....
0050 00000000 00000000 04000000 00000000 ................
0060 0c000000 40000042 02000000 00000000 ....@..B........
- 0070 00000000 .... \ No newline at end of file
+ 0070 00000000 ....
diff --git a/ld/testsuite/ld-pe/pdb3-c13-info1.d b/ld/testsuite/ld-pe/pdb3-c13-info1.d
index 5a4f948..8c2f320 100644
--- a/ld/testsuite/ld-pe/pdb3-c13-info1.d
+++ b/ld/testsuite/ld-pe/pdb3-c13-info1.d
@@ -11,4 +11,4 @@ Contents of section .data:
0060 04000000 02000080 18000000 02000000 ................
0070 1c000000 08000000 03000080 0c000000 ................
0080 04000080 00000000 01000000 14000000 ................
- 0090 10000000 05000080 ........ \ No newline at end of file
+ 0090 10000000 05000080 ........
diff --git a/ld/testsuite/ld-pe/pdb3-c13-info2.d b/ld/testsuite/ld-pe/pdb3-c13-info2.d
index 1c33ce1..f74af2f 100644
--- a/ld/testsuite/ld-pe/pdb3-c13-info2.d
+++ b/ld/testsuite/ld-pe/pdb3-c13-info2.d
@@ -5,4 +5,4 @@ Contents of section .data:
0000 f4000000 30000000 06000000 100198ba ....0...........
0010 dcfe1023 45676745 2301efcd ab890000 ...#EggE#.......
0020 0a000000 10013b2a 19087f6e 5d4c4c5d ......;*...n]LL]
- 0030 6e7f0819 2a3b0000 n...*;.. \ No newline at end of file
+ 0030 6e7f0819 2a3b0000 n...*;..
diff --git a/ld/testsuite/ld-pe/pdb3-source-info.d b/ld/testsuite/ld-pe/pdb3-source-info.d
index 5b7d58c..4239c1c 100644
--- a/ld/testsuite/ld-pe/pdb3-source-info.d
+++ b/ld/testsuite/ld-pe/pdb3-source-info.d
@@ -4,4 +4,4 @@
Contents of section .data:
0000 03000300 00000100 02000200 02000000 ................
0010 00000000 04000000 04000000 08000000 ................
- 0020 666f6f00 62617200 62617a00 foo.bar.baz. \ No newline at end of file
+ 0020 666f6f00 62617200 62617a00 foo.bar.baz.
diff --git a/ld/testsuite/ld-pe/pe.exp b/ld/testsuite/ld-pe/pe.exp
index 6a30366..6a1afef 100644
--- a/ld/testsuite/ld-pe/pe.exp
+++ b/ld/testsuite/ld-pe/pe.exp
@@ -144,3 +144,18 @@ run_dump_test "exclude-symbols-embedded-i386"
run_dump_test "exclude-symbols-embedded-x86_64"
run_dump_test "exclude-symbols-def-i386"
run_dump_test "exclude-symbols-def-x86_64"
+
+if [check_shared_lib_support] {
+ set old_ASFLAGS $ASFLAGS
+ if [is_underscore_target] {
+ append ASFLAGS " --defsym UNDERSCORE=1"
+ }
+ run_dump_test "symbols-ordinals-hints-exports-ld"
+ # no dlltool for these two
+ setup_xfail aarch64-*-* sh-*-*
+ run_dump_test "symbols-ordinals-hints-exports-dlltool"
+ run_dump_test "symbols-ordinals-hints-imports-ld"
+ setup_xfail aarch64-*-* sh-*-*
+ run_dump_test "symbols-ordinals-hints-imports-dlltool"
+ set ASFLAGS $old_ASFLAGS
+}
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s b/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s
new file mode 100644
index 0000000..57fd3ed
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-call-imports.s
@@ -0,0 +1,17 @@
+.ifdef UNDERSCORE
+ .global _func
+_func:
+ .dc.a __imp__sym1
+ .dc.a __imp__sym2
+ .dc.a __imp__sym3
+ .dc.a __imp__sym4
+ .dc.a __imp__sym5
+.else
+ .global func
+func:
+ .dc.a __imp_sym1
+ .dc.a __imp_sym2
+ .dc.a __imp_sym3
+ .dc.a __imp_sym4
+ .dc.a __imp_sym5
+.endif
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d
new file mode 100644
index 0000000..fad59ea
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-dlltool.d
@@ -0,0 +1,21 @@
+#source: symbols-ordinals-hints-exports.s
+#dlltool: -d ${srcdir}/${subdir}/symbols-ordinals-hints.def -e tmpdir/exports-dlltool.o
+#ld: -shared tmpdir/exports-dlltool.o
+#objdump: -p
+
+# Rules for Ordinal/Name Pointer Table:
+# - Table rows must be lexicographically sorted by symbol names
+# - Hint numbers must be in sequence starting from zero
+# - Ordinal numbers must match the @ordinal keyword from .def file
+# - Symbols in .def file without @ordinal keyword have assigned the first free ordinal starting from 1
+# - Symbols in .def file with NONAME keyword must not be present in Name Pointer Table
+
+#...
+.*\[Ordinal/Name Pointer\] Table -- Ordinal Base.*
+.* Ordinal Hint Name
+.*\+base\[ 2\] 0000 sym1
+.*\+base\[ 5\] 0001 sym2
+.*\+base\[ 3\] 0002 sym4
+.*\+base\[ 4\] 0003 sym5
+
+#pass
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-ld.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-ld.d
new file mode 100644
index 0000000..0e7dcac
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports-ld.d
@@ -0,0 +1,20 @@
+#source: symbols-ordinals-hints-exports.s
+#ld: -shared ${srcdir}/${subdir}/symbols-ordinals-hints.def
+#objdump: -p
+
+# Rules for Ordinal/Name Pointer Table:
+# - Table rows must be lexicographically sorted by symbol names
+# - Hint numbers must be in sequence starting from zero
+# - Ordinal numbers must match the @ordinal keyword from .def file
+# - Symbols in .def file without @ordinal keyword have assigned the first free ordinal starting from 1
+# - Symbols in .def file with NONAME keyword must not be present in Name Pointer Table
+
+#...
+.*\[Ordinal/Name Pointer\] Table -- Ordinal Base.*
+.* Ordinal Hint Name
+.*\+base\[ 2\] 0000 sym1
+.*\+base\[ 5\] 0001 sym2
+.*\+base\[ 3\] 0002 sym4
+.*\+base\[ 4\] 0003 sym5
+
+#pass
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s
new file mode 100644
index 0000000..26ee52b
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-exports.s
@@ -0,0 +1,25 @@
+# define symbols in no specific order
+.ifdef UNDERSCORE
+ .global _sym2
+ .global _sym5
+ .global _sym3
+ .global _sym1
+ .global _sym4
+_sym2:
+_sym5:
+_sym3:
+_sym1:
+_sym4:
+.else
+ .global sym2
+ .global sym5
+ .global sym3
+ .global sym1
+ .global sym4
+sym2:
+sym5:
+sym3:
+sym1:
+sym4:
+.endif
+ .nop
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d
new file mode 100644
index 0000000..5f3702e
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-dlltool.d
@@ -0,0 +1,27 @@
+#source: symbols-ordinals-hints-call-imports.s
+#dlltool: -d ${srcdir}/${subdir}/symbols-ordinals-hints.def -l tmpdir/libimports-dlltool.a
+#ld: -shared
+#ld_after_inputfiles: tmpdir/libimports-dlltool.a
+#objdump: -p
+
+# Rules for Import Tables:
+# - Ordinal, Hint and Member-Name (what is present) match Ordinal/Name Pointer Table of
+# the external DLL (from corresponding symbols-ordinals-hints-exports-*.d test)
+# - Symbols in .def file with NONAME keyword have only Ordinal, must no have Hint and Member-Name
+# - Symbols in .def file without NONAME keyword have Hint and Member-Name, must not have Ordinal
+
+#...
+The Import Tables \(interpreted \.idata section contents\)
+ vma: Hint Time Forward DLL First
+ Table Stamp Chain Name Thunk
+.*
+
+.*DLL Name:.*
+.* Ordinal Hint Member-Name Bound-To
+.* <none> 0000 sym1
+.* <none> 0001 sym2
+.* 1 <none> <none>
+.* <none> 0002 sym4
+.* <none> 0003 sym5
+
+#pass
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d
new file mode 100644
index 0000000..7b7cdaa
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints-imports-ld.d
@@ -0,0 +1,26 @@
+#source: symbols-ordinals-hints-exports.s
+#ld: -shared ${srcdir}/${subdir}/symbols-ordinals-hints.def --out-implib tmpdir/libimports-ld.a
+#ld_after_inputfiles: && $AS $ASFLAGS ${srcdir}/${subdir}/symbols-ordinals-hints-call-imports.s -o tmpdir/call-imports-ld.o && $LD -shared tmpdir/call-imports-ld.o tmpdir/libimports-ld.a -o tmpdir/dump
+#objdump: -p
+
+# Rules for Import Tables:
+# - Ordinal, Hint and Member-Name (what is present) match Ordinal/Name Pointer Table of
+# the external DLL (from corresponding symbols-ordinals-hints-exports-*.d test)
+# - Symbols in .def file with NONAME keyword have only Ordinal, must no have Hint and Member-Name
+# - Symbols in .def file without NONAME keyword have Hint and Member-Name, must not have Ordinal
+
+#...
+The Import Tables \(interpreted \.idata section contents\)
+ vma: Hint Time Forward DLL First
+ Table Stamp Chain Name Thunk
+.*
+
+.*DLL Name:.*
+.* Ordinal Hint Member-Name Bound-To
+.* <none> 0000 sym1
+.* <none> 0001 sym2
+.* 1 <none> <none>
+.* <none> 0002 sym4
+.* <none> 0003 sym5
+
+#pass
diff --git a/ld/testsuite/ld-pe/symbols-ordinals-hints.def b/ld/testsuite/ld-pe/symbols-ordinals-hints.def
new file mode 100644
index 0000000..5b79a48
--- /dev/null
+++ b/ld/testsuite/ld-pe/symbols-ordinals-hints.def
@@ -0,0 +1,9 @@
+LIBRARY "symbols-ordinals-hints.dll"
+EXPORTS
+; define symbols in no specific order
+; define ordinals also in no specific order
+sym2 @5
+sym5
+sym3 @1 NONAME
+sym1 @2
+sym4