Skip to contentSkip to conversation

create-diff-object: Include string sections later

PATCH In review Pawel Wieczorkiewicz 3 participants 3 messages Dec 3, 2019 – Dec 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 create-diff-object.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
create-diff-object.c +2 -2
index 1ce5c09..a516670 100644
@@ -2372,8 +2372,6 @@ int main(int argc, char *argv[])
 	log_debug("Include hook elements\n");
 	num_changed += kpatch_include_hook_elements(kelf_patched);
 	log_debug("num_changed = %d\n", num_changed);
-	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);
@@ -2390,6 +2388,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");
Signature · 20 lines
2.16.5




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Ralf Herbrich
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879




_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Tested-by on v1 1/1
#1 lore raw
Quoted 9 lines · Pawel Wieczorkiewicz

... 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.

This fixes creation/loading of my test LP.

--
Thanks,
Sergey

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Pawel Wieczorkiewicz
Quoted 9 lines · Pawel Wieczorkiewicz

... 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.

... and pushed. Thanks!

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel