home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / utils / bug / 1563 < prev    next >
Encoding:
Text File  |  1992-09-11  |  1.4 KB  |  72 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!sysrap.CS.fujitsu.co.JP!seki
  3. From: seki@sysrap.CS.fujitsu.co.JP (Masahiro SEKIGUCHI)
  4. Subject: binutils 2.0, ld, item count in DTOR_LIST
  5. Message-ID: <9209110716.AA00468@seki.sysrap.cs.fujitsu.co.jp>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 11 Sep 1992 07:16:12 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 59
  12.  
  13. Dear binutils maintainers,
  14.  
  15. I guess ld in binutils 2.0 puts a wrong item count in DTOR_LIST.  It makes
  16. __do_global_dtors() in libgcc2.c (in gcc 2.2.2 distribution) fail to work.
  17.  
  18. Environment:
  19.  
  20.     SunOS 4.0.3
  21.     binutils 2.0 (configure sun3)
  22.     gcc 2.2.2 (configure sun3 --with-gnu-as --with-gnu-ld)
  23.     gas 1.38.1
  24.     libg++ 2.2
  25.  
  26. Test case:
  27.  
  28.     The following program, ctor.cc, runs properly in the above
  29.     environment with binutils 1.9.  With binutils 2.0, the
  30.     destructor is not called.
  31.  
  32.     ctor.cc:
  33.  
  34.     #include <stdlib.h>
  35.     #include <stdio.h>
  36.  
  37.     class Foo
  38.     {
  39.      public:
  40.       Foo ()    { printf( "init\n" ); }
  41.       ~Foo ()    { printf( "exit\n" ); }
  42.     };
  43.  
  44.     Foo foo;
  45.  
  46.     main ()
  47.     {
  48.       printf( "running...\n" );
  49.       exit( 0 );
  50.     }
  51.  
  52.     log (with binutils 2.0):
  53.  
  54.     % gcc ctor.cc
  55.     % a.out
  56.     init
  57.     running...
  58.     % gdb a.out
  59.  
  60.         ... abridged ...
  61.  
  62.     (gdb) x/x __DTOR_LIST__
  63.     0x208a8 <__CTOR_LIST__$e>:    0x00000000    <= this should be 1
  64.     (gdb) 
  65.     0x208ac <__DTOR_LIST__+4>:    0x00002342
  66.     (gdb) 
  67.     0x208b0 <__DTOR_LIST__+8>:    0x00000000
  68.     (gdb) 
  69.  
  70. Regards,
  71.  
  72.