lkml.org 
[lkml]   [2014]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH 0/3] Mark literal strings in __init / __exit code
From
On 24 June 2014 22:57, Joe Perches <joe@perches.com> wrote:
> On Tue, 2014-06-24 at 22:41 +0200, Mathias Krause wrote:
>> there is more to optimize
>> if one is patient enough ;)
>
> Ever thus.
>
>> And all of those strings should be in the .rodata section, now. But
>> why you're asking?
>
> Because now they will be duplicated in .rodata
> and the __init section no?

No. A string marked with __init_str() will only life in the
.init.rodata section. No duplication.

>> Yes. My vanilla vmlinux build has quite a lot of copies of "off" in
>> it. But I doubt any linker would merge those. Does LTO do so?
>
> I would expect that duplicated strings in
> separate sections would not be merged.

I do hope so, too! :D Because if strings in .rodata would be merged
with ones in .init.rodata the former would be dangling when the latter
are freed after initialization.
Having duplicated strings in .rodata and .init.rodata is also no
problem as the latter will be freed.

Regards,
Mathias


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