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:16] – [Address space] asie | wswan:guide:elf_quirks [2024/09/22 11:58] (current) – asie | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
The ELF format created by Wonderful has some quirks, owing both to the non-upstream binutils fork used and to the specifics of the ROM format itself. | The ELF format created by Wonderful has some quirks, owing both to the non-upstream binutils fork used and to the specifics of the ROM format itself. | ||
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 |
- | ELF addresses '' | + | 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 '' | ||
< | < | ||
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 '' |
+ | |||
+ | ===== Address space (wwitch) ===== | ||
+ | |||
+ | All of this may be changed in a future version, so please don't rely on it. | ||
+ | |||
+ | ELF VMA addresses '' | ||
+ | |||
+ | ELF VMA addresses '' |
wswan/guide/elf_quirks.1726996602.txt.gz · Last modified: 2024/09/22 09:16 by asie