]> xenbits.xensource.com Git - people/wipawel/livepatch-build-tools/commit
create-diff-object: Do not include all .rodata sections
authorPawel Wieczorkiewicz <wipawel@amazon.de>
Mon, 1 Oct 2018 12:42:08 +0000 (12:42 +0000)
committerPawel Wieczorkiewicz <wipawel@amazon.de>
Thu, 8 Aug 2019 08:55:30 +0000 (08:55 +0000)
commitccabd458076bc0bbcef8535a09de97e8190babc9
treed3096a90c298e7c9f76aedf20f6d2f319888932a
parent464ab25e2866e6dd7ac095fecfdc12d8038fa5c3
create-diff-object: Do not include all .rodata sections

Older versions of GCC did not split .rodata.str sections by function.
Because of that, the entire section was always included.
The livepatch-build-tools commit [1] fixed patch creation and kept
including all .rodata.str sections, in order to maintain existing
behavior for GCC 6.1+.
This means all .rodata.str sections are always included by default,
regardless of whether they are needed or not.

During stacked hotpatch builds it leads to unnecessary accumulation of
the .rodata.str sections as each and every consecutive hotpatch module
contains all the .rodata.str sections of previous modules.

To prevent this situation, mark the .rodata.str sections for inclusion
only if they are referenced by any of the current hotpatch symbols (or
a corresponding RELA section).

Extend patchability verification to detect all non-standard, non-rela,
non-debug and non-special sections that are not referenced by any of
the symbols or RELA sections.

[1] 2af6f1aa6233 Fix patch creation with GCC 6.1+

Signed-off-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Andra-Irina Paraschiv <andraprs@amazon.com>
Reviewed-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Norbert Manthey <nmanthey@amazon.de>
create-diff-object.c