This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Rename strdup uses
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Thu, 9 Feb 2017 19:43:43 -0200
- Subject: Re: [PATCH] Rename strdup uses
- Authentication-results: sourceware.org; auth=none
- References: <AM5PR0802MB2610773CACA9C6A1A84A44F583660@AM5PR0802MB2610.eurprd08.prod.outlook.com> <AM5PR0802MB2610F7B0CDC4D12A37F8843B83450@AM5PR0802MB2610.eurprd08.prod.outlook.com>
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