[MLton] commit r4732: Generate .symbol_stub sections on x86-darwin
Matthew Fluet
fluet at mlton.org
Thu Oct 19 18:42:43 PDT 2006
The MacOS X assembler guide describes how to generate symbol stubs for
undefined functions that are called in the module.
http://tuvix.apple.com/documentation/DeveloperTools/Reference/Assembler/Assembler.pdf
This is untested, since I don't have access to an Intel Mac, but the
produced assembly appears to match the spec. I believe that this
should accomodate the _import syntax.
I don't know if anything special needs to be done on x86-darwin to
access a symbol defined in a dynamic library; i.e., the _symbol and
_address syntax. I'd be interested to know how gcc compiles:
extern int x;
void setX(int y) { x = y; }
int getX() { return x; }
int* getXAddr() { return &x; }
----------------------------------------------------------------------
U mlton/trunk/mlton/codegen/x86-codegen/x86-allocate-registers.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86-generate-transfers.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86-translate.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86-validate.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86.fun
U mlton/trunk/mlton/codegen/x86-codegen/x86.sig
More information about the MLton
mailing list