]> git.proxmox.com Git - mirror_edk2.git/commit - BaseTools/Conf/tools_def.template
BaseTools/tools_def: switch GCC/X64 to the PIE small model
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 15 Jul 2016 22:16:11 +0000 (00:16 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 21 Jul 2016 11:32:09 +0000 (13:32 +0200)
commitf49513f666ed25d24bdf3a02a1fdb5d18ae081c0
tree050c3888d01be79c80a0838a27bffd7cac412b06
parent1252a681a67da81bf1304c7ac836f90eab8bb7cb
BaseTools/tools_def: switch GCC/X64 to the PIE small model

The ordinary small code model for x86_64 cannot be used in UEFI, since
it assumes the executable is loaded in the first 2 GB of memory.
Therefore, we use the large model instead, which can execute anywhere,
but uses absolute 64-bit wide quantities for all symbol references,
which is costly in terms of code size.

So switch to the PIE small code model, this uses 32-bit relative
references where possible, but does not make any assumptions about the
load address (i.e., all absolute symbol references are 64-bits wide).
Note that, due to the 'protected' visibility pragma introduced in an
earlier patch, there is no need for the EDK2 build system to deal with
GOT related ELF relocation types.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-By: Liming Gao <liming.gao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Conf/tools_def.template