diff options
Diffstat (limited to 'ports/sysdeps/m68k')
-rw-r--r-- | ports/sysdeps/m68k/ffs.c | 1 | ||||
-rw-r--r-- | ports/sysdeps/m68k/fpu/fegetround.c | 1 | ||||
-rw-r--r-- | ports/sysdeps/m68k/m680x0/fpu/s_nextafterl.c | 8 | ||||
-rw-r--r-- | ports/sysdeps/m68k/start.S | 21 |
4 files changed, 26 insertions, 5 deletions
diff --git a/ports/sysdeps/m68k/ffs.c b/ports/sysdeps/m68k/ffs.c index fd4e5ffaed..a3c1a0d02b 100644 --- a/ports/sysdeps/m68k/ffs.c +++ b/ports/sysdeps/m68k/ffs.c @@ -36,6 +36,7 @@ __ffs (x) return 32 - cnt; } weak_alias (__ffs, ffs) +libc_hidden_def (__ffs) libc_hidden_builtin_def (ffs) #undef ffsl weak_alias (__ffs, ffsl) diff --git a/ports/sysdeps/m68k/fpu/fegetround.c b/ports/sysdeps/m68k/fpu/fegetround.c index f1227fe593..54fa7df896 100644 --- a/ports/sysdeps/m68k/fpu/fegetround.c +++ b/ports/sysdeps/m68k/fpu/fegetround.c @@ -28,3 +28,4 @@ fegetround (void) return fpcr & FE_UPWARD; } +libm_hidden_def (fegetround) diff --git a/ports/sysdeps/m68k/m680x0/fpu/s_nextafterl.c b/ports/sysdeps/m68k/m680x0/fpu/s_nextafterl.c index 9a03b78631..03c136bb08 100644 --- a/ports/sysdeps/m68k/m680x0/fpu/s_nextafterl.c +++ b/ports/sysdeps/m68k/m680x0/fpu/s_nextafterl.c @@ -46,7 +46,8 @@ long double __nextafterl(long double x, long double y) if((ix|hx|lx)==0) { /* x == 0 */ SET_LDOUBLE_WORDS(x,esy&0x8000,0,1);/* return +-minsubnormal */ y = x*x; - if(y==x) return y; else return x; /* raise underflow flag */ + math_force_eval (y); /* raise underflow flag */ + return x; } if(esx>=0) { /* x > 0 */ if(esx>esy||((esx==esy) && (hx>hy||((hx==hy)&&(lx>ly))))) { @@ -91,10 +92,7 @@ long double __nextafterl(long double x, long double y) if(esy==0x7fff) return x+x; /* overflow */ if(esy==0 && (hx & 0x80000000) == 0) { /* underflow */ y = x*x; - if(y!=x) { /* raise underflow flag */ - SET_LDOUBLE_WORDS(y,esx,hx,lx); - return y; - } + math_force_eval (y); /* raise underflow flag */ } SET_LDOUBLE_WORDS(x,esx,hx,lx); return x; diff --git a/ports/sysdeps/m68k/start.S b/ports/sysdeps/m68k/start.S index a09896fdc0..c3ceee6fa6 100644 --- a/ports/sysdeps/m68k/start.S +++ b/ports/sysdeps/m68k/start.S @@ -52,6 +52,8 @@ NULL */ +#include <sysdep.h> + .text .globl _start .type _start,@function @@ -74,6 +76,24 @@ _start: pea (%a1) /* Push address of the shared library termination function. */ +#ifdef SHARED + /* Load PIC register. */ + LOAD_GOT (%a5) + + /* Push the address of our own entry points to `.fini' and + `.init'. */ + move.l __libc_csu_fini@GOT(%a5), -(%sp) + move.l __libc_csu_init@GOT(%a5), -(%sp) + + pea (%a0) /* Push second argument: argv. */ + move.l %d0, -(%sp) /* Push first argument: argc. */ + + move.l main@GOT(%a5), -(%sp) + + /* Call the user's main function, and exit with its value. But + let the libc call main. */ + jbsr __libc_start_main@PLTPC +#else /* Push the address of our own entry points to `.fini' and `.init'. */ pea __libc_csu_fini @@ -87,6 +107,7 @@ _start: /* Call the user's main function, and exit with its value. But let the libc call main. */ jbsr __libc_start_main +#endif illegal /* Crash if somehow `exit' does return. */ |