[fpc-pascal] Constants

Peter Vreman peter at freepascal.org
Wed Jan 18 23:01:01 CET 2006


>> It's not the keyword that is the problem. The whole logic for this would
>> have to be implemented.  Think switches, commands to the linker, a way
>> to
>> configure the name for the segment etc. Part of this is specific for
>> your
>> device setup.
>>
>> If writable const is off, also variables declared with CONST could be
>> put in
>> a different segment. There is no need to invent new syntax.
>>
>> However all the linker stuff should be implemented by sb who has such a
>> device and the interest to work on it.
>
> Why not just drop static constants in the Text (Code) segment. I have
> seen other compilers do that. This will not involve any change of the
> interface with the linker (That is what I am doing now in a separate
> assembler file).
> On the other hand I am already using a configuration file for the
> linker. (Where to place Stack, data code etc.)  I assume that it would
> be easy to take care of an extra segment in the linker configuration
> file.

In the compiler is support for a .rodata section, but this doesn't work
yet.  It has very low priority to fix this support. You are welcome to
supply patches to make it work. In your own linker script you can then
include the .rodata in the .text segment of the final executable.






More information about the fpc-pascal mailing list