Commit 008bd2c0 authored by Thiago Macieira's avatar Thiago Macieira

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
parent e216a524
......@@ -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");
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment