66 Commits

Author SHA1 Message Date
Marvin Häuser
ed40e08291 ImageTool: Replace QuickSort with qsort 2023-05-10 10:22:23 +03:00
Marvin Häuser
e11f00a64c ImageTool: Remove old HII functionality 2023-05-10 10:22:23 +03:00
Marvin Häuser
fd7f3b94b1 BaseTools: Introduce new HII section design 2023-05-10 10:22:23 +03:00
Marvin Häuser
a54d495da6 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2023-05-10 10:22:22 +03:00
Marvin Häuser
e446bbff25 ImageTool: Update command syntax to suit BaseTools/GenMake 2023-05-10 10:22:22 +03:00
Marvin Häuser
9fe980971f ImageTool: Support FixedAddress 2023-05-10 10:22:22 +03:00
Marvin Häuser
692969b2b1 ImageTool: Utilize UefiImageLib 2023-05-10 10:22:22 +03:00
Marvin Häuser
ae08542f89 ImageTool: Support stripping relocs 2023-05-10 10:22:22 +03:00
Marvin Häuser
efb6eea39e ImageTool: Separate image generation from file I/O logic 2023-05-10 10:22:22 +03:00
Marvin Häuser
5976987671 ImageTool: Make IR canonical and compare input/output IRs 2023-05-10 10:22:22 +03:00
Marvin Häuser
1edfc1f6b7 ImageTool: Make ELF SymbolsPath optional 2023-05-10 10:22:22 +03:00
Marvin Häuser
942e747a91 ImageTool: Append .hii during PE generation 2023-05-10 10:22:22 +03:00
Marvin Häuser
75662ff41a ImageTool: Relocate using the IR 2023-05-10 10:22:22 +03:00
Marvin Häuser
3a4c288fd3 ImageTool: Always store the full image segment data, including padding 2023-05-10 10:22:22 +03:00
Marvin Häuser
b666a59399 ImageTool: Don't shrink segment DataSize during validation 2023-05-10 10:22:22 +03:00
Marvin Häuser
85a3942525 ImageTool: Unify 32-bit and 64-bit tool variants 2023-05-10 10:22:22 +03:00
Marvin Häuser
fef57dfc27 ImageTool: Don't output errors for ElfScan() RETURN_UNSUPPORTED 2023-05-10 10:22:22 +03:00
Marvin Häuser
8ed1fada2d ImageTool: Remove ImageInfo global state 2023-05-10 10:22:22 +03:00
Marvin Häuser
b2de62e37f ImageTool: Remove global state from ELF scanning 2023-05-10 10:22:22 +03:00
Marvin Häuser
92bb32130b ImageTool: Prefer ELF PIE over object file relocations 2023-04-17 12:08:02 +02:00
Marvin Häuser
dac1ed6cb9 ImageTool: Translate all loadable ELF sections 2023-04-17 12:08:02 +02:00
Marvin Häuser
3f691ba5eb ImageTool: Determine PE section characteristics based on permissions 2023-04-17 12:08:02 +02:00
Marvin Häuser
b4bcef3681 ImageTool: Properly handle ELF base address 2023-04-17 12:08:02 +02:00
Marvin Häuser
fa34c0e0bc ImageTool: Remove unused functions 2023-04-17 12:08:02 +02:00
Savva Mitrofanov
4a19cb0dc4
BaseTools/ImageTool: Move Pcd tokens into OC User library 2023-04-14 21:17:13 +06:00
Mikhail Krichanov
511f3b2637 ImageTool: Fixed Amaranth boot. Stack canaries' relocations are stored in .rela section, relocations of which are applicable to the whole file (sh_info == 0) and must be kept. 2023-04-14 11:17:47 +03:00
Marvin Häuser
1c6925aaa2 Drop support for the TE format 2023-04-12 19:56:18 +03:00
Mikhail Krichanov
b58fc72d8a ImageTool: Dropped MOVW/T relocs. 2023-04-12 16:46:40 +03:00
Mikhail Krichanov
19978560ba BaseTools: Cleaned up ARM relocs calculation in ImageTool and removed several relocation types' definitions as according to ARM ABI (aaelf32.pdf) 177-255 codes are reserved for future allocation. 2023-04-12 16:46:40 +03:00
Savva Mitrofanov
687086ce0e
ImageTool: Drop duplicated BaseOverflowLib symbols 2023-04-12 18:02:13 +06:00
Marvin Häuser
79ee7f5475 ImageTool: Rework PE section emission 2023-04-11 09:27:39 +02:00
Marvin Häuser
c497d51928 ImageTool: Only translate ELF relocs targeting translated sections 2023-04-11 09:27:39 +02:00
Marvin Häuser
016a079008 ImageTool: Support R_ARM_NONE relocation type 2023-04-11 09:27:39 +02:00
Marvin Häuser
6623dd8671 ImageTool: Error when encountering unknown ELF SHF_ALLOC sections 2023-04-11 09:27:39 +02:00
Marvin Häuser
08778e2a3d ImageTool: Abstract executable generation 2023-04-11 09:27:35 +02:00
Marvin Häuser
75fcd420f6 ImageTool: Distinguish between non-ELF/PE and incompatible ELF/PE 2023-04-10 22:40:52 +02:00
Marvin Häuser
1fc65bdb8d ImageTool: Correctly emit VirtualSize as ImageSize for non-XIP 2023-04-10 22:39:42 +02:00
Marvin Häuser
d27a576b86 ImageTool: Explicitly convert IR to XIP for PE emission 2023-04-10 22:39:42 +02:00
Marvin Häuser
0bfa467344 ImageTool: Use realloc() for IR segment enlarging 2023-04-10 22:39:42 +02:00
Marvin Häuser
2f91fddf99 Drop premature UE support 2023-04-10 22:21:15 +02:00
Mikhail Krichanov
d58d5c1bc3 ImageTool: Extended debug printings. 2023-04-10 10:31:53 +02:00
Mikhail Krichanov
7abc3faeec ImageTool: Made compilation of EFI_IMAGE_MACHINE selection conditional. 2023-04-10 10:31:53 +02:00
Marvin Häuser
373bb081ee ImageTool: Fix ARM image generation 2023-04-10 10:31:53 +02:00
Marvin Häuser
b1851ef38d BaseTools/ImageTool: Fix PeScan error handling 2023-04-02 00:04:46 +02:00
Marvin Häuser
d5eecc2e2d BaseTools/ImageTool: Use AllocateAlignedCodePages() for images 2023-04-02 00:04:28 +02:00
Marvin Häuser
240e920841 BaseTools/ImageTool: Consume CommonMemoryAllocationLib 2023-04-01 23:59:10 +02:00
Marvin Häuser
0cd5908c7f BaseTools/ImageTool: Rename PreferredAddress to BaseAddress 2023-03-30 00:18:28 +02:00
Marvin Häuser
ea97361c29 ImageTool: Fix SymbolsPathLen inconsistencies 2023-03-28 23:52:27 +02:00
Marvin Häuser
d24e8eb64a BaseTools/CommonLib: Consume MdePkg and MdeModulePkg
BaseTools has been duplicating and adapting code that is defined in
MdePkg and MdeModulePkg. This leads to desync issues where the same
symbols may be backed by different functions with slightly different
semantics and also fixes that apply only to BaseTools or only to MdePkg
and MdeModulePkg.

To address these issues, update BaseTools/Source/C to utilize the code
from MdePkg and MdeModulePkg.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
2023-03-17 15:16:23 +03:00
Mikhail Krichanov
aba1c68ac1 ImageTool: Fixed compilation for AARCH64. 2023-03-16 15:33:03 +03:00