Article View: rec.games.programmer
Article #2257Re: Writing code at run-time
From: Junaid A. Walker
Date: Tue, 07 Jun 1994 06:15
Date: Tue, 07 Jun 1994 06:15
21 lines
2660 bytes
2660 bytes
Alan Cox (iiitac@uk.ac.swan.pyr) wrote: : In article <2suogv$s60@harbinger.cc.monash.edu.au> junaid@barney.eng.monash.edu.au (Junaid A. Walker) writes: : >***Linux: : > : >1) malloc the required # bytes : >2) use mmap() to create a executable segment mapping of 1) : >3) store a pointer to 1) in a function pointer, and invoke pointed to : > function (making sure function passing prolog is included in code). : > OR use a bit of inline assembler to make a direct call to register : > loaded with pointer in 1) : 1) will not work the way you want - you can't go off writing self modifying : code or you'll get attacked by cache problems - especially on the newer chips. : 2) ought to work - thats how Linux shared libraries are bound. : Writing code to do custom gif rendering is quite a neat concept. I'm not sure : how much it will save you but I don't see why you can't compile the executable : of the gif renderer into the program, or dynamically link it either at run time : as a shared library (which uses mmap()) or using the GNU dynamic linker : Alan
Technical Details
Message-ID:
<2t13ao$m1r@harbinger.cc.monash.edu.au>Path:
arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!sunic!trane.uninett.no!ifi.uio.no!wabbit.cc.uow.edu.au!metro!inferno.mpx.com.au!news.cs.su.oz.au!harbinger.cc.monash.edu.au!barney.eng.monash.edu.au!junaidReferences:
<2suogv$s60@harbinger.cc.monash.edu.au> <1994Jun6.115625.10787@uk.ac.swan.pyr>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10f6aa,e6b2b5751c2b9056 X-Google-Attributes: gid10f6aa,public X-Google-Thread: fe306,e6b2b5751c2b9056 X-Google-Attributes: gidfe306,public X-Google-Thread: 1103af,e6b2b5751c2b9056 X-Google-Attributes: gid1103af,public X-Google-Thread: 102bfa,e6b2b5751c2b9056 X-Google-Attributes: gid102bfa,public X-Google-Thread: f9382,e6b2b5751c2b9056 X-Google-Attributes: gidf9382,public X-Google-Thread: 102983,e6b2b5751c2b9056 X-Google-Attributes: gid102983,public X-Google-Thread: 10a997,e6b2b5751c2b9056 X-Google-Attributes: gid10a997,public X-Google-ArrivalTime: 1994-06-07 00:16:00 PST Path: arc1-ca.pugleaf.net!nntp.gmd.de!Germany.EU.net!EU.net!sunic!trane.uninett.no!ifi.uio.no!wabbit.cc.uow.edu.au!metro!inferno.mpx.com.au!news.cs.su.oz.au!harbinger.cc.monash.edu.au!barney.eng.monash.edu.au!junaid From: junaid@barney.eng.monash.edu.au (Junaid A. Walker) Newsgroups: rec.games.programmer,alt.uu.comp.os.linux.questions,aus.computers.linux,comp.os.linux,comp.os.linux.misc,alt.msdos.programmer,comp.os.msdos.programmer Subject: Re: Writing code at run-time Followup-To: rec.games.programmer,alt.uu.comp.os.linux.questions,aus.computers.linux,comp.os.linux,comp.os.linux.misc,alt.msdos.programmer,comp.os.msdos.programmer Date: 7 Jun 1994 06:15:52 GMT Organization: Monash University Lines: 21 Message-ID: <2t13ao$m1r@harbinger.cc.monash.edu.au> References: <2suogv$s60@harbinger.cc.monash.edu.au> <1994Jun6.115625.10787@uk.ac.swan.pyr> NNTP-Posting-Host: barney.eng.monash.edu.au X-Newsreader: TIN [version 1.2 PL1]