From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1643 Path: news.gmane.org!not-for-mail From: musl Newsgroups: gmane.linux.lib.musl.general Subject: ldso: dlclose. Date: Sun, 19 Aug 2012 18:26:45 +0200 Message-ID: <503113C5.5010206@gmail.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345393623 22116 80.91.229.3 (19 Aug 2012 16:27:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Aug 2012 16:27:03 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1644-gllmg-musl=m.gmane.org@lists.openwall.com Sun Aug 19 18:27:03 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1T38L7-0006Dv-9A for gllmg-musl@plane.gmane.org; Sun, 19 Aug 2012 18:27:01 +0200 Original-Received: (qmail 21563 invoked by uid 550); 19 Aug 2012 16:26:59 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21555 invoked from network); 19 Aug 2012 16:26:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=cqc1x7eOZSF5uBzNQOO3EVcgzMVCshGT/luvbA6eLN8=; b=tp8DjdQ1nIu0SDq+P+OaxEr1/vMbOUQKijiS/MYA002+k4gNb2gLKDsCfi84Bli643 qKr0BAjz8RCk+7OIIbyOisl849txpfh30qCcaZ7ggfTulP5Appt9P3hM7cyFd/1+SxUq PUdGaRzkJs1DElJQjg9EZpEQkXN/nsONHQKgM/PvkJ0IgoUQPen3RKqDLgpDV+cQV0Ug ITTokCfWvB9/2kV2SZl0zw7Bp1tuVesam2QACEI4yP0NVkAUcePDczafUb1h84l+nVkq Yschcry2kqweZeAu9vXaQXIwDCiQhBKRd5aO8Y93sBqdn4Dl2S6l9AoQootFC37HKIVg QgQQ== User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 Xref: news.gmane.org gmane.linux.lib.musl.general:1643 Archived-At: Hi, I noticed that the dlclose function is not implemented (always return 0). It might be a problem in my case cause I use dlfuncs to implement a plugin system and when I unload a plugin, the memory is not released. Do you plan to implement this function ? I can work on this but it seems that __cxa_finalize is not implemented either and the 'struct fl' (atexit.c) does not contain any dso field. Do you have some concern about how this should be done. BTW I think there is a bug in the '__funcs_on_exit' (atexit.c) : only the first non null function of each function pool is called. Something like this should do the trick. void __funcs_on_exit() { int i; void (*func)(void *), *arg; LOCK(lock); for (; head; head=head->next) { for (i=COUNT-1; i>=0 && !head->f[i]; i--); if (i<0) continue; for (; i>=0; i--) { func = head->f[i]; arg = head->a[i]; head->f[i] = 0; UNLOCK(lock); func(arg); LOCK(lock); } } } Regards, Boris