[Wisp-cvs] wisp/users/dig elf.py,1.23,1.24 makehello.py,1.22,1.23
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-04-13 23:41:00
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv12932 Modified Files: elf.py makehello.py Log Message: declare relocatable files to be of type ET.REL Index: elf.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/elf.py,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- elf.py 13 Apr 2003 10:37:40 -0000 1.23 +++ elf.py 13 Apr 2003 23:40:56 -0000 1.24 @@ -487,7 +487,10 @@ binary = Linkie('<') memory_boundary = memory_bottom # must be at page boundary binary.paste(0, make_ELF32_header('<')) - binary.place_symbol('#elf/type', ET.EXEC) + if want_relocatable: + binary.place_symbol('#elf/type', ET.REL) + else: + binary.place_symbol('#elf/type', ET.EXEC) binary.place_symbol('#elf/machine', EM.I386) binary.place_symbol('#elf/flags', 0) # no flags for ia386 Index: makehello.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/makehello.py,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- makehello.py 13 Apr 2003 08:47:50 -0000 1.22 +++ makehello.py 13 Apr 2003 23:40:56 -0000 1.23 @@ -39,3 +39,11 @@ f = open('hellowosym', 'w') hellowosym.get_file().tofile(f) f.close() + +print 'Relocatable' +hellorel = make_ELF32_object(text = code, data = data, flags = 'rs') +hellorel.dump() + +f = open('hellorel.o', 'w') +hellorel.get_file().tofile(f) +f.close() |