aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-x86-64
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-x86-64')
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-1.od1
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-2.od1
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-3.od1
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-4.od1
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-5.od1
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-5.rd3
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-6.obj.bz2bin0 -> 1366 bytes
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64-6.od91
-rw-r--r--ld/testsuite/ld-x86-64/pe-x86-64.exp9
9 files changed, 107 insertions, 1 deletions
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-1.od b/ld/testsuite/ld-x86-64/pe-x86-64-1.od
index 4966d55..227875f 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64-1.od
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-1.od
@@ -2,6 +2,7 @@
.*: +file format .*
SYMBOL TABLE:
+0+400000 g .text\$mn 0000000000000000 __executable_start
0+401000 g .text\$mn 0000000000000000 getaddr1
0+401020 g .text\$mn 0000000000000000 begin
0+403014 g .bss 0000000000000000 __bss_start
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-2.od b/ld/testsuite/ld-x86-64/pe-x86-64-2.od
index 4966d55..227875f 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64-2.od
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-2.od
@@ -2,6 +2,7 @@
.*: +file format .*
SYMBOL TABLE:
+0+400000 g .text\$mn 0000000000000000 __executable_start
0+401000 g .text\$mn 0000000000000000 getaddr1
0+401020 g .text\$mn 0000000000000000 begin
0+403014 g .bss 0000000000000000 __bss_start
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-3.od b/ld/testsuite/ld-x86-64/pe-x86-64-3.od
index 4966d55..227875f 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64-3.od
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-3.od
@@ -2,6 +2,7 @@
.*: +file format .*
SYMBOL TABLE:
+0+400000 g .text\$mn 0000000000000000 __executable_start
0+401000 g .text\$mn 0000000000000000 getaddr1
0+401020 g .text\$mn 0000000000000000 begin
0+403014 g .bss 0000000000000000 __bss_start
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-4.od b/ld/testsuite/ld-x86-64/pe-x86-64-4.od
index e0bde11..320c6be 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64-4.od
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-4.od
@@ -2,6 +2,7 @@
.*: +file format .*
SYMBOL TABLE:
+0+400000 g .text\$mn 0000000000000000 __executable_start
0+403038 g .bss 0000000000000000 c
0+401000 g .text\$mn 0000000000000000 begin
0+403038 g .bss 0000000000000000 __bss_start
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-5.od b/ld/testsuite/ld-x86-64/pe-x86-64-5.od
index 8a4f4a6..6ef13ab 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64-5.od
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-5.od
@@ -4,6 +4,7 @@
SYMBOL TABLE:
0+402014 g .bss 0000000000000000 non_initdummy
0+402010 g .data 0000000000000000 initdummy
+0+400000 g .text\$mn 0000000000000000 __executable_start
0+401000 g .text\$mn 0000000000000000 begin
0+402012 g .bss 0000000000000000 __bss_start
0+402000 g .data 0000000000000000 Struct
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-5.rd b/ld/testsuite/ld-x86-64/pe-x86-64-5.rd
index 8370665..2370528 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64-5.rd
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-5.rd
@@ -1,9 +1,10 @@
-Symbol table '.symtab' contains 10 entries:
+Symbol table '.symtab' contains 11 entries:
Num: Value Size Type Bind Vis Ndx Name
+[a-f0-9]+: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+[a-f0-9]+: 0000000000402014 0 NOTYPE GLOBAL DEFAULT 3 non_initdummy
+[a-f0-9]+: 0000000000402010 0 NOTYPE GLOBAL DEFAULT 2 initdummy
+ +[a-f0-9]+: 0000000000400000 0 NOTYPE GLOBAL DEFAULT 1 __executable_start
+[a-f0-9]+: 0000000000401000 0 NOTYPE GLOBAL DEFAULT 1 begin
+[a-f0-9]+: 0000000000402012 0 NOTYPE GLOBAL DEFAULT 3 __bss_start
+[a-f0-9]+: 0000000000402000 0 NOTYPE GLOBAL DEFAULT 2 Struct
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-6.obj.bz2 b/ld/testsuite/ld-x86-64/pe-x86-64-6.obj.bz2
new file mode 100644
index 0000000..3825504
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-6.obj.bz2
Binary files differ
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64-6.od b/ld/testsuite/ld-x86-64/pe-x86-64-6.od
new file mode 100644
index 0000000..cc23658
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pe-x86-64-6.od
@@ -0,0 +1,91 @@
+
+.*: +file format .*
+
+SYMBOL TABLE:
+0+4010a8 g .text\$mn 0000000000000000 xfunc
+0+402000 g .rdata 0000000000000000 \?\?_C@_02LDKJOMJN@AB@
+0+400000 g .text\$mn 0000000000000000 __executable_start
+0+403058 g .data 0000000000000000 __bss_start
+0+401000 g .text\$mn 0000000000000000 main
+0+403038 g .data 0000000000000000 deadloopvar
+0+4010ac g .text\$mn 0000000000000000 xstring
+0+403058 g .data 0000000000000000 _edata
+0+403058 g .data 0000000000000000 _end
+
+
+
+Disassembly of section .text\$mn:
+
+0+401000 <main>:
+ +[a-f0-9]+: 48 89 5c 24 08 mov %rbx,0x8\(%rsp\)
+ +[a-f0-9]+: 48 89 6c 24 10 mov %rbp,0x10\(%rsp\)
+ +[a-f0-9]+: 48 89 74 24 20 mov %rsi,0x20\(%rsp\)
+ +[a-f0-9]+: 57 push %rdi
+ +[a-f0-9]+: 48 83 ec 20 sub \$0x20,%rsp
+ +[a-f0-9]+: cc int3
+ +[a-f0-9]+: 8b 05 1d 20 00 00 mov 0x201d\(%rip\),%eax # 403038 <deadloopvar>
+ +[a-f0-9]+: 83 f8 01 cmp \$0x1,%eax
+ +[a-f0-9]+: 74 f5 je 401015 <main\+0x15>
+ +[a-f0-9]+: 0f 31 rdtsc
+ +[a-f0-9]+: 48 c1 e2 20 shl \$0x20,%rdx
+ +[a-f0-9]+: 48 0b c2 or %rdx,%rax
+ +[a-f0-9]+: 74 5d je 401088 <main\+0x88>
+ +[a-f0-9]+: 33 ff xor %edi,%edi
+ +[a-f0-9]+: 48 8d 2d cc ef ff ff lea -0x1034\(%rip\),%rbp # 400000 <__executable_start>
+ +[a-f0-9]+: 33 db xor %ebx,%ebx
+ +[a-f0-9]+: 48 8d 35 ff 1f 00 00 lea 0x1fff\(%rip\),%rsi # 40303c <deadloopvar\+0x4>
+ +[a-f0-9]+: 48 8b 8c 2b 50 30 00 00 mov 0x3050\(%rbx,%rbp,1\),%rcx
+ +[a-f0-9]+: 44 8a 01 mov \(%rcx\),%r8b
+ +[a-f0-9]+: 45 84 c0 test %r8b,%r8b
+ +[a-f0-9]+: 74 28 je 401075 <main\+0x75>
+ +[a-f0-9]+: b8 05 00 00 00 mov \$0x5,%eax
+ +[a-f0-9]+: 2b 84 2b 48 30 00 00 sub 0x3048\(%rbx,%rbp,1\),%eax
+ +[a-f0-9]+: 99 cltd
+ +[a-f0-9]+: 2b c2 sub %edx,%eax
+ +[a-f0-9]+: d1 f8 sar %eax
+ +[a-f0-9]+: 48 63 d0 movslq %eax,%rdx
+ +[a-f0-9]+: 48 03 d6 add %rsi,%rdx
+ +[a-f0-9]+: 48 ff c1 inc %rcx
+ +[a-f0-9]+: 44 88 02 mov %r8b,\(%rdx\)
+ +[a-f0-9]+: 48 ff c2 inc %rdx
+ +[a-f0-9]+: 44 8a 01 mov \(%rcx\),%r8b
+ +[a-f0-9]+: 45 84 c0 test %r8b,%r8b
+ +[a-f0-9]+: 75 ef jne 401064 <main\+0x64>
+ +[a-f0-9]+: 48 8b ce mov %rsi,%rcx
+ +[a-f0-9]+: e8 2f 00 00 00 call 4010ac <xstring>
+ +[a-f0-9]+: ff c7 inc %edi
+ +[a-f0-9]+: 48 83 c3 08 add \$0x8,%rbx
+ +[a-f0-9]+: 83 ff 01 cmp \$0x1,%edi
+ +[a-f0-9]+: 72 b5 jb 40103d <main\+0x3d>
+ +[a-f0-9]+: b1 aa mov \$0xaa,%cl
+ +[a-f0-9]+: e8 19 00 00 00 call 4010a8 <xfunc>
+ +[a-f0-9]+: 48 8b 5c 24 30 mov 0x30\(%rsp\),%rbx
+ +[a-f0-9]+: 33 c0 xor %eax,%eax
+ +[a-f0-9]+: 48 8b 6c 24 38 mov 0x38\(%rsp\),%rbp
+ +[a-f0-9]+: 48 8b 74 24 48 mov 0x48\(%rsp\),%rsi
+ +[a-f0-9]+: 48 83 c4 20 add \$0x20,%rsp
+ +[a-f0-9]+: 5f pop %rdi
+ +[a-f0-9]+: c3 ret
+ +[a-f0-9]+: 66 90 xchg %ax,%ax
+
+0+4010a8 <xfunc>:
+ +[a-f0-9]+: 66 90 xchg %ax,%ax
+ +[a-f0-9]+: cc int3
+ +[a-f0-9]+: c3 ret
+
+0+4010ac <xstring>:
+ +[a-f0-9]+: 40 53 rex push %rbx
+ +[a-f0-9]+: 48 83 ec 20 sub \$0x20,%rsp
+ +[a-f0-9]+: 8a 01 mov \(%rcx\),%al
+ +[a-f0-9]+: 48 8b d9 mov %rcx,%rbx
+ +[a-f0-9]+: eb 0c jmp 4010c5 <xstring\+0x19>
+ +[a-f0-9]+: 8a c8 mov %al,%cl
+ +[a-f0-9]+: e8 e8 ff ff ff call 4010a8 <xfunc>
+ +[a-f0-9]+: 48 ff c3 inc %rbx
+ +[a-f0-9]+: 8a 03 mov \(%rbx\),%al
+ +[a-f0-9]+: 84 c0 test %al,%al
+ +[a-f0-9]+: 75 f0 jne 4010b9 <xstring\+0xd>
+ +[a-f0-9]+: 48 83 c4 20 add \$0x20,%rsp
+ +[a-f0-9]+: 5b pop %rbx
+ +[a-f0-9]+: c3 ret
+#pass
diff --git a/ld/testsuite/ld-x86-64/pe-x86-64.exp b/ld/testsuite/ld-x86-64/pe-x86-64.exp
index ccfcdfa..f5d2c84 100644
--- a/ld/testsuite/ld-x86-64/pe-x86-64.exp
+++ b/ld/testsuite/ld-x86-64/pe-x86-64.exp
@@ -73,4 +73,13 @@ run_ld_link_tests [list \
{readelf {-s -x .data} pe-x86-64-5.rd}} \
"pe-x86-64-5" \
] \
+ [list \
+ "Build pe-x86-64-6" \
+ "-m elf_x86_64 --entry=main" \
+ "" \
+ "" \
+ {pe-x86-64-6.obj.bz2 } \
+ {{objdump {-dw --sym} pe-x86-64-6.od}} \
+ "pe-x86-64-6" \
+ ] \
]