2010-09-13 Kai Tietz <kai.tietz@onevision.com>
* gas/pe/pe.exp: Add x64 SEH tests. * gas/pe/peseh-x64.s: New. * gas/pe/peseh-x64.d: New. * gas/pe/peseh-x64-2.s: New. * gas/pe/peseh-x64-2.d: New. * gas/pe/peseh-x64-3.s: New. * gas/pe/peseh-x64-3.d: New.
This commit is contained in:
parent
2d646f5b6f
commit
47c8d350c8
|
@ -1,3 +1,13 @@
|
|||
2010-09-13 Kai Tietz <kai.tietz@onevision.com>
|
||||
|
||||
* gas/pe/pe.exp: Add x64 SEH tests.
|
||||
* gas/pe/peseh-x64.s: New.
|
||||
* gas/pe/peseh-x64.d: New.
|
||||
* gas/pe/peseh-x64-2.s: New.
|
||||
* gas/pe/peseh-x64-2.d: New.
|
||||
* gas/pe/peseh-x64-3.s: New.
|
||||
* gas/pe/peseh-x64-3.d: New.
|
||||
|
||||
2010-09-09 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
PR gas/11973
|
||||
|
|
|
@ -35,3 +35,13 @@ run_dump_test "aligncomm-d"
|
|||
|
||||
run_dump_test "section-align-1"
|
||||
run_dump_test "section-align-3"
|
||||
|
||||
# SEH related tests
|
||||
|
||||
# These tests are only for x86_64 targets
|
||||
if ([istarget "x86_64-*-mingw*"]) then {
|
||||
|
||||
run_dump_test "peseh-x64"
|
||||
run_dump_test "peseh-x64-2"
|
||||
run_dump_test "peseh-x64-3"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#objdump: -s -j .xdata
|
||||
#name: PE x64 SEH test 2
|
||||
|
||||
.*: .*
|
||||
|
||||
Contents of section .xdata:
|
||||
0000 01080305 08320403 01500000 .*
|
|
@ -0,0 +1,26 @@
|
|||
.file "t2.c"
|
||||
.text
|
||||
.p2align 4,,15
|
||||
.globl foo
|
||||
.def foo; .scl 2; .type 32; .endef
|
||||
.seh_proc foo
|
||||
foo:
|
||||
pushq %rbp
|
||||
.seh_pushreg %rbp
|
||||
movq %rsp, %rbp
|
||||
.seh_setframe %rbp, 0
|
||||
subq $32, %rsp
|
||||
.seh_stackalloc 32
|
||||
.seh_endprologue
|
||||
leal 1(%rcx), %eax
|
||||
cltq
|
||||
addq $30, %rax
|
||||
andq $-16, %rax
|
||||
call ___chkstk
|
||||
leaq 32(%rsp), %rcx
|
||||
call bar
|
||||
movq %rbp, %rsp
|
||||
popq %rbp
|
||||
ret
|
||||
.seh_endproc
|
||||
.def bar; .scl 2; .type 32; .endef
|
|
@ -0,0 +1,9 @@
|
|||
#objdump: -s -j .xdata
|
||||
#name: PE x64 SEH test 3
|
||||
|
||||
.*: .*
|
||||
|
||||
Contents of section .xdata:
|
||||
0000 09080305 08520403 01500000 00000000 .....R...P......
|
||||
0010 01000000 0f000000 1c000000 00000000 ................
|
||||
0020 1c000000 .*
|
|
@ -0,0 +1,31 @@
|
|||
.file "t3.c"
|
||||
.text
|
||||
.globl nMainCRTStartup
|
||||
.def nMainCRTStartup; .scl 2; .type 32; .endef
|
||||
.seh_proc nMainCRTStartup
|
||||
nMainCRTStartup:
|
||||
pushq %rbp
|
||||
.seh_pushreg %rbp
|
||||
movq %rsp, %rbp
|
||||
.seh_setframe %rbp, 0
|
||||
subq $48, %rsp
|
||||
.seh_stackalloc 48
|
||||
.seh_endprologue
|
||||
movl $255, -4(%rbp)
|
||||
.l_startw:
|
||||
.seh_handler __C_specific_handler, @except
|
||||
.seh_handlerdata
|
||||
.long 1
|
||||
.rva .l_startw, .l_endw, _gnu_exception_handler ,.l_endw
|
||||
.text
|
||||
call __security_init_cookie
|
||||
call __tmainCRTStartup
|
||||
movl %eax, -4(%rbp)
|
||||
.l_endw: nop
|
||||
movl -4(%rbp), %eax
|
||||
addq $48, %rsp
|
||||
popq %rbp
|
||||
ret
|
||||
.seh_endproc
|
||||
.def __security_init_cookie; .scl 2; .type 32; .endef
|
||||
.def __tmainCRTStartup; .scl 2; .type 32; .endef
|
|
@ -0,0 +1,7 @@
|
|||
#objdump: -s -j .xdata
|
||||
#name: PE x64 SEH test 1
|
||||
|
||||
.*: .*
|
||||
|
||||
Contents of section .xdata:
|
||||
0000 01040100 04020000 .*
|
|
@ -0,0 +1,14 @@
|
|||
.file "t1.c"
|
||||
.text
|
||||
.p2align 4,,15
|
||||
.globl foo
|
||||
.def foo; .scl 2; .type 32; .endef
|
||||
.seh_proc foo
|
||||
foo:
|
||||
subq $8, %rsp
|
||||
.seh_stackalloc 8
|
||||
.seh_endprologue
|
||||
movl $1, %eax
|
||||
addq $8, %rsp
|
||||
ret
|
||||
.seh_endproc
|
Loading…
Reference in New Issue