This is a followup the the RFC series 'AArch64 linker script and small C model'.

As it turns out, using the 'small' C model for AArch64 has its drawbacks,
especially regarding binary size due to padding to keep the code 4 KB
alignment. I briefly investigated using the small model for boot time
non-XIP code only, but due to library dependencies that may be satisfied
by code built with a different model, mixing it is really not an option
either. Since the size and performance benefit is unquantified at this time,
I have dropped the C model aspect from this series entirely.

What remains are two other issues that this series aims to solve:
- As Eugene Cohen reported, some ELF based tooling expects the .text and .data
  sections to be at the same relative offset in the PE/COFF binary (and thus in
  memory) as in the ELF intermediate file. Since the builtin GNU ld linker
  script tries to put a 64 KB alignment boundary in between, this is often not
  the case.
- For the newly introduced Properties Table feature, that allows runtime modules
  to be mapped more strictly by the OS, (i.e., .text mapped as R-X and .data
  mapped as RW-), these sections need to be aligned at 64 KB so that they are
  guaranteed to be disjoint even when executing under and OS that runs with
  64 KB page size.

So this series simply introduces a set of linker scripts, and wires up the
generic one for all AArch64 targets. The 64 KB alignment is enabled for the
ArmVirtPkg platform only.

Ard Biesheuvel (2):
  BaseTools: AArch64: use explicit linker scripts
  ArmVirtPkg: build runtime drivers with 64 KB section alignment

 ArmVirtPkg/ArmVirt.dsc.inc                        |  3 ++
 BaseTools/Conf/tools_def.template                 | 23 +++++++-----
 BaseTools/Scripts/gcc-aarch64-64K-align-ld-script |  4 ++
 BaseTools/Scripts/gcc-aarch64-ld-script           | 39 ++++++++++++++++++++
 4 files changed, 59 insertions(+), 10 deletions(-)
 create mode 100644 BaseTools/Scripts/gcc-aarch64-64K-align-ld-script
 create mode 100644 BaseTools/Scripts/gcc-aarch64-ld-script

-- 
1.9.1


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to