Linux PARISC architecture development
 help / color / mirror / Atom feed
* [parisc-linux] gcc (g++) problem
@ 2002-02-26  3:53 Jeremy Drake
  2002-02-26  4:25 ` John David Anglin
  0 siblings, 1 reply; 5+ messages in thread
From: Jeremy Drake @ 2002-02-26  3:53 UTC (permalink / raw)
  To: parisc-linux

As you may remember from my last question, I'm having some problems
building some code on parisc-linux.  I have been able to reproduce the
problem using a more simple program.

Here's the problem.  This program segfaults when compiled with -fPIC, as
required to build a .so.  It is fine when compiled without -fPIC.  It is
also fine on intel platform with both.  Is there something wrong with the
code that I'm not seeing, or is this a compiler bug?  I have tried this
with gcc-3 on an intel box, and it is fine, so I assume it is this port?

Thanks for your help...

g++ -g -o test -fPIC test.cpp

---- test.cpp ----
#include <stdio.h>

class Foo
{
public:
	Foo(const char * const blah);
	unsigned char* text;
};
Foo::Foo(const char * const blah)
{
	text=(unsigned char *)blah;
}

const Foo test("Blah");
int main()
{
	printf("%s\n", test.text);
	return 0;
}



-- 
Advertisements contain the only truths to be relied on in a newspaper.
		-- Thomas Jefferson

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-27  0:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-26  3:53 [parisc-linux] gcc (g++) problem Jeremy Drake
2002-02-26  4:25 ` John David Anglin
2002-02-26  4:38   ` Randolph Chung
2002-02-26 16:20     ` John David Anglin
2002-02-27  0:13   ` Jeremy Drake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox