The assignAddresses() function accumulates state in the LinkerScript that prevents it from being called multiple times. This change moves the state into a separate structure AddressState that is created at the start of the function and disposed of at the end.
CurAddressState is used rather than passing a reference to the state as a parameter to the functions used by assignAddresses(). This is because the getSymbolValue function needs to be executed in the context of AddressState but it is stored in ScriptParser when AddressState is not available.
The AddressState is also used in a limited context by processCommands()