I don't think the native ld on alpha-dec-osf3 supports such a feature, so we would (I assume) have to leave -split-objs in ghc even if we do implement -ffunction-sections/-fdata-sections. (Would it just be a matter of enabling it when invoking gcc? Would I be able to try it on my i386-linux box with -optc-ffunction-sections? Or I suppose the mangler would need to be educated...)
AFAIK it only works on ELF, and only with GNU ld. You could take advantage of it when doing unregisterised compilation, but otherwise we have to teach the mangler about it. And there's bound to be some complication due to the assumptions we make in the RTS about the relative ordering of code/data. Cheers, Simon
Simon (talking about using -ffunction-sections)
And there's bound to be some complication due to the assumptions we make in the RTS about the relative ordering of code/data.
Sounds like the mangler should do the function section magic. Assuming the mangler understands where section boundaries can and cannot go (I think this is true), this should be quite easy. If you run this: $ cat > /tmp/tst.c int f(int x) {return x;} int g(int x) {return x;} $ gcc -ffunction-sections -o - -S /tmp/tst.c You'll see that the -ffunction-sections flag causes gcc to output these section directives before the code implementing f and g. .section .text.f,"ax",@progbits .section .text.g,"ax",@progbits The corresponding GNU linker magic constructs the .text segment out of all the .text.* segments. -- Alastair Reid reid@cs.utah.edu http://www.cs.utah.edu/~reid/
participants (2)
-
Alastair David Reid -
Simon Marlow