x86/build: Rework binary conversion for boot/{cmdline,reloc}.c
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 14 Apr 2022 09:33:01 +0000 (10:33 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 20 Apr 2022 18:11:48 +0000 (19:11 +0100)
commitfdef107edd4459375f9c0e6e377f30e82d498747
tree518191263d93364fb021a1611779879c3890483b
parente1e72198213b80b7a82bdc90f96ed05ae4f53e20
x86/build: Rework binary conversion for boot/{cmdline,reloc}.c

There is no need to opencode .got.plt size check; it can be done with linker
asserts instead.  Extend the checking to all dynamic linkage sections, and
drop the $(OBJDUMP) pass.

Furthermore, instead of removing .got.plt specifically, take only .text when
converting to a flat binary.  This makes the process invariant of .text's
position relative to the start of the binary, which avoids needing to discard
all sections, and removes the need to work around sections that certain
linkers are unhappy discarding.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/boot/Makefile
xen/arch/x86/boot/build32.lds