llvm-mos / llvm-mos-sdk

SDK for developing with the llvm-mos compiler
https://www.llvm-mos.org
Other
266 stars 53 forks source link

Add sections for the ram memory area when c-in-prg-ram is used #216

Closed cogwheel closed 11 months ago

cogwheel commented 11 months ago

On NES mapper targets, when c-in-prg-ram is used, there are no sections that map into the RAM memory area. This makes (2 KiB - 2 pages) worth of RAM effectively unavailable for use without adding custom linker scripts.

Maybe there could sections like .low_ram.(bss|data|noinit).* that always map to the ram region? These could even be used by things like the neslib buffers and the software stack to leave more "user" ram available (and marginally simplify PRG-RAM banking)

mysterymath commented 11 months ago

By analogy this should just be called .ram; that's the name of the memory region, like .prg_ram_k. We generally don't support the bss/data semantics for non-C regions; there's an existing issue for this (llvm-mos/llvm-mos#220), but it's non-trivial. This was pretty much just a straight oversight, so I'm calling it a bug. But yes, every other region has dedicated sections; RAM should too.

mysterymath commented 11 months ago

Fixed by #218.