Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2009-09

Constants

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Carsten Bager

Hi

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?

Regards

Carsten

Reply by email

Jonas Maebe
to Carsten Bager
Carsten Bager wrote 10 lines
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

Reply by email