[PATCH] Avoid __uselocale PLT slot
Jakub Jelinek
jakub@redhat.com
Fri Feb 2 15:06:00 GMT 2007
Hi!
strerror_l is apparently the first function in libc.so to call
__uselocale or uselocale, and cases an unnecessary PLT slot.
Either we make __uselocale a hidden def, or uselocale.
This patch does the former. Ok?
2007-02-02 Jakub Jelinek <jakub@redhat.com>
* include/locale.h (__uselocale): Add libc_hidden_proto.
* locale/uselocale.c (__uselocale): Add libc_hidden_def.
--- libc/include/locale.h.jj 2005-12-21 08:25:11.000000000 +0100
+++ libc/include/locale.h 2007-02-02 15:58:49.000000000 +0100
@@ -4,6 +4,7 @@
extern __typeof (uselocale) __uselocale;
libc_hidden_proto (setlocale)
+libc_hidden_proto (__uselocale)
/* This has to be changed whenever a new locale is defined. */
#define __LC_LAST 13
--- libc/locale/uselocale.c.jj 2004-03-14 21:40:48.000000000 +0100
+++ libc/locale/uselocale.c 2007-02-02 15:59:25.000000000 +0100
@@ -1,5 +1,5 @@
/* uselocale -- fetch and set the current per-thread locale
- Copyright (C) 2002, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -70,4 +70,5 @@ __uselocale (locale_t newloc)
return oldloc == &_nl_global_locale ? LC_GLOBAL_LOCALE : oldloc;
}
+libc_hidden_def (__uselocale)
weak_alias (__uselocale, uselocale)
Jakub
More information about the Libc-hacker
mailing list