summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/Linker.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 4f85498f0c..58cfca684a 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -6709,6 +6709,11 @@ static int ocRunInit_MachO ( ObjectCode *oc )
getProgEnvv(&envc, &envv);
for (i = 0; i < segLC->nsects; i++) {
+ // ToDo: replace this with a proper check for the S_MOD_INIT_FUNC_POINTERS
+ // flag. We should do this elsewhere in the Mach-O linker code
+ // too. Note that the system linker will *refuse* to honor
+ // sections which don't have this flag, so this could cause
+ // weird behavior divergence (albeit reproduceable).
if (0 == strcmp(sections[i].sectname,"__mod_init_func")) {
char *init_startC = image + sections[i].offset;
init_t *init = (init_t*)init_startC;