From eca3646fff4daecd5bcabb7b5ebf871438229777 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sun, 1 Mar 2026 17:43:38 -0700 Subject: [PATCH] Update docs/splits.md --- configure.py | 1 - docs/splits.md | 37 ++++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/configure.py b/configure.py index ba24603..fb97b4f 100755 --- a/configure.py +++ b/configure.py @@ -199,7 +199,6 @@ cflags_base = [ "-enum int", "-fp hardware", "-Cpp_exceptions off", - # "-W all", "-O4,p", "-inline auto", '-pragma "cats off"', diff --git a/docs/splits.md b/docs/splits.md index ab69e1f..9e707f1 100644 --- a/docs/splits.md +++ b/docs/splits.md @@ -5,6 +5,12 @@ This file contains file splits for a module. Example: ```yaml +Sections: + .text type:code align:32 + .ctors type:rodata align:32 + .data type:data align:32 + .bss type:bss align:32 + path/to/file.cpp: .text start:0x80047E5C end:0x8004875C .ctors start:0x803A54C4 end:0x803A54C8 @@ -13,7 +19,20 @@ path/to/file.cpp: .bss start:0x8040D4AC end:0x8040D4D8 common ``` -## Format +## Header + +```yaml +Sections: + section [section attributes] +``` + +### Attributes + +- `type:` The section type. `code`, `data`, `rodata` or `bss`. +- `align:` The section alignment in bytes. +- `vaddr:` (REL only) The fixed virtual address of the section. When set, split and symbol addresses are written as absolute addresses. + +## Files ```yaml path/to/file.cpp: [file attributes] @@ -53,19 +72,3 @@ path/to/file.cpp: [file attributes] - `rename:` Writes this section under a different name when generating the split object. Used for `.ctors$10`, etc. - `common` Only valid for `.bss`. See [Common BSS](common_bss.md). - `skip` Skips this data when writing the object file. Used for ignoring data that's linker-generated. - -#### `Sections:` header (REL modules only) - -REL modules can specify fixed virtual addresses for sections using a `Sections:` block at the top of the file. This is useful for projects where REL modules load at known addresses, allowing symbols and splits to use absolute addresses instead of section-relative ones. - -```yaml -Sections: - .text type:code vaddr:0x805A1234 - .data type:data vaddr:0x805B0000 - -path/to/file.cpp: - .text start:0x805A1234 end:0x805A2000 -``` - -- `type:` The section type. `code` or `data`. -- `vaddr:` The fixed virtual address of the section. When set, split and symbol addresses are written as absolute addresses.