Subject: Re: Strange segmentation fault trying to run postgresql on current
To: Markus W Kilbinger <mk@kilbi.de>
From: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
List: port-cobalt
Date: 05/01/2007 11:36:56
On Tue, 1 May 2007, Markus W Kilbinger wrote:

> After reading
>
>  http://gcc.gnu.org/install/specific.html#mips-x-x

   I looked at that, but didn't see anything relating to the problem.

> I tried to link the problematic (crashing) postgres binary directly
> from the *.o files to circumvent the SUBSYS.o dance and I've got a
> working postgres binary and finally working postgres82-server package!
> :-)

   I was looking through ld options relating to common, and found -d which 
says it assigns space to common symbols even if a relocatable object file 
was specified.  The description didn't quite sound like it would affect 
the alignment problem, but I tested it on my simple test case, and found 
that it changed the alignment of the .sbss section from 1 to 4 in the 
resulting object file.  I modified by build of postgresql82-server to 
include -d when creating the relocatable object files, and I think it may 
have cured the problem:

$ nm work/post*/src/backend/postgres|grep progname
008740c0 D __progname
00797714 T get_progname
00888efc S progname
^^^^^^^^
        Yay!

> Is there an easy way to use more actual GNU binutils versions under
> NetBSD to verify that these version solve the problem?

   I was going to see if I have an older installation on a disk someplace 
to check this, but I'm not sure when I will get around to doing that.

> Does it make sense to send-pr about this?

   Yes.  I'm planning on submitting a PR about this, since I have a very 
simple test case that shows it.

--
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA