[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#91512: marked as done (problem with atexit and shared libraries)



Your message dated Wed, 28 Mar 2001 22:24:37 +0200 (MEST)
with message-id <15042.18399.830758.140486@bolero>
and subject line fixed in gcc-2.95-2.95.3-9
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Darren Benham
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 26 Mar 2001 07:43:43 +0000
>From rsch@experteam.de Mon Mar 26 01:43:43 2001
Return-path: <rsch@experteam.de>
Received: from www1.experteam.de [195.138.53.252] 
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 14hRfD-0006tw-00; Mon, 26 Mar 2001 01:43:43 -0600
Received: from m-kombi.ExperTeam.de (m-kombi.experteam.de [192.168.5.1])
	by www1.ExperTeam.de (8.9.1/8.9.3) with SMTP id JAA10103
	for <submit@bugs.debian.org>; Mon, 26 Mar 2001 09:43:03 +0200
Received: from ExperTeam.de ([192.168.5.52]) by m-kombi.ExperTeam.de (Lotus SMTP MTA v4.6.2  (693.3 8-11-1998)) with SMTP id 41256A1B.002FDAAA; Mon, 26 Mar 2001 09:42:41 +0100
Sender: rsch@ExperTeam.de
Message-ID: <3ABEEBD1.4C5DFA00@ExperTeam.de>
Date: Mon, 26 Mar 2001 09:12:17 +0200
From: Roderich Schupp <rsch@ExperTeam.de>
Organization: ExperTeam AG
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.3-pre7+nfsdops i586)
X-Accept-Language: en
MIME-Version: 1.0
To: submit@bugs.debian.org
Subject: problem with atexit and shared libraries
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Delivered-To: submit@bugs.debian.org

Package: libc6
Version: 2.2.2-4

There is problem with atexit (which got moved from libc.so.6 to
libc_nonshared.a
in 2.2.2-2): when a shared library references atexit and another shared
library
depends on the first, linking against the latter fails 
with "undefined reference to `atexit'". See below for a minimal example.

This scenario is very common (e.g. libpng depends on libz which
references atexit,
linking with libpng only fails). This used to work with libc6 2.2.2-1.
However, the bug may be in binutils? Relevant versions:

ii  libc6          2.2.2-4        GNU C Library: Shared libraries and
Timezone
ii  libc6-dev      2.2.2-4        GNU C Library: Development Libraries
and Hea
ii  binutils       2.11.90.0.1-1  The GNU assembler, linker and binary
utiliti
ii  gcc-2.95       2.95.3-8       The GNU C compiler.

Cheers, Roderich


$ cat fubar.c
extern void bar(void);
int main(int argc, char **argv)
{
    bar();
}


$ cat bar.c
extern void foo(void);
void bar()
{
    foo();
}


$ cat foo.c
#include <stdio.h>
static FILE* f;
void foo()
{
    f = fopen("foo", "r");	/* fopen causes reference to atexit */
}


$  cat Makefile 
fubar: fubar.o libbar.so
        LD_LIBRARY_PATH=$(CURDIR) $(CC) -o fubar fubar.o -L. -lbar
	# link against libbar only
libbar.so: bar.o libfoo.so
        $(CC) -shared -o libbar.so bar.o -L. -lfoo -lc
	# libbar depends on libfoo
libfoo.so: foo.o
        $(CC) -shared -o libfoo.so foo.o -lc


$ make
gcc    -c -o fubar.o fubar.c
gcc    -c -o bar.o bar.c
gcc    -c -o foo.o foo.c
gcc -shared -o libfoo.so foo.o -lc
gcc -shared -o libbar.so bar.o -L. -lfoo -lc
LD_LIBRARY_PATH=/tmp/fubar gcc -o fubar fubar.o -L. -lbar
/tmp/fubar/libfoo.so: undefined reference to `atexit'
collect2: ld returned 1 exit status
make: *** [fubar] Error 1


$ nm -p libfoo.so
00000690 t gcc2_compiled.
00000690 t call_gmon_start
000006c0 t gcc2_compiled.
00001844 d p.3
00001858 ? __DTOR_LIST__
00001848 d completed.4
000006c0 t __do_global_dtors_aux
0000184c ? __EH_FRAME_BEGIN__
00000728 t fini_dummy
0000192c b object.11
00000740 t frame_dummy
00000778 t init_dummy
0000184c d force_to_data
00001850 ? __CTOR_LIST__
000007c0 t gcc2_compiled.
000007c0 t __do_global_ctors_aux
00001854 ? __CTOR_END__
000007f4 t init_dummy
0000184c d force_to_data
0000185c ? __DTOR_END__
0000184c ? __FRAME_END__
00000820 t gcc2_compiled.
00000790 t gcc2_compiled.
00001944 b f
0000188c A _DYNAMIC
         w __register_frame_info@@GLIBC_2.0
00000620 ? _init
         U ___brk_addr@@GLIBC_2.0
         w __deregister_frame_info@@GLIBC_2.0
0000192c A __bss_start
         U __environ@@GLIBC_2.0
00000820 ? _fini
         U atexit				<---
         U __curbrk@@GLIBC_2.0
00000790 T foo
0000192c A _edata
00001860 A _GLOBAL_OFFSET_TABLE_
00001948 A _end
         U fopen@@GLIBC_2.1
         w __gmon_start__

---------------------------------------
Received: (at 91512-done) by bugs.debian.org; 28 Mar 2001 20:31:23 +0000
>From doko@cs.tu-berlin.de Wed Mar 28 14:31:24 2001
Return-path: <doko@cs.tu-berlin.de>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 14iMbD-0002YF-00; Wed, 28 Mar 2001 14:31:23 -0600
Received: from bolero.cs.tu-berlin.de (doko@bolero.cs.tu-berlin.de [130.149.19.1])
	by mail.cs.tu-berlin.de (8.9.3/8.9.3) with ESMTP id WAA29107;
	Wed, 28 Mar 2001 22:24:38 +0200 (MET DST)
Received: (from doko@localhost)
	by bolero.cs.tu-berlin.de (8.9.3+Sun/8.9.3) id WAA15023;
	Wed, 28 Mar 2001 22:24:37 +0200 (MEST)
From: Matthias Klose <doko@cs.tu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Date: Wed, 28 Mar 2001 22:24:37 +0200 (MEST)
To: 91512-done@bugs.debian.org, 90370-done@bugs.debian.org
Subject: fixed in gcc-2.95-2.95.3-9
X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs  Lucid
Message-ID: <15042.18399.830758.140486@bolero>
Delivered-To: 91512-done@bugs.debian.org

fixed in gcc-2.95-2.95.3-9



Reply to: