[Wisp-cvs] wisp/users/dig linkie.py,1.15,1.16
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2003-03-09 19:33:27
|
Update of /cvsroot/wisp/wisp/users/dig In directory sc8-pr-cvs1:/tmp/cvs-serv1458 Modified Files: linkie.py Log Message: made the $ symbol prefix behave like the & prefix currently does Index: linkie.py =================================================================== RCS file: /cvsroot/wisp/wisp/users/dig/linkie.py,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- linkie.py 9 Mar 2003 13:39:46 -0000 1.15 +++ linkie.py 9 Mar 2003 19:33:24 -0000 1.16 @@ -143,12 +143,13 @@ def place_symbol (this, symbol, value = None): """place_symbol(symbol, value = None) => value Places a globally visible symbol in the linkie. - Takes care of adding the base address if the symbol starts in '&'. + Takes care of adding the base address if the symbol + starts in '&' or '$'. Does NOT check uniqueness. None signifies the current offset.""" if type(symbol) <> StringType: raise 'Not a string', symbol if value == None: value = len(this._binary) + this._skipped - if symbol[0] == '&': value += this._origin + if symbol[0] in '&$': value += this._origin this._symbols.append((symbol, value)) return value def align (this, boundary): @@ -168,16 +169,16 @@ def set_origin (this, origin): """set_origin(origin) Sets the base address of the linkie to the specified value. - Recalculates the &foo symbols. Does NOT influence already - resolved references to changing labels, so be careful if - using after partial linkage.""" + Recalculates the &foo and $foo symbols. Does NOT influence + already resolved references to changing labels, so be careful + if using after partial linkage.""" if (origin % this._alignment) != 0: raise 'New base address violates alignment', \ (boundary, this._origin) delta = origin - this._origin for i in range(len(this._symbols)): symbol, value = this._symbols[i] - if symbol[0] == '&': + if symbol[0] in '&$': this._symbols[i] = symbol, value + delta this._origin = origin @@ -276,7 +277,7 @@ rsymbols = {}; othersymbols = [] rnotes = {}; othernotes = [] for sym, val in this._symbols: - if sym[0] == '&': val -= this._origin + if sym[0] in '&$': val -= this._origin if sym[0] != '#' and 0 <= val < this.memsz(): if rsymbols.has_key(val): rsymbols[val].append(sym) else: rsymbols[val] = [sym] |