summaryrefslogtreecommitdiff
path: root/linker_scripts
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-08-19 09:16:04 -0700
committerGitHub <noreply@github.com>2024-08-19 18:16:04 +0200
commitf5fd8daffb02bafff5869f181a13da48b0f3ae0e (patch)
tree32f2804fbc4f7e23f966c0778f6d41903c3ae9dd /linker_scripts
parent46a5fa919b7bb261c3a11b93fe502c6720619b52 (diff)
Use incremental link for z_message/z_game_over data shenanigans (#2051)
Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
Diffstat (limited to 'linker_scripts')
-rw-r--r--linker_scripts/audio_table_rodata.ld17
-rw-r--r--linker_scripts/data_with_rodata.ld22
2 files changed, 22 insertions, 17 deletions
diff --git a/linker_scripts/audio_table_rodata.ld b/linker_scripts/audio_table_rodata.ld
deleted file mode 100644
index 27eab49fc..000000000
--- a/linker_scripts/audio_table_rodata.ld
+++ /dev/null
@@ -1,17 +0,0 @@
-OUTPUT_ARCH (mips)
-
-/* Audio Table Linker Script, maps data into rodata */
-
-SECTIONS {
-
- .rodata :
- {
- *(.data*)
- *(.rodata*)
- }
-
- /DISCARD/ :
- {
- *(*);
- }
-}
diff --git a/linker_scripts/data_with_rodata.ld b/linker_scripts/data_with_rodata.ld
new file mode 100644
index 000000000..8d508ee18
--- /dev/null
+++ b/linker_scripts/data_with_rodata.ld
@@ -0,0 +1,22 @@
+OUTPUT_ARCH (mips)
+
+/* Maps data into rodata, used for audio tables and z_message/z_game_over */
+
+SECTIONS {
+ .rodata :
+ {
+ *(.data)
+ *(.rodata)
+ *(.rodata.str*)
+ *(.rodata.cst*)
+ }
+
+ /DISCARD/ :
+ {
+ /* GNU ld assumes that the linker script always combines .gptab.data and
+ * .gptab.sdata into .gptab.sdata, and likewise for .gptab.bss and .gptab.sbss.
+ * To avoid dealing with this, we just discard all .gptab sections.
+ */
+ *(.gptab.*)
+ }
+}