|
From: Dirk M. <dm...@gm...> - 2005-11-08 02:26:38
|
Hi,
it seems valgrind 3.1 cannot deal anymore with executable stack requirement.
testcase:
=== libtest.c ===
void foo()
{
__asm__("\n"
".section .note.GNU-stack,\"x\",@progbits\n"
".previous\n"
);
}
=== libtest.c ===
=== test.c ===
#include <stdio.h>
extern void foo();
int main()
{
foo();
printf("hello world\n");
return 0;
}
=== test.c ===
gcc -shared -o libtest.so libtest.c
gcc -o test test.c -L. -ltest
LD_LIBRARY_PATH=. valgrind --trace-syscalls=yes ./test
gives:
SYSCALL[671,1](125) sys_mprotect ( 0xBEE5C000, 4096, 16777223 )[sync] -->
Failure(0x16)
SYSCALL[671,1]( 6) sys_close ( 3 )[sync] --> Success(0x0)
SYSCALL[671,1](146) sys_writev ( 2, 0xBEE5C3B8, 10 ) --> [async] ...
./test: error while loading shared libraries: libtest.so: cannot enable
executable stack as shared object requires: Invalid argument
Any idea what could be wrong? looks like the actual mprotect fails with a very
weird way.
Dirk
|