Third attempt at unifying the various GCC linker scripts for different
architectures, GCC versions and minimum alignments.

Changes since v2:
- for easier bisection, factor out the differences between the original
  and the unified linker scripts for X86 before making the switch
  (patches #1 - #4 and #6)
- add Intel copyright notice to unified version (patch #5)
- avoid defining *_*_*_DLINK2_FLAGS so that we don't pollute the variable
  definition space of non-GCC toolchains (patches #8 and #12)
- added Laszlo's ack to patch #10

---------------------------- v2 blurb ---------------------------------
This time, I have added only a single unified GCC linker script that
can be parametrised by ld command line options:
- --defsym=PECOFF_HEADER_SIZE sets the size of the PE/COFF header
- -z common-page-size sets the minimum alignment

This use of common-page-size is entirely legal: it sets an internal LD
constant which can be referred to as CONSTANT(COMMONPAGESIZE) in linker
scripts, and is otherwise unused internally by the linker.

Tested with ArmVirtQemu/AARCH64 and Ovmf/X64

Branch is here

Ard Biesheuvel (12):
  BaseTools/GCC: remove NOP padding from X86/IA32 GCC linker scripts
  BaseTools/GCC: move .rodata to PE/COFF .text section
  BaseTools/GCC: drop redundant alignment from linker script
  BaseTools/GCC: move .got contents to the PE/COFF .text section
  BaseTools/GCC: add unified GCC linker script for all archs and
  BaseTools/GCC: align start of .data to .text alignment
  BaseTools/GCC: move AutoGen.obj contents to .text section
  BaseTools/AARCH64: move to unified GCC linker script
  ArmPlatformPkg/ArmVExpressPkg: move to unified GCC linker script
  ArmVirtPkg: move to unified GCC linker script
  BaseTools/AARCH64: remove incremental linker script for 64K alignment
  BaseTools/X86|IA32: move to unified GCC linker script

 ArmPlatformPkg/ArmVExpressPkg/ |  2 +-
 ArmVirtPkg/                        |  2 +-
 BaseTools/Conf/tools_def.template                 | 37 ++++++++++-
 BaseTools/Scripts/                     | 70 ++++++++++++++++++++
 BaseTools/Scripts/gcc-4K-align-ld-script          | 44 ------------
 BaseTools/Scripts/gcc-aarch64-64K-align-ld-script |  4 --
 BaseTools/Scripts/gcc-aarch64-ld-script           | 39 -----------
 BaseTools/Scripts/gcc4.4-ld-script                | 44 ------------
 BaseTools/Scripts/gcc4.9-ld-script                | 44 ------------
 9 files changed, 106 insertions(+), 180 deletions(-)
 create mode 100644 BaseTools/Scripts/
 delete mode 100644 BaseTools/Scripts/gcc-4K-align-ld-script
 delete mode 100644 BaseTools/Scripts/gcc-aarch64-64K-align-ld-script
 delete mode 100644 BaseTools/Scripts/gcc-aarch64-ld-script
 delete mode 100644 BaseTools/Scripts/gcc4.4-ld-script
 delete mode 100644 BaseTools/Scripts/gcc4.9-ld-script


edk2-devel mailing list

Reply via email to