diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-06-12 22:36:38 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-06-12 22:36:38 +0000 |
commit | 3164bf09f529754216eebfa66a5c32ce84eaec25 (patch) | |
tree | f6d9ea5383014ddd81ead768961b27e3868cd476 /libio | |
parent | 8737be806407be51f046b358d8824c4c968912de (diff) | |
download | glibc-3164bf09f529754216eebfa66a5c32ce84eaec25.tar.gz |
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 'libio')
-rw-r--r-- | libio/iofputs.c | 2 | ||||
-rw-r--r-- | libio/iofputs_u.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libio/iofputs.c b/libio/iofputs.c index 00c1cba5da..d1e34e40b4 100644 --- a/libio/iofputs.c +++ b/libio/iofputs.c @@ -48,6 +48,8 @@ libc_hidden_def (_IO_fputs) weak_alias (_IO_fputs, fputs) # ifndef _IO_MTSAFE_IO +strong_alias (_IO_fputs, __fputs_unlocked) +libc_hidden_def (__fputs_unlocked) weak_alias (_IO_fputs, fputs_unlocked) libc_hidden_ver (_IO_fputs, fputs_unlocked) # endif diff --git a/libio/iofputs_u.c b/libio/iofputs_u.c index 6f79838eae..f823686d5b 100644 --- a/libio/iofputs_u.c +++ b/libio/iofputs_u.c @@ -29,7 +29,7 @@ #include <string.h> int -fputs_unlocked (str, fp) +__fputs_unlocked (str, fp) const char *str; _IO_FILE *fp; { @@ -40,4 +40,6 @@ fputs_unlocked (str, fp) result = 1; return result; } -libc_hidden_def (fputs_unlocked) +libc_hidden_def (__fputs_unlocked) +weak_alias (__fputs_unlocked, fputs_unlocked) +libc_hidden_weak (fputs_unlocked) |