Replace copyreloc-main.c with copyreloc-main.S
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Dec 2014 16:40:19 +0000 (08:40 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 3 Dec 2014 16:44:49 +0000 (08:44 -0800)
* 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
ld/testsuite/ld-x86-64/copyreloc-main.S [new file with mode: 0644]
ld/testsuite/ld-x86-64/copyreloc-main.c [deleted file]
ld/testsuite/ld-x86-64/x86-64.exp

index d00586d..8cf3540 100644 (file)
@@ -1,3 +1,10 @@
+2014-12-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * 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  <hongjiu.lu@intel.com>
 
        * 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 (file)
index 0000000..cc17f0e
--- /dev/null
@@ -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 (file)
index 430eefb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-extern int a_glob;
-
-int
-main (void)
-{
-  return a_glob != 2;
-}
index c8d105b..8841993 100644 (file)
@@ -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" \
        ] \