This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Rename strdup uses



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:

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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]