Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!apple!agate!ucbvax!ucsd!sdd.hp.com!spool.mu.edu!uunet!mcsun!ukc!edcastle!aipna!ermine!awb From: awb@ermine.ed.ac.uk (Alan W Black) Newsgroups: comp.os.minix Subject: Re: Unified MINIX GNU port -- a.out and fix Message-ID: <1991Jan31.092848@ermine.ed.ac.uk> Date: 31 Jan 91 09:28:48 GMT References: <43079@nigel.ee.udel.edu> <1991Jan29.234455.10126@jarvis.csri.toronto.edu> Sender: news@aipna.ed.ac.uk Reply-To: awb@ermine.ed.ac.uk (Alan W Black) Organization: Dept of AI, University of Edinburgh, Scotland Lines: 181 In article <1991Jan29.234455.10126@jarvis.csri.toronto.edu>, wayne@csri.toronto.edu (Wayne Hayes) writes: # In article <43079@nigel.ee.udel.edu> HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) writes: # >My question, would it be tolerable to use the originial GNU a.out format and # >design a conversion program that converts GNU binaries to MINIX binaries # # Sorry to disappoint you, but this has already been done. I've forgotten # where I got it, but I have gcc up and running on my Minix-386 box, and # it produces a non-Minix a.out which is converted to Minix via a program # called, oddly enough, 'gcc2minix'. It works fine when you put a nice # front end shell script onto it that calls gcc and then gcc2minix. # # -- # "Dad, what should I be when I grow up?" # "Honest." -- Robert M. Pirsig, _Zen and the Art of Motorcycle Maintenence_. # # Wayne Hayes INTERNET: wayne@csri.utoronto.ca CompuServe: 72401,3525 gcc2minix is part of our (Richard Tobin and I) port of gcc. The intention was not to make changes to the GNU bin uitilities to make them convert the format to MINIX a.out format. Since then we have gone further and modified mm/exec.c to read GNU a.out format files directly thus not requiring a separate convertion process. This makes dumping for things like GNU emacs easier. and was a first step to make gdb easier (we will post a version of this port soon, if anybody is desperate to test gdb please drop me a line). The GNU a.out format does not contain a memory size field (changed by chmem in MINIX a.out files). We have solved this by extending the GNU header to include a new field. A header is checked and if a secondary magic number exists the memsize is read from the new field, if no magic number exists then a default of 65k is taken. This means the a simple gcc -o hw hw.c will produce an executable (for small files) which makes using gcc for small programs used in building larger ones possible without modify many places in a makefile. This is for Minix 386 and not for the 68k gcc port. the 68k stuff contains relocation information which does make the conversion harder but I have exchanged mail with someone who is trying to do extend my changes so that mm recognises 68k a.out format too. Enclosed here are the patches to mm/exec.c and chmem.c as well as patches for file.c though Andrew Martin's recent post of file.c include our file.c changes. Alan Alan W Black 80 South Bridge, Edinburgh, UK Dept of Artificial Intelligence tel: (+44) -31 650 2713 University of Edinburgh email: awb@ed.ac.uk ------- begin 644 gnutoo.tar.Z M'YV09]S4H?/FS0L "!,J7,BPH<.'$"-*G(@0AL4;-6J ##A@P;-#1RM&AQ MQD88$6'0N$$CA@R7,6*"@!&CHPV3 &I0W,FSI\^? .K,H1-&3L(P=\0 ?3@G MSYRE#DG"/$ER1HR-4+-JW.&0HD:18A4J=>F3Q]KWLRY M,V<5H$&0-8O6Q1LY:_#AXF/@ "%< MN(+G(%3 9P^"3ADV;$"L*2/'S7T088CQQD @%(%%$4.\]]QW\,GW'!5HE '" M&VZPD8=H;M AQX5PO)%&AB"D,0<(9+SQQ6AG*;#"@BHN"%\3;ZAE1AIED %" M@ENMLE-DT<04\]&P;KC*4B'%%$EH4<1S-OQ[KZM$#%SP MP2#EN&&S)*^]RI("3A!+9,?.&7 M$$E0,06<]H* =]/=P-NAZ.%PPW@YK.1'UH?+B& M"\2W"3L;%)X!@AAUF+%%S5)P_/ +] M\LP[KW'T-U-O/?;:G_]]^.,SO=:;\\DN11E$ R^A[7:2 X"8%K@(,H-9439 \%Z MSC<'P)7I2OAYPQWFH ,_K+.W)*%Q'"A*=:'+*YICAM;$P;*E>$,;5@:'5H(@CN@X0UIH]S[YB!" M,L&12FFPP]+ZAD 1A!V\<&D@V D(QK9B" 8L,]+0G/H>@3XL^IP^B M$:6$1@J"DL9./M[\) 7AJ,L4VO$(M+.D $/6(INNI9L?!"<9 (<"%(P!#46) M3PK2EX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