From patchwork Thu Feb 9 22:36:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 19210 Received: (qmail 83818 invoked by alias); 9 Feb 2017 22:37:12 -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 83745 invoked by uid 89); 9 Feb 2017 22:37:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=chunk, Hx-languages-length:1609, sk:cfa335e, rcmdc X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com From: Wilco Dijkstra To: "adhemerval.zanella@linaro.org" CC: "libc-alpha@sourceware.org" , nd Subject: Re: [PATCH] Rename strdup uses Date: Thu, 9 Feb 2017 22:36:57 +0000 Message-ID: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wilco.Dijkstra@arm.com; x-ms-office365-filtering-correlation-id: 6bfaefc0-0434-47e6-9664-08d4513c2808 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:AM5PR0802MB2609; x-microsoft-exchange-diagnostics: 1; AM5PR0802MB2609; 7:QC+RQ4kBaa9wMEUhtrHUDsuEAZHjUJbnDN2J7+Itf5Z0AaM5P08TPEwl1bsHkAKv+JZuz9CaWQ58eUIoMYGXRdNdcgR0NtAat41iseOZYY3oASf7c0oRcOdpgEeXfIfEcbOvXQ9iAN5tlGlDBM1Vsx4tqq+k/swuDcCf/dheQ9xPxDRqUOlHqfjpzHeF8qtjfG8HvLtxR2tCl2M1ZlQpzvtKeLXcPCrOvz6xcxdlOfWa9jqou/p2REFS4N205Khk6h1DuY/pvCOenHbcq+QlGn96ynpY65xmuWawqIgX41xax+o66EVgdIsQ8SrMbl8TrsDj0e/tX0LggPTSy4H2pszFlxUxTr/azAtRoattoTzZvNlZw5+RmBmQAx3AGqrHj8ncBGdeWXzb8xiwQ8WS1d04WP940X6TcWmj+6yGlsVDakVQpaHpBRg97TwP0FEPmAwky3g1aFDmychoJzS6OqrIavixFmbHTC/SyW1wEaQMDWcT0j/9GkmbRdn23yKGwwkbNtI88RLBxOob3URYTw== nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(788757137089); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123562025)(20161123558025)(20161123564025)(6072148); SRVR:AM5PR0802MB2609; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2609; x-forefront-prvs: 02135EB356 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39860400002)(39850400002)(39410400002)(39840400002)(39450400003)(189002)(199003)(24454002)(106356001)(189998001)(8676002)(2501003)(53936002)(106116001)(53546003)(2351001)(92566002)(3660700001)(101416001)(68736007)(54356999)(81166006)(8936002)(3846002)(50986999)(4326007)(2906002)(66066001)(102836003)(81156014)(122556002)(3280700002)(33656002)(6246003)(97736004)(6116002)(54906002)(105586002)(9686003)(55016002)(5640700003)(99286003)(7736002)(229853002)(2900100001)(25786008)(77096006)(6916009)(6436002)(5660300001)(6506006)(7696004)(38730400002)(110136004)(86362001)(305945005)(74316002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2609; H:AM5PR0802MB2610.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2017 22:36:57.4569 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2609 Adhemerval Zanella wrote: On 09/02/2017 13:17, Wilco Dijkstra wrote: > > 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: I think you must have mispasted my patch as it starts like this: --- diff --git a/inet/rcmd.c b/inet/rcmd.c > With this change we can just remove the str{n}dup macros on string.h and > simplify this a lot. I'll remove that chunk from my other patch then. I specifically did this search and replace as a separate patch since it's much easier to review and get approval for minor clean-ups. Wilco diff --git a/elf/dl-cache.c b/elf/dl-cache.c index cfa335eb326cd04f3892a09d4c00cef8208a2f33..4c8afd0684b96b44ec069f907b9537d4fc2ff6d2 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