mapfile-parser 2.9.3__tar.gz → 2.9.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/CHANGELOG.md +8 -0
  2. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/Cargo.lock +1 -1
  3. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/Cargo.toml +1 -1
  4. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/PKG-INFO +3 -3
  5. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/README.md +2 -2
  6. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/pyproject.toml +1 -1
  7. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/__init__.py +1 -1
  8. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/lib.rs +1 -1
  9. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/parser.rs +115 -32
  10. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/section.rs +10 -44
  11. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/segment.rs +1 -1
  12. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/.gitattributes +0 -0
  13. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/.gitignore +0 -0
  14. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/LICENSE +0 -0
  15. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/__main__.py +0 -0
  16. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/__init__.py +0 -0
  17. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/bss_check.py +0 -0
  18. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/first_diff.py +0 -0
  19. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/jsonify.py +0 -0
  20. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/objdiff_report.py +0 -0
  21. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/pj64_syms.py +0 -0
  22. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/progress.py +0 -0
  23. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/sym_info.py +0 -0
  24. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/symbol_sizes_csv.py +0 -0
  25. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/frontends/upload_frogress.py +0 -0
  26. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/internals/__init__.py +0 -0
  27. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/internals/objdiff_report.py +0 -0
  28. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/mapfile.py +0 -0
  29. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/mapfile_parser.pyi +0 -0
  30. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/mapfile_rs.py +0 -0
  31. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/progress_stats.py +0 -0
  32. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/progress_stats_rs.py +0 -0
  33. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/mapfile_parser/utils.py +0 -0
  34. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/found_symbol_info.rs +0 -0
  35. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/mapfile.rs +0 -0
  36. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/maps_comparison_info.rs +0 -0
  37. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/progress_stats.rs +0 -0
  38. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/report.rs +0 -0
  39. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/symbol.rs +0 -0
  40. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/symbol_comparison_info.rs +0 -0
  41. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/symbol_decomp_state.rs +0 -0
  42. {mapfile_parser-2.9.3 → mapfile_parser-2.9.4}/src/rs/utils.rs +0 -0
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.9.4] - 2025-06-02
11
+
12
+ ### Changed
13
+
14
+ - Implement parsing for `mwld` 2.7+ generated mapfiles.
15
+ - Handle `*fill*`s in `mwld`.
16
+
10
17
  ## [2.9.3] - 2025-06-01
11
18
 
12
19
  ### Fixed
@@ -613,6 +620,7 @@ Full changes: <https://github.com/Decompollaborate/mapfile_parser/compare/702a73
613
620
  - Initial release
614
621
 
615
622
  [unreleased]: https://github.com/Decompollaborate/mapfile_parser/compare/master...develop
623
+ [2.9.4]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.3...2.9.4
616
624
  [2.9.3]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.2...2.9.3
617
625
  [2.9.2]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.1...2.9.2
618
626
  [2.9.1]: https://github.com/Decompollaborate/mapfile_parser/compare/2.9.0...2.9.1
@@ -171,7 +171,7 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
171
171
 
172
172
  [[package]]
173
173
  name = "mapfile_parser"
174
- version = "2.9.3"
174
+ version = "2.9.4"
175
175
  dependencies = [
176
176
  "lazy_static",
177
177
  "objdiff-core",
@@ -3,7 +3,7 @@
3
3
 
4
4
  [package]
5
5
  name = "mapfile_parser"
6
- version = "2.9.3"
6
+ version = "2.9.4"
7
7
  edition = "2021"
8
8
  rust-version = "1.74.0"
9
9
  authors = ["Anghelo Carvajal <angheloalf95@gmail.com>"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapfile_parser
3
- Version: 2.9.3
3
+ Version: 2.9.4
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -55,7 +55,7 @@ If you use a `requirements.txt` file in your repository, then you can add
55
55
  this library with the following line:
56
56
 
57
57
  ```txt
58
- mapfile_parser>=2.9.3,<3.0.0
58
+ mapfile_parser>=2.9.4,<3.0.0
59
59
  ```
60
60
 
61
61
  #### Development version
@@ -94,7 +94,7 @@ cargo add mapfile_parser
94
94
  Or add the following line manually to your `Cargo.toml` file:
95
95
 
96
96
  ```toml
97
- mapfile_parser = "2.9.3"
97
+ mapfile_parser = "2.9.4"
98
98
  ```
99
99
 
100
100
  ## Versioning and changelog
@@ -36,7 +36,7 @@ If you use a `requirements.txt` file in your repository, then you can add
36
36
  this library with the following line:
37
37
 
38
38
  ```txt
39
- mapfile_parser>=2.9.3,<3.0.0
39
+ mapfile_parser>=2.9.4,<3.0.0
40
40
  ```
41
41
 
42
42
  #### Development version
@@ -75,7 +75,7 @@ cargo add mapfile_parser
75
75
  Or add the following line manually to your `Cargo.toml` file:
76
76
 
77
77
  ```toml
78
- mapfile_parser = "2.9.3"
78
+ mapfile_parser = "2.9.4"
79
79
  ```
80
80
 
81
81
  ## Versioning and changelog
@@ -3,7 +3,7 @@
3
3
 
4
4
  [project]
5
5
  name = "mapfile_parser"
6
- version = "2.9.3"
6
+ version = "2.9.4"
7
7
  description = "Map file parser library focusing decompilation projects"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.9"
@@ -5,7 +5,7 @@
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
- __version_info__ = (2, 9, 3)
8
+ __version_info__ = (2, 9, 4)
9
9
  __version__ = ".".join(map(str, __version_info__)) # + "-dev0"
10
10
  __author__ = "Decompollaborate"
11
11
 
@@ -63,6 +63,6 @@ mod tests {
63
63
 
64
64
  #[test]
65
65
  fn w0_000_map() {
66
- let _ = MapFile::new_from_map_file(&PathBuf::from("tests/maps/w0_000.map"));
66
+ let _ = MapFile::new_from_map_file(&PathBuf::from("tests/maps/gnuld/misc/w0_000.map"));
67
67
  }
68
68
  }
@@ -232,7 +232,7 @@ impl MapFile {
232
232
  filepath,
233
233
  vram,
234
234
  size,
235
- section_type,
235
+ section_type.into(),
236
236
  ));
237
237
  } else if let Some(section_alone_match) =
238
238
  regex_section_alone_entry.captures(prev_line)
@@ -250,7 +250,7 @@ impl MapFile {
250
250
  filepath,
251
251
  vram,
252
252
  size,
253
- section_type,
253
+ section_type.into(),
254
254
  ));
255
255
  }
256
256
  }
@@ -319,7 +319,7 @@ impl MapFile {
319
319
  filepath,
320
320
  vram,
321
321
  size,
322
- &section_type,
322
+ section_type,
323
323
  ));
324
324
  }
325
325
  }
@@ -497,8 +497,8 @@ impl MapFile {
497
497
  }
498
498
 
499
499
  let mut new_section =
500
- section::Section::new_fill(filepath, vram, size, &section_type);
501
- if !utils::is_noload_section(&section_type) {
500
+ section::Section::new_fill(filepath, vram, size, section_type);
501
+ if !utils::is_noload_section(&new_section.section_type) {
502
502
  new_section.vrom = vrom;
503
503
  }
504
504
  current_segment.sections_list.push(new_section);
@@ -510,9 +510,13 @@ impl MapFile {
510
510
  if size > 0 {
511
511
  let current_segment = temp_segment_list.last_mut().unwrap();
512
512
 
513
- let mut new_section =
514
- section::Section::new_default(filepath, vram, size, section_type);
515
- if !utils::is_noload_section(section_type) {
513
+ let mut new_section = section::Section::new_default(
514
+ filepath,
515
+ vram,
516
+ size,
517
+ section_type.into(),
518
+ );
519
+ if !utils::is_noload_section(&new_section.section_type) {
516
520
  new_section.vrom = vrom;
517
521
  }
518
522
  new_section.align = Some(align);
@@ -608,34 +612,41 @@ impl MapFile {
608
612
  let map_data = preprocess_map_data_mw(map_contents);
609
613
 
610
614
  let memory_map = parse_memory_map_mw(map_data);
611
-
612
- // Almost every line starts with this information, so instead of duplicating it we put them on one single regex
613
- let regex_row_entry = Regex::new(r"^\s*(?P<starting>[0-9a-fA-F]+)\s+(?P<size>[0-9a-fA-F]+)\s+(?P<vram>[0-9a-fA-F]+)\s+(?P<align>[0-9a-fA-F]+)\s+(?P<subline>.+)").unwrap();
614
-
615
- let regex_segment_entry = Regex::new(r"^(?P<name>.+) section layout$").unwrap();
616
- let regex_label_entry =
617
- Regex::new(r"^(?P<label>lbl_[0-9A-F]{8})\s+(?P<filename>.+?)\s*$").unwrap();
618
- let regex_symbol_entry =
619
- Regex::new(r"^\s*(?P<name>[^ ]+)\s+(?P<filename>.+?)\s*$").unwrap();
615
+ let regex_entries = MwRegexEntries::new(map_data);
620
616
 
621
617
  let mut temp_segment_list = vec![segment::Segment::new_placeholder()];
622
618
 
623
619
  // Use a bunch of characters that shouldn't be valid in any os as a marker that we haven't found a file yet.
624
- let mut current_filename = "invalid file <>:\"/\\|?*".to_string();
620
+ let invalid_file_name = "invalid file <>:\"/\\|?*";
621
+ let mut current_filename = invalid_file_name.to_string();
625
622
 
626
623
  for line in map_data.lines() {
627
- // Check for regex_row_entry since it is more likely to match
628
- if let Some(row_entry_match) = regex_row_entry.captures(line) {
624
+ // Check for regex_entries.common_row first since it is more likely to match
625
+ if let (Some(row_entry_match), false) = (
626
+ regex_entries.common_row.captures(line),
627
+ temp_segment_list.is_empty(),
628
+ ) {
629
629
  let starting = utils::parse_hex(&row_entry_match["starting"]);
630
630
  let size = utils::parse_hex(&row_entry_match["size"]);
631
631
  let vram = utils::parse_hex(&row_entry_match["vram"]);
632
632
  let align = utils::parse_hex(&row_entry_match["align"]);
633
633
 
634
+ let rom = row_entry_match.name("rom").map_or_else(
635
+ || {
636
+ temp_segment_list
637
+ .last()
638
+ .unwrap()
639
+ .vrom
640
+ .map(|segment_rom| segment_rom + starting)
641
+ },
642
+ |x| Some(utils::parse_hex(x.as_str())),
643
+ );
644
+
634
645
  let subline = &row_entry_match["subline"];
635
646
 
636
- if regex_label_entry.is_match(subline) {
647
+ if regex_entries.label.is_match(subline) {
637
648
  // pass
638
- } else if let Some(symbol_entry_match) = regex_symbol_entry.captures(subline) {
649
+ } else if let Some(symbol_entry_match) = regex_entries.symbol.captures(subline) {
639
650
  let filename = &symbol_entry_match["filename"];
640
651
 
641
652
  if filename == current_filename {
@@ -652,7 +663,7 @@ impl MapFile {
652
663
  new_symbol.size = size;
653
664
  }
654
665
  if !current_section.is_noload_section() {
655
- new_symbol.vrom = current_segment.vrom.map(|x| x + starting)
666
+ new_symbol.vrom = rom
656
667
  }
657
668
  if align > 0 {
658
669
  new_symbol.align = Some(align);
@@ -662,27 +673,62 @@ impl MapFile {
662
673
  }
663
674
  } else {
664
675
  // New file!
665
- current_filename = filename.to_string();
666
-
667
676
  if size > 0 {
668
677
  let section_type = &symbol_entry_match["name"];
669
678
  let filepath = PathBuf::from(filename);
670
679
 
671
680
  let current_segment = temp_segment_list.last_mut().unwrap();
672
681
 
673
- let mut new_section =
674
- section::Section::new_default(filepath, vram, size, section_type);
675
- if !utils::is_noload_section(section_type) {
676
- new_section.vrom = current_segment.vrom.map(|x| x + starting)
682
+ let mut new_section = section::Section::new_default(
683
+ filepath,
684
+ vram,
685
+ size,
686
+ section_type.into(),
687
+ );
688
+ if !utils::is_noload_section(&new_section.section_type) {
689
+ new_section.vrom = rom
677
690
  }
678
691
 
679
692
  current_segment.sections_list.push(new_section);
693
+
694
+ // I'm not sure how to treat these cases.
695
+ // I guess we can treat them as files without symbols for now...
696
+ current_filename = if filename == "Linker Generated Symbol File" {
697
+ invalid_file_name.to_string()
698
+ } else {
699
+ filename.to_string()
700
+ };
680
701
  }
681
702
  }
703
+ } else if regex_entries.fill.is_match(subline) {
704
+ // Make a dummy section to handle pads
705
+ let current_segment = temp_segment_list.last_mut().unwrap();
706
+
707
+ let mut filepath = PathBuf::new();
708
+ let mut section_type = "".to_owned();
709
+
710
+ if let Some(prev_section) = current_segment.sections_list.last() {
711
+ let mut name = prev_section.filepath.file_name().unwrap().to_owned();
712
+
713
+ name.push("__fill__");
714
+ filepath = prev_section.filepath.with_file_name(name);
715
+ section_type.clone_from(&prev_section.section_type);
716
+ }
717
+
718
+ let mut new_section =
719
+ section::Section::new_fill(filepath, vram, size, section_type);
720
+ new_section.align = Some(align);
721
+ if !utils::is_noload_section(&new_section.section_type) {
722
+ new_section.vrom = rom;
723
+ }
724
+ current_segment.sections_list.push(new_section);
725
+
726
+ // Don't count this as a valid file.
727
+ current_filename = invalid_file_name.to_string();
682
728
  } else {
683
- println!("{}", subline);
729
+ // println!("'{}'", subline);
684
730
  }
685
- } else if let Some(segment_entry_match) = regex_segment_entry.captures(line) {
731
+ } else if let Some(segment_entry_match) = regex_entries.segment.captures(line) {
686
732
  let name = &segment_entry_match["name"];
687
733
 
688
734
  let new_segment = if let Some(segment_entry) = memory_map.get(name) {
@@ -697,6 +743,10 @@ impl MapFile {
697
743
  };
698
744
 
699
745
  temp_segment_list.push(new_segment);
746
+
747
+ // Reset the tracked filename state.
748
+ // This avoid carrying the filename from one segment to the other
749
+ current_filename = invalid_file_name.to_string();
700
750
  }
701
751
  }
702
752
 
@@ -704,7 +754,6 @@ impl MapFile {
704
754
  }
705
755
 
706
756
  fn post_process_segments_mw(temp_segment_list: Vec<segment::Segment>) -> Vec<segment::Segment> {
707
- // TODO: actually implement
708
757
  let mut segments_list = Vec::with_capacity(temp_segment_list.len());
709
758
 
710
759
  for (i, segment) in temp_segment_list.into_iter().enumerate() {
@@ -793,6 +842,40 @@ fn parse_memory_map_mw(map_data: &str) -> HashMap<String, MwMemoryMapEntry> {
793
842
  memory_map
794
843
  }
795
844
 
845
+ struct MwRegexEntries {
846
+ common_row: Regex,
847
+ segment: Regex,
848
+ label: Regex,
849
+ symbol: Regex,
850
+ fill: Regex,
851
+ }
852
+
853
+ impl MwRegexEntries {
854
+ fn new(map_data: &str) -> Self {
855
+ // Almost every line starts with this information, so instead of duplicating it we put them on one single regex
856
+ let common_row = if map_data.contains("address Size address offset") {
857
+ // mwld 2.7+
858
+ Regex::new(r"^\s*(?P<starting>[0-9a-fA-F]+)\s+(?P<size>[0-9a-fA-F]+)\s+(?P<vram>[0-9a-fA-F]+)\s+(?P<rom>[0-9a-fA-F]+)\s+(?P<align>[0-9a-fA-F]+)\s+(?P<subline>.+)").unwrap()
859
+ } else {
860
+ // mwld 1.3.2-
861
+ Regex::new(r"^\s*(?P<starting>[0-9a-fA-F]+)\s+(?P<size>[0-9a-fA-F]+)\s+(?P<vram>[0-9a-fA-F]+)\s+(?P<align>[0-9a-fA-F]+)\s+(?P<subline>.+)").unwrap()
862
+ };
863
+
864
+ let segment = Regex::new(r"^(?P<name>.+) section layout$").unwrap();
865
+ let label = Regex::new(r"^(?P<label>lbl_[0-9A-F]{8})\s+(?P<filename>.+?)\s*$").unwrap();
866
+ let symbol = Regex::new(r"^\s*(?P<name>[^ ]+)\s+(?P<filename>.+?)\s*$").unwrap();
867
+ let fill = Regex::new(r"^\s*\*fill\*\s*$").unwrap();
868
+
869
+ Self {
870
+ common_row,
871
+ segment,
872
+ label,
873
+ symbol,
874
+ fill,
875
+ }
876
+ }
877
+ }
878
+
796
879
  impl MapFile {
797
880
  fn preprocess_map_data_gnu(map_data: &str) -> &str {
798
881
  // Skip the stuff we don't care about
@@ -42,7 +42,7 @@ impl Section {
42
42
  filepath: PathBuf,
43
43
  vram: u64,
44
44
  size: u64,
45
- section_type: &str,
45
+ section_type: String,
46
46
  vrom: Option<u64>,
47
47
  align: Option<u64>,
48
48
  ) -> Self {
@@ -53,7 +53,7 @@ impl Section {
53
53
  filepath: PathBuf,
54
54
  vram: u64,
55
55
  size: u64,
56
- section_type: &str,
56
+ section_type: String,
57
57
  vrom: Option<u64>,
58
58
  align: Option<u64>,
59
59
  is_fill: bool,
@@ -62,7 +62,7 @@ impl Section {
62
62
  filepath,
63
63
  vram,
64
64
  size,
65
- section_type: section_type.into(),
65
+ section_type,
66
66
  vrom,
67
67
  align,
68
68
  is_fill,
@@ -303,52 +303,20 @@ impl Section {
303
303
 
304
304
  impl Section {
305
305
  pub(crate) fn new_default(
306
- filepath: std::path::PathBuf,
306
+ filepath: PathBuf,
307
307
  vram: u64,
308
308
  size: u64,
309
- section_type: &str,
309
+ section_type: String,
310
310
  ) -> Self {
311
- Section {
312
- filepath,
313
- vram,
314
- size,
315
- section_type: section_type.into(),
316
- vrom: None,
317
- align: None,
318
- is_fill: false,
319
- symbols: Vec::new(),
320
- }
311
+ Self::new_impl(filepath, vram, size, section_type, None, None, false)
321
312
  }
322
313
 
323
314
  pub(crate) fn new_placeholder() -> Self {
324
- Self {
325
- filepath: "".into(),
326
- vram: 0,
327
- size: 0,
328
- section_type: "".into(),
329
- vrom: None,
330
- align: None,
331
- is_fill: false,
332
- symbols: Vec::new(),
333
- }
315
+ Self::new_impl("".into(), 0, 0, "".into(), None, None, false)
334
316
  }
335
317
 
336
- pub(crate) fn new_fill(
337
- filepath: std::path::PathBuf,
338
- vram: u64,
339
- size: u64,
340
- section_type: &str,
341
- ) -> Self {
342
- Self {
343
- filepath,
344
- vram,
345
- size,
346
- section_type: section_type.into(),
347
- vrom: None,
348
- align: None,
349
- is_fill: true,
350
- symbols: Vec::new(),
351
- }
318
+ pub(crate) fn new_fill(filepath: PathBuf, vram: u64, size: u64, section_type: String) -> Self {
319
+ Self::new_impl(filepath, vram, size, section_type, None, None, true)
352
320
  }
353
321
 
354
322
  pub fn is_placeholder(&self) -> bool {
@@ -420,8 +388,6 @@ impl Hash for Section {
420
388
  pub(crate) mod python_bindings {
421
389
  use pyo3::{intern, prelude::*, IntoPyObjectExt};
422
390
 
423
- use std::path::PathBuf;
424
-
425
391
  // Required to call the `.hash` and `.finish` methods, which are defined on traits.
426
392
  use std::hash::{Hash, Hasher};
427
393
 
@@ -439,7 +405,7 @@ pub(crate) mod python_bindings {
439
405
  filepath: PathBuf,
440
406
  vram: u64,
441
407
  size: u64,
442
- section_type: &str,
408
+ section_type: String,
443
409
  vrom: Option<u64>,
444
410
  align: Option<u64>,
445
411
  is_fill: bool,
@@ -195,7 +195,7 @@ impl Segment {
195
195
  let vram = first_section.vram;
196
196
  let mut size = 0;
197
197
  let vrom = first_section.vrom;
198
- let section_type = &first_section.section_type;
198
+ let section_type = first_section.section_type.clone();
199
199
  let align = first_section.align;
200
200
 
201
201
  let mut symbols = Vec::new();
File without changes