17
17
from . import FunctionRodataEntry
18
18
19
19
20
- def createSectionFromSplitEntry (splitEntry : common .FileSplitEntry , array_of_bytes : bytearray , outputPath : Path , context : common .Context ) -> sections .SectionBase :
20
+ def createSectionFromSplitEntry (splitEntry : common .FileSplitEntry , array_of_bytes : bytearray , context : common .Context ) -> sections .SectionBase :
21
21
offsetStart = splitEntry .offset
22
22
offsetEnd = splitEntry .nextOffset
23
23
@@ -36,15 +36,16 @@ def createSectionFromSplitEntry(splitEntry: common.FileSplitEntry, array_of_byte
36
36
37
37
f : sections .SectionBase
38
38
if splitEntry .section == common .FileSectionType .Text :
39
- f = sections .SectionText (context , offsetStart , offsetEnd , vram , outputPath . stem , array_of_bytes , 0 , None )
39
+ f = sections .SectionText (context , offsetStart , offsetEnd , vram , splitEntry . fileName , array_of_bytes , 0 , None )
40
40
if splitEntry .isRsp :
41
41
f .instrCat = rabbitizer .InstrCategory .RSP
42
42
elif splitEntry .section == common .FileSectionType .Data :
43
- f = sections .SectionData (context , offsetStart , offsetEnd , vram , outputPath . stem , array_of_bytes , 0 , None )
43
+ f = sections .SectionData (context , offsetStart , offsetEnd , vram , splitEntry . fileName , array_of_bytes , 0 , None )
44
44
elif splitEntry .section == common .FileSectionType .Rodata :
45
- f = sections .SectionRodata (context , offsetStart , offsetEnd , vram , outputPath . stem , array_of_bytes , 0 , None )
45
+ f = sections .SectionRodata (context , offsetStart , offsetEnd , vram , splitEntry . fileName , array_of_bytes , 0 , None )
46
46
elif splitEntry .section == common .FileSectionType .Bss :
47
- f = sections .SectionBss (context , offsetStart , offsetEnd , splitEntry .vram , splitEntry .vram + offsetEnd - offsetStart , outputPath .stem , 0 , None )
47
+ bssVramEnd = splitEntry .vram + offsetEnd - offsetStart
48
+ f = sections .SectionBss (context , offsetStart , offsetEnd , splitEntry .vram , bssVramEnd , splitEntry .fileName , 0 , None )
48
49
else :
49
50
common .Utils .eprint ("Error! Section not set!" )
50
51
exit (- 1 )
@@ -105,6 +106,8 @@ def writeOtherRodata(path: Path, rodataFileList: list[sections.SectionBase]):
105
106
continue
106
107
107
108
rodataSymbolPath = rodataPath / (rodataSym .getName () + ".s" )
109
+ common .Utils .printVerbose (f"Writing unmigrated rodata { rodataSymbolPath } " )
110
+
108
111
with rodataSymbolPath .open ("w" ) as f :
109
112
f .write (".section .rodata" + common .GlobalConfig .LINE_ENDS )
110
113
f .write (rodataSym .disassemble (migrate = True ))
0 commit comments