Article View: comp.sys.atari.st
Article #37010bug in gcc V1.34 crt0.s -- fix included
From: Jwahar R. Bammi
Date: Fri, 10 Mar 1989 21:10
Date: Fri, 10 Mar 1989 21:10
46 lines
2093 bytes
2093 bytes
Thanks to eric smith who reported the following serious bug in
gcc V1.34 startup file (crt0.s):
i had tried to include a redirection for stderr to console, so that
gcc applications would not need a wrapper shell to run in by doing
a
Fforce(2,(short)Fdup(1))
in crt0.s. This works fine, until you try to redirect stdout from
a shell (like gulam)
a.out > foo
what happens is that stdout and stderr end up in foo (another exotic TOS
bug -- is this fixed in tos 1.4??)
Now if you try to run this program a second time:
- i get error code -61
- eric smith reported that some files got trashed
so depending on your setup, i suspect one of the two will happen.
Please apply the patch enclosed below that backs out these changes, and
recompile and install crt0.o in $GNULIB. Hopefully we will come up
with a better scheme for stderr soon:
--
*** crt0.s~ Fri Mar 10 16:00:34 1989
--- crt0.s Fri Mar 10 16:01:00 1989
***************
*** 146,162 ****
| movw d3, sp@- | push argc
movel d3,sp@- | .. jrd
- movw #1, sp@- | set up stderr ++jrb
- movw #0x45,sp@- | Fforce(2,(int)Fdup(1))
- trap #1
- movw d0,sp@-
- movw #2,sp@-
- movw #0x46,sp@- | Fforce
- trap #1
- lea sp@(10),sp | adjust stack
-
- subl a6, a6 | clear link reg - why I don't know
-
| here we set up a trap handler for address errors - this is used in
| doing long branches and long bsrs (see comments in Leat()).
--- 146,151 ----
usenet: {decvax,sun}!cwjcc!dsrgsun!bammi jwahar r. bammi
csnet: bammi@dsrgsun.ces.CWRU.edu
arpa: bammi@dsrgsun.ces.CWRU.edu
compuServe: 71515,155
Technical Details
Message-ID:
<579@cwjcc.CWRU.Edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!cwjcc!bammi@dsrgsun.ces.cwru.eduShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!cwjcc!bammi@dsrgsun.ces.cwru.edu From: bammi@dsrgsun.ces.cwru.edu (Jwahar R. Bammi) Newsgroups: comp.sys.atari.st Subject: bug in gcc V1.34 crt0.s -- fix included Keywords: bug gcc V1.34 C Gnu Message-ID: <579@cwjcc.CWRU.Edu> Date: 10 Mar 89 21:10:57 GMT Sender: news@cwjcc.CWRU.Edu Reply-To: bammi@dsrgsun.ces.cwru.edu (Jwahar R. Bammi) Organization: Case Western Reserve University Lines: 46