On 17/09/2012 02:32, Michael Norrish wrote:
On 17/09/12 00:02, Rob Arthan wrote:
Object files now use standard "text" and "data" areas when exporting. In particular this means that it is no longer necessary to use --segprot on Mac OS X to avoid a bus error.
I have make files that detect Mac OS X and insert the -segprot option automatically. Should I change these to be more specific about Poly/ML versions, or is it harmless to continue to give the -segprot option?
I have the same question.
If the linker doesn't complain then I don't see any harm in continuing to provide it.
The option says: set the protection on the "segment" (Mac object-file terminology) called "POLY" to be read/write/execute. There no longer is a segment called "POLY" so it's possible, but unlikely, that the linker might complain.
The reason for using the option was that Poly's object-file exporter used to put everything into a single segment and set the protection bits in the object file to read/write/execute. It seems that the linker removed the execute permission which had no effect on 32-bit which doesn't check the execute bit but caused a bus error on 64-bit when trying to execute code in the final executable. Poly/ML 5.5 splits the object file into code (read/execute) and data (read/write) which is the way other languages work. The linker sets the correct permissions without the need for an option.
David