From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1641 invoked by alias); 2 Feb 2007 15:06:29 -0000 Received: (qmail 1624 invoked by uid 22791); 2 Feb 2007 15:06:29 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 02 Feb 2007 15:06:19 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l12FAva9032303; Fri, 2 Feb 2007 16:10:57 +0100 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l12FAvWD032302; Fri, 2 Feb 2007 16:10:57 +0100 Date: Fri, 02 Feb 2007 15:06:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Avoid __uselocale PLT slot Message-ID: <20070202151057.GA16901@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-02/txt/msg00000.txt.bz2 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 * 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