From 039f1b3c564667ab6fc9955bd892c2e527eb80b0 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 10 Sep 2018 15:51:44 -0400 Subject: [PATCH] make arch __fesetround backends hidden these are not public interfaces and do not match the public function, but delegate argument checking to it. --- src/fenv/aarch64/fenv.s | 1 + src/fenv/arm/fenv-hf.S | 1 + src/fenv/fesetround.c | 3 ++- src/fenv/i386/fenv.s | 1 + src/fenv/m68k/fenv.c | 3 ++- src/fenv/mips/fenv.S | 1 + src/fenv/mips64/fenv.S | 1 + src/fenv/mipsn32/fenv.S | 1 + src/fenv/powerpc/fenv.S | 1 + src/fenv/powerpc64/fenv.c | 3 ++- src/fenv/s390x/fenv.c | 3 ++- src/fenv/sh/fenv.S | 1 + src/fenv/x32/fenv.s | 1 + src/fenv/x86_64/fenv.s | 1 + 14 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/fenv/aarch64/fenv.s b/src/fenv/aarch64/fenv.s index f0db5d9d..8f3ec965 100644 --- a/src/fenv/aarch64/fenv.s +++ b/src/fenv/aarch64/fenv.s @@ -6,6 +6,7 @@ fegetround: ret .global __fesetround +.hidden __fesetround .type __fesetround,%function __fesetround: mrs x1, fpcr diff --git a/src/fenv/arm/fenv-hf.S b/src/fenv/arm/fenv-hf.S index f55d798a..2a1de0d1 100644 --- a/src/fenv/arm/fenv-hf.S +++ b/src/fenv/arm/fenv-hf.S @@ -11,6 +11,7 @@ fegetround: bx lr .global __fesetround +.hidden __fesetround .type __fesetround,%function __fesetround: fmrx r3, fpscr diff --git a/src/fenv/fesetround.c b/src/fenv/fesetround.c index 9bbd4ade..a85db712 100644 --- a/src/fenv/fesetround.c +++ b/src/fenv/fesetround.c @@ -1,8 +1,9 @@ #include +#include "libc.h" /* __fesetround wrapper for arch independent argument check */ -int __fesetround(int); +hidden int __fesetround(int); int fesetround(int r) { diff --git a/src/fenv/i386/fenv.s b/src/fenv/i386/fenv.s index a189ca2e..e7f7932a 100644 --- a/src/fenv/i386/fenv.s +++ b/src/fenv/i386/fenv.s @@ -61,6 +61,7 @@ feraiseexcept: ret .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: mov 4(%esp),%ecx diff --git a/src/fenv/m68k/fenv.c b/src/fenv/m68k/fenv.c index e60949d1..fa853797 100644 --- a/src/fenv/m68k/fenv.c +++ b/src/fenv/m68k/fenv.c @@ -1,4 +1,5 @@ #include +#include "libc.h" #if __HAVE_68881__ || __mcffpu__ @@ -50,7 +51,7 @@ int fegetround(void) return getcr() & FE_UPWARD; } -int __fesetround(int r) +hidden int __fesetround(int r) { setcr((getcr() & ~FE_UPWARD) | r); return 0; diff --git a/src/fenv/mips/fenv.S b/src/fenv/mips/fenv.S index a5cb1f58..ffa92971 100644 --- a/src/fenv/mips/fenv.S +++ b/src/fenv/mips/fenv.S @@ -39,6 +39,7 @@ fegetround: andi $2, $2, 3 .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: cfc1 $5, $31 diff --git a/src/fenv/mips64/fenv.S b/src/fenv/mips64/fenv.S index 3cba3f0f..d5e0a620 100644 --- a/src/fenv/mips64/fenv.S +++ b/src/fenv/mips64/fenv.S @@ -39,6 +39,7 @@ fegetround: andi $2, $2, 3 .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: cfc1 $5, $31 diff --git a/src/fenv/mipsn32/fenv.S b/src/fenv/mipsn32/fenv.S index cce6436b..563d3220 100644 --- a/src/fenv/mipsn32/fenv.S +++ b/src/fenv/mipsn32/fenv.S @@ -38,6 +38,7 @@ fegetround: andi $2, $2, 3 .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: cfc1 $5, $31 diff --git a/src/fenv/powerpc/fenv.S b/src/fenv/powerpc/fenv.S index 1516eb5c..22cea216 100644 --- a/src/fenv/powerpc/fenv.S +++ b/src/fenv/powerpc/fenv.S @@ -79,6 +79,7 @@ fegetround: blr .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: /* diff --git a/src/fenv/powerpc64/fenv.c b/src/fenv/powerpc64/fenv.c index 739420b7..9db0fb6f 100644 --- a/src/fenv/powerpc64/fenv.c +++ b/src/fenv/powerpc64/fenv.c @@ -1,5 +1,6 @@ #define _GNU_SOURCE #include +#include "libc.h" static inline double get_fpscr_f(void) { @@ -49,7 +50,7 @@ int fegetround(void) return get_fpscr() & 3; } -int __fesetround(int r) +hidden int __fesetround(int r) { set_fpscr(get_fpscr() & ~3L | r); return 0; diff --git a/src/fenv/s390x/fenv.c b/src/fenv/s390x/fenv.c index 9a3488d7..72b9dbea 100644 --- a/src/fenv/s390x/fenv.c +++ b/src/fenv/s390x/fenv.c @@ -1,4 +1,5 @@ #include +#include "libc.h" static inline unsigned get_fpc(void) { @@ -36,7 +37,7 @@ int fegetround(void) return get_fpc() & 3; } -int __fesetround(int r) +hidden int __fesetround(int r) { set_fpc(get_fpc() & ~3L | r); return 0; diff --git a/src/fenv/sh/fenv.S b/src/fenv/sh/fenv.S index cd47b5bc..907aefc0 100644 --- a/src/fenv/sh/fenv.S +++ b/src/fenv/sh/fenv.S @@ -8,6 +8,7 @@ fegetround: and #3, r0 .global __fesetround +.hidden __fesetround .type __fesetround, @function __fesetround: sts fpscr, r0 diff --git a/src/fenv/x32/fenv.s b/src/fenv/x32/fenv.s index 45310465..835f23b6 100644 --- a/src/fenv/x32/fenv.s +++ b/src/fenv/x32/fenv.s @@ -30,6 +30,7 @@ feraiseexcept: ret .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: push %rax diff --git a/src/fenv/x86_64/fenv.s b/src/fenv/x86_64/fenv.s index b5aeaf4f..98d876da 100644 --- a/src/fenv/x86_64/fenv.s +++ b/src/fenv/x86_64/fenv.s @@ -30,6 +30,7 @@ feraiseexcept: ret .global __fesetround +.hidden __fesetround .type __fesetround,@function __fesetround: push %rax -- 2.25.1