binutils-gdb/gold/testsuite/split_x32_1.s
H.J. Lu 4fc1b9d43c Handle stack split for x32
X32 uses cmp %fs:NN,%esp, lea NN(%rsp),%r10d, lea NN(%rsp),%r11d,
instead of cmp %fs:NN,%rsp, lea NN(%rsp),%r10, lea NN(%rsp),%r11.
This patch handles it.

	PR gold/17729
	* configure.ac (DEFAULT_TARGET_X86_64): Don't set for x32.
	(DEFAULT_TARGET_X32): Set for x32.
	* x86_64.cc (cmp_insn_32): New.
	(lea_r10_insn_32): Likewise.
	(lea_r11_insn_32): Likewise.
	(cmp_insn_64): Likewise.
	(lea_r10_insn_64): Likewise.
	(lea_r11_insn_64): Likewise.
	(Target_x86_64<size>::do_calls_non_split): Handle x32.
	* testsuite/Makefile.am (check_SCRIPTS): Add split_x32.sh.
	(check_DATA): Add split_x32 files.
	(split_x32_[1234n].o): New targets.
	(split_x32_[124]): New targets.
	(split_x32_[1234r].stdout): New targets.
	* testsuite/split_x32.sh: New file.
	* testsuite/split_x32_1.s: Likewise.
	* testsuite/split_x32_2.s: Likewise.
	* testsuite/split_x32_3.s: Likewise.
	* testsuite/split_x32_4.s: Likewise.
	* testsuite/split_x32_n.s: Likewise.
	* configure: Regenerated.
	* testsuite/Makefile.in: Likewise.
2015-01-06 15:38:25 -08:00

34 lines
441 B
ArmAsm

# split_x32_1.s: x32 specific test case for -fsplit-stack.
.text
.global fn1
.type fn1,@function
fn1:
cmp %fs:0x40,%esp
jae 1f
callq __morestack
retq
1:
callq fn2
retq
.size fn1,. - fn1
.global fn2
.type fn2,@function
fn2:
lea -0x200(%rsp),%r10d
cmp %fs:0x40,%r10d
jae 1f
callq __morestack
retq
1:
callq fn1
retq
.size fn2,. - fn2
.section .note.GNU-stack,"",@progbits
.section .note.GNU-split-stack,"",@progbits