diff mbox

Use libc_hidden_* for tolower, toupper (bug 15105)

Message ID alpine.DEB.2.20.1802222124240.4516@digraph.polyomino.org.uk
State New, archived
Headers show

Commit Message

Joseph Myers Feb. 22, 2018, 9:24 p.m. UTC
Continuing the fixes for localplt test failures with -Os arising from
functions not being inlined in that case, this patch fixes such
failures for tolower and toupper by using libc_hidden_proto and
libc_hidden_def.

Tested for x86_64 (both that it removes this particular localplt
failure for -Os, and that the testsuite continues to pass without
-Os).  Together with my patch
<https://sourceware.org/ml/libc-alpha/2018-02/msg00602.html> for atoi
(pending review), this completes fixing such localplt failures for -Os
(at least for x86_64).

2018-02-22  Joseph Myers  <joseph@codesourcery.com>

	[BZ #15105]
	* ctype/ctype.c (tolower): Use libc_hidden_def.
	(toupper): Likewise.
	* include/ctype.h [!_ISOMAC] (tolower): Use libc_hidden_proto.
	[!_ISOMAC] (toupper): Likewise.

Comments

Florian Weimer Feb. 23, 2018, 8:58 a.m. UTC | #1
On 02/22/2018 10:24 PM, Joseph Myers wrote:
> 2018-02-22  Joseph Myers<joseph@codesourcery.com>
> 
> 	[BZ #15105]
> 	* ctype/ctype.c (tolower): Use libc_hidden_def.
> 	(toupper): Likewise.
> 	* include/ctype.h [!_ISOMAC] (tolower): Use libc_hidden_proto.
> 	[!_ISOMAC] (toupper): Likewise.

Looks good.

Thanks,
Florian
diff mbox

Patch

diff --git a/ctype/ctype.c b/ctype/ctype.c
index e86c5b0..6cb8000 100644
--- a/ctype/ctype.c
+++ b/ctype/ctype.c
@@ -45,9 +45,11 @@  tolower (int c)
 {
   return c >= -128 && c < 256 ? __ctype_tolower[c] : c;
 }
+libc_hidden_def (tolower)
 
 int
 toupper (int c)
 {
   return c >= -128 && c < 256 ? __ctype_toupper[c] : c;
 }
+libc_hidden_def (toupper)
diff --git a/include/ctype.h b/include/ctype.h
index ac6db79..493a6f8 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -11,6 +11,9 @@  libc_hidden_proto (__ctype_init)
    So defeat macro expansion with parens for this declaration.  */
 extern int (__isctype) (int __c, int __mask);
 
+libc_hidden_proto (tolower)
+libc_hidden_proto (toupper)
+
 # if IS_IN (libc)
 
 /* These accessors are used by the optimized macros to find the