This series deals with the basetools optimizations to get rid of excessive XIP
alignment padding when using 2 KB or 4 KB alignment, which is common on AARCH64,
since the exception vector table requires 2 KB alignment, and the small code
model (which is the only one supported by the commercial LLVM based compiler
supplied by ARM) requires 4 KB alignment.


--------------------------------------------------------------------------------
v2 changelog
- patches #1 and #2 are unchanged
- patch #3 and #4 have been updated to only emit or adjust the special padding
  section if the FDF [Rule] defines the FFS_ATTRIB_FIXED attributed for the file
- the adjustment logic in patch #4 has been reordered and the comments updated
  to reflect more clearly that the misalignment and adjustment are not specific
  to a single FFS section, but to the alignment of the FFS file as a whole
- patch #4 now clears the alignment bits in the FFS header since they have no
  meaning in FFS files that have been modified in place
- replaced pointer arithmetic using VOID* pointers

--------------------------------------------------------------------------------
v1 changelog compared to 'RFC: small C model and LLVM/clang support for AARCH64'

Patches #1 and #2 (formerly #2 and #3) are unchanged.

Patch #3 (formerly #4) has been updated to ensure that a special reducible
padding section is only emitted right before the first section in a FFS that
has alignment requirements. Reducing the size of such a section will shift all
subsequent sections into alignment, provided that the size of the padding is
sufficient. In some cases, for instance, when the padding section is based on
a section that has a minimum alignment of 32 bytes, and is followed by a section
which requires 4 KB alignment, the size of the padding section may be too small
and the adjustment will not be possible. In this case, we simply proceed as if
the padding section is an ordinary padding section, and everything will just
work as before.

Patch #4 is unchanged, except for a clarification in the comments, to explain
that the misalignment is calculated based on the first byte of the FFS payload,
and not of the aligned section. Since all FFS sections are padded out relative
to the first byte of the FFS payload, compensating its misalignment will shift
all sections into place.

Ard Biesheuvel (4):
  BaseTools/GenFw: move .debug contents to .data to save space
  BaseTools/GenFw: move PE/COFF header closer to payload
  BaseTools: use GUID identifiable section for FFS alignment padding
  BaseTools/GenFv: optimize away redundant padding

 BaseTools/Source/C/GenFfs/GenFfs.c                           |  99 +++++++-----
 BaseTools/Source/C/GenFv/GenFvInternalLib.c                  | 169 
+++++++++++++++++++-
 BaseTools/Source/C/GenFw/Elf32Convert.c                      |  66 ++++----
 BaseTools/Source/C/GenFw/Elf64Convert.c                      |  64 ++++----
 BaseTools/Source/C/Include/Guid/FfsSectionAlignmentPadding.h |  22 +++
 5 files changed, 318 insertions(+), 102 deletions(-)
 create mode 100644 BaseTools/Source/C/Include/Guid/FfsSectionAlignmentPadding.h

-- 
1.9.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to