home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.utils.bug
- Path: sparky!uunet!cis.ohio-state.edu!sysrap.CS.fujitsu.co.JP!seki
- From: seki@sysrap.CS.fujitsu.co.JP (Masahiro SEKIGUCHI)
- Subject: binutils 2.0, ld, item count in DTOR_LIST
- Message-ID: <9209110716.AA00468@seki.sysrap.cs.fujitsu.co.jp>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Fri, 11 Sep 1992 07:16:12 GMT
- Approved: bug-gnu-utils@prep.ai.mit.edu
- Lines: 59
-
- Dear binutils maintainers,
-
- I guess ld in binutils 2.0 puts a wrong item count in DTOR_LIST. It makes
- __do_global_dtors() in libgcc2.c (in gcc 2.2.2 distribution) fail to work.
-
- Environment:
-
- SunOS 4.0.3
- binutils 2.0 (configure sun3)
- gcc 2.2.2 (configure sun3 --with-gnu-as --with-gnu-ld)
- gas 1.38.1
- libg++ 2.2
-
- Test case:
-
- The following program, ctor.cc, runs properly in the above
- environment with binutils 1.9. With binutils 2.0, the
- destructor is not called.
-
- ctor.cc:
-
- #include <stdlib.h>
- #include <stdio.h>
-
- class Foo
- {
- public:
- Foo () { printf( "init\n" ); }
- ~Foo () { printf( "exit\n" ); }
- };
-
- Foo foo;
-
- main ()
- {
- printf( "running...\n" );
- exit( 0 );
- }
-
- log (with binutils 2.0):
-
- % gcc ctor.cc
- % a.out
- init
- running...
- % gdb a.out
-
- ... abridged ...
-
- (gdb) x/x __DTOR_LIST__
- 0x208a8 <__CTOR_LIST__$e>: 0x00000000 <= this should be 1
- (gdb)
- 0x208ac <__DTOR_LIST__+4>: 0x00002342
- (gdb)
- 0x208b0 <__DTOR_LIST__+8>: 0x00000000
- (gdb)
-
- Regards,
-
-