From 0159d4335275e5226fd4734d160bb067545b15cd Mon Sep 17 00:00:00 2001 From: Tharo <17233964+Thar0@users.noreply.github.com> Date: Sat, 9 Mar 2024 15:54:42 +0000 Subject: [PATCH] mkldscript: Capture more special rodata sections for GCC (#1919) --- tools/mkldscript.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tools/mkldscript.c b/tools/mkldscript.c index ed61e543e9..05ecdfd353 100644 --- a/tools/mkldscript.c +++ b/tools/mkldscript.c @@ -109,8 +109,6 @@ static void write_ld_script(FILE *fout) fprintf(fout, " %s (.data)\n" " . = 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 // the ones named directly below. These sections do not contain values that // 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. // 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" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); - fprintf(fout, " %s (.rodata.cst4)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); - fprintf(fout, " %s (.rodata.cst8)\n" - " . = ALIGN(0x10);\n", seg->includes[j].fpath); + fprintf(fout, " %s (.rodata)\n" + " %s (.rodata.str*)\n" + " %s (.rodata.cst*)\n" + " . = ALIGN(0x10);\n", + seg->includes[j].fpath, seg->includes[j].fpath, seg->includes[j].fpath); } fprintf(fout, " _%sSegmentRoDataEnd = .;\n", seg->name);