diff options
author | 2011-04-13 17:53:46 -0400 | |
---|---|---|
committer | 2011-04-13 17:53:46 -0400 | |
commit | 718e9dd2242be19aa342ec1e0db71a3b0fc9f1e0 (patch) | |
tree | 7d5d21f35c816cc7148646250d23863042cf72fd | |
parent | fix-gnustack.c: added needed gelf_update_phdr() (diff) | |
download | elfix-718e9dd2242be19aa342ec1e0db71a3b0fc9f1e0.tar.gz elfix-718e9dd2242be19aa342ec1e0db71a3b0fc9f1e0.tar.bz2 elfix-718e9dd2242be19aa342ec1e0db71a3b0fc9f1e0.zip |
fix-gnustack.c: removed unnecessary and harmful elf_update()
-rw-r--r-- | fix-gnustack.c | 4 | ||||
-rw-r--r-- | tests/bad.c | 2 | ||||
-rw-r--r-- | tests/test-bad.asm | 13 |
3 files changed, 6 insertions, 13 deletions
diff --git a/fix-gnustack.c b/fix-gnustack.c index cb558ba..b7e48de 100644 --- a/fix-gnustack.c +++ b/fix-gnustack.c @@ -61,10 +61,6 @@ int main( int argc, char *argv[]) phdr.p_flags = nflags ; gelf_update_phdr(elf, i, &phdr); - //if(elf_flagphdr(elf, ELF_C_SET, ELF_F_DIRTY) == 0) - // error(EXIT_FAILURE, 0, "elf_flagphdr() fail: %s", elf_errmsg(-1)); - if(elf_update(elf, ELF_C_WRITE_MMAP) < 0) - error (EXIT_FAILURE, 0, "elf_update(ELF_C_WRITE) failed: %s.", elf_errmsg(-1)); } } } diff --git a/tests/bad.c b/tests/bad.c index ea8cb2b..7999e35 100644 --- a/tests/bad.c +++ b/tests/bad.c @@ -1,7 +1,7 @@ #include <stdlib.h> -extern int badness(); +//extern int badness(); int main() { diff --git a/tests/test-bad.asm b/tests/test-bad.asm index 265fdb6..8468062 100644 --- a/tests/test-bad.asm +++ b/tests/test-bad.asm @@ -4,12 +4,9 @@ SECTION .text align 16
badness:
+ push rbp
+ mov rbp,rsp
- push RBX
- push RBP
-
- pop RBP
- pop RBX
- ret
-
-end
+ mov rsp,rbp
+ pop rbp
+ ret
|