diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c783ce5..10e7169e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,8 @@ * Add new symbol attributes: * `function_owner`: Allows to force a rodata symbol to be migrated to the given function, skipping over the rodata migration heuristic. - * `allow_reference`: Allows toggling if the symbol is allowed to reference other symbols. - * `allow_be_referenced`: Allows toggling if the symbol is allowed to be referenced by other symbols. + * `can_reference`: Allows toggling if the symbol is allowed to reference other symbols. + * `can_be_referenced`: Allows toggling if the symbol is allowed to be referenced by other symbols. * `spimdisasm` 1.29.0 or above is now required. ### 0.27.0 diff --git a/docs/Adding-Symbols.md b/docs/Adding-Symbols.md index c83cafe0..f5ee838f 100644 --- a/docs/Adding-Symbols.md +++ b/docs/Adding-Symbols.md @@ -150,7 +150,7 @@ This attribute overrides the global `allow_data_addends` option. aspMainTextStart = 0x80084760; // dont_allow_addend:True ``` -### `allow_reference` +### `can_reference` Allows this symbol to reference (or to not reference) other symbols. @@ -161,10 +161,10 @@ Defaults to `True`. **Example:** ```ini -aspMainTextStart = 0x80084760; // allow_reference:False +aspMainTextStart = 0x80084760; // can_reference:False ``` -### `allow_be_referenced` +### `can_be_referenced` Allows this symbol to be referenced (or to not be referenced) by other symbols. @@ -175,7 +175,7 @@ Defaults to `True`. **Example:** ```ini -dummy_symbol = 0x800782B0; // allow_be_referenced:True +dummy_symbol = 0x800782B0; // can_be_referenced:True ``` ### `allow_duplicated` diff --git a/src/splat/util/symbols.py b/src/splat/util/symbols.py index e04d6d6f..cb6be43a 100644 --- a/src/splat/util/symbols.py +++ b/src/splat/util/symbols.py @@ -235,11 +235,11 @@ def get_seg_for_rom(rom: int) -> Optional["Segment"]: if attr_name == "dont_allow_addend": sym.dont_allow_addend = tf_val continue - if attr_name == "allow_reference": - sym.allow_reference = tf_val + if attr_name == "can_reference": + sym.can_reference = tf_val continue - if attr_name == "allow_be_referenced": - sym.allow_be_referenced = tf_val + if attr_name == "can_be_referenced": + sym.can_be_referenced = tf_val continue if attr_name == "allow_duplicated": sym.allow_duplicated = True @@ -484,10 +484,10 @@ def add_symbol_to_spim_segment( context_sym.allowedToReferenceAddends = True if sym.dont_allow_addend: context_sym.notAllowedToReferenceAddends = True - if sym.allow_reference is not None: - context_sym.allowedToReferenceSymbols = sym.allow_reference - if sym.allow_be_referenced is not None: - context_sym.allowedToBeReferenced = sym.allow_be_referenced + if sym.can_reference is not None: + context_sym.allowedToReferenceSymbols = sym.can_reference + if sym.can_be_referenced is not None: + context_sym.allowedToBeReferenced = sym.can_be_referenced context_sym.setNameGetCallbackIfUnset(lambda _: sym.name) if sym.given_name_end: context_sym.nameEnd = sym.given_name_end @@ -630,8 +630,8 @@ class Symbol: allow_addend: bool = False dont_allow_addend: bool = False - allow_reference: Optional[bool] = None - allow_be_referenced: Optional[bool] = None + can_reference: Optional[bool] = None + can_be_referenced: Optional[bool] = None linker_section: Optional[str] = None