[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#30820: Chunked store references in compiled code break grafting (aga
bug#30820: Chunked store references in compiled code break grafting (again)
Mon, 19 Mar 2018 23:29:10 +0100
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
Danny Milosavljevic <address@hidden> skribis:
>> The second issue is that the patch only ever worked with literal
>> strings. It does not “see” strings in constant arrays like the ‘str’
>> array in the example above.
>> The gconv-module file name mentioned in the first message in this bug
>> report is an example of a string assigned to a static array, in
>> /* This is the default path where we look for module lists. */
>> static const char default_gconv_path = GCONV_PATH;
> I don't understand why this is a problem. Grafting would just
> mutate default_gconv_path, right? Who cares how the runtime memcpy
> works (if there's no literal as source)?
At compile-time, GCC finds out that ‘default_gconv_path’ is used only
in one place, in an strcpy call. Thus, it chooses to use the movabs
optimization, and as a consequence, to split ‘default_gconv_path’ in
8-byte chunks. It can do so because it’s ‘static’.
bug#30820: Chunked store references in compiled code break grafting (again), Mark H Weaver, 2018/03/19
bug#30820: Chunked store references in compiled code break grafting (again), Ludovic Courtès, 2018/03/19