wswan:guide:elf_quirks
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| wswan:guide:elf_quirks [2024/09/22 09:20] – asie | wswan:guide:elf_quirks [2024/09/22 11:58] (current) – asie | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| In general, gcc-ia16 ELF files follow the 32-bit x86 ELF format. | In general, gcc-ia16 ELF files follow the 32-bit x86 ELF format. | ||
| - | ===== Address space ===== | + | ===== Segment relocations ===== |
| + | |||
| + | binutils-ia16 introduces a custom set of relocations to support segmentation - the segelf specification as proposed by H. Peter Anvin. In particular, ELFs emitted by Wonderful currently use the following relocations: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | In addition, '' | ||
| + | |||
| + | More extensive documentation for these relocations is available [[https:// | ||
| + | |||
| + | ===== Address space (wswan) | ||
| - | ELF addresses '' | + | ELF addresses '' |
| < | < | ||
| Line 15: | Line 29: | ||
| ||| |||| |||| |||| |||| |||| |||| |||| | ||| |||| |||| |||| |||| |||| |||| |||| | ||
| ||| |||| |||| ++++-++++-++++-++++-++++- CPU address (bits 0-19) | ||| |||| |||| ++++-++++-++++-++++-++++- CPU address (bits 0-19) | ||
| - | +++-++++-++++-------------------------- ROM bank (bits 30-20) | + | +++-++++-++++-------------------------- |
| Corresponds to banks 000 - 7FF (128 MB maximum) | Corresponds to banks 000 - 7FF (128 MB maximum) | ||
| The last ROM bank uses addresses FFFxxxxx | The last ROM bank uses addresses FFFxxxxx | ||
| </ | </ | ||
| + | |||
| + | To turn this into a physical address in the cartridge ROM's space, you should use the following equation: '' | ||
| + | |||
| + | The high four bits of the CPU address are ignored for physical ROM address transformations. This is because their purpose is to tell the compiler/ | ||
| + | |||
| + | * The ELF address '' | ||
| + | * The ELF address '' | ||
| ELF addresses '' | ELF addresses '' | ||
| Line 30: | Line 51: | ||
| </ | </ | ||
| - | ELF addresses '' | + | ELF addresses '' |
| - | ===== Segment relocations | + | ===== Address space (wwitch) |
| - | binutils-ia16 introduces | + | All of this may be changed in a future version, so please don't rely on it. |
| - | * '' | + | ELF VMA addresses '' |
| - | * '' | + | |
| - | * '' | + | |
| - | * '' | + | |
| - | * '' | + | |
| - | In addition, | + | ELF VMA addresses |
| - | + | ||
| - | More extensive documentation for these relocations is available [[https:// | + | |
wswan/guide/elf_quirks.1726996847.txt.gz · Last modified: by asie
