From 8aad35ba5d3de476d64df471bbde478c1d55d123 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Mon, 25 Aug 2025 17:33:02 -0700 Subject: [PATCH] Update spimdisasm and macro.inc --- include/macro.inc | 57 ++++++++++++++++++++++++++++++++++-------- requirements.txt | 2 +- tools/disasm/disasm.py | 8 +++--- 3 files changed, 51 insertions(+), 16 deletions(-) diff --git a/include/macro.inc b/include/macro.inc index 9700d05aa5..81a9a3aafb 100644 --- a/include/macro.inc +++ b/include/macro.inc @@ -3,25 +3,60 @@ .internal _MACRO_INC_GUARD .set _MACRO_INC_GUARD, 1 -.macro glabel label - .global \label - .ent \label +# A function symbol. +.macro glabel label, visibility=global + .\visibility \label .type \label, @function + \label: + .ent \label +.endm + +# The end of a function symbol. +.macro endlabel label + .size \label, . - \label + .end \label +.endm + +# An alternative entry to a function. +.macro alabel label, visibility=global + .\visibility \label + .type \label, @function + \label: + .aent \label +.endm + +# A label referenced by an error handler table. +.macro ehlabel label, visibility=global + .\visibility \label \label: .endm -.macro endlabel label - .end \label + +# A label referenced by a jumptable. +.macro jlabel label, visibility=global + \label: +.endm + + +# A data symbol. +.macro dlabel label, visibility=global + .\visibility \label + .type \label, @object + \label: +.endm + +# End of a data symbol. +.macro enddlabel label .size \label, . - \label .endm -.macro dlabel label - .global \label - \label: -.endm -.macro jlabel label - \label: +# Label to signal the symbol haven't been matched yet. +.macro nonmatching label, size=1 + .global \label\().NON_MATCHING + .type \label\().NON_MATCHING, @object + .size \label\().NON_MATCHING, \size + \label\().NON_MATCHING: .endm # COP0 register aliases diff --git a/requirements.txt b/requirements.txt index 57787f0e3f..8a78b826cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ pyyaml>=6.0.1,<7.0.0 # disasm rabbitizer>=1.3.0,<2.0.0 -spimdisasm>=1.34.2,<2.0.0 # Sync with tools/disasm/disasm.py +spimdisasm>=1.36.0,<2.0.0 # Sync with tools/disasm/disasm.py # yars pyelftools>=0.26 diff --git a/tools/disasm/disasm.py b/tools/disasm/disasm.py index 0b9914c8d9..031496dd0d 100755 --- a/tools/disasm/disasm.py +++ b/tools/disasm/disasm.py @@ -85,10 +85,10 @@ def main(): args = parser.parse_args() - if spimdisasm.__version_info__ < (1, 28, 1): - # Version should be kept up to date with requirements.txt - print(f"Error: spimdisasm>=1.34.2 is required (you have {spimdisasm.__version__})") - print("Hint: run `make venv` to update the venv.") + if spimdisasm.__version_info__ < (1, 36, 0): + # Version should be kept up to date with requirements.txt + print(f"Error: spimdisasm>=1.36.0 is required (you have {spimdisasm.__version__})") + print("Hint: run `make setup` to update the venv.") exit(1) context = spimdisasm.common.Context()