On 08-Nov-2000, Simon Marlow <simonmar@microsoft.com> wrote:
(2) the ability for FFI to link in values as weak external references. (In other words the reference doesn't have to be resolved and you can find out if it has been.) So assuming (1) has been implemented, I might want something additionally like foreign import weak "default_arguments" getDefaultArguments :: IO (Maybe Addr) Now while I would LIKE these features, they aren't there, and it won't cause me great distress to work around their absence. But why not implement them anyway?
Do you know how to use existing support for weak references in the linker/assembler? I believe GNU as/ld has them, but I can't find any reference in the docs.
In GNU C: extern int foo __attribute__((weak)); int main() { printf("%p", &foo); } This is documented in the gcc info pages. In GNU as: .weak foo -- Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit | of excellence is a lethal habit" WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.