|
From: Philipp K. K. <pk...@sp...> - 2025-01-29 09:28:28
|
Am 29.01.25 um 08:33 schrieb Atirut Wattanamongkol: > Hi all. I've been trying to figure out how to make SDCC put > initialized data in the data section instead of in `.initializer` and > such, but no luck. > > My goal is to make SDCC work well with Binutils with minimal custom > linker script work, and putting initialized data in the data section > is part of this. Problem is, I can't seem to figure out how to force > SDCC to do that. All my hacks made to the compiler only seem to move > it somewhere else other than the data section. Should I look at > directly implementing native ELF output instead? Which port are you working on? I don't see how ELF would make a difference here (but if you want to see for yourself, have a look at one of the ports that do support ELF output (hc08, s08, stm8)). Typical SDCC targets are small systems with RAM and ROM/Flash, and SDCC needs to take care of initializing data on startup. Philipp |