From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 8E95513800E for ; Sun, 29 Jul 2012 15:24:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E29EE0262; Sun, 29 Jul 2012 15:24:11 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2789AE0262 for ; Sun, 29 Jul 2012 15:24:11 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 682A31B4007 for ; Sun, 29 Jul 2012 15:24:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 2D613E5437 for ; Sun, 29 Jul 2012 15:24:09 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1343575429.d61df6074dc99b361025bc3706d2841ce2f80cc2.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:elfix-0.5.x commit in: /, tests/gnustack/ X-VCS-Repository: proj/elfix X-VCS-Files: .gitignore configure.ac tests/gnustack/Makefile.am tests/gnustack/bad-gnustack.c tests/gnustack/bad32.s tests/gnustack/bad64.s X-VCS-Directories: / tests/gnustack/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: d61df6074dc99b361025bc3706d2841ce2f80cc2 X-VCS-Branch: elfix-0.5.x Date: Sun, 29 Jul 2012 15:24:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fc2b9e19-13f0-4247-87ea-66d1081987ea X-Archives-Hash: a0b7e9f56b175ae0ca25193f67781565 commit: d61df6074dc99b361025bc3706d2841ce2f80cc2 Author: Anthony G. Basile gentoo org> AuthorDate: Sun Jul 29 00:26:33 2012 +0000 Commit: Anthony G. Basile gentoo 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 . -*/ - - .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 . -*/ - - .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