|
From: <sv...@va...> - 2008-04-16 18:19:41
|
Author: bart
Date: 2008-04-16 19:19:45 +0100 (Wed, 16 Apr 2008)
New Revision: 7883
Log:
Replaced -nostdlib by -nodefaultlibs such that constructors are executed at shared library load time. Replaced _init() function in drd_pthread_intercepts.c by a function with a constructor attribute in order to increase portability.
Modified:
trunk/Makefile.flags.am
trunk/exp-drd/drd_pthread_intercepts.c
Modified: trunk/Makefile.flags.am
===================================================================
--- trunk/Makefile.flags.am 2008-04-16 18:17:12 UTC (rev 7882)
+++ trunk/Makefile.flags.am 2008-04-16 18:19:45 UTC (rev 7883)
@@ -64,8 +64,8 @@
# Baseline link flags for making dynamic shared objects.
#
-PRELOAD_LDFLAGS_COMMON_LINUX = -nostdlib -shared -Wl,-z,interpose,-z,initfirst
-PRELOAD_LDFLAGS_COMMON_AIX5 = -nostdlib -shared -Wl,-G -Wl,-bnogc
+PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst
+PRELOAD_LDFLAGS_COMMON_AIX5 = -nodefaultlibs -shared -Wl,-G -Wl,-bnogc
PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@
PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@
Modified: trunk/exp-drd/drd_pthread_intercepts.c
===================================================================
--- trunk/exp-drd/drd_pthread_intercepts.c 2008-04-16 18:17:12 UTC (rev 7882)
+++ trunk/exp-drd/drd_pthread_intercepts.c 2008-04-16 18:19:45 UTC (rev 7883)
@@ -83,7 +83,7 @@
/* Function declarations. */
-void _init(void);
+static void init(void) __attribute__((constructor));
static void check_threading_library(void);
static void vg_set_main_thread_state(void);
@@ -94,7 +94,7 @@
* after dlopen() has loaded the shared library. This function must not
* be declared static.
*/
-void _init(void)
+static void init(void)
{
check_threading_library();
vg_set_main_thread_state();
|