Skip to content

Commit

Permalink
Fix jtbl labels missing segment suffixes (#435)
Browse files Browse the repository at this point in the history
* Fix jtbl label missing label suffixes

* version bump and changelog
  • Loading branch information
AngheloAlf authored Dec 28, 2024
1 parent d3c3d97 commit af668f0
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# splat Release Notes

### 0.32.2

* Fix jumptable labels not being properly formatted with the given `symbol_name_format`.
* `spimdisasm` 1.32.0 or above is now required.

### 0.32.1

* Include subsegment information when aggregating split statistics.

### 0.32.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The brackets corresponds to the optional dependencies to install while installin
If you use a `requirements.txt` file in your repository, then you can add this library with the following line:

```txt
splat64[mips]>=0.32.0,<1.0.0
splat64[mips]>=0.32.2,<1.0.0
```

### Optional dependencies
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "splat64"
# Should be synced with src/splat/__init__.py
version = "0.32.0"
version = "0.32.2"
description = "A binary splitting tool to assist with decompilation and modding projects"
readme = "README.md"
license = {file = "LICENSE"}
Expand All @@ -20,7 +20,7 @@ dependencies = [

[project.optional-dependencies]
mips = [
"spimdisasm>=1.31.0,<2.0.0", # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py
"spimdisasm>=1.32.0,<2.0.0", # This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py
"rabbitizer>=1.12.0,<2.0.0",
"pygfxd",
"n64img>=0.3.3",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tqdm
intervaltree
colorama
# This value should be keep in sync with the version listed on disassembler/spimdisasm_disassembler.py and pyproject.toml
spimdisasm>=1.31.0
spimdisasm>=1.32.0
rabbitizer>=1.10.0
pygfxd
n64img>=0.1.4
Expand Down
2 changes: 1 addition & 1 deletion src/splat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__package_name__ = __name__

# Should be synced with pyproject.toml
__version__ = "0.32.0"
__version__ = "0.32.2"
__author__ = "ethteck"

from . import util as util
Expand Down
2 changes: 1 addition & 1 deletion src/splat/disassembler/spimdisasm_disassembler.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class SpimdisasmDisassembler(disassembler.Disassembler):
# This value should be kept in sync with the version listed on requirements.txt and pyproject.toml
SPIMDISASM_MIN = (1, 31, 0)
SPIMDISASM_MIN = (1, 32, 0)

def configure(self):
# Configure spimdisasm
Expand Down
2 changes: 1 addition & 1 deletion src/splat/segtypes/common/codesubsegment.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def process_insns(
)

# Gather symbols found by spimdisasm and create those symbols in splat's side
for referenced_vram in func_spim.instrAnalyzer.referencedVrams:
for referenced_vram in func_spim.referencedVrams:
context_sym = self.spim_section.get_section().getSymbol(
referenced_vram, tryPlusOffset=False
)
Expand Down
10 changes: 10 additions & 0 deletions src/splat/segtypes/common/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ def disassemble_data(self, rom_bytes):
self.get_most_parent(), symbol.contextSym
)

# Gather symbols found by spimdisasm and create those symbols in splat's side
for referenced_vram in symbol.referencedVrams:
context_sym = self.spim_section.get_section().getSymbol(
referenced_vram, tryPlusOffset=False
)
if context_sym is not None:
symbols.create_symbol_from_spim_symbol(
self.get_most_parent(), context_sym
)

# Hint to the user that we are now in the .rodata section and no longer in the .data section (assuming rodata follows data)
if (
self.suggestion_rodata_section_start
Expand Down
10 changes: 10 additions & 0 deletions src/splat/segtypes/common/rodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ def disassemble_data(self, rom_bytes):
)
generated_symbol.linker_section = self.get_linker_section_linksection()

# Gather symbols found by spimdisasm and create those symbols in splat's side
for referenced_vram in symbol.referencedVrams:
context_sym = self.spim_section.get_section().getSymbol(
referenced_vram, tryPlusOffset=False
)
if context_sym is not None:
symbols.create_symbol_from_spim_symbol(
self.get_most_parent(), context_sym
)

possible_text = self.get_possible_text_subsegment_for_symbol(symbol)
if possible_text is not None:
text_segment, refenceeFunction = possible_text
Expand Down

0 comments on commit af668f0

Please sign in to comment.