diff mbox

Rename strdup uses

Message ID a3366aac-1c13-ee84-2017-3ea3f7a4cb5b@linaro.org
State New
Headers show

Commit Message

Adhemerval Zanella Netto Feb. 9, 2017, 9:43 p.m. UTC
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 mbox

Patch

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