about summary refs log tree commit diff
path: root/include/stdio.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-02-15 20:57:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2018-02-15 20:57:15 +0000
commit7fc03cf320f9ed0178babbb33de0550d393b8886 (patch)
treecde5c33ae087157df65748a4a4d2b96cffdbf41a /include/stdio.h
parent0c8a67a5737b4b6dd74bd24219fc642c8d244bee (diff)
downloadglibc-7fc03cf320f9ed0178babbb33de0550d393b8886.tar.gz
glibc-7fc03cf320f9ed0178babbb33de0550d393b8886.tar.xz
glibc-7fc03cf320f9ed0178babbb33de0550d393b8886.zip
Fix -Os feof_unlocked linknamespace, localplt issues (bug 15105, bug 19463).
Continuing the fixes for linknamespace and localplt test failures with
-Os that arise from functions not being inlined in that case, this
patch fixes such failures for feof_unlocked.

The usual approach is followed of adding __feof_unlocked (inlined when
feof_unlocked is), making calls use it when required for namespace
reasons, and using libc_hidden_proto / libc_hidden_weak for the
feof_unlocked weak alias when only localplt but not namespace issues
are involved.  In the case of getaddrinfo.c, use of __feof_unlocked
needs to be conditional since that code is also used in nscd (where
__feof_unlocked is not available).

Tested for x86_64 (both without -Os to make sure that case continues
to work, and with -Os to make sure all the relevant linknamespace and
localplt test failures are resolved).  Because of other such failures
that remain after this patch, neither of the bugs can yet be closed.

	[BZ #15105]
	[BZ #19463]
	* libio/feof_u.c (feof_unlocked): Rename to __feof_unlocked and
	define as weak alias of __feof_unlocked.  Use libc_hidden_weak.
	* include/stdio.h (feof_unlocked): Use libc_hidden_proto.
	(__feof_unlocked): New declaration, and inline function if
	[__USE_EXTERN_INLINES].
	* iconv/gconv_conf.c (read_conf_file): Call __feof_unlocked
	instead of feof_unlocked.
	* intl/localealias.c [_LIBC] (FEOF): Likewise.
	* nss/nsswitch.c (nss_parse_file): Likewise.
	* sysdeps/unix/sysv/linux/readonly-area.c (__readonly_area):
	Likewise.
	* time/getdate.c (__getdate_r): Likewise.
	* sysdeps/posix/getaddrinfo.c [IS_IN (libc)] (feof_unlocked):
	Define as macro to call __feof_unlocked.
Diffstat (limited to 'include/stdio.h')
-rw-r--r--include/stdio.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 94bc2fdc7e..7ab3ddd942 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -179,6 +179,8 @@ libc_hidden_proto (__fgets_unlocked)
 libc_hidden_proto (fputs_unlocked)
 extern __typeof (fputs_unlocked) __fputs_unlocked;
 libc_hidden_proto (__fputs_unlocked)
+libc_hidden_proto (feof_unlocked)
+extern __typeof (feof_unlocked) __feof_unlocked attribute_hidden;
 libc_hidden_proto (fmemopen)
 /* The prototype needs repeating instead of using __typeof to use
    __THROW in C++ tests.  */
@@ -199,5 +201,13 @@ libc_hidden_proto (__fmemopen)
 extern int __gen_tempfd (int flags);
 libc_hidden_proto (__gen_tempfd)
 
+#  ifdef __USE_EXTERN_INLINES
+__extern_inline int
+__NTH (__feof_unlocked (FILE *__stream))
+{
+  return __feof_unlocked_body (__stream);
+}
+#  endif
+
 # endif /* not _ISOMAC */
 #endif /* stdio.h */