[Wisp-cvs] wisp/users/dig linkie.py,1.2,1.3
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-02-06 13:57:26
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv16986 Modified Files: linkie.py Log Message: made Linkie.dump show linker notes Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- linkie.py 5 Feb 2003 22:43:57 -0000 1.2 +++ linkie.py 6 Feb 2003 13:57:23 -0000 1.3 @@ -210,21 +210,28 @@ return this def dump (this): - rsymbols = {}; rnotes = {} - othersymbols = [] + rsymbols = {}; othersymbols = [] + rnotes = {}; othernotes = [] for sym, val in this._symbols: if 0 <= val < this.memsz(): if rsymbols.has_key(val): rsymbols[val].append(sym) else: rsymbols[val] = [sym] else: othersymbols.append((sym, val)) + for ofs, typ, arg in this._linker_notes: + if 0 <= ofs < this.memsz(): + if rnotes.has_key(ofs): rnotes[ofs].append((typ, arg)) + else: rnotes[ofs] = [(typ, arg)] + else: othernotes.append((ofs, typ, arg)) buf = []; bufstart = 0 for i in range(this.memsz()): - if len(buf) >= 16 or rsymbols.has_key(i): + if len(buf) >= 16 or rsymbols.has_key(i) or rnotes.has_key(i): if buf: print ' %08x:' % bufstart, ' '.join(buf) buf = []; bufstart = i if rsymbols.has_key(i): - rsymbols[i].sort() for s in rsymbols[i]: print s + ':' + if rnotes.has_key(i): + for typ, ofs in rnotes[i]: + print '%r(%s)' % (typ, ofs) if i < len(this._binary): buf.append('%02x' % ord(this._binary[i])) else: |