Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv5188
Added Files:
coff.py
Log Message:
wrote make_coff_section_header
--- NEW FILE: coff.py ---
#### coff.py - COFF object format
#
# Copyleft © 2003 by Andres Soolo (di...@us...)
# This file is licensed under the GNU GPL v2. If you
# don't know what that means, please do read the GPL.
#
#### @(#) $Id: coff.py,v 1.1 2003/05/16 14:03:29 digg Exp $
from linkie import Linkie
def make_coff_section_header (byte_order, name):
h = Linkie(byte_order)
h.align(4)
h.emit_string((name + '\0' * 8)[:8])
h[::4] = '&%s' % name # physical address
h[::4] = '&%s' % name # virtual address
h[::4] = '#%s/filesz' % name
h[::4] = '!%s' % name
h[::4] = '!%s/reloc' % name
h[::4] = '!%s/lineno' % name
h[::2] = '#%s/reloc' % name
h[::2] = '#%s/lineno' % name
h[::4] = '#%s/flags' % name
return h
|