Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Sep 10, 2024
1 parent 558fdab commit 84b7bcb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions docs/Adding-Symbols.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.

Expand All @@ -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`
Expand Down
20 changes: 10 additions & 10 deletions src/splat/util/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 84b7bcb

Please sign in to comment.