From e1c3cf6a753f912738ebb8bbaf48155de353f22f Mon Sep 17 00:00:00 2001 From: Valery Ushakov Date: Thu, 2 Jun 2016 03:28:22 +0300 Subject: fns.h should declare "coherence", not define it. Move the definition to main.c and init it "nofence". This is required because with dynamic linking init/fini code runs before main() has a chance to init it. Since emu provides its own malloc, init/fini code that uses malloc will eventually call coherence() and crash if it's not inited. --- emu/port/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'emu/port/main.c') diff --git a/emu/port/main.c b/emu/port/main.c index 158f6b03..da1aa432 100644 --- a/emu/port/main.c +++ b/emu/port/main.c @@ -27,6 +27,10 @@ extern int mflag; ulong displaychan; char *cputype; +/* For dynamic linking init/fini code that needs malloc */ +void (*coherence)(void) = nofence; + + static void usage(void) { -- cgit v1.2.3