From owner-freebsd-hackers Wed Jun 17 13:42:46 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA02362 for freebsd-hackers-outgoing; Wed, 17 Jun 1998 13:42:46 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (daemon@smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA02356 for ; Wed, 17 Jun 1998 13:42:42 -0700 (PDT) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id NAA23888; Wed, 17 Jun 1998 13:42:28 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp03.primenet.com, id smtpd023826; Wed Jun 17 13:42:18 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id NAA27665; Wed, 17 Jun 1998 13:42:16 -0700 (MST) From: Terry Lambert Message-Id: <199806172042.NAA27665@usr01.primenet.com> Subject: Re: Problem with ld.so + LD_PRELOAD + _init() To: mikko@dynas.se Date: Wed, 17 Jun 1998 20:42:16 +0000 (GMT) Cc: freebsd-hackers@FreeBSD.ORG In-Reply-To: from "=?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?=" at Jun 17, 98 05:30:47 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Fiddling around with LD_PRELOAD and wrapping of system calls, I > discovered that the "_init()" function of the preloaded lib never gets > called. > > It is not entirely clear from the man-page that it should be, > but on Solaris 2.[56], it is. And it works for libraries linked with > the program, as well as libraries loaded with dlopen(). Also, it > sometimes makes life a lot easier... It should be called. If it is not called, pure virtual base class constructors won't be called for C++ shared objects. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message