]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
create-diff-object: Include string sections later
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Tue, 3 Dec 2019 07:57:22 +0000 (07:57 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 4 Dec 2019 13:54:11 +0000 (13:54 +0000)
... when all symbols have their status and include flags processed.

Processing special sections may include additional symbols. String
sections (.rodata*) are included iff they are referenced by at least
one symbol. Thus, in order to decide if string section should be
included or not, all symbols must be evaluated first.

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reported-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Tested-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
create-diff-object.c

index bfe86e4cfe4f629d2c2e473cec9b49217b0d2706..bdbd27a48e57918b9dc7ec42c4daa3be1c402e83 100644 (file)
@@ -2318,8 +2318,6 @@ int main(int argc, char *argv[])
        kpatch_include_debug_sections(kelf_patched);
        log_debug("Include hook elements\n");
        kpatch_include_hook_elements(kelf_patched);
-       log_debug("Include standard string elements\n");
-       kpatch_include_standard_string_elements(kelf_patched);
        log_debug("Include new globals\n");
        new_globals_exist = kpatch_include_new_globals(kelf_patched);
        log_debug("new_globals_exist = %d\n", new_globals_exist);
@@ -2336,6 +2334,8 @@ int main(int argc, char *argv[])
 
        log_debug("Process special sections\n");
        kpatch_process_special_sections(kelf_patched);
+       log_debug("Include standard string elements\n");
+       kpatch_include_standard_string_elements(kelf_patched);
        log_debug("Strip undefined elements of known size\n");
        livepatch_strip_undefined_elements(kelf_patched);
        log_debug("Verify patchability\n");