[Wisp-cvs] wisp/users/dig linkie.py,1.63,1.64 pe.py,1.16,1.17
Status: Alpha
Brought to you by:
digg
|
From: <di...@us...> - 2003-05-18 21:56:30
|
Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv17666
Modified Files:
linkie.py pe.py
Log Message:
no file bits for .bss in PE files
Index: linkie.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- linkie.py 18 May 2003 15:42:06 -0000 1.63
+++ linkie.py 18 May 2003 21:56:26 -0000 1.64
@@ -199,7 +199,7 @@
for ofs, typ, arg in that._linker_notes:
this._linker_notes.append((ofs + delta, typ, arg))
return delta
- def glue (this, offset, that, origin):
+ def glue (this, offset, that, origin, bitlessp = 0):
# Pastes /that/ into /this/ at specified /offset/.
# Adds /origin/ to all &symbols in /that/ and converta sll
# relative references to &symbols in /that/ into absolute
@@ -216,9 +216,10 @@
# convert any padding to hard zeroes if needed
if that.filesz(): this.deskip()
- # carry over all the bits
- this._contents.extend(that._contents)
- this._skipped = that._skipped
+ if not bitlessp:
+ # carry over all the bits
+ this._contents.extend(that._contents)
+ this._skipped = that._skipped
# carry over the symbols
for sym, val in that._symbols:
Index: pe.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- pe.py 18 May 2003 18:04:14 -0000 1.16
+++ pe.py 18 May 2003 21:56:26 -0000 1.17
@@ -245,14 +245,17 @@
# memory alignment
memory_boundary = roundup(memory_boundary, \
max(0x1000, sections[s].get_alignment()))
- # establish origin symbols
- e.place_symbol('!' + s)
- e.place_symbol('&' + s, memory_boundary)
# process sizes
e.place_symbol('#' + s + '/memsz', sections[s].memsz())
- e.place_symbol('#' + s + '/filesz', roundup(sections[s].filesz(), 0x200))
+ filesz = roundup(sections[s].filesz(), 0x200)
+ e.place_symbol('#' + s + '/filesz', filesz)
+ # establish origin symbols
+ if filesz: e.place_symbol('!' + s)
+ else: e.place_symbol('!' + s, 0)
+ e.place_symbol('&' + s, memory_boundary)
+
# paste bits
- e.glue(e.memsz(), sections[s], memory_boundary)
+ e.glue(e.memsz(), sections[s], memory_boundary, bitlessp = s == '.bss')
# increase memory_boundary
memory_boundary = roundup(memory_boundary + sections[s].memsz(), 4096)
|