From c76d88dc691095808544982290d599f00e80fa22 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 3 Dec 2014 08:40:19 -0800 Subject: [PATCH] Replace copyreloc-main.c with copyreloc-main.S * ld-x86-64/copyreloc-main.c: Removed. * ld-x86-64/copyreloc-main.S: New. * ld-x86-64/x86-64.exp: Replace copyreloc-main.c with copyreloc-main.S. --- ld/testsuite/ChangeLog | 7 +++++++ ld/testsuite/ld-x86-64/copyreloc-main.S | 15 +++++++++++++++ ld/testsuite/ld-x86-64/copyreloc-main.c | 7 ------- ld/testsuite/ld-x86-64/x86-64.exp | 6 +++--- 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 ld/testsuite/ld-x86-64/copyreloc-main.S delete mode 100644 ld/testsuite/ld-x86-64/copyreloc-main.c diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index d00586d..8cf3540 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-12-03 H.J. Lu + + * ld-x86-64/copyreloc-main.c: Removed. + * ld-x86-64/copyreloc-main.S: New. + * ld-x86-64/x86-64.exp: Replace copyreloc-main.c with + copyreloc-main.S. + 2014-12-02 H.J. Lu * ld-x86-64/copyreloc-lib.c: New file. diff --git a/ld/testsuite/ld-x86-64/copyreloc-main.S b/ld/testsuite/ld-x86-64/copyreloc-main.S new file mode 100644 index 0000000..cc17f0e --- /dev/null +++ b/ld/testsuite/ld-x86-64/copyreloc-main.S @@ -0,0 +1,15 @@ + .section .text.startup,"ax",@progbits + .p2align 4,,15 + .globl main + .type main, @function +main: +.LFB0: + .cfi_startproc + xorl %eax, %eax + cmpl $2, a_glob(%rip) + setne %al + ret + .cfi_endproc +.LFE0: + .size main, .-main + .section .note.GNU-stack,"",@progbits diff --git a/ld/testsuite/ld-x86-64/copyreloc-main.c b/ld/testsuite/ld-x86-64/copyreloc-main.c deleted file mode 100644 index 430eefb..0000000 --- a/ld/testsuite/ld-x86-64/copyreloc-main.c +++ /dev/null @@ -1,7 +0,0 @@ -extern int a_glob; - -int -main (void) -{ - return a_glob != 2; -} diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp index c8d105b..8841993 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp @@ -345,7 +345,7 @@ if { [isnative] && [which $CC] != 0 } { "Build copyreloc-main with PIE without -fPIE (1)" \ "tmpdir/copyreloc-lib.so -pie" \ "" \ - { copyreloc-main.c } \ + { copyreloc-main.S } \ {{readelf {-Wr} copyreloc-main1.rd}} \ "copyreloc-main" \ ] \ @@ -353,7 +353,7 @@ if { [isnative] && [which $CC] != 0 } { "Build copyreloc-main with PIE without -fPIE (2)" \ "tmpdir/copyreloc-lib.so -pie" \ "" \ - { copyreloc-main.c } \ + { copyreloc-main.S } \ {{readelf {-Wr} copyreloc-main2.rd}} \ "copyreloc-main" \ ] \ @@ -364,7 +364,7 @@ if { [isnative] && [which $CC] != 0 } { "Run copyreloc-main with PIE without -fPIE" \ "tmpdir/copyreloc-lib.so -pie" \ "" \ - { copyreloc-main.c } \ + { copyreloc-main.S } \ "copyreloc-main" \ "copyreloc-main.out" \ ] \ -- 2.7.4