Use a constructor function instead of one called _init.

This allows us to compile without -nostdlib, which is causing a lot of
issues.

Reviewed-By: hjk
This commit is contained in:
Thiago Macieira
2011-02-21 14:36:16 +01:00
parent e216a52456
commit 008bd2c043
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,9 @@
#include <sys/prctl.h>
#include <sys/types.h>
int _init(void)
int ptracepreload_init(void) __attribute__((constructor,visibility("hidden")));
int ptracepreload_init(void)
{
prctl(0x59616d61, getppid(), 0, 0, 0);
puts("eeks\n");

View File

@@ -7,8 +7,6 @@ CONFIG += shared
CONFIG -= qt
DESTDIR = $$IDE_LIBRARY_PATH
QMAKE_LFLAGS -= -Wl,--as-needed
QMAKE_LFLAGS *= -nostdlib
LIBS += -ldl -lc
SOURCES = ptracepreload.c