]> git.ipfire.org Git - thirdparty/systemd.git/commit
ukify: Fix section offset calculation
authorJan Janssen <medhefgo@web.de>
Sun, 1 Jan 2023 10:32:55 +0000 (11:32 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 2 Jan 2023 14:59:17 +0000 (15:59 +0100)
commit599c930e48c95e198dc0c8d9c8d68cf14cbfa566
treed915aec4918fed8dd38298c4711d89f39ccb2810
parent8d885b4477ef544093a617027a7a36d34c803479
ukify: Fix section offset calculation

objcopy seems to expect that the offset passed to --change-section-vma
is absolute instead of relative to ImageBase. If this is not accounted
for an invalid image is created that cannot be loaded:

  0 .osrel        0000016b  0000000200016000  0000000200016000  00000400  2**2
  …
  6 .text         0000d242  0000000140001000  0000000140001000  00c6e800  2**4

This isn't an issue with gnu-efi based PE images, but natively created
ones will have a non-zero ImageBase.
src/ukify/ukify.py