aboutsummaryrefslogtreecommitdiff
path: root/libio/iofputs.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2018-02-15 20:58:16 +0000
committerFangrui Song <maskray@google.com>2021-11-19 13:20:26 -0800
commitd7c1214f4d417119c4cca5c36c2adfc4d83be8fc (patch)
treea6adef5fb4201447a4c565d9989d2e0094919872 /libio/iofputs.c
parentaac0d8a9a3a1ffbfd105de339c8653f39fc5ef17 (diff)
downloadglibc-d7c1214f4d417119c4cca5c36c2adfc4d83be8fc.zip
glibc-d7c1214f4d417119c4cca5c36c2adfc4d83be8fc.tar.gz
glibc-d7c1214f4d417119c4cca5c36c2adfc4d83be8fc.tar.bz2
Use libc_hidden_* for fputs (bug 15105).
Among other localplt test failures when building with -Os, there are libc.so PLT references for fputs. fputs calls normally get redirected to _IO_fputs by a macro in include/stdio.h (and _IO_fputs in turn uses libc_hidden_proto), but GCC can convert an fprintf call with a constant string argument into an fputs call, which of course is then unaffected by the macro redirection. (I don't know why this issue only appears with -Os.) This patch duly adds a use of libc_hidden_proto for fputs. I see no obvious reason why the fputs macro redirection is needed at all, but this patch does not change it. Tested for x86_64 (both that it removes this particular localplt failure for -Os - but other such failures remain so the bug can't yet be closed - and that the testsuite continues to pass without -Os). [BZ #15105] * include/stdio.h [!_ISOMAC && IS_IN (libc)] (fputs): Use libc_hidden_proto. * libio/iofputs.c (fputs): Use libc_hidden_weak. (cherry picked from commit 499b315324519f8deb5b42a143a76319934a3ab0)
Diffstat (limited to 'libio/iofputs.c')
-rw-r--r--libio/iofputs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libio/iofputs.c b/libio/iofputs.c
index b4fbeb5..176e9ed 100644
--- a/libio/iofputs.c
+++ b/libio/iofputs.c
@@ -43,6 +43,7 @@ _IO_fputs (const char *str, _IO_FILE *fp)
libc_hidden_def (_IO_fputs)
weak_alias (_IO_fputs, fputs)
+libc_hidden_weak (fputs)
# ifndef _IO_MTSAFE_IO
strong_alias (_IO_fputs, __fputs_unlocked)