Dong Phuong <[EMAIL PROTECTED]> writes: > I'm porting for a microcontroller which support > segment memory. But I don't know how to porting GCC so > that it can understand addresses in different memory > segment. > For example, I want to create seperate code segment > and data segment. > > Is it possible in GCC ? and if the answer is "yes", > how can I do that ?
gcc can support systems with different code and data segments. It doesn't take any special work in gcc itself; gcc already uses different sections for different types of objects. The harder work is in the assembler and linker. I've done it by using extra bits in the addresses to distinguish code and data, and having the linker scripts set section addresses accordingly; of course, these bits are masked out of the final output. Ian