31100 Commits

Author SHA1 Message Date
Marvin Häuser
820d54669f BaseTools: Introduce new HII section design 2023-05-09 18:24:31 +03:00
Marvin Häuser
3cbb3f3c55 BaseTools/C: Consume UefiImageLib and ImageToolEmit 2023-05-09 18:24:31 +03:00
Marvin Häuser
c80ad49870 BaseTools/GenFv: Remove .text and .data from FV map 2023-05-09 18:24:30 +03:00
Marvin Häuser
2ab0dbf987 BaseTools: Remove GenFw 2023-05-09 18:24:30 +03:00
Marvin Häuser
8d2d635a7a BaseTools/Python: Replace GenFw with ImageTool 2023-05-09 18:24:30 +03:00
Marvin Häuser
6567f22721 ImageTool: Update command syntax to suit BaseTools/GenMake 2023-05-09 18:24:30 +03:00
Marvin Häuser
eb498a2fc3 ImageTool: Support FixedAddress 2023-05-09 18:24:30 +03:00
Marvin Häuser
5ed47e7c71 ImageTool: Utilize UefiImageLib 2023-05-09 18:24:30 +03:00
Marvin Häuser
dcdb8d3425 MdePkg/UefiImageLib: Add API for the image format ID 2023-05-09 18:24:30 +03:00
Marvin Häuser
b9a2fa8473 ImageTool: Support stripping relocs 2023-05-09 18:24:30 +03:00
Marvin Häuser
5bbcef04ab MdePkg/BaseUefiImageLib: Factor out ExecutionSupport 2023-05-09 18:24:30 +03:00
Marvin Häuser
41a8eaf22b ImageTool: Separate image generation from file I/O logic 2023-05-09 18:24:30 +03:00
Marvin Häuser
3f044a39b8 ImageTool: Make IR canonical and compare input/output IRs 2023-05-09 18:24:30 +03:00
Marvin Häuser
a68aaab3c1 ImageTool: Make ELF SymbolsPath optional 2023-05-09 18:24:30 +03:00
Marvin Häuser
5548b0a92e Remove hacks related to former lack of XCODE5 .hii support 2023-05-09 18:24:30 +03:00
Marvin Häuser
857d3804c7 ImageTool: Append .hii during PE generation 2023-05-09 18:24:30 +03:00
Marvin Häuser
8ab268389f BaseUefiImageLib: Fix segment logging 2023-05-09 18:24:30 +03:00
Marvin Häuser
6d772a4b8e MdePkg/BasePeCoffLib2: Fix uninitialized RtContext for RelocateImage() 2023-05-09 18:24:30 +03:00
Marvin Häuser
3a16df0e2d MdePkg/BasePeCoffLib2: Fix RuntimeRelocate sanity-check 2023-05-09 18:24:30 +03:00
Marvin Häuser
c790116e13 ImageTool: Relocate using the IR 2023-05-09 18:24:30 +03:00
Marvin Häuser
4fccfa0359 ImageTool: Always store the full image segment data, including padding 2023-05-09 18:24:30 +03:00
Marvin Häuser
108c0769ad ImageTool: Don't shrink segment DataSize during validation 2023-05-09 18:24:30 +03:00
Marvin Häuser
efc88fb685 MdePkg/PeCoffLib2: Expose ARM Thumb MOVW/MOVT relocation helpers 2023-05-09 18:24:30 +03:00
Marvin Häuser
98179a20bf BaseTools: Simplify ELF-to-PE build 2023-05-09 18:24:30 +03:00
Marvin Häuser
141a48425c ImageTool: Unify 32-bit and 64-bit tool variants 2023-05-09 18:24:30 +03:00
Marvin Häuser
270a038c4d ImageTool: Don't output errors for ElfScan() RETURN_UNSUPPORTED 2023-05-09 18:24:30 +03:00
Marvin Häuser
35049dd27c ImageTool: Remove ImageInfo global state 2023-05-09 18:24:30 +03:00
Marvin Häuser
49d174dd95 ImageTool: Remove global state from ELF scanning 2023-05-09 18:24:30 +03:00
Mikhail Krichanov
d6b9b3c21b Added .md file summarizing current states of packages. 2023-05-09 18:24:30 +03:00
Mikhail Krichanov
fb8bf205c3 Fixed compilation of all packages tracked by CI after rebasing upon edk2-stable202302. 2023-05-09 18:24:30 +03:00
Marvin Häuser
8f3ea92eda BaseTools/build_rule: Drop deprecated ASM16 definition 2023-05-09 18:24:30 +03:00
Mikhail Krichanov
c7edf90a16 Drop support for the TE format 2023-05-09 18:24:29 +03:00
Marvin Häuser
8d93295a77 ArmPkg/ArmMmuLib: ASSERT ArmReplaceLiveTranslationEntry alignment 2023-05-09 18:24:29 +03:00
Marvin Häuser
5e15fce5d3 MdeModulePkg/ExtendedFirmwarePerformance: Fix FPDT struct alignment 2023-05-09 18:24:29 +03:00
Marvin Häuser
319a83ad2b UefiPayloadPkg/UefiPayloadEntry: Return image destination size as UINT32 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
e04de5db08 ArmPkg/ArmMmuLib: Fix ArmReplaceLiveTranslationEntry() alignment
As the ASM_FUNC() macro performs a section switch, the preceding
.balign directive applies the alignment constraint to the current
location in the previous section. As the linker may not merge the
sections in-order, ArmReplaceLiveTranslationEntry() may be left
unaligned.

Replace the explicit invocation of .balign with the ASM_FUNC_ALIGN()
macro, which guarantees the alignment constraint is applied correctly.
To make sure related issues are reliably caught in the future, align the
end of the function before checking the total occupied size. This
ensures crossing a 0x200 boundary will cause a compilation error.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-05-09 18:24:29 +03:00
Mikhail Krichanov
c16951f06e ArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN()
With the current ASM_FUNC() macro, there is no good way to declare an
alignment constraint for a function. As ASM_FUNC() switches sections,
declaring the constraint before the macro invocation applies it to the
current location in the previous section. Declaring the constraint after
the macro invocation lets the function label point to the location prior
to alignment. Depending on toolchain behaviour, this may cause the label
to point to alignment padding preceding the actual function definition.

To address these issues, introduce the ASM_FUNC_ALIGN() macro, which
declares the alignment constraint right before the function label.

Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-05-09 18:24:29 +03:00
Mikhail Krichanov
bef3e16d5d MdePkg/ProcessorBind AARCH64: Add asm macro to emit GNU BTI note
Implement a CPP macro that can be called from .S files to emit the .note
section carrying the annotation that informs the linker that the object
file is compatible with BTI control flow integrity checks.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Oliver Smith-Denny <osd@smith-denny.com>
2023-05-09 18:24:29 +03:00
Savva Mitrofanov
f3d158c6a0 ArmVirtPkg/ArmVirtQemu: Disable PcdPrePiProduceMemoryTypeInformationHob for ARM
The PcdPrePiProduceMemoryTypeInformationHob on ARM breaks Linux efistub
boot. The efistub for arm32 uncompresses Linux kernel into memory ranges
which occupied by DXE-phase drivers which leads to
'permission denied'-error during page write. So as a temporary solution
we use PcdPrePiProduceMemoryTypeInformationHob only for AARCH64

Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
2023-05-09 18:24:29 +03:00
vit9696
b063a20c61 MdePkg: Fix uninitialised access in SafeString 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
c2aa73cf3d UefiImageLib: Ensure consistently passing the full buffer size 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
002702671a BaseTools/CommonLib: Consume MemoryAllocationLib 2023-05-09 18:24:29 +03:00
Marvin Häuser
2dcbc0591a EmbeddedPkg/PrePiLib: Deduplicate MemoryAllocationLib declarations 2023-05-09 18:24:29 +03:00
Marvin Häuser
5ac7f80191 EmbeddedPkg/NonCoherentDmaLib: Utilize AllocateAlignedPagesEx 2023-05-09 18:24:29 +03:00
Marvin Häuser
9ef906f695 MdePkg/UefiImageLib: Require callers to allocate aligned memory 2023-05-09 18:24:29 +03:00
Marvin Häuser
91f0ea84f1 MdePkg/MemoryAllocationLib: Add Allocate(Aligned)CodePages 2023-05-09 18:24:29 +03:00
Marvin Häuser
581e3aa89a EmulatorPkg/Host: Consume MemoryAllocationLib 2023-05-09 18:24:29 +03:00
Mikhail Krichanov
4c8f3ef802 MdePkg: Introduce CommonMemoryAllocationLib 2023-05-09 18:24:29 +03:00
Marvin Häuser
91775aef7f MdeModulePkg: Manage MemoryProfileLib separately 2023-05-09 18:24:29 +03:00
Marvin Häuser
dcce25f5f6 MdePkg/Base.h: Introduce ALIGN_VALUE_SUBTRAHEND 2023-05-09 18:24:29 +03:00