From 2899de9b05f15e67966ed3d046709b48703a162a Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 22 May 2014 20:06:23 -0700 Subject: [PATCH] Hide various stdio implementation details. I've left __sF exposed since that's how the OpenBSD stdin, stdout, stderr are implemented. Other BSDs and glibc use a separate global for each instead of an array. Bug: 11156955 Change-Id: I9f3d2d4314a8d4a78c3197b9acd9258820c5f150 --- libc/stdio/glue.h | 4 ++++ libc/stdio/local.h | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/libc/stdio/glue.h b/libc/stdio/glue.h index 73cef6327..81f83fc01 100644 --- a/libc/stdio/glue.h +++ b/libc/stdio/glue.h @@ -42,4 +42,8 @@ struct glue { FILE *iobs; }; +#pragma GCC visibility push(hidden) + extern struct glue __sglue; + +#pragma GCC visibility pop diff --git a/libc/stdio/local.h b/libc/stdio/local.h index 7afa761ed..7ab73c0b8 100644 --- a/libc/stdio/local.h +++ b/libc/stdio/local.h @@ -41,6 +41,8 @@ #include "wcio.h" #include "fileext.h" +#pragma GCC visibility push(hidden) + int __sflush(FILE *); int __sflush_locked(FILE *); FILE *__sfp(void); @@ -118,3 +120,10 @@ static __inline int __sputc(int _c, FILE* _p) { return (__swbuf(_c, _p)); } } + +/* OpenBSD declares these in fvwrite.h but we want to ensure they're hidden. */ +struct __suio; +extern int __sfvwrite(FILE *, struct __suio *); +wint_t __fputwc_unlock(wchar_t wc, FILE *fp); + +#pragma GCC visibility pop