[Wisp-cvs] wisp/users/dig linkie.py,1.26,1.27 make-pe-exe.py,1.4,1.5 makehello.py,1.23,1.24 tran.py,
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-14 21:59:29
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv27914 Modified Files: linkie.py make-pe-exe.py makehello.py tran.py Log Message: made Linkie.get_file refuse emitting unlinked executables unless explicitly forced Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- linkie.py 14 Apr 2003 21:46:42 -0000 1.26 +++ linkie.py 14 Apr 2003 21:59:24 -0000 1.27 @@ -202,11 +202,12 @@ this._symbols[i] = symbol, value + delta this._origin_secondary = origin - def get_file (this): + def get_file (this, force = 0): """get_file() -> array of chars Returns a copy of the file image of the linkie. See also get_memory.""" - if this._unresolved_locals: raise 'Incomplete linkie', this + if this._unresolved_locals: raise 'incomplete linkie', this + if this._linker_notes and not force: raise 'unlinked linkie', this return this._binary[:] def get_memory (this): """get_memory() -> array of chars Index: make-pe-exe.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/make-pe-exe.py,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- make-pe-exe.py 14 Apr 2003 21:47:06 -0000 1.4 +++ make-pe-exe.py 14 Apr 2003 21:59:25 -0000 1.5 @@ -210,4 +210,4 @@ e.paste(None, make_pe_aout_header()) e.link() e.dump() -e.get_file().tofile(open('pehello.exe', 'w')) +e.get_file(force = 1).tofile(open('pehello.exe', 'w')) Index: makehello.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/makehello.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- makehello.py 13 Apr 2003 23:40:56 -0000 1.23 +++ makehello.py 14 Apr 2003 21:59:25 -0000 1.24 @@ -29,7 +29,7 @@ hello.dump() f = open('hello', 'w') -hello.get_file().tofile(f) +hello.get_file(force = 1).tofile(f) f.close() print 'Without symbols' @@ -37,7 +37,7 @@ hellowosym.dump() f = open('hellowosym', 'w') -hellowosym.get_file().tofile(f) +hellowosym.get_file(force = 1).tofile(f) f.close() print 'Relocatable' @@ -45,5 +45,5 @@ hellorel.dump() f = open('hellorel.o', 'w') -hellorel.get_file().tofile(f) +hellorel.get_file(force = 1).tofile(f) f.close() Index: tran.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/tran.py,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tran.py 14 Apr 2003 14:15:00 -0000 1.6 +++ tran.py 14 Apr 2003 21:59:25 -0000 1.7 @@ -224,7 +224,6 @@ Macrostack = [] Registers = {Generic_Register: 'reg'} # for reverse translation - def get_token (): if Macrostack: tok = Macrostack[-1][1][Macrostack[-1][0]] @@ -257,7 +256,7 @@ raise 'Regstack not empty after parsing ended', Regstack binary = elf.make_ELF32_object(text = Text, data = Data, flags = 's') f = open(output_name, 'w') - binary.get_file().tofile(f) + binary.get_file(force = 1).tofile(f) f.close() main() |