[fpc-pascal] Constants

Tomas Hajny XHajT03 at mbox.vol.cz
Wed Jan 18 13:51:53 CET 2006


Carsten Bager wrote:
>> 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.

I might be completely wrong, but I suspect it isn't such an easy decision
(as a general rule at least). Some CPUs/platforms might not allow data
access in TEXT (code) segment at all. I don't know whether this is the
case for any of our currently supported platforms (I surely know that it
is _not_ the case for x86 at least ;-) and I guess the same is true for
ARM if you're doing it right now), but it might be (either now or in
future).

Tomas




More information about the fpc-pascal mailing list