Commit 776d55c8 authored by Erik de Castro Lopo's avatar Erik de Castro Lopo

rts/Linker.c: Drop support for legacy OS X dyn loading

Drop support for old OS X (OS X 10.2 and earlier) dynamic linking.
10.3 was released in 2003.

Test Plan: Validate on OS X and Linux.

Reviewers: bgamari, thomie, austin

Reviewed By: thomie, austin

Differential Revision: https://phabricator.haskell.org/D1393
parent c1e1584a
......@@ -107,9 +107,6 @@
# include <mach-o/loader.h>
# include <mach-o/nlist.h>
# include <mach-o/reloc.h>
#if !defined(HAVE_DLFCN_H)
# include <mach-o/dyld.h>
#endif
#if defined(powerpc_HOST_ARCH)
# include <mach-o/ppc/reloc.h>
#endif
......@@ -914,11 +911,8 @@ static void* lookupSymbol_ (char *lbl)
# if defined(OBJFORMAT_ELF)
return internal_dlsym(lbl);
# elif defined(OBJFORMAT_MACHO)
# if HAVE_DLFCN_H
/* On OS X 10.3 and later, we use dlsym instead of the old legacy
interface.
HACK: On OS X, all symbols are prefixed with an underscore.
/* HACK: On OS X, all symbols are prefixed with an underscore.
However, dlsym wants us to omit the leading underscore from the
symbol name -- the dlsym routine puts it back on before searching
for the symbol. For now, we simply strip it off here (and ONLY
......@@ -927,14 +921,6 @@ static void* lookupSymbol_ (char *lbl)
IF_DEBUG(linker, debugBelch("lookupSymbol: looking up %s with dlsym\n", lbl));
ASSERT(lbl[0] == '_');
return internal_dlsym(lbl + 1);
# else
if (NSIsSymbolNameDefined(lbl)) {
NSSymbol symbol = NSLookupAndBindSymbol(lbl);
return NSAddressOfSymbol(symbol);
} else {
return NULL;
}
# endif /* HAVE_DLFCN_H */
# elif defined(OBJFORMAT_PEi386)
void* sym;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment