diff --git a/CHANGELOG.md b/CHANGELOG.md index dad2a36..1cae2b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `lld` can segfault in certain conditions if those sections are not listed explicitly on the linker script. - Add `.got` to the default list of discarded sections. +- Simplify the formatting used for extra sections. ## [0.3.0] - 2024-08-17 diff --git a/slinky/src/linker_writer.rs b/slinky/src/linker_writer.rs index de91559..1d84b3c 100644 --- a/slinky/src/linker_writer.rs +++ b/slinky/src/linker_writer.rs @@ -435,15 +435,8 @@ impl LinkerWriter<'_> { self.buffer.write_empty_line(); } - let address = " 0"; - for sect in &self.d.settings.sections_allowlist { - self.buffer.writeln(&format!("{}{} :", sect, address)); - self.buffer.begin_block(); - - self.buffer.writeln(&format!("*({});", sect)); - - self.buffer.end_block(); + self.buffer.write_single_entry_section(sect, "0"); } need_ln = true; @@ -454,15 +447,8 @@ impl LinkerWriter<'_> { self.buffer.write_empty_line(); } - let address = " 0"; - for sect in &self.d.settings.sections_allowlist_extra { - self.buffer.writeln(&format!("{}{} :", sect, address)); - self.buffer.begin_block(); - - self.buffer.writeln(&format!("*({});", sect)); - - self.buffer.end_block(); + self.buffer.write_single_entry_section(sect, "0"); } need_ln = true; diff --git a/slinky/src/script_buffer.rs b/slinky/src/script_buffer.rs index 9fdc452..94754cf 100644 --- a/slinky/src/script_buffer.rs +++ b/slinky/src/script_buffer.rs @@ -46,6 +46,10 @@ impl ScriptBuffer { self.writeln("}"); } + pub fn write_single_entry_section(&mut self, section: &str, address: &str) { + self.writeln(&format!("{} {} : {{ *({}); }}", section, address, section)); + } + pub fn write_linker_symbol(&mut self, symbol: &str, value: &str) { // TODO: check `symbol` is a valid C identifier diff --git a/tests/partial_linking/follow_segment.ld b/tests/partial_linking/follow_segment.ld index 993ceca..a8251c9 100644 --- a/tests/partial_linking/follow_segment.ld +++ b/tests/partial_linking/follow_segment.ld @@ -330,18 +330,9 @@ SECTIONS main_ROM_END = __romPos; main_ROM_SIZE = ABSOLUTE(main_ROM_END - main_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/follow_segment/us/ascii.ld b/tests/partial_linking/follow_segment/us/ascii.ld index 67e80f8..233a525 100644 --- a/tests/partial_linking/follow_segment/us/ascii.ld +++ b/tests/partial_linking/follow_segment/us/ascii.ld @@ -48,18 +48,9 @@ SECTIONS build/us/src/alphabets/ascii.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/follow_segment/us/boot.ld b/tests/partial_linking/follow_segment/us/boot.ld index 3da3a0b..4e15cd3 100644 --- a/tests/partial_linking/follow_segment/us/boot.ld +++ b/tests/partial_linking/follow_segment/us/boot.ld @@ -68,18 +68,9 @@ SECTIONS build/us/src/libultra.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/follow_segment/us/kanji.ld b/tests/partial_linking/follow_segment/us/kanji.ld index 11ef52c..209c3bc 100644 --- a/tests/partial_linking/follow_segment/us/kanji.ld +++ b/tests/partial_linking/follow_segment/us/kanji.ld @@ -48,18 +48,9 @@ SECTIONS build/us/src/alphabets/kanji.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/follow_segment/us/main.ld b/tests/partial_linking/follow_segment/us/main.ld index f33d6ce..3c9ce29 100644 --- a/tests/partial_linking/follow_segment/us/main.ld +++ b/tests/partial_linking/follow_segment/us/main.ld @@ -64,18 +64,9 @@ SECTIONS KEEP(build/us/asm/main/util.o(COMMON*)); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/required_syms.ld b/tests/partial_linking/required_syms.ld index c3bee90..ae224ef 100644 --- a/tests/partial_linking/required_syms.ld +++ b/tests/partial_linking/required_syms.ld @@ -68,18 +68,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/required_syms/boot.ld b/tests/partial_linking/required_syms/boot.ld index 4a01f89..ff4d437 100644 --- a/tests/partial_linking/required_syms/boot.ld +++ b/tests/partial_linking/required_syms/boot.ld @@ -48,18 +48,9 @@ SECTIONS build/src/boot/boot_main.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/undefined_syms.ld b/tests/partial_linking/undefined_syms.ld index c0cb2c8..d2da2f6 100644 --- a/tests/partial_linking/undefined_syms.ld +++ b/tests/partial_linking/undefined_syms.ld @@ -266,18 +266,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/undefined_syms/us/boot.ld b/tests/partial_linking/undefined_syms/us/boot.ld index 9364fd5..2afd0b6 100644 --- a/tests/partial_linking/undefined_syms/us/boot.ld +++ b/tests/partial_linking/undefined_syms/us/boot.ld @@ -64,18 +64,9 @@ SECTIONS build/asm/util.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/undefined_syms/us/entry.ld b/tests/partial_linking/undefined_syms/us/entry.ld index a8feb84..2ae149f 100644 --- a/tests/partial_linking/undefined_syms/us/entry.ld +++ b/tests/partial_linking/undefined_syms/us/entry.ld @@ -50,18 +50,9 @@ SECTIONS build/asm/entry.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/undefined_syms/us/header.ld b/tests/partial_linking/undefined_syms/us/header.ld index 163b7cc..b10034e 100644 --- a/tests/partial_linking/undefined_syms/us/header.ld +++ b/tests/partial_linking/undefined_syms/us/header.ld @@ -48,18 +48,9 @@ SECTIONS build/asm/data/rom_header.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/undefined_syms/us/ipl3.ld b/tests/partial_linking/undefined_syms/us/ipl3.ld index dcf36d6..7701566 100644 --- a/tests/partial_linking/undefined_syms/us/ipl3.ld +++ b/tests/partial_linking/undefined_syms/us/ipl3.ld @@ -48,18 +48,9 @@ SECTIONS build/asm/data/ipl3.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes.ld b/tests/partial_linking/vram_classes.ld index 7f7f905..9d082ec 100644 --- a/tests/partial_linking/vram_classes.ld +++ b/tests/partial_linking/vram_classes.ld @@ -1058,18 +1058,9 @@ SECTIONS segment_05_VRAM_CLASS_SIZE = segment_05_VRAM_CLASS_END - segment_05_VRAM_CLASS_START; segment_06_VRAM_CLASS_SIZE = segment_06_VRAM_CLASS_END - segment_06_VRAM_CLASS_START; - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/assets1.ld b/tests/partial_linking/vram_classes/assets1.ld index 13b7330..f08df0e 100644 --- a/tests/partial_linking/vram_classes/assets1.ld +++ b/tests/partial_linking/vram_classes/assets1.ld @@ -56,18 +56,9 @@ SECTIONS build/src/assets/assets1/dlist.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/assets2.ld b/tests/partial_linking/vram_classes/assets2.ld index 36bef31..492a8d1 100644 --- a/tests/partial_linking/vram_classes/assets2.ld +++ b/tests/partial_linking/vram_classes/assets2.ld @@ -56,18 +56,9 @@ SECTIONS build/src/assets/assets2/dlist.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/assets3.ld b/tests/partial_linking/vram_classes/assets3.ld index 22e2b7d..3840bcf 100644 --- a/tests/partial_linking/vram_classes/assets3.ld +++ b/tests/partial_linking/vram_classes/assets3.ld @@ -56,18 +56,9 @@ SECTIONS build/src/assets/assets3/dlist.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/assets4.ld b/tests/partial_linking/vram_classes/assets4.ld index 3b79926..d5e1c66 100644 --- a/tests/partial_linking/vram_classes/assets4.ld +++ b/tests/partial_linking/vram_classes/assets4.ld @@ -56,18 +56,9 @@ SECTIONS build/src/assets/assets4/dlist.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/battle_code.ld b/tests/partial_linking/vram_classes/battle_code.ld index 9daca14..af8614c 100644 --- a/tests/partial_linking/vram_classes/battle_code.ld +++ b/tests/partial_linking/vram_classes/battle_code.ld @@ -72,18 +72,9 @@ SECTIONS build/src/battle_code/popup_messages.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/battle_partner_goombario.ld b/tests/partial_linking/vram_classes/battle_partner_goombario.ld index fec9844..127bfce 100644 --- a/tests/partial_linking/vram_classes/battle_partner_goombario.ld +++ b/tests/partial_linking/vram_classes/battle_partner_goombario.ld @@ -48,18 +48,9 @@ SECTIONS build/src/battle_partner/goombario.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/battle_partner_goompa.ld b/tests/partial_linking/vram_classes/battle_partner_goompa.ld index b7f2b77..36640c2 100644 --- a/tests/partial_linking/vram_classes/battle_partner_goompa.ld +++ b/tests/partial_linking/vram_classes/battle_partner_goompa.ld @@ -48,18 +48,9 @@ SECTIONS build/src/battle_partner/goompa.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/battle_partner_kooper.ld b/tests/partial_linking/vram_classes/battle_partner_kooper.ld index 1d11eca..c19a14a 100644 --- a/tests/partial_linking/vram_classes/battle_partner_kooper.ld +++ b/tests/partial_linking/vram_classes/battle_partner_kooper.ld @@ -48,18 +48,9 @@ SECTIONS build/src/battle_partner/kooper.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/boot.ld b/tests/partial_linking/vram_classes/boot.ld index d75bb56..659aae6 100644 --- a/tests/partial_linking/vram_classes/boot.ld +++ b/tests/partial_linking/vram_classes/boot.ld @@ -58,18 +58,9 @@ SECTIONS build/src/boot/dmadata.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/heaps2.ld b/tests/partial_linking/vram_classes/heaps2.ld index 921db19..ceb5f86 100644 --- a/tests/partial_linking/vram_classes/heaps2.ld +++ b/tests/partial_linking/vram_classes/heaps2.ld @@ -48,18 +48,9 @@ SECTIONS build/src/heaps2/heaps2.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/omo2_1.ld b/tests/partial_linking/vram_classes/omo2_1.ld index 8d37160..4add0ea 100644 --- a/tests/partial_linking/vram_classes/omo2_1.ld +++ b/tests/partial_linking/vram_classes/omo2_1.ld @@ -48,18 +48,9 @@ SECTIONS build/src/battle/area/omo2_1/actor/shy_squad.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/omo2_2.ld b/tests/partial_linking/vram_classes/omo2_2.ld index 0d0da1c..4d5a877 100644 --- a/tests/partial_linking/vram_classes/omo2_2.ld +++ b/tests/partial_linking/vram_classes/omo2_2.ld @@ -48,18 +48,9 @@ SECTIONS build/src/battle/area/omo2_2/actor/stilt_guy.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/omo2_3.ld b/tests/partial_linking/vram_classes/omo2_3.ld index 1b7f3a2..1a4c6cb 100644 --- a/tests/partial_linking/vram_classes/omo2_3.ld +++ b/tests/partial_linking/vram_classes/omo2_3.ld @@ -48,18 +48,9 @@ SECTIONS build/src/battle/area/omo2_3/actor/shy_stack.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/texture_memory.ld b/tests/partial_linking/vram_classes/texture_memory.ld index 8844f4d..7d90210 100644 --- a/tests/partial_linking/vram_classes/texture_memory.ld +++ b/tests/partial_linking/vram_classes/texture_memory.ld @@ -48,18 +48,9 @@ SECTIONS build/src/texture_memory/texture_memory.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/partial_linking/vram_classes/world_script_api.ld b/tests/partial_linking/vram_classes/world_script_api.ld index 052b01a..9ccb1cd 100644 --- a/tests/partial_linking/vram_classes/world_script_api.ld +++ b/tests/partial_linking/vram_classes/world_script_api.ld @@ -72,18 +72,9 @@ SECTIONS build/src/world/script_api/enter_exit.o(COMMON*); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/archives.ld b/tests/test_cases/archives.ld index ab3fd4d..bb3da3a 100644 --- a/tests/test_cases/archives.ld +++ b/tests/test_cases/archives.ld @@ -148,18 +148,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/basic_example.ld b/tests/test_cases/basic_example.ld index 0912f46..9a75824 100644 --- a/tests/test_cases/basic_example.ld +++ b/tests/test_cases/basic_example.ld @@ -282,18 +282,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/conditional_includes.ld b/tests/test_cases/conditional_includes.ld index 4f10908..64f6c39 100644 --- a/tests/test_cases/conditional_includes.ld +++ b/tests/test_cases/conditional_includes.ld @@ -394,18 +394,9 @@ SECTIONS player_model_ROM_END = __romPos; player_model_ROM_SIZE = ABSOLUTE(player_model_ROM_END - player_model_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/drmario64.ld b/tests/test_cases/drmario64.ld index 6f8d8e6..07871af 100644 --- a/tests/test_cases/drmario64.ld +++ b/tests/test_cases/drmario64.ld @@ -7940,155 +7940,44 @@ SECTIONS segment_tutorial_data_ROM_END = __romPos; segment_tutorial_data_ROM_SIZE = ABSOLUTE(segment_tutorial_data_ROM_END - segment_tutorial_data_ROM_START); - .pdr 0 : - { - *(.pdr); - } - .mdebug 0 : - { - *(.mdebug); - } - .mdebug.abi32 0 : - { - *(.mdebug.abi32); - } - .debug 0 : - { - *(.debug); - } - .line 0 : - { - *(.line); - } - .debug_srcinfo 0 : - { - *(.debug_srcinfo); - } - .debug_sfnames 0 : - { - *(.debug_sfnames); - } - .debug_aranges 0 : - { - *(.debug_aranges); - } - .debug_pubnames 0 : - { - *(.debug_pubnames); - } - .debug_info 0 : - { - *(.debug_info); - } - .debug_abbrev 0 : - { - *(.debug_abbrev); - } - .debug_line 0 : - { - *(.debug_line); - } - .debug_line_end 0 : - { - *(.debug_line_end); - } - .debug_frame 0 : - { - *(.debug_frame); - } - .debug_str 0 : - { - *(.debug_str); - } - .debug_loc 0 : - { - *(.debug_loc); - } - .debug_macinfo 0 : - { - *(.debug_macinfo); - } - .debug_weaknames 0 : - { - *(.debug_weaknames); - } - .debug_funcnames 0 : - { - *(.debug_funcnames); - } - .debug_typenames 0 : - { - *(.debug_typenames); - } - .debug_varnames 0 : - { - *(.debug_varnames); - } - .debug_pubtypes 0 : - { - *(.debug_pubtypes); - } - .debug_ranges 0 : - { - *(.debug_ranges); - } - .debug_addr 0 : - { - *(.debug_addr); - } - .debug_line_str 0 : - { - *(.debug_line_str); - } - .debug_loclists 0 : - { - *(.debug_loclists); - } - .debug_macro 0 : - { - *(.debug_macro); - } - .debug_names 0 : - { - *(.debug_names); - } - .debug_rnglists 0 : - { - *(.debug_rnglists); - } - .debug_str_offsets 0 : - { - *(.debug_str_offsets); - } - .debug_sup 0 : - { - *(.debug_sup); - } - .gnu.attributes 0 : - { - *(.gnu.attributes); - } - .note 0 : - { - *(.note); - } - .comment 0 : - { - *(.comment); - } - - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .pdr 0 : { *(.pdr); } + .mdebug 0 : { *(.mdebug); } + .mdebug.abi32 0 : { *(.mdebug.abi32); } + .debug 0 : { *(.debug); } + .line 0 : { *(.line); } + .debug_srcinfo 0 : { *(.debug_srcinfo); } + .debug_sfnames 0 : { *(.debug_sfnames); } + .debug_aranges 0 : { *(.debug_aranges); } + .debug_pubnames 0 : { *(.debug_pubnames); } + .debug_info 0 : { *(.debug_info); } + .debug_abbrev 0 : { *(.debug_abbrev); } + .debug_line 0 : { *(.debug_line); } + .debug_line_end 0 : { *(.debug_line_end); } + .debug_frame 0 : { *(.debug_frame); } + .debug_str 0 : { *(.debug_str); } + .debug_loc 0 : { *(.debug_loc); } + .debug_macinfo 0 : { *(.debug_macinfo); } + .debug_weaknames 0 : { *(.debug_weaknames); } + .debug_funcnames 0 : { *(.debug_funcnames); } + .debug_typenames 0 : { *(.debug_typenames); } + .debug_varnames 0 : { *(.debug_varnames); } + .debug_pubtypes 0 : { *(.debug_pubtypes); } + .debug_ranges 0 : { *(.debug_ranges); } + .debug_addr 0 : { *(.debug_addr); } + .debug_line_str 0 : { *(.debug_line_str); } + .debug_loclists 0 : { *(.debug_loclists); } + .debug_macro 0 : { *(.debug_macro); } + .debug_names 0 : { *(.debug_names); } + .debug_rnglists 0 : { *(.debug_rnglists); } + .debug_str_offsets 0 : { *(.debug_str_offsets); } + .debug_sup 0 : { *(.debug_sup); } + .gnu.attributes 0 : { *(.gnu.attributes); } + .note 0 : { *(.note); } + .comment 0 : { *(.comment); } + + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/fixed_symbol.ld b/tests/test_cases/fixed_symbol.ld index 0e21c26..f992a5d 100644 --- a/tests/test_cases/fixed_symbol.ld +++ b/tests/test_cases/fixed_symbol.ld @@ -900,18 +900,9 @@ SECTIONS stage_3_ROM_END = __romPos; stage_3_ROM_SIZE = ABSOLUTE(stage_3_ROM_END - stage_3_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/follow_segment.ld b/tests/test_cases/follow_segment.ld index 88c99eb..75b05b6 100644 --- a/tests/test_cases/follow_segment.ld +++ b/tests/test_cases/follow_segment.ld @@ -232,18 +232,9 @@ SECTIONS main_ROM_END = __romPos; main_ROM_SIZE = ABSOLUTE(main_ROM_END - main_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/groups.ld b/tests/test_cases/groups.ld index bc64689..1256b69 100644 --- a/tests/test_cases/groups.ld +++ b/tests/test_cases/groups.ld @@ -1832,18 +1832,9 @@ SECTIONS framebuffer_ROM_END = __romPos; framebuffer_ROM_SIZE = ABSOLUTE(framebuffer_ROM_END - framebuffer_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/hardcoded_gp.ld b/tests/test_cases/hardcoded_gp.ld index 0033af5..62508c2 100644 --- a/tests/test_cases/hardcoded_gp.ld +++ b/tests/test_cases/hardcoded_gp.ld @@ -78,18 +78,9 @@ SECTIONS main_ROM_END = __romPos; main_ROM_SIZE = ABSOLUTE(main_ROM_END - main_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/hit_and_run.ld b/tests/test_cases/hit_and_run.ld index 4517313..b005c5e 100644 --- a/tests/test_cases/hit_and_run.ld +++ b/tests/test_cases/hit_and_run.ld @@ -33519,155 +33519,44 @@ SECTIONS cod_noload_VRAM_END = .; cod_noload_VRAM_SIZE = ABSOLUTE(cod_noload_VRAM_END - cod_noload_VRAM); - .pdr 0 : - { - *(.pdr); - } - .mdebug 0 : - { - *(.mdebug); - } - .mdebug.abi32 0 : - { - *(.mdebug.abi32); - } - .debug 0 : - { - *(.debug); - } - .line 0 : - { - *(.line); - } - .debug_srcinfo 0 : - { - *(.debug_srcinfo); - } - .debug_sfnames 0 : - { - *(.debug_sfnames); - } - .debug_aranges 0 : - { - *(.debug_aranges); - } - .debug_pubnames 0 : - { - *(.debug_pubnames); - } - .debug_info 0 : - { - *(.debug_info); - } - .debug_abbrev 0 : - { - *(.debug_abbrev); - } - .debug_line 0 : - { - *(.debug_line); - } - .debug_line_end 0 : - { - *(.debug_line_end); - } - .debug_frame 0 : - { - *(.debug_frame); - } - .debug_str 0 : - { - *(.debug_str); - } - .debug_loc 0 : - { - *(.debug_loc); - } - .debug_macinfo 0 : - { - *(.debug_macinfo); - } - .debug_weaknames 0 : - { - *(.debug_weaknames); - } - .debug_funcnames 0 : - { - *(.debug_funcnames); - } - .debug_typenames 0 : - { - *(.debug_typenames); - } - .debug_varnames 0 : - { - *(.debug_varnames); - } - .debug_pubtypes 0 : - { - *(.debug_pubtypes); - } - .debug_ranges 0 : - { - *(.debug_ranges); - } - .debug_addr 0 : - { - *(.debug_addr); - } - .debug_line_str 0 : - { - *(.debug_line_str); - } - .debug_loclists 0 : - { - *(.debug_loclists); - } - .debug_macro 0 : - { - *(.debug_macro); - } - .debug_names 0 : - { - *(.debug_names); - } - .debug_rnglists 0 : - { - *(.debug_rnglists); - } - .debug_str_offsets 0 : - { - *(.debug_str_offsets); - } - .debug_sup 0 : - { - *(.debug_sup); - } - .gnu.attributes 0 : - { - *(.gnu.attributes); - } - .note 0 : - { - *(.note); - } - .comment 0 : - { - *(.comment); - } + .pdr 0 : { *(.pdr); } + .mdebug 0 : { *(.mdebug); } + .mdebug.abi32 0 : { *(.mdebug.abi32); } + .debug 0 : { *(.debug); } + .line 0 : { *(.line); } + .debug_srcinfo 0 : { *(.debug_srcinfo); } + .debug_sfnames 0 : { *(.debug_sfnames); } + .debug_aranges 0 : { *(.debug_aranges); } + .debug_pubnames 0 : { *(.debug_pubnames); } + .debug_info 0 : { *(.debug_info); } + .debug_abbrev 0 : { *(.debug_abbrev); } + .debug_line 0 : { *(.debug_line); } + .debug_line_end 0 : { *(.debug_line_end); } + .debug_frame 0 : { *(.debug_frame); } + .debug_str 0 : { *(.debug_str); } + .debug_loc 0 : { *(.debug_loc); } + .debug_macinfo 0 : { *(.debug_macinfo); } + .debug_weaknames 0 : { *(.debug_weaknames); } + .debug_funcnames 0 : { *(.debug_funcnames); } + .debug_typenames 0 : { *(.debug_typenames); } + .debug_varnames 0 : { *(.debug_varnames); } + .debug_pubtypes 0 : { *(.debug_pubtypes); } + .debug_ranges 0 : { *(.debug_ranges); } + .debug_addr 0 : { *(.debug_addr); } + .debug_line_str 0 : { *(.debug_line_str); } + .debug_loclists 0 : { *(.debug_loclists); } + .debug_macro 0 : { *(.debug_macro); } + .debug_names 0 : { *(.debug_names); } + .debug_rnglists 0 : { *(.debug_rnglists); } + .debug_str_offsets 0 : { *(.debug_str_offsets); } + .debug_sup 0 : { *(.debug_sup); } + .gnu.attributes 0 : { *(.gnu.attributes); } + .note 0 : { *(.note); } + .comment 0 : { *(.comment); } - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/linker_offset.ld b/tests/test_cases/linker_offset.ld index f9c33f8..43dc1d9 100644 --- a/tests/test_cases/linker_offset.ld +++ b/tests/test_cases/linker_offset.ld @@ -94,18 +94,9 @@ SECTIONS main_ROM_END = __romPos; main_ROM_SIZE = ABSOLUTE(main_ROM_END - main_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/makerom_zelda_like.ld b/tests/test_cases/makerom_zelda_like.ld index 94d457d..2eb53aa 100644 --- a/tests/test_cases/makerom_zelda_like.ld +++ b/tests/test_cases/makerom_zelda_like.ld @@ -429,18 +429,9 @@ SECTIONS _gameplay_dangeon_keepSegmentRomEnd = __romPos; _gameplay_dangeon_keepSegmentRomSize = ABSOLUTE(_gameplay_dangeon_keepSegmentRomEnd - _gameplay_dangeon_keepSegmentRomStart); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/pad_test.ld b/tests/test_cases/pad_test.ld index 466e973..746417f 100644 --- a/tests/test_cases/pad_test.ld +++ b/tests/test_cases/pad_test.ld @@ -95,18 +95,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/required_syms.ld b/tests/test_cases/required_syms.ld index d03a32b..6ab4ac9 100644 --- a/tests/test_cases/required_syms.ld +++ b/tests/test_cases/required_syms.ld @@ -68,18 +68,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/section_order_reorder.ld b/tests/test_cases/section_order_reorder.ld index 79e5623..d88c496 100644 --- a/tests/test_cases/section_order_reorder.ld +++ b/tests/test_cases/section_order_reorder.ld @@ -114,18 +114,9 @@ SECTIONS code_ROM_END = __romPos; code_ROM_SIZE = ABSOLUTE(code_ROM_END - code_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/section_start_alignment.ld b/tests/test_cases/section_start_alignment.ld index 653ac32..a06befd 100644 --- a/tests/test_cases/section_start_alignment.ld +++ b/tests/test_cases/section_start_alignment.ld @@ -227,18 +227,9 @@ SECTIONS cod_noload_VRAM_END = .; cod_noload_VRAM_SIZE = ABSOLUTE(cod_noload_VRAM_END - cod_noload_VRAM); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/undefined_syms.ld b/tests/test_cases/undefined_syms.ld index fab1245..58c1a4b 100644 --- a/tests/test_cases/undefined_syms.ld +++ b/tests/test_cases/undefined_syms.ld @@ -298,18 +298,9 @@ SECTIONS boot_ROM_END = __romPos; boot_ROM_SIZE = ABSOLUTE(boot_ROM_END - boot_ROM_START); - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : { diff --git a/tests/test_cases/vram_classes.ld b/tests/test_cases/vram_classes.ld index 2c844e1..aac5064 100644 --- a/tests/test_cases/vram_classes.ld +++ b/tests/test_cases/vram_classes.ld @@ -1145,18 +1145,9 @@ SECTIONS segment_05_VRAM_CLASS_SIZE = segment_05_VRAM_CLASS_END - segment_05_VRAM_CLASS_START; segment_06_VRAM_CLASS_SIZE = segment_06_VRAM_CLASS_END - segment_06_VRAM_CLASS_START; - .symtab 0 : - { - *(.symtab); - } - .strtab 0 : - { - *(.strtab); - } - .shstrtab 0 : - { - *(.shstrtab); - } + .symtab 0 : { *(.symtab); } + .strtab 0 : { *(.strtab); } + .shstrtab 0 : { *(.shstrtab); } /DISCARD/ : {