🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Masahiro SEKIGUCHI Fri, 11 Sep 1992 07:16
binutils 2.0, ld, item count in DTOR_LIST
#811
Author: Masahiro SEKIGUCHI
Date: Fri, 11 Sep 1992 07:16
58 lines
1495 bytes
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,
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads