mirror of
https://github.com/zeldaret/oot.git
synced 2024-11-10 19:20:13 +00:00
fix rodata order inconsistency bug in mkldscript (required for GCC support) (#932)
* fix rodata order inconsistency bug in mkldscript (required for GCC support) * Update tools/mkldscript.c Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
This commit is contained in:
parent
6ef1f3ea3e
commit
7728f75d2a
1 changed files with 13 additions and 0 deletions
|
@ -377,7 +377,20 @@ static void write_ld_script(void)
|
|||
fprintf(fout, " _%sSegmentRoDataStart = .;\n", seg->name);
|
||||
|
||||
for (j = 0; j < seg->includesCount; j++)
|
||||
{
|
||||
fprintf(fout, " %s (.rodata)\n", seg->includes[j]);
|
||||
// Compilers other than IDO, such as GCC, produce different sections such as
|
||||
// the ones named directly below. These sections do not contain values that
|
||||
// need relocating, but we need to ensure that the base .rodata section
|
||||
// always comes first. The reason this is important is due to relocs assuming
|
||||
// the base of .rodata being the offset for the relocs and thus needs to remain
|
||||
// the beginning of the entire rodata area in order to remain consistent.
|
||||
// Inconsistencies will lead to various .rodata reloc crashes as a result of
|
||||
// either missing relocs or wrong relocs.
|
||||
fprintf(fout, " %s (.rodata.str1.4)\n", seg->includes[j]);
|
||||
fprintf(fout, " %s (.rodata.cst4)\n", seg->includes[j]);
|
||||
fprintf(fout, " %s (.rodata.cst8)\n", seg->includes[j]);
|
||||
}
|
||||
|
||||
//fprintf(fout, " . = ALIGN(0x10);\n");
|
||||
|
||||
|
|
Loading…
Reference in a new issue