diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2012-07-28 20:26:33 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2012-07-28 20:26:33 -0400 |
commit | f2a19530532ef81f404723a93932d30e04828a4c (patch) | |
tree | 54a264582d4ea68a0d7560cea91649cc4ee86e8d /tests | |
parent | configure.ac: remove unnecessary check for yasm (diff) | |
download | elfix-f2a19530532ef81f404723a93932d30e04828a4c.tar.gz elfix-f2a19530532ef81f404723a93932d30e04828a4c.tar.bz2 elfix-f2a19530532ef81f404723a93932d30e04828a4c.zip |
tests/gnustack: make test machine independant
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gnustack/Makefile.am | 10 | ||||
-rw-r--r-- | tests/gnustack/bad-gnustack.c | 2 | ||||
-rw-r--r-- | tests/gnustack/bad32.s | 29 | ||||
-rw-r--r-- | tests/gnustack/bad64.s | 37 |
4 files changed, 7 insertions, 71 deletions
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 |