From: Pawel Wieczorkiewicz Date: Tue, 3 Dec 2019 07:57:22 +0000 (+0000) Subject: create-diff-object: Include string sections later X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a1277bfa9c6e82ba03edd6c931672505afe75477;p=livepatch-build-tools.git create-diff-object: Include string sections later ... 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 Reported-by: Sergey Dyasli Tested-by: Sergey Dyasli Reviewed-by: Ross Lagerwall --- diff --git a/create-diff-object.c b/create-diff-object.c index bfe86e4..bdbd27a 100644 --- a/create-diff-object.c +++ b/create-diff-object.c @@ -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");