On Thu, Jun 23, 2011 at 02:21:36PM -0400, Adam Jackson wrote:
I played briefly with jamming relro into ghc command line options,
you can kind of do it ("-optl-z -optlrelro -optlc-Wl,z,relro" in
ghc-options), but it doesn't change much on its own. You do end up with
an executable with a GNU_RELRO segment, but there's nothing in it
besides linker details (though admittedly, that's not nothing). In
particular you don't end up with a .data.rel.ro section, which implies
that the generated C code isn't bothering to mark things as const that
it expects will need relocations.
I don't think GHC generates C (it used to, a very long time ago). GHC
and OCaml contain code generators that generate machine code directly.
So this could require changes to the code generator, but at least for
RELRO it seems this is just a link-time change (is it?)
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)