From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/elfix:elfix-0.5.x commit in: /, tests/gnustack/
Date: Sun, 29 Jul 2012 15:24:09 +0000 (UTC) [thread overview]
Message-ID: <1343575429.d61df6074dc99b361025bc3706d2841ce2f80cc2.blueness@gentoo> (raw)
commit: d61df6074dc99b361025bc3706d2841ce2f80cc2
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 29 00:26:33 2012 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Jul 29 15:23:49 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=d61df607
tests/gnustack: make test machine independant
(cherry picked from commit f2a19530532ef81f404723a93932d30e04828a4c)
---
.gitignore | 1 +
configure.ac | 1 -
tests/gnustack/Makefile.am | 10 +++++-----
tests/gnustack/bad-gnustack.c | 2 ++
tests/gnustack/bad32.s | 29 -----------------------------
tests/gnustack/bad64.s | 37 -------------------------------------
6 files changed, 8 insertions(+), 72 deletions(-)
diff --git a/.gitignore b/.gitignore
index 5bd120c..f18ff9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@ stamp-h1
#
.deps
*.o
+*.s
*.swp
fix-gnustack
paxctl-ng
diff --git a/configure.ac b/configure.ac
index 6ae009a..23d9fd7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,6 @@ AC_ARG_ENABLE(
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
-AM_PROG_AS
# Checks for libraries.
AC_CHECK_LIB([elf], [elf_begin],[],[AC_MSG_ERROR(["Missing necessary function elf_begin in libelf"])])
diff --git a/tests/gnustack/Makefile.am b/tests/gnustack/Makefile.am
index 7a19c18..2915988 100644
--- a/tests/gnustack/Makefile.am
+++ b/tests/gnustack/Makefile.am
@@ -1,11 +1,11 @@
noinst_PROGRAMS = bad-gnustack
-bad_gnustack_SOURCES = bad64.s bad32.s
-ARCH = $(shell uname -m | sed -e 's/i./x/')
+bad-gnustack.s: bad-gnustack.c
+ $(CC) -S $<
+ sed -i -e 's/GNU-stack,"",@progbits/GNU-stack,"x",@progbits/' $@
-bad-gnustack: bad64.s bad32.s
- [[ "$(ARCH)" == "x86" ]] && $(CCAS) -m32 -o bad-gnustack bad32.s || true
- [[ "$(ARCH)" == "x86_64" ]] && $(CCAS) -m64 -o bad-gnustack bad64.s || true
+bad-gnustack: bad-gnustack.s
+ $(CC) -o $@ $<
check_SCRIPTS = test.sh
TEST = $(check_SCRIPTS)
diff --git a/tests/gnustack/bad-gnustack.c b/tests/gnustack/bad-gnustack.c
new file mode 100644
index 0000000..b6c1f55
--- /dev/null
+++ b/tests/gnustack/bad-gnustack.c
@@ -0,0 +1,2 @@
+// Any c will do here
+int main() { return 0 ; }
diff --git a/tests/gnustack/bad32.s b/tests/gnustack/bad32.s
deleted file mode 100644
index 95441d8..0000000
--- a/tests/gnustack/bad32.s
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- bad32.s: 32-bit asm source for sample elf with X on GNU_STACK
- Copyright (C) 2012 Anthony G. Basile
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
- .file "main.c"
- .text
- .globl main
- .type main, @function
-main:
- pushl %ebp
- movl %esp, %ebp
- popl %ebp
- ret
- .size main, .-main
- .section .note.GNU-stack,"x",@progbits
diff --git a/tests/gnustack/bad64.s b/tests/gnustack/bad64.s
deleted file mode 100644
index 0168921..0000000
--- a/tests/gnustack/bad64.s
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- bad32.s: 32-bit asm source for sample elf with X on GNU_STACK
- Copyright (C) 2012 Anthony G. Basile
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
- .file "main.c"
- .text
- .globl main
- .type main, @function
-main:
-.LFB0:
- .cfi_startproc
- pushq %rbp
- .cfi_def_cfa_offset 16
- movq %rsp, %rbp
- .cfi_offset 6, -16
- .cfi_def_cfa_register 6
- leave
- .cfi_def_cfa 7, 8
- ret
- .cfi_endproc
-.LFE0:
- .size main, .-main
- .section .note.GNU-stack,"x",@progbits
next reply other threads:[~2012-07-29 15:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-29 15:24 Anthony G. Basile [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-07-29 15:27 [gentoo-commits] proj/elfix:elfix-0.5.x commit in: /, tests/gnustack/ Anthony G. Basile
2012-07-27 22:31 Anthony G. Basile
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343575429.d61df6074dc99b361025bc3706d2841ce2f80cc2.blueness@gentoo \
--to=blueness@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox