diff options
| author | Peter Jones <pjones@redhat.com> | 2021-03-25 14:10:46 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2021-03-25 14:36:34 -0400 |
| commit | d74629207188d290810db15dbfe91a89e7751ffb (patch) | |
| tree | ff92f6a761e2b9bffb48089fc7e106eba0a2e57c | |
| parent | ab40c869a2765262d9a911fe6284a606fd1fe0d6 (diff) | |
| download | efi-boot-shim-d74629207188d290810db15dbfe91a89e7751ffb.tar.gz efi-boot-shim-d74629207188d290810db15dbfe91a89e7751ffb.zip | |
arm/aa64: Swizzle some sections to make old sbsign happier.
xnox reports that with some versions of sbsign/sbcheck, it gets very
unhappy with non-contiguous sections and gaps between sections, which we
currently produce on targets with hand-coded headers. This is all wrong
behavior from sbsigntools, and has been fixed in newer versions, but
nevertheless it's not hard for us to avoid.
This patch re-arranges the sections so there are no gaps, by padding the
file-size of .data and .sbat up to the full page, moving .sbat to be
before .vendor_cert, and moving .vendor_cert and .rela out of the range
covered by _edata, while still leaving included in the calculation of
SizeOfInitializedData.
Signed-off-by: Peter Jones <pjones@redhat.com>
| -rw-r--r-- | elf_aarch64_efi.lds | 40 | ||||
| -rw-r--r-- | elf_arm_efi.lds | 39 |
2 files changed, 48 insertions, 31 deletions
diff --git a/elf_aarch64_efi.lds b/elf_aarch64_efi.lds index feb4ead9..84e0ff1c 100644 --- a/elf_aarch64_efi.lds +++ b/elf_aarch64_efi.lds @@ -48,39 +48,47 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) - . = ALIGN(16); + . = ALIGN(4096); _bss_end = .; } - - . = ALIGN(4096); - .vendor_cert : - { - *(.vendor_cert) - } - . = ALIGN(4096); - .rela : - { - *(.rela.dyn) - *(.rela.plt) - *(.rela.got) - *(.rela.data) - *(.rela.data*) - } _edata = .; _data_size = . - _data; + . = ALIGN(4096); .sbat : { _sbat = .; *(.sbat) *(.sbat.*) + . = ALIGN(4096); } _esbat = .; _sbat_vsize = . - _sbat; . = ALIGN(4096); _sbat_size = . - _sbat; + + . = ALIGN(4096); + .vendor_cert : + { + _vendor_cert = .; + *(.vendor_cert) + _evirt_vendor_cert = .; + . = ALIGN(4096); + } + _evendor_cert = .; + _vendor_cert_vsize = _evirt_vendor_cert - _vendor_cert; + _vendor_cert_size = . - _vendor_cert; _alldata_size = . - _data; + .rela : + { + *(.rela.dyn) + *(.rela.plt) + *(.rela.got) + *(.rela.data) + *(.rela.data*) + } + . = ALIGN(4096); .dynsym : { *(.dynsym) } . = ALIGN(4096); diff --git a/elf_arm_efi.lds b/elf_arm_efi.lds index d7de181f..7f12098f 100644 --- a/elf_arm_efi.lds +++ b/elf_arm_efi.lds @@ -46,15 +46,38 @@ SECTIONS *(.dynbss) *(.bss) *(COMMON) - . = ALIGN(16); + . = ALIGN(4096); _bss_end = .; } + _edata = .; + _data_size = . - _data; + + . = ALIGN(4096); + .sbat : + { + _sbat = .; + *(.sbat) + *(.sbat.*) + . = ALIGN(4096); + } + _esbat = .; + _sbat_vsize = . - _sbat; + . = ALIGN(4096); + _sbat_size = . - _sbat; . = ALIGN(4096); .vendor_cert : { + _vendor_cert = .; *(.vendor_cert) + _evirt_vendor_cert = .; + . = ALIGN(4096); } + _evendor_cert = .; + _vendor_cert_vsize = _evirt_vendor_cert - _vendor_cert; + _vendor_cert_size = . - _vendor_cert; + _alldata_size = . - _data; + . = ALIGN(4096); .rel : { @@ -64,20 +87,6 @@ SECTIONS *(.rel.data) *(.rel.data*) } - _edata = .; - _data_size = . - _data; - . = ALIGN(4096); - .sbat : - { - _sbat = .; - *(.sbat) - *(.sbat.*) - } - _esbat = .; - _sbat_vsize = . - _sbat; - . = ALIGN(4096); - _sbat_size = . - _sbat; - _alldata_size = . - _data; . = ALIGN(4096); .dynsym : { *(.dynsym) } |
