https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125058
--- Comment #4 from Mikael Pettersson <mikpelinux at gmail dot com> --- (In reply to Mikael Pettersson from comment #3) > Created attachment 65082 [details] > executable test case > > Standalone executable test case. I used the apout emulator for PDP-11 > user-mode executables, and crt0.o and libc.a from 2.11 BSD patchlevel 431. > > > pdp11-unknown-aout-gcc -O1 pr125058.c > > apout a.out > error > > echo $? > 1 > > Notes: > 1. __builtin_exit just made it exit 1 so I decided to print to stderr on > error. > 2. libc doesn't have atexit so I had to override libgcc's __main with a stub > 3. Seeing that 2BSD support was removed from gcc, I first tried with crt0.o > and libc.a from V7, but binutils doesn't like those object files. Apparently > V7 and 2BSD have different a.out flavours. After applying the proposed patch in #c2 the test program is silent and exits 0.
