
On 5/7/06, Grant Likely grant.likely@secretlab.ca wrote:
On 5/7/06, Forrest Chan chenm@scut.edu.cn wrote:
Hello guys, I know, to implement XIP(eXecute In Place) on linux, read-only data and read-writable data of linux have to be splitted by some certain means, say, by way of using gnu linker scripts. Yes, gnu linker scripts are available to assemble language, but what about C files? Can the scritps separate the two types of data in C files? You know, C source files don't have diretives, like "AREA", "DATA" and "CODE", as assemble source files do. Any reply is appreciated.
This question is a little off-topic for this list.
Typically; the C compiler uses the following sections:
machine code in .text initialized globals and statics in .data* uninitialized globals and statics in .bss (which init code is supposed to clear with zeros) constants in .rodata*
I forgot to mention; For individual variable and functions; GCC allow you to override the default section assignments. Look in the GCC documentation:
http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Function-Attributes.html#index-g... http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Variable-Attributes.html#index-g...
g.
-- Grant Likely, B.Sc. P.Eng. Secret Lab Technologies Ltd. (403) 399-0195