mirror of
https://github.com/encounter/dtk-template.git
synced 2026-07-10 03:18:35 -07:00
Update docs/splits.md
This commit is contained in:
@@ -199,7 +199,6 @@ cflags_base = [
|
||||
"-enum int",
|
||||
"-fp hardware",
|
||||
"-Cpp_exceptions off",
|
||||
# "-W all",
|
||||
"-O4,p",
|
||||
"-inline auto",
|
||||
'-pragma "cats off"',
|
||||
|
||||
+20
-17
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user