about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-06-12 22:36:38 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-06-12 22:36:38 +0000
commit3164bf09f529754216eebfa66a5c32ce84eaec25 (patch)
treef6d9ea5383014ddd81ead768961b27e3868cd476 /include
parent8737be806407be51f046b358d8824c4c968912de (diff)
downloadglibc-3164bf09f529754216eebfa66a5c32ce84eaec25.tar.gz
glibc-3164bf09f529754216eebfa66a5c32ce84eaec25.tar.xz
glibc-3164bf09f529754216eebfa66a5c32ce84eaec25.zip
Fix syslog fputs_unlocked namespace (bug 18530).
syslog (XSI POSIX) brings in references to fputs_unlocked (not
POSIX).  This patch fixes this by making fputs_unlocked into a weak
alias for __fputs_unlocked and using __fputs_unlocked as needed.  (No
linknamespace test XFAILs are removed because there are other failures
from syslog as well.)

Tested for x86_64 and x86 (testsuite, and comparison of disassembly of
installed stripped shared libraries).  Disassembly of installed
stripped shared libraries is unchanged on x86_64; on x86, I see some
small changes to instruction ordering and register choice, with no
apparent reason for such changes to be related to this patch, but they
also seem completely harmless with no change to code size.

	[BZ #18530]
	* libio/iofputs.c [!_IO_MTSAFE_IO] (__fputs_unlocked): Define as
	strong alias of _IO_fputs.  Use libc_hidden_def.
	* libio/iofputs_u.c (fputs_unlocked): Rename to __fputs_unlocked
	and define as weak alias of __fputs_unlocked.  Use
	libc_hidden_weak.
	* include/stdio.h (__fputs_unlocked): Declare.  Use
	libc_hidden_proto.
	* misc/syslog.c (__vsyslog_chk): Call __fputs_unlocked instead of
	fputs_unlocked.
Diffstat (limited to 'include')
-rw-r--r--include/stdio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 489e41999d..6ae70a35f4 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -159,6 +159,8 @@ libc_hidden_proto (fgets_unlocked)
 extern __typeof (fgets_unlocked) __fgets_unlocked;
 libc_hidden_proto (__fgets_unlocked)
 libc_hidden_proto (fputs_unlocked)
+extern __typeof (fputs_unlocked) __fputs_unlocked;
+libc_hidden_proto (__fputs_unlocked)
 libc_hidden_proto (fmemopen)
 /* The prototype needs repeating instead of using __typeof to use
    __THROW in C++ tests.  */