Skip to content

Commit

Permalink
Improve comment specifying the reason why an address could not be sym…
Browse files Browse the repository at this point in the history
…bolized if it is `$gp` relative.
  • Loading branch information
AngheloAlf committed Oct 1, 2024
1 parent 86334da commit 21c8eaf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [1.30.2] - 2024-09-19

### Changed

- Improve comment specifying the reason why an address could not be symbolized
if it is `$gp` relative.

### Fixed

- Fix not generating branch labels under some circuntances.
- Fix not generating branch labels under some circumstances.

## [1.30.1] - 2024-09-19

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[project]
name = "spimdisasm"
# Version should be synced with spimdisasm/__init__.py
version = "1.30.2"
version = "1.30.3-dev0"
description = "MIPS disassembler"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
4 changes: 2 additions & 2 deletions spimdisasm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from __future__ import annotations

__version_info__: tuple[int, int, int] = (1, 30, 2)
__version__ = ".".join(map(str, __version_info__))# + "-dev0"
__version_info__: tuple[int, int, int] = (1, 30, 3)
__version__ = ".".join(map(str, __version_info__)) + "-dev0"
__author__ = "Decompollaborate"

from . import common as common
Expand Down
8 changes: 7 additions & 1 deletion spimdisasm/mips/symbols/MipsSymbolFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,13 @@ def _generateRelocsFromInstructionAnalyzer(self) -> None:
if generatedReloc is not None:
self.relocs[instrOffset] = generatedReloc
else:
self.endOfLineComment[instrOffset//4] = f" /* Failed to symbolize address 0x{constant:08X} for {relocType.getPercentRel()}. Make sure this address is within the recognized valid address space */"
comment = f"Failed to symbolize address 0x{constant:08X} for {relocType.getPercentRel()}. Make sure this address is within the recognized valid address space."
if relocType in {common.RelocType.MIPS_GPREL16, common.RelocType.MIPS_GOT16}:
if common.GlobalConfig.GP_VALUE is None:
comment += f" Please specify a gp_value."
elif not self.context.isInTotalVramRange(common.GlobalConfig.GP_VALUE):
comment += f" The provided gp_value (0x{common.GlobalConfig.GP_VALUE:08X}) seems wrong."
self.endOfLineComment[instrOffset//4] = f" /* {comment} */"

for instrOffset, targetVram in self.instrAnalyzer.funcCallInstrOffsets.items():
funcSym = self.getSymbol(targetVram, tryPlusOffset=False)
Expand Down

0 comments on commit 21c8eaf

Please sign in to comment.