NetBSD Problem Report #37454
From yamt@mwd.biglobe.ne.jp Fri Nov 30 11:11:11 2007
Return-Path: <yamt@mwd.biglobe.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 9490963B8D8
for <gnats-bugs@gnats.NetBSD.org>; Fri, 30 Nov 2007 11:11:11 +0000 (UTC)
Message-Id: <20071130111109.0E1E611702@yamt.dyndns.org>
Date: Fri, 30 Nov 2007 20:11:09 +0900 (JST)
From: yamt@mwd.biglobe.ne.jp
Reply-To: yamt@mwd.biglobe.ne.jp
To: gnats-bugs@NetBSD.org
Subject: __libc_init is not called for static binaries
X-Send-Pr-Version: 3.95
>Number: 37454
>Category: lib
>Synopsis: __libc_init is not called for static binaries
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: joerg
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Nov 30 11:15:01 +0000 2007
>Closed-Date: Sun Jul 18 00:09:34 +0000 2010
>Last-Modified: Sun Jul 18 00:09:34 +0000 2010
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 4.99.38
>Organization:
>Environment:
System: NetBSD 4.99.38
Architecture: i386
Machine: i386
>Description:
static link doesn't pull initfini.o and its .ctors section.
>How-To-Repeat:
statically link an application which uses pthread.
>Fix:
move libc constructors to their own modules (ssp, thread-stub) ?
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: lib-bug-people->joerg
Responsible-Changed-By: joerg@NetBSD.org
Responsible-Changed-When: Fri, 25 Jun 2010 13:55:17 +0000
Responsible-Changed-Why:
Working on it.
From: Joerg Sonnenberger <joerg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/37454 CVS commit: src/lib/libc
Date: Mon, 28 Jun 2010 21:58:02 +0000
Module Name: src
Committed By: joerg
Date: Mon Jun 28 21:58:02 UTC 2010
Modified Files:
src/lib/libc/misc: initfini.c
src/lib/libc/stdlib: exit.c
Log Message:
Ensure that initfini.c is referenced by exit.c. The start up code has to
reference the latter as a return of main() results in a call to exit(3),
so this ensures that the libc constructors are run for statically linked
programs. Fixes PR 37454.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/misc/initfini.c
cvs rdiff -u -r1.11 -r1.12 src/lib/libc/stdlib/exit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Jeff Rizzo <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/37454 CVS commit: [netbsd-5] src/lib/libc
Date: Fri, 16 Jul 2010 18:34:08 +0000
Module Name: src
Committed By: riz
Date: Fri Jul 16 18:34:08 UTC 2010
Modified Files:
src/lib/libc/misc [netbsd-5]: initfini.c
src/lib/libc/stdlib [netbsd-5]: exit.c
Log Message:
Pull up following revision(s) (requested by joerg in ticket #1423):
lib/libc/stdlib/exit.c: revision 1.12
lib/libc/misc/initfini.c: revision 1.6
Ensure that initfini.c is referenced by exit.c. The start up code has to
reference the latter as a return of main() results in a call to exit(3),
so this ensures that the libc constructors are run for statically linked
programs. Fixes PR 37454.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.6.1 src/lib/libc/misc/initfini.c
cvs rdiff -u -r1.11 -r1.11.12.1 src/lib/libc/stdlib/exit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 18 Jul 2010 00:09:34 +0000
State-Changed-Why:
fixed and pulled up to -5; thanks everyoen
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.