diff mbox series

create-diff-object: do not strip STN_UNDEF symbols from *.fixup

Message ID 20191105153745.74257-1-wipawel@amazon.de (mailing list archive)
State New, archived
Headers show
Series create-diff-object: do not strip STN_UNDEF symbols from *.fixup | expand

Commit Message

Wieczorkiewicz, Pawel Nov. 5, 2019, 3:37 p.m. UTC
The rela groups in the *.fixup sections vary in size. That makes it
more complex to handle in the livepatch_strip_undefined_elements().
It is also unnecessary as the .fixup sections are unlikely to have
any STN_UNDEF symbols anyway.

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
---
 create-diff-object.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Ross Lagerwall Nov. 25, 2019, 5:06 p.m. UTC | #1
On 11/5/19 3:37 PM, Pawel Wieczorkiewicz wrote:
> The rela groups in the *.fixup sections vary in size. That makes it
> more complex to handle in the livepatch_strip_undefined_elements().
> It is also unnecessary as the .fixup sections are unlikely to have
> any STN_UNDEF symbols anyway.
> 
> Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
> ---

Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
diff mbox series

Patch

diff --git a/create-diff-object.c b/create-diff-object.c
index 2f0e162..abf3cc7 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -2081,6 +2081,13 @@  static void livepatch_strip_undefined_elements(struct kpatch_elf *kelf)
 		if (!is_rela_section(sec))
 			continue;
 
+		/* The rela groups in the .fixup sections vary in size.
+		 * Ignore them as they are unlikely to have any STN_UNDEF
+		 * symbols anyway.
+		 */
+		if (strstr(sec->name, ".fixup"))
+			continue;
+
 		/* only known, fixed-size entries can be stripped */
 		entry_size = get_section_entry_size(sec->base, kelf);
 		if (entry_size == 0)