From patchwork Thu Feb 9 21:43:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 19209 Received: (qmail 99211 invoked by alias); 9 Feb 2017 21:44:02 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 97106 invoked by uid 89); 9 Feb 2017 21:43:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=localplt, 3027, dlcachec, 19463 X-HELO: mail-qt0-f172.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=ITQ05oNSitS96cBsjN2IDFsqUjBDcV8R/HdYjul1A1o=; b=aIAO5HePTP+eD8O94zRvdJQYmEP0wKzsRQ/o+hgYnxf8YpgfitFhCRkYpmJUQ/L4uc l7VC11VpwzoTla4iFpHawJqmkHWdaV+JBC4f3UX5f2rMRsxnDLKD1ELLre5PmikEDhMW +hSLBNM6kHTzK9kgCMiQ1Z2DUBLywqO+zPVkuGW1Ot7tucOlPd5c5luyyOT8/4mrgL7U C8R0vVAulLK6snA2BPmlDVle1GNMaxiGDwsqBtpZodtW2oIKBb4Os7G6zwCUDLFw9j1e /od9iY/JuQsVf/QWfZsh9/EdoOxhxnpTMdUrAnI688MX74VNouvTYha5lY1OPeRqAifw gvuA== X-Gm-Message-State: AMke39kgGIznu1lxJxLhd9Dqg/vXTsP6bG3sL6sV6awLXBB+3M/8HmSg2mfDm28SGsZRkBmR X-Received: by 10.200.45.177 with SMTP id p46mr4856193qta.240.1486676627683; Thu, 09 Feb 2017 13:43:47 -0800 (PST) Subject: Re: [PATCH] Rename strdup uses To: libc-alpha@sourceware.org References: From: Adhemerval Zanella Message-ID: Date: Thu, 9 Feb 2017 19:43:43 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: On 09/02/2017 13:17, Wilco Dijkstra wrote: > ping (added mention of BZ tickets) > > > From: Wilco Dijkstra > Sent: 11 January 2017 16:02 > To: libc-alpha@sourceware.org > Cc: nd > Subject: [PATCH] Rename strdup uses > > Rename existing uses of str(n)dup to __str(n)dup so it no longer needs to be > redirected to a builtin. Also building GLIBC with -Os now no longer shows localplt > or linkname space failures (partial fix for BZ #15105 and BZ #19463). Although this > means a loss of inlining (based on current committed headers) in 2 cases, these > are both error messages so not performance critical. I would prefer to just clump both this patch and the one that removes strdup inlines [1] together and then just remove the strdup and strndup macros on string/string.h. Also, it seems that this patch is not really complete, since by removing the defines on string.h I see the missing spot that triggers PLT failures: With this change we can just remove the str{n}dup macros on string.h and simplify this a lot. [1] https://sourceware.org/ml/libc-alpha/2017-02/msg00187.html diff --git a/elf/dl-cache.c b/elf/dl-cache.c index 1ac7524..017c78a 100644 --- a/elf/dl-cache.c +++ b/elf/dl-cache.c @@ -302,7 +302,7 @@ _dl_load_cache_lookup (const char *name) char *temp; temp = alloca (strlen (best) + 1); strcpy (temp, best); - return strdup (temp); + return __strdup (temp); } #ifndef MAP_COPY