audk/BaseTools/Source/C
Ard Biesheuvel c9f297559b BaseTools X64: fold PLT relocations into simple relative references
For X64/GCC, we use position independent code with hidden visibility
to inform the compiler that symbol references are never resolved at
runtime, which removes the need for PLTs and GOTs. However, in some
cases, GCC has been reported to still emit PLT based relocations, which
we need to handle in the ELF to PE/COFF perform by GenFw.

Unlike GOT based relocations, which are non-trivial to handle since the
indirections in the code can not be fixed up easily (although relocation
types exist for X64 that annotate relocation targets as suitable for
relaxation), PLT relocations simply point to jump targets, and we can
relax such relocations by resolving them using the symbol directly rather
than via a PLT entry that does nothing more than tail call the function
we already know it is going to call (since all symbol references are
resolved in the same module).

So handle R_X86_64_PLT32 as a R_X86_64_PC32 relocation.

Suggested-by: Steven Shi <steven.shi@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-08-08 08:26:41 +02:00
..
BootSectImage BaseTools: Change source files to DOS format. 2016-03-10 17:37:51 +08:00
Common BaseTools: Eliminate two shift-negative-value in FvLib.c 2016-05-18 09:50:44 +08:00
EfiLdrImage BaseTools: Change source files to DOS format. 2016-03-10 17:37:51 +08:00
EfiRom License header updated to match correct format. 2014-08-28 13:53:34 +00:00
GenBootSector BaseTools: Fix 'caculate' typos 2016-01-06 01:13:35 +00:00
GenCrc32 License header updated to match correct format. 2014-08-28 13:53:34 +00:00
GenFfs BaseTools: use GUID identifiable section for FFS alignment padding 2015-07-27 13:50:19 +00:00
GenFv BaseTools: Update ARM/AArch64 GenFv vector processing for encapsulated FVs 2016-03-10 22:04:11 +07:00
GenFw BaseTools X64: fold PLT relocations into simple relative references 2016-08-08 08:26:41 +02:00
GenPage License header updated to match correct format. 2014-08-28 13:53:34 +00:00
GenSec License header updated to match correct format. 2014-08-28 13:53:34 +00:00
GenVtf BaseTools: Update BaseTools to pass VS2015 compiler 2016-01-29 04:54:37 +00:00
GnuGenBootSector License header updated to match correct format. 2014-08-28 13:53:34 +00:00
Include BaseTools: Add HII definitions from UEFI 2.6 2016-05-16 15:47:21 +08:00
LzmaCompress BaseTools/LZMA: fix the format issue for last patch 2016-03-03 12:06:41 +08:00
Makefiles BaseTools: Fix build on FreeBSD and allow use of non-gcc system compiler 2015-07-08 01:06:25 +00:00
PyEfiCompressor License header updated to match correct format. 2014-08-28 13:53:34 +00:00
PyUtility License header updated to match correct format. 2014-08-28 13:53:34 +00:00
Split BaseTools: Change source files to DOS format. 2016-03-10 17:37:51 +08:00
TianoCompress License header updated to match correct format. 2014-08-28 13:53:34 +00:00
VfrCompile BaseTools/VfrCompile: Add two new option for VfrCompile 2016-08-08 11:07:24 +08:00
VolInfo BaseTools/VolInfo: Update to handle PE image with .code section only 2016-04-15 08:43:49 +08:00
GNUmakefile BaseTools: add ARCH detection for AARCH64 and ARM 2015-08-12 05:22:49 +00:00
Makefile Fix nmake cleanall bugs. 2014-08-25 05:00:34 +00:00