1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

Fix -Os ferror_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 ferror_unlocked.

The usual approach is followed of adding __ferror_unlocked (inlined
when ferror_unlocked is), making calls use it when required for
namespace reasons (only one such call), and using libc_hidden_proto /
libc_hidden_weak for the ferror_unlocked weak alias when only localplt
but not namespace issues are involved.

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/ferror_u.c (ferror_unlocked): Rename to __ferror_unlocked
	and define as weak alias of __ferror_unlocked.  Use
	libc_hidden_weak.
	* include/stdio.h [!_ISOMAC] (ferror_unlocked): Use
	libc_hidden_proto.
	[!_ISOMAC] (__ferror_unlocked) New declaration, and inline
	function if [__USE_EXTERN_INLINES].
	* time/getdate.c (__getdate_r): Call __ferror_unlocked instead of
	ferror_unlocked.
This commit is contained in:
Joseph Myers
2018-02-19 17:32:34 +00:00
parent 7d15ef84f5
commit ec481ad81b
4 changed files with 26 additions and 2 deletions

View File

@ -30,8 +30,10 @@
#undef ferror_unlocked
int
ferror_unlocked (_IO_FILE *fp)
__ferror_unlocked (_IO_FILE *fp)
{
CHECK_FILE (fp, EOF);
return _IO_ferror_unlocked (fp);
}
weak_alias (__ferror_unlocked, ferror_unlocked)
libc_hidden_weak (ferror_unlocked)