[fpc-devel] Constants

Jonas Maebe jonas.maebe at elis.ugent.be
Tue Sep 1 12:36:07 CEST 2009


On 01 Sep 2009, at 12:22, Carsten Bager wrote:

> For 3 years ago I asked about placing constants the code segment.
>
> Peter Vreman replied:
> 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.
>
> How is this looking in the 2.2.4 version of the compiler?

The same, except for Darwin (there read-only data is placed in read- 
only sections). The reason that it's not done for other platforms, is  
because
a) nobody spent time on it
b) it also requires changes to the internal assembler for i386 and  
x86_64 there (the internal assembler is not used for Darwin), to  
support rodata.rel sections (i.e., sections that contain relocated  
data and which therefore have to be read/write on program startup, but  
which afterwards can be made read-only)


Jonas



More information about the fpc-devel mailing list