Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!mcvax!jclark!jjc From: mcvax!jclark!jjc@UUNET.UU.NET (James Clark) Newsgroups: gnu.g++.bug Subject: g++ 1.34.0 sparc bug Message-ID: <8903121149.AA04023@jclark.uucp> Date: 12 Mar 89 11:49:09 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 32 I have looked further at the bug I reported to you earlier today (with g++ 1.34.0 on the SPARC). It turns out to be a problem with ld++ If you compile and run the following, you'll see the problem. static double x; main() { x = 1.0; } What happens is that the bss segment ends up being aligned on a 4-byte boundary, which causes the program to generate a bus error on execution. The following diff seems to fix this problem: *** ld.c.distrib Sat Feb 25 21:41:56 1989 --- ld.c Sun Mar 12 11:37:27 1989 *************** *** 2189,2194 **** --- 2189,2195 ---- outheader.a_text += N_ADDRADJ (outheader); #endif + data_size = (data_size + sizeof(double) - 1) & ~(sizeof(double)-1); /* Make the data segment address start in memory on a suitable boundary. */ data_start = N_DATADDR (outheader) + text_start - N_TXTADDR (outheader); I don't really understand ld too well, so this may not be a good fix, but it seems to work for me.