Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Apr 1998 21:01:16 +0000
From:      Niall Smart <rotel@indigo.ie>
To:        John Polstra <jdp@polstra.com>, rotel@indigo.ie
Cc:        hackers@FreeBSD.ORG
Subject:   Re: ld: internal error: allocated set symbol space (2) doesn't match actual (6)
Message-ID:  <199804112001.VAA06760@indigo.ie>
In-Reply-To: John Polstra <jdp@polstra.com> "Re: ld: internal error: allocated set symbol space (2) doesn't match actual (6)" (Apr 11, 10:17am)

next in thread | previous in thread | raw e-mail | index | archive | help
On Apr 11, 10:17am, John Polstra wrote:
} Subject: Re: ld: internal error: allocated set symbol space (2) doesn't ma
> > FWIW here is the diff of the output of nm for a -O2 main.o and a -03
> > main.o:
> 
> Thanks.  Could I trouble you to do the same thing using "ldd -v"
> instead of "nm"?  That gives a lot more useful information.

Firstly a correction to my earlier post, I do not know if the
problem occurs with gcc 2.7.2.1 for the simple reason that it cannot
compile the code because it contains exception handling stuff that
earlier gcc's don't grok too well.  I thought I had been picking
up /usr/bin/c++ with "c++" but just noticed that I wasn't. (doh)
It does link ok egcs on other platforms though, so I still think
its a bug with the linker.

I've been working on isolating a simple test case that might be
more useful than the output from ldd -v, (though you're still
welcome to that, or the source/binaries) I've appended it to this
mail.

If you compile it with egcs-current without -DGLOBAL then all cases
work, if you compile with -DGLOBAL then it won't link for cases A
and D, it links but dumps core before main() for cases B and E and
case C works fine.

This code doesn't use exception handling so I've tried it with gcc
2.7.2.1 and it works in all cases.  This kinda points the finger
at egcs,  so if you want me to take this to egcs-bugs thats ok :)
However I would be surprised if egcs is at fault because this code
is very, very simple and it would have to be extremely brain dead
to get it wrong,  which is the opposite of my experience with egcs.

If you don't have egcs then I guess you can't compile this code
and see it break, if so give me a shout for what you need
(ldd -v, object files etc.)

Regards,

Niall




#if defined(CASE_A) || defined(CASE_C) || defined(CASE_D)
#include <iostream.h>
#endif

#if defined(CASE_B) || defined(CASE_E)
#include <stdio.h>
#endif

class C
{
public:
#if defined(CASE_A)
	C()
	{
		cout << 0 << endl;
	}
#elif defined(CASE_B)
	C()
	{
		printf("%d\n", 0);
	}
#elif defined(CASE_C)
	foo()
	{
		cout << 0 << endl;
	}
#elif defined(CASE_D)
	~C()
	{
		cout << 0 << endl;
	}
#elif defined(CASE_E)
	~C()
	{
		printf("%d\n", 0);
	}
#else
#error define one of CASE_[ABCDE] when compiling
#endif
};


#ifdef GLOBAL
C	c;
#endif


int main()
{
#ifndef GLOBAL
	C	c;
#endif
	
#ifdef CASE_C
	c.foo();
#endif
	
	return 0;
}

-- 
Niall Smart.  Microsoft Suck.  See www.freebsd.org for details.
Annoy your enemies and amaze your friends:
echo "#define if(x) if(!(x))" >> /usr/include/stdio.h

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804112001.VAA06760>