From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753341AbbC0Hcs (ORCPT ); Fri, 27 Mar 2015 03:32:48 -0400 Received: from smtprelay0173.hostedemail.com ([216.40.44.173]:50534 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753095AbbC0Hcr (ORCPT ); Fri, 27 Mar 2015 03:32:47 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 40,2.5,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4605:5007:6119:6261:7903:10011:10400:10848:10967:11026:11232:11658:11914:12043:12257:12517:12519:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:1:0 X-HE-Tag: match11_5230333587f27 X-Filterd-Recvd-Size: 2568 Message-ID: <1427441563.20980.7.camel@perches.com> Subject: Re: String literals in __init functions From: Joe Perches To: Mathias Krause Cc: Andrew Morton , Mason , Linux ARM , LKML , Ingo Molnar Date: Fri, 27 Mar 2015 00:32:43 -0700 In-Reply-To: References: <5512F6C6.1020304@free.fr> <1427306517.2717.0.camel@perches.com> <5513FE2F.3040306@free.fr> <1427386390.15849.13.camel@perches.com> <1427392393.15849.16.camel@perches.com> <20150326144058.56ef6916b00ad38030296089@linux-foundation.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2015-03-27 at 08:05 +0100, Mathias Krause wrote: > On 26 March 2015 at 22:40, Andrew Morton wrote: > > On Thu, 26 Mar 2015 21:49:06 +0100 Mathias Krause wrote: > > > >> Andrew, what's your opinion on such a patch set? Do you too think it's > >> useful? Or do you share Ingo's fear about the additional maintenance > >> burden? > > > > I don't think the burden would be toooo high, although it will mess the > > code up a bit. [] > > Did anyone ask the gcc developers? I'd have thought that a function-wide > > __attribute__((__string_section__(foo)) > > wouldn't be a ton of work to implement. > > The point is you cannot blindly mark all strings referenced from > __init / __exit code to end up in a matching string section because > strings in this code might have to live longer when passed to > functions keeping a pointer on them. This is the primary reason I support the pi_/pe_/ printk_init/printk_exit markings. It's simple and not a large burden to the coder/reader. If a few formats aren't marked appropriately, it's not generally a significant loss, but it is easily correctable by scripts. From mboxrd@z Thu Jan 1 00:00:00 1970 From: joe@perches.com (Joe Perches) Date: Fri, 27 Mar 2015 00:32:43 -0700 Subject: String literals in __init functions In-Reply-To: References: <5512F6C6.1020304@free.fr> <1427306517.2717.0.camel@perches.com> <5513FE2F.3040306@free.fr> <1427386390.15849.13.camel@perches.com> <1427392393.15849.16.camel@perches.com> <20150326144058.56ef6916b00ad38030296089@linux-foundation.org> Message-ID: <1427441563.20980.7.camel@perches.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, 2015-03-27 at 08:05 +0100, Mathias Krause wrote: > On 26 March 2015 at 22:40, Andrew Morton wrote: > > On Thu, 26 Mar 2015 21:49:06 +0100 Mathias Krause wrote: > > > >> Andrew, what's your opinion on such a patch set? Do you too think it's > >> useful? Or do you share Ingo's fear about the additional maintenance > >> burden? > > > > I don't think the burden would be toooo high, although it will mess the > > code up a bit. [] > > Did anyone ask the gcc developers? I'd have thought that a function-wide > > __attribute__((__string_section__(foo)) > > wouldn't be a ton of work to implement. > > The point is you cannot blindly mark all strings referenced from > __init / __exit code to end up in a matching string section because > strings in this code might have to live longer when passed to > functions keeping a pointer on them. This is the primary reason I support the pi_/pe_/ printk_init/printk_exit markings. It's simple and not a large burden to the coder/reader. If a few formats aren't marked appropriately, it's not generally a significant loss, but it is easily correctable by scripts.