lkml.org 
[lkml]   [2014]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 0/3] Mark literal strings in __init / __exit code
From
Date
On Mon, 2014-06-23 at 00:46 +0200, Mathias Krause wrote:
> This RFC series tries to address the problem of dangling strings of
> __init functions after initialization, as well as __exit strings for
> code not even included in the final kernel image. The code might get
> freed, but the format strings are not.
>
> One solution to the problem might be to declare variables in the code
> and mark those variables as __initconst. That, though, makes the code
> ugly, as can be seen, e.g., in drivers/hwmon/w83627ehf.c -- a pile of
> 'static const char[] __initconst' lines just for the pr_info() call.

Another solution might be, as David Daney suggested, using
gcc 4.5+ plug-ins to extract these format strings and
const char * arrays into specific sections automatically.

https://lkml.org/lkml/2009/7/21/483

Seems feasible, but there might be a negative of string
duplication in multiple sections that would otherwise
be consolidated into a single object.



\
 
 \ /
  Last update: 2014-06-23 04:01    [W:0.344 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site