1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-15 06:06:04 +00:00

mkldscript: Capture more special rodata sections for GCC (#1919)

This commit is contained in:
Tharo 2024-03-09 15:54:42 +00:00 committed by GitHub
parent 68a86d2d00
commit 0159d43352
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,8 +109,6 @@ static void write_ld_script(FILE *fout)
fprintf(fout, " %s (.data)\n" fprintf(fout, " %s (.data)\n"
" . = ALIGN(0x10);\n", seg->includes[j].fpath); " . = ALIGN(0x10);\n", seg->includes[j].fpath);
fprintf(fout, " %s (.rodata)\n"
" . = ALIGN(0x10);\n", seg->includes[j].fpath);
// Compilers other than IDO, such as GCC, produce different sections such as // Compilers other than IDO, such as GCC, produce different sections such as
// the ones named directly below. These sections do not contain values that // the ones named directly below. These sections do not contain values that
// need relocating, but we need to ensure that the base .rodata section // need relocating, but we need to ensure that the base .rodata section
@ -119,12 +117,11 @@ static void write_ld_script(FILE *fout)
// the beginning of the entire rodata area in order to remain consistent. // the beginning of the entire rodata area in order to remain consistent.
// Inconsistencies will lead to various .rodata reloc crashes as a result of // Inconsistencies will lead to various .rodata reloc crashes as a result of
// either missing relocs or wrong relocs. // either missing relocs or wrong relocs.
fprintf(fout, " %s (.rodata.str1.4)\n" fprintf(fout, " %s (.rodata)\n"
" . = ALIGN(0x10);\n", seg->includes[j].fpath); " %s (.rodata.str*)\n"
fprintf(fout, " %s (.rodata.cst4)\n" " %s (.rodata.cst*)\n"
" . = ALIGN(0x10);\n", seg->includes[j].fpath); " . = ALIGN(0x10);\n",
fprintf(fout, " %s (.rodata.cst8)\n" seg->includes[j].fpath, seg->includes[j].fpath, seg->includes[j].fpath);
" . = ALIGN(0x10);\n", seg->includes[j].fpath);
} }
fprintf(fout, " _%sSegmentRoDataEnd = .;\n", seg->name); fprintf(fout, " _%sSegmentRoDataEnd = .;\n", seg->name);