* [gentoo-commits] proj/elfix:master commit in: /, tests/gnustack/
@ 2012-07-29 1:16 Anthony G. Basile
0 siblings, 0 replies; 4+ messages in thread
From: Anthony G. Basile @ 2012-07-29 1:16 UTC (permalink / raw
To: gentoo-commits
commit: 8fa951f1421051e12778fd438856cd77864c2302
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 29 01:16:22 2012 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun Jul 29 01:16:30 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=8fa951f1
tests/gnustack/Makefile.am: make sed line work on arm
---
configure.ac | 1 +
tests/gnustack/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 987b20a..75a09b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,7 @@ AC_ARG_ENABLE(
# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
+AC_PROG_SED
# 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 a1dc24b..6f5f569 100644
--- a/tests/gnustack/Makefile.am
+++ b/tests/gnustack/Makefile.am
@@ -2,7 +2,7 @@ noinst_PROGRAMS = bad-gnustack
bad-gnustack.s: bad-gnustack.c
$(CC) -S $<
- sed -i -e 's/GNU-stack,"",@progbits/GNU-stack,"x",@progbits/' $@
+ $(SED) -i -e 's/GNU-stack,"",/GNU-stack,"x",/' $@
bad-gnustack: bad-gnustack.s
$(CC) -o $@ $<
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/elfix:master commit in: /, tests/gnustack/
@ 2013-05-20 11:41 Anthony G. Basile
0 siblings, 0 replies; 4+ messages in thread
From: Anthony G. Basile @ 2013-05-20 11:41 UTC (permalink / raw
To: gentoo-commits
commit: 81a525e85441935c7d80e5199c7c3c40f9dcbacd
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Mon May 20 11:40:41 2013 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon May 20 11:40:41 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=81a525e8
Bump to automake 1.12
---
configure.ac | 2 +-
tests/gnustack/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 4fbf6b2..a50f00d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@ AC_PREREQ([2.68])
AC_INIT([elfix], [0.8], [http://bugs.gentoo.org/])
AC_CONFIG_SRCDIR([src/fix-gnustack.c])
AC_CONFIG_HEADERS([config.h])
-AM_INIT_AUTOMAKE([1.11 foreign])
+AM_INIT_AUTOMAKE([1.12 foreign])
AM_SILENT_RULES([no])
LT_PREREQ([2.4])
diff --git a/tests/gnustack/Makefile.am b/tests/gnustack/Makefile.am
index 85d5f9f..2590ba2 100644
--- a/tests/gnustack/Makefile.am
+++ b/tests/gnustack/Makefile.am
@@ -8,7 +8,7 @@ bad-gnustack.s: bad-gnustack.c
$(CC) -S $<
$(SED) -i -e 's/GNU-stack,"",/GNU-stack,"x",/' $@
-bad-gnustack: bad-gnustack.s
+bad-gnustack$(EXEEXT): bad-gnustack.s
$(CC) -o $@ $<
check_SCRIPTS = gnustacktest
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/elfix:master commit in: /, tests/gnustack/
@ 2012-07-29 0:26 Anthony G. Basile
0 siblings, 0 replies; 4+ messages in thread
From: Anthony G. Basile @ 2012-07-29 0:26 UTC (permalink / raw
To: gentoo-commits
commit: f2a19530532ef81f404723a93932d30e04828a4c
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 00:26:33 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=f2a19530
tests/gnustack: make test machine independant
---
.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 0de2e42..b4c9839 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,7 @@ stamp-h1
#
.deps
*.o
+*.s
*.swp
fix-gnustack
paxctl-ng
diff --git a/configure.ac b/configure.ac
index b4f9c0d..987b20a 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/elfix:master commit in: /, tests/gnustack/
@ 2012-07-27 21:07 Anthony G. Basile
0 siblings, 0 replies; 4+ messages in thread
From: Anthony G. Basile @ 2012-07-27 21:07 UTC (permalink / raw
To: gentoo-commits
commit: f8a6f9f2f822e7d1c9b5abc32f409af3d82c99ef
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 27 21:07:28 2012 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Fri Jul 27 21:07:28 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=f8a6f9f2
tests/gnustack: switch from yasm to gcc for assembler
---
configure.ac | 2 +
tests/gnustack/Makefile.am | 18 ++++++----------
tests/gnustack/bad32.asm | 26 -------------------------
tests/gnustack/{bad-gnustack.c => bad32.s} | 21 ++++++++++++-------
tests/gnustack/bad64.asm | 25 ------------------------
tests/gnustack/{bad-gnustack.c => bad64.s} | 29 ++++++++++++++++++++-------
6 files changed, 43 insertions(+), 78 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9cf4143..f97c3d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,6 +6,7 @@ AC_INIT([elfix], [0.5], [http://bugs.gentoo.org/])
AC_CONFIG_SRCDIR([src/fix-gnustack.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.11 foreign])
+AM_SILENT_RULES([yes])
AC_ARG_ENABLE(
[tests],
@@ -61,6 +62,7 @@ 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 af11d60..7a19c18 100644
--- a/tests/gnustack/Makefile.am
+++ b/tests/gnustack/Makefile.am
@@ -1,15 +1,11 @@
noinst_PROGRAMS = bad-gnustack
-bad_gnustack_SOURCES = bad-gnustack.c
-bad_gnustack_DEPENDENCIES = bad-asm.o
-bad_gnustack_LDADD = bad-asm.o
-
-EXTRA_DIST = bad64.asm bad32.asm
+bad_gnustack_SOURCES = bad64.s bad32.s
ARCH = $(shell uname -m | sed -e 's/i./x/')
-bad-asm.o: bad64.asm bad32.asm
- [[ "$(ARCH)" == "x86" ]] && yasm -f elf -m x86 bad32.asm && mv bad32.o bad-asm.o || true
- [[ "$(ARCH)" == "x86_64" ]] && yasm -f elf -m amd64 bad64.asm && mv bad64.o bad-asm.o || true
+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
check_SCRIPTS = test.sh
TEST = $(check_SCRIPTS)
@@ -17,12 +13,12 @@ TEST = $(check_SCRIPTS)
test.sh:
@echo "================================================================================"
@echo
- @echo "Fixing Bad GNU_STACK Elf"
+ @echo "Before GNU_STACK Elf: "
@../../src/fix-gnustack -f bad-gnustack
@echo
- @echo "Fixed Bad GNU_STACK Elf"
+ @echo "After GNU_STACK Elf: "
@../../src/fix-gnustack bad-gnustack
@echo
@echo "================================================================================"
-CLEANFILES = bad-asm.o test.sh
+CLEANFILES = *.o test.sh
diff --git a/tests/gnustack/bad32.asm b/tests/gnustack/bad32.asm
deleted file mode 100644
index 8020ac7..0000000
--- a/tests/gnustack/bad32.asm
+++ /dev/null
@@ -1,26 +0,0 @@
-;bad32.asm: 32-bit asm source for sample elf with X on GNU_STACK
-;Copyright (C) 2011 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/>.
-
-global badness
-
-SECTION .text
-
-badness:
- push ebp
- mov ebp,esp
- mov esp,ebp
- pop ebp
- ret
diff --git a/tests/gnustack/bad-gnustack.c b/tests/gnustack/bad32.s
similarity index 69%
copy from tests/gnustack/bad-gnustack.c
copy to tests/gnustack/bad32.s
index fa7bcf5..95441d8 100644
--- a/tests/gnustack/bad-gnustack.c
+++ b/tests/gnustack/bad32.s
@@ -1,6 +1,6 @@
/*
- bad-gnustack.c: C source for sample elf with X on GNU_STACK
- Copyright (C) 2011 Anthony G. Basile
+ 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
@@ -15,10 +15,15 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
-int main()
-{
- badness();
- return 0;
-}
+ .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.asm b/tests/gnustack/bad64.asm
deleted file mode 100644
index 1164095..0000000
--- a/tests/gnustack/bad64.asm
+++ /dev/null
@@ -1,25 +0,0 @@
-;bad64.asm: 64-bit asm source for sample elf with X on GNU_STACK
-;Copyright (C) 2011 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/>.
-
-global badness
-
-SECTION .text
-badness:
- push rbp
- mov rbp,rsp
- mov rsp,rbp
- pop rbp
- ret
diff --git a/tests/gnustack/bad-gnustack.c b/tests/gnustack/bad64.s
similarity index 61%
rename from tests/gnustack/bad-gnustack.c
rename to tests/gnustack/bad64.s
index fa7bcf5..0168921 100644
--- a/tests/gnustack/bad-gnustack.c
+++ b/tests/gnustack/bad64.s
@@ -1,6 +1,6 @@
/*
- bad-gnustack.c: C source for sample elf with X on GNU_STACK
- Copyright (C) 2011 Anthony G. Basile
+ 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
@@ -15,10 +15,23 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
-int main()
-{
- badness();
- return 0;
-}
+ .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
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-05-20 11:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-29 1:16 [gentoo-commits] proj/elfix:master commit in: /, tests/gnustack/ Anthony G. Basile
-- strict thread matches above, loose matches on Subject: below --
2013-05-20 11:41 Anthony G. Basile
2012-07-29 0:26 Anthony G. Basile
2012-07-27 21:07 Anthony G. Basile
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox