🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Hongjiu Lu Mon, 10 Jun 1991 05:04
Ld Got Bus Error When Building G++ 1.39.1 and Libg++ 1.39.0 ONAT386 Running AT&T SVR3.2.2
#554
Author: Hongjiu Lu
Date: Mon, 10 Jun 1991 05:04
33 lines
2013 bytes
In my previous article I sent, I forgot mentioning the machine I am 
trying to build g++ 1.39.1 and libg++ 1.39.0 on, which is an AT386 and
running AT&T UNIX System V/386 Release 3.2.2. I am using the native
assembler and linker come with the system.

I finaly managed to compile everthing. After playing around for
serveral days I finally passed all the tests of libg++. Also it works
fine now, I still have somethngs I don't understand.

It seems that the output of ld -r cannot be used with the later ld run
everytime. Some of them will produce the error message "Bus error - core
dumped" during the final ld run to create the executable file. Here is
the example of a ld run.

g++ -v -o tPQ tPQ.o -L. -L../src -ltest -lg++ -lm -lc_s

g++ version 1.39.1 (based on GCC 1.39)
 ld -r -o /usr/tmp/cca00467.R /lib/crt1.o -L. -L../src tPQ.o -ltest -lg++ -lm -lc_s -lg++ /usr/local/lib/gcc-gnulib -lc /lib/crtn.o
 /usr/local/lib/gcc-collect -o /usr/tmp/cca00467.s /usr/tmp/cca00467.R
 as /usr/tmp/cca00467.s -o /usr/tmp/cca00467.O
 ld -o ttt /usr/tmp/cca00467.R /usr/tmp/cca00467.O
g++: Program ld got fatal signal 10.

I was wondering under what condition ld will cause the bus error when
doing a 
	ld -o xxx xxx.o xxx.o
Could anyone give me a hint? I got around this by relink everything.
But I still want to know why I have to do this.

Thanks in advance.


H.J. Lu
Re: Ld Got Bus Error When Building G++ 1.39.1 and Libg++ 1.39.0 ONAT386 Running AT&T SVR3.2.2
#637
Author: Ami A. Silberman
Date: Mon, 17 Jun 1991 20:06
56 lines
2954 bytes
hlu@yoda.eecs.wsu.edu (Hongjiu Lu) writes:

>In my previous article I sent, I forgot mentioning the machine I am 
>trying to build g++ 1.39.1 and libg++ 1.39.0 on, which is an AT386 and
>running AT&T UNIX System V/386 Release 3.2.2. I am using the native
>assembler and linker come with the system.

>I finaly managed to compile everthing. After playing around for
>serveral days I finally passed all the tests of libg++. Also it works
>fine now, I still have somethngs I don't understand.

>It seems that the output of ld -r cannot be used with the later ld run
>everytime. Some of them will produce the error message "Bus error - core
>dumped" during the final ld run to create the executable file. Here is
>the example of a ld run.

>g++ -v -o tPQ tPQ.o -L. -L../src -ltest -lg++ -lm -lc_s

>g++ version 1.39.1 (based on GCC 1.39)
> ld -r -o /usr/tmp/cca00467.R /lib/crt1.o -L. -L../src tPQ.o -ltest -lg++ -lm -lc_s -lg++ /usr/local/lib/gcc-gnulib -lc /lib/crtn.o
> /usr/local/lib/gcc-collect -o /usr/tmp/cca00467.s /usr/tmp/cca00467.R
> as /usr/tmp/cca00467.s -o /usr/tmp/cca00467.O
> ld -o ttt /usr/tmp/cca00467.R /usr/tmp/cca00467.O
>g++: Program ld got fatal signal 10.

>I was wondering under what condition ld will cause the bus error when
>doing a 
>	ld -o xxx xxx.o xxx.o
>Could anyone give me a hint? I got around this by relink everything.
>But I still want to know why I have to do this.

>Thanks in advance.


>H.J. Lu
 
What probably happened was that, due to a bug in your native C compiler,
lines 530-about 532 of expr.c in the gnu assembler code were miscompiled.
the lines read:

	"if (expressionP -> X_subtract_symbol == expressionP ->X_addsymbol
	|| (expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag

and the next line is similar.  If expressionP->X_subtract_symbol == 0,
and expressionP->X_addsymbol != 0, then there will be an attempted
access down a nul pointer and a resulting bus error, signal 10.

The fix is to add the following two lines before the above expression

	if (expressionP-> X_subtract_symbol == NULL) {break;}
        if (expressionP-> X_add_symbol == NULL) {break;}

I found that this works fine.
-- 
ami silberman - janitor of lunacy
	silber@cs.uiuc.edu
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