Symbols: Make the symbol shift optional

The symbol_shift isn't quite as nice as it could be, because we use None
to demark an unset state, which is different than a value of 0 (because
unset will trip linux to try to identify, whereas 0 will not).

Every where we use the value, we get it from the dictionary and use 0 if
it's not found (essentially forcing a default), but ideally, the default
would be set.  As such, it's safe to set optional to true (and thus not
require it for configuration files), but it's not ideal that the linux
symbol finder can't determine whether to run or not without knowing
whether the value's been intentionally set...
This commit is contained in:
Mike Auty
2021-03-21 00:21:13 +00:00
parent 6702595ebe
commit 2402a51c60
+1 -1
View File
@@ -303,7 +303,7 @@ class SymbolTableInterface(BaseSymbolTableInterface, configuration.ConfigurableI
@classmethod
def get_requirements(cls) -> List[RequirementInterface]:
return super().get_requirements() + [
requirements.IntRequirement(name = 'symbol_shift', description = 'Symbol Shift', optional = False),
requirements.IntRequirement(name = 'symbol_shift', description = 'Symbol Shift', optional = True),
requirements.IntRequirement(
name = 'symbol_mask', description = 'Address mask for symbols', optional = True, default = 0),
]