Skip to content

Commit 7ef5859

Browse files
authored
Merge pull request #36 from Decompollaborate/develop
2.7.3
2 parents fbcc802 + 5af19fe commit 7ef5859

22 files changed

+733
-662
lines changed
+98-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.2.3
1+
# This file is autogenerated by maturin v1.8.2
22
# To update, run
33
#
44
# maturin generate-ci github
@@ -15,86 +15,137 @@ permissions:
1515

1616
jobs:
1717
linux:
18-
runs-on: ubuntu-latest
18+
runs-on: ${{ matrix.platform.runner }}
1919
strategy:
2020
matrix:
21-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
21+
platform:
22+
- runner: ubuntu-22.04
23+
target: x86_64
24+
- runner: ubuntu-22.04
25+
target: x86
26+
- runner: ubuntu-22.04
27+
target: aarch64
28+
- runner: ubuntu-22.04
29+
target: armv7
30+
- runner: ubuntu-22.04
31+
target: s390x
32+
- runner: ubuntu-22.04
33+
target: ppc64le
2234
steps:
23-
- uses: actions/checkout@v3
24-
- uses: actions/setup-python@v4
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-python@v5
2537
with:
26-
python-version: '3.13'
38+
python-version: 3.x
2739
- name: Build wheels
2840
uses: PyO3/maturin-action@v1
2941
with:
30-
target: ${{ matrix.target }}
42+
target: ${{ matrix.platform.target }}
3143
args: --release --out dist --find-interpreter
32-
sccache: 'true'
44+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
3345
manylinux: auto
3446
- name: Upload wheels
35-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: wheels-linux-${{ matrix.platform.target }}
50+
path: dist
51+
52+
musllinux:
53+
runs-on: ${{ matrix.platform.runner }}
54+
strategy:
55+
matrix:
56+
platform:
57+
- runner: ubuntu-22.04
58+
target: x86_64
59+
- runner: ubuntu-22.04
60+
target: x86
61+
- runner: ubuntu-22.04
62+
target: aarch64
63+
- runner: ubuntu-22.04
64+
target: armv7
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: actions/setup-python@v5
68+
with:
69+
python-version: 3.x
70+
- name: Build wheels
71+
uses: PyO3/maturin-action@v1
72+
with:
73+
target: ${{ matrix.platform.target }}
74+
args: --release --out dist --find-interpreter
75+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
76+
manylinux: musllinux_1_2
77+
- name: Upload wheels
78+
uses: actions/upload-artifact@v4
3679
with:
37-
name: wheels
80+
name: wheels-musllinux-${{ matrix.platform.target }}
3881
path: dist
3982

4083
windows:
41-
runs-on: windows-latest
84+
runs-on: ${{ matrix.platform.runner }}
4285
strategy:
4386
matrix:
44-
target: [x64, x86]
87+
platform:
88+
- runner: windows-latest
89+
target: x64
90+
- runner: windows-latest
91+
target: x86
4592
steps:
46-
- uses: actions/checkout@v3
47-
- uses: actions/setup-python@v4
93+
- uses: actions/checkout@v4
94+
- uses: actions/setup-python@v5
4895
with:
49-
python-version: '3.13'
50-
architecture: ${{ matrix.target }}
96+
python-version: 3.x
97+
architecture: ${{ matrix.platform.target }}
5198
- name: Build wheels
5299
uses: PyO3/maturin-action@v1
53100
with:
54-
target: ${{ matrix.target }}
101+
target: ${{ matrix.platform.target }}
55102
args: --release --out dist --find-interpreter
56-
sccache: 'true'
103+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
57104
- name: Upload wheels
58-
uses: actions/upload-artifact@v3
105+
uses: actions/upload-artifact@v4
59106
with:
60-
name: wheels
107+
name: wheels-windows-${{ matrix.platform.target }}
61108
path: dist
62109

63110
macos:
64-
runs-on: macos-latest
111+
runs-on: ${{ matrix.platform.runner }}
65112
strategy:
66113
matrix:
67-
target: [x86_64, aarch64]
114+
platform:
115+
- runner: macos-13
116+
target: x86_64
117+
- runner: macos-14
118+
target: aarch64
68119
steps:
69-
- uses: actions/checkout@v3
70-
- uses: actions/setup-python@v4
120+
- uses: actions/checkout@v4
121+
- uses: actions/setup-python@v5
71122
with:
72-
python-version: '3.13'
123+
python-version: 3.x
73124
- name: Build wheels
74125
uses: PyO3/maturin-action@v1
75126
with:
76-
target: ${{ matrix.target }}
127+
target: ${{ matrix.platform.target }}
77128
args: --release --out dist --find-interpreter
78-
sccache: 'true'
129+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
79130
- name: Upload wheels
80-
uses: actions/upload-artifact@v3
131+
uses: actions/upload-artifact@v4
81132
with:
82-
name: wheels
133+
name: wheels-macos-${{ matrix.platform.target }}
83134
path: dist
84135

85136
sdist:
86137
runs-on: ubuntu-latest
87138
steps:
88-
- uses: actions/checkout@v3
139+
- uses: actions/checkout@v4
89140
- name: Build sdist
90141
uses: PyO3/maturin-action@v1
91142
with:
92143
command: sdist
93144
args: --out dist
94145
- name: Upload sdist
95-
uses: actions/upload-artifact@v3
146+
uses: actions/upload-artifact@v4
96147
with:
97-
name: wheels
148+
name: wheels-sdist
98149
path: dist
99150

100151
check_clippy_python_bindings:
@@ -120,16 +171,26 @@ jobs:
120171
release:
121172
name: Release
122173
runs-on: ubuntu-latest
123-
if: "startsWith(github.ref, 'refs/tags/')"
124-
needs: [linux, windows, macos, sdist, check_clippy_python_bindings]
174+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
175+
needs: [linux, musllinux, windows, macos, sdist, check_clippy_python_bindings]
176+
permissions:
177+
# Use to sign the release artifacts
178+
id-token: write
179+
# Used to upload release artifacts
180+
contents: write
181+
# Used to generate artifact attestation
182+
attestations: write
125183
steps:
126-
- uses: actions/download-artifact@v3
184+
- uses: actions/download-artifact@v4
185+
- name: Generate artifact attestation
186+
uses: actions/attest-build-provenance@v1
127187
with:
128-
name: wheels
188+
subject-path: 'wheels-*/*'
129189
- name: Publish to PyPI
190+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
130191
uses: PyO3/maturin-action@v1
131192
env:
132193
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
133194
with:
134195
command: upload
135-
args: --non-interactive --skip-existing *
196+
args: --non-interactive --skip-existing wheels-*/*

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [2.7.3] - 2025-02-09
11+
12+
### Fixed
13+
14+
- Fix symbol's VROM calculation not properly accounting for the first symbol of
15+
the section being a `static` symbol (missing from the mapfile).
16+
- This fix only applies to GNU mapfiles.
17+
1018
## [2.7.2] - 2024-12-15
1119

1220
### Added
@@ -445,6 +453,7 @@ Full changes: <https://github.com/Decompollaborate/mapfile_parser/compare/702a73
445453
- Initial release
446454

447455
[unreleased]: https://github.com/Decompollaborate/mapfile_parser/compare/master...develop
456+
[2.7.3]: https://github.com/Decompollaborate/mapfile_parser/compare/2.7.2...2.7.3
448457
[2.7.2]: https://github.com/Decompollaborate/mapfile_parser/compare/2.7.1...2.7.2
449458
[2.7.1]: https://github.com/Decompollaborate/mapfile_parser/compare/2.7.0...2.7.1
450459
[2.7.0]: https://github.com/Decompollaborate/mapfile_parser/compare/2.6.0...2.7.0

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[package]
55
name = "mapfile_parser"
6-
version = "2.7.2"
6+
version = "2.7.3"
77
edition = "2021"
88
rust-version = "1.65.0"
99
authors = ["Anghelo Carvajal <[email protected]>"]

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ If you use a `requirements.txt` file in your repository, then you can add
3535
this library with the following line:
3636

3737
```txt
38-
mapfile_parser>=2.7.2,<3.0.0
38+
mapfile_parser>=2.7.3,<3.0.0
3939
```
4040

4141
#### Development version
@@ -74,7 +74,7 @@ cargo add mapfile_parser
7474
Or add the following line manually to your `Cargo.toml` file:
7575

7676
```toml
77-
mapfile_parser = "2.7.2"
77+
mapfile_parser = "2.7.3"
7878
```
7979

8080
## Versioning and changelog

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
[project]
55
name = "mapfile_parser"
6-
version = "2.7.2"
6+
version = "2.7.3"
77
description = "Map file parser library focusing decompilation projects"
88
readme = "README.md"
99
requires-python = ">=3.9"

src/mapfile_parser/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from __future__ import annotations
77

8-
__version_info__ = (2, 7, 2)
8+
__version_info__ = (2, 7, 3)
99
__version__ = ".".join(map(str, __version_info__))# + "-dev0"
1010
__author__ = "Decompollaborate"
1111

src/rs/mapfile.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -277,19 +277,20 @@ impl MapFile {
277277
if symbols_count > 0 {
278278
let mut sym_vrom = vrom_offset;
279279

280+
// The first symbol of the file on the mapfile may not be the actual first
281+
// symbol if it is marked `static`, be a jumptable, etc, producing a mismatch
282+
// on the vrom address of each symbol of this section.
283+
// A way to adjust this difference is by increasing the start of the vrom
284+
// by the difference in vram address between the first symbol and the vram
285+
// of the file.
286+
if let Some(first_sym) = file.symbols.first() {
287+
sym_vrom += first_sym.vram - file.vram;
288+
}
289+
280290
// Calculate size of each symbol
281291
for index in 0..symbols_count - 1 {
282292
let next_sym_vram = file.symbols[index + 1].vram;
283293
let sym = &mut file.symbols[index];
284-
285-
if index == 0 && sym.vram > file.vram {
286-
// If the vram of the first symbol doesn't match the vram of the file
287-
// it means the first(s) symbols were not emitted in the mapfile (static,
288-
// jumptables, etc)
289-
// We try to adjust the vrom to account for it.
290-
sym_vrom += sym.vram - file.vram;
291-
}
292-
293294
let sym_size = next_sym_vram - sym.vram;
294295
acummulated_size += sym_size;
295296

tests/output/animalforest.jp.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/output/animalforest.jp.machine.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/output/drmario64.cn.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/output/drmario64.cn.machine.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)