diff --git a/CHANGELOG.md b/CHANGELOG.md index bb037c6e..1b62d235 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # splat Release Notes +### 0.41.1 + +* Mark `__romPos` as `HIDDEN`. + * Prevents the generated `__romPos` linker symbol from being exported as GLOBAL in the built elf. + * Useful for PSX projects with overlays being different binaries from the main program. + ### 0.41.0 * Add `bss_size` attribute for `bss` subsegments. diff --git a/README.md b/README.md index e9d844f8..c50e1871 100644 --- a/README.md +++ b/README.md @@ -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.41.0,<1.0.0 +splat64[mips]>=0.41.1,<1.0.0 ``` ### Optional dependencies diff --git a/pyproject.toml b/pyproject.toml index 324a8987..dbc9a018 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "splat64" # Should be synced with src/splat/__init__.py -version = "0.41.0" +version = "0.41.1" description = "A binary splitting tool to assist with decompilation and modding projects" readme = "README.md" license = {file = "LICENSE"} diff --git a/src/splat/__init__.py b/src/splat/__init__.py index 8ffd5c4d..56992ae1 100644 --- a/src/splat/__init__.py +++ b/src/splat/__init__.py @@ -1,7 +1,7 @@ __package_name__ = __name__ # Should be synced with pyproject.toml -__version__ = "0.41.0" +__version__ = "0.41.1" __author__ = "ethteck" from . import util as util diff --git a/src/splat/segtypes/linker_entry.py b/src/splat/segtypes/linker_entry.py index 426973a8..eaa6a793 100644 --- a/src/splat/segtypes/linker_entry.py +++ b/src/splat/segtypes/linker_entry.py @@ -202,7 +202,13 @@ def __init__(self, is_partial: bool = False): self._begin_block() if not self.is_partial: - self._writeln(f"__romPos = {options.opts.ld_rom_start};") + # Define `__romPos` as a HIDDEN elf symbol so it isn't + # exported/GLOBAL in the symtab, allowing for a built binary to be + # used when building other binaries and referencing their symbols. + # Useful for PSX projects with overlays being different binaries + # from the main program. + # https://sourceware.org/binutils/docs/ld/HIDDEN.html + self._writeln(f"HIDDEN(__romPos = {options.opts.ld_rom_start});") if options.opts.ld_gp_expression is not None: self._writeln(f"_gp = {options.opts.ld_gp_expression};") diff --git a/test/basic_app/expected/basic_app.ld b/test/basic_app/expected/basic_app.ld index 56689bcc..413bae05 100644 --- a/test/basic_app/expected/basic_app.ld +++ b/test/basic_app/expected/basic_app.ld @@ -1,6 +1,6 @@ SECTIONS { - __romPos = 0; + HIDDEN(__romPos = 0); header_ROM_START = __romPos; header_VRAM = ADDR(.header); .header : AT(header_ROM_START) SUBALIGN(16)