Commit Graph

33980 Commits

Author SHA1 Message Date
Leif Lindholm 3e7e3e2467 MdePkg/AArch64: fix AsmMacroLib signed value handling for MOV32/MOV64
MOV32 and MOV64, defined in AsmMacrolib.h, use a combination of movz and
movk instructions to fill a register with an immediate value. With each
instruction supplying 16 of the bits.

CLANGPDB builds have been reported to fail on the current implementation
when provided with negative values with:
  error: immediate must be an integer in range [0, 65535].

To resolve this, add a mask for the line filling the top 16 bits, like
the other lines already had.

Reported-by: Michael Kubacki <mikuback@linux.microsoft.com>
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-02-24 16:30:19 +00:00
Michael Kubacki 81803b9eba OvmfPkg: Add SmmCommunicationDxe
Adds the driver when SMM_REQUIRE is set to publish the
gEdkiiPiSmmCommunicationRegionTableGuid config table. Some code
now uses this table to find common communication buffers.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-24 14:08:32 +00:00
Ajan Zhong 0058f7486f .azurepipelines: Introduce Build.Archlist for Azure GCC5 pipeline
Azure Ubuntu GCC5 pipeline builds packages with all architectures.
However, UefiPayloadPkg supports multiple architectures, including
IA32, X64 and AARCH64. In this case, Azure pipeline builds modules
for IA32, X64 and AARCH64 architectures, generates FD with same
FDF file. It leads build system failed to locate which module should
be integrated into Flash image.

Add Build.Archlist to specify architectures to be build with, and
separate TARGET_UEFIPAYLOAD to TARGET_UEFIPAYLOAD_IA32_X64 and
TARGET_UEFIPAYLOAD_AARCH64 to cover all supported architectures for
UefiPayloadPkg package.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
Amos Bu f0a2015373 UefiPayloadPkg: Add AARCH64 support
Add basic support for FIT image on the AARCH64 architecture, reuse
exsitting DSC and FDF files for IA32, X64 and AARCH64 architectures.

Introduce new PCD: PcdUseUniversalPayloadSerialPort to indicate
which serial port module is used due to some serial port parameters
are fixed for ARM SoC and Platform.

Please use following command to build AARCH64 UPL FIT image:
"
 export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
 python UefiPayloadPkg/UniversalPayloadBuild.py -a AARCH64
        -t GCC5 -b DEBUG --Fit
"

Signed-off-by: Amos Bu <amos.bu@newfw.com>
Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
Ajan Zhong 9757ffaa38 UefiPayloadPkg: Update logic of fetching Processor Physical Address size
UefiPayloadEntry utilizes CPUID 0x80000008 leaf to retrieve the Processor's
Physical Address size for X86 architecture. To enable support for multiple
architectures, replace the direct implementation with an architecture-level
function provided by the UefiCpuPkg library, abstracting the underlying details.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
Ajan Zhong 9fe0980a77 UefiCpuPkg: Add common architecture level library support
Introduce fundamental architecture-level functionalities which should
be implemented cross different architectures.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-24 12:31:47 +00:00
anandhkrishnau 8f57cf0829 EmulatorPkg/Unix/Host: Skip symbol unloading for stripped images
Skip symbol unloading for the PE/COFF images which dont have pdb area
when it built in RELEASE MODE.

Signed-off-by: Anandh krishna U <anandhkrishnau@ami.com>
2025-02-24 04:59:43 +00:00
Dun Tan e2bb5b530b StandaloneMmPkg/Core: dump HOB list in MMRAM
This commit is to dump finaled HOB list in MMRAM.

In previous commit, we verify the HOB list and initialize a
new HOB list in MMRAM before we call the library constructor.
Since we might migrate some memory allocation HOB into MMRAM,
it's cleared to dump information in finaled HOB list.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-02-24 03:24:08 +00:00
Dun Tan 1b71ddea42 StandaloneMmPkg/Core: pass HOB list in MMRAM to library constructor
The commit changes the code to initializes new HOB list in MMRAM
before the ProcessLibraryConstructorList() and pass the MMRAM HOB
list to lib constructor.

Previously, the HOB list in non-MMRAM range is passed to the lib
constructor. Then code in the library constructor would consume
unverified HOB list in non-MMRAM buffer. With this commit, the
HOB validation and memory allocation HOB migration are doned before
the library constructor.

Since the HOB list initialization needs to allocate memory in MMRAM,
we also need to call the MmInitializeMemoryServices() before the HOB
list initialization. Then the duplicated code in the StandaloneMmCore
MemoryAllocationLib can also be removed.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-02-24 03:24:08 +00:00
Ray Ni 8e92e8761c IntelFsp2Pkg/FspSecCore: initialize FspMode in FSP_GLOBAL_DATA
FspSecCore only runs in API mode.
When it allocates memory in stack for FSP_GLOBAL_DATA, it does not
initialize the FspMode to FSP_IN_API_MODE.

The patch enhances the code to initialize the FspMode as well.

This change does not have functionality impact as there should
be some code elsewhere which sets the FspMode.
This change allows to remove the extra code logic that sets
FspMode in API mode.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
2025-02-24 02:36:58 +00:00
Sean Rhodes 83a86f465c UefiPayloadPkg: Allow boot timeout to be configured
This patch moves `PcdPlatformBootTimeOut` from `[PcdsDynamicExDefault]`
to `[PcdsDynamicHii]`, allowing the boot timeout to be configured through
HII, rather than being a compile-time setting.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
2025-02-23 21:32:17 +00:00
Aravind P R 063e19bab2 IntelFsp2Pkg: Fixing TemporaryRamSize Configurability option.
Issue : Configuring TemporaryRamSize using FSP-T arch UPD
(added as part of Spec 2.5) is not working as expected.

Root cause : Code is reading the ImageAttribute from the wrong
address which confirms the TemporaryRamSize Configurability,
hence the TemporaryRamSize UPD is ignored. This is because
the code expects the FspInfoheader Offset to be in ESI/RSI
(from which ImageAttribute read) is not guaranteed as per the
current implementation.

Fix : Modified code to make sure that ESI/RSI contains the
FspInfoheader offset by time the code reads the ImageAttribute.

Tests : Verified the fix on Both 32 Bit and 64 Bit FSP Binaries
by configuring the TemporaryRamSize using the FSPT Arch UPD.

Signed-off-by: Aravind P R <aravind.p.r@intel.com>
2025-02-21 17:57:46 +00:00
Longhaox Lee fbe0805b20 MdeModulePkg/HiiDatabaseDxe: Remove buffer error for string default.
Remove efivarstore IFR buffer error when string load default.
In the case of varstore type IFR, it will be NULL,
just break into next opcode process.

Resolve issue from commit cbe8a09dba
varstore type IFR string might return status error
while execute ExtractConfig function.

Signed-off-by: Longhao Lee <longhaox.lee@intel.com>
2025-02-21 08:50:36 +08:00
Phil Noh 0192f2d7cb MdeModulePkg/UsbBusPei: Improve PEI USB enumeration
Unlike DXE USB enumeration that enumerates all changed ports on timer
interrupt, PEI USB Enumeration runs once at the driver entry point.
USB3.x devices initially appear in USB2.0 ports. When the USB2.0 port is
reset, the USB3.x device disappears from the USB2.0 port and appears on the
USB3.0 port. The USB3.x device won't be enumerated if the USB2.0 port
number is greater than the USB3.0 port number. Re-enumerate USB to make
sure USB3.x devices in this case.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-02-19 10:21:00 +08:00
Oliver Smith-Denny bc664d1830 Revert "FatPkg: Validate Reserved FAT Entries on Volume Open"
This reverts commit 58766a4729.

In edk2 commit 58766a4, validation of the two reserved FAT entries
was added.

However, it also checked the return of FatGetFatEntry to MAX_UINT32,
which is what FatGetFatEntry returns when it encounters an error,
e.g. not being able to read the disk. However, MAX_UINT32 is also a
valid value for the reserved FAT entries and under some conditions
these will be returned in the success case.

A FAT volume formatted with these valid values of the reserved FAT
entries will fail to boot an OS because the opening of the volume
will fail.

However, the reason FatGetFatEntry returns MAX_UINT32 is that most
other uses of the function are comparing it against the END_OF_CHAIN
mark, which MAX_UINT32 will trip and those functions will fail out.

Because this is a critical bug that can prevent OS booting and the
bug the original commit was solving was accounting for a bad FAT
filesystem formatting tool, this commit is reverted for now.

Future work will clean up FatGetFatEntry so that it returns an
EFI_STATUS, but that involves more work and this bug needs to be
resolved in the meantime.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-14 06:58:07 +00:00
Kun Qin 523dbb6d59 ArmPkg: ArmFfaStandaloneMmLib: Fix non-FFA path
ArmFfaLibCommonInit will return EFI_UNSUPPORTED when there is no FFA
supported on the platform. This is expected behavior. However, the return
of error code will incur program asserts.

This change fixed the non-FFA path for the Standalone MM instance.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-02-11 21:21:40 +00:00
Ard Biesheuvel 96cf70951f MdePkg/DynamicStackCookieEntryPointLib: Drop execute-in-place versions
SEC, PEI_CORE and PEIM type modules generally execute in place from
memory that is not writable. This means that it is not generally
possible to use an entrypoint implementation that stores a dynamically
generated stack cookie into a global variable. For PEIMs in particular,
there may be other options, such as a DEPEX on the permanent memory PPI,
but the current dynamic implementations of the stack checking library
entrypoints for PEI_CORE and PEIM modules must not be used as-is.

So remove them, and update the readme accordingly.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-02-11 20:25:08 +00:00
Ard Biesheuvel 5c3dcef94c MdePkg/DynamicStackCookieEntryPointLib: Remove unused files
Remove some source files that were part of an earlier incarnation of
DynamicStackCookieEntryPointLib but are no longer actually in use.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-02-11 20:25:08 +00:00
Ajan Zhong 23007f7ae2 UefiPayloadPkg: Add StackCheckLib to fix FIT build issue
Commit efbf5ed moves StackCheckLibStaticInit to StackCheckLib,
and each SEC module has a dependency on StackCheckLib now.

Add StackCheckLib in FitUniversalPayloadEntry.inf to fix build
issue.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2025-02-11 19:09:23 +00:00
Star Zeng 7308568dd6 StandaloneMmPkg StandaloneMmCoreMemoryAllocationLib: Rename gMmst
StandaloneMmCoreMemoryAllocationLib.c and StandaloneMmServicesTableLib.c
are both defining gMmst, StandaloneMmCoreMemoryAllocationLib will be
linked to StandaloneMmCore directly, StandaloneMmServicesTableLib may be
linked to StandaloneMmCore indirectly, when they are both linked to
StandaloneMmCore, there will be "lld-link: error: duplicate symbol: gMmst"
build error with Clang compiler.

gMmst is declared in MmServicesTableLib.h and its definition should be
owned by MmServicesTableLib.

This patch renames gMmst in StandaloneMmCoreMemoryAllocationLib.c to
mMemoryAllocationMmst to avoid this build error.

Signed-off-by: Star Zeng <star.zeng@intel.com>
2025-02-11 18:04:35 +00:00
Kane Chen 0d61f52fe3 Add MockVariablePolicyHelperLib
Signed-off-by: Kane Chen <kane.chen@microsoft.com>
2025-02-07 18:43:32 +00:00
Abdul Lateef Attar 2b3ea9334f DynamicTablesPkg: Adds X64 support to SRAT table generator
Adds X64 support to the SRAT table generator library.
Adds EX64ObjLocalApicX2ApicAffinity CM object to get
platform configuration information.
Update the parser with newly added CM object.

Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-02-07 15:24:03 +00:00
Oliver Smith-Denny 1f1182c396 ArmVirtPkg: ArmVirtQemu: Add Custom Stack Cookies
In order to provide an example and test out dynamic stack
cookies in edk2, dynamic stack cookies are added to ArmVirtPkg
platforms using ArmVirt.dsc.inc, per maintainer request.

This does require moving the ArmVirt.dsc.inc to be included
before MdeLibs.dsc.inc as the BaseTools does not expand all
the Defines sections before processing.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny 861b91d975 ArmVirtPkg: Add RNDR Support to QEMU
In order to use dynamic stack cookies in ArmVirtQemu, we need
RNDR support. This is added by using the neoverse-n2 cpu.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny 30547859f2 OvmfPkg: OvmfIA32X64: Add Custom Stack Cookie Checking
To provide an example and test the code within edk2, this
adds stack cookie checking to OvmfIA32X64, doing no checking
for SEC and PEI_CORE modules, static cookies for PEIMs, and
dynamic cookies for all other module types.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny 6d741357c2 OvmfPkg: Add RDRAND Support To QEMU
In order to use dynamic stack cookies, we need RDRAND support
from QEMU, so this updates the QEMU launching code for OvmfPkg
to include RDRAND support.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny e6b6aa90d4 MdePkg: Add Dynamic Stack Cookie Support
Adds dynamic stack cookies in the form of copies of the entry
point libraries that use shared logic to update stack cookies
at runtime.

This relies on RDRAND on IA32/X64 and RNDR on AARCH64 to get a
random number to apply to the stack cookie on module entry point.

This simplifies the logic a platform must do to include stack
check functionality.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny efbf5ed08c MdePkg: Move StackCheckLibStaticInit to StackCheckLib
This commit oves StackCheckLib from a NULL lib to an instance of
StackCheckLib. This requires every entry point to add a library
dependency on StackCheckLib. It also requires every SEC module
to have a dependency on StackCheckLib because there is no
standard SEC entry point.

It allows for greater flexibility for a platform to apply stack
cookies and simplifies DSC logic.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny db03bf1d9d StandaloneMmPkg: Consume X64 StandaloneMmCoreEntryPoint From MdePkg
Now that the X64 StandaloneMmCoreEntryPoint has been moved to
MdePkg, it can be removed from StandaloneMmPkg and consumed
from MdePpkg.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny 885bcca649 MdePkg: Add StandaloneMmCoreEntryPoint for X64
Moves StandaloneMmCoreEntryPoint for X64 to MdePkg to live with
the other entry point libs. It does not move the ARM64 version,
as this was just moved to ArmPkg due to its heavy coupling with
ArmPkg code. This will need to be revisited when dynamic stack
cookie support is added to ARM64 StMM.

This commit just adds the library in MdePkg, a separate commit
will remove it from StandaloneMmPkg to make it easier to consume.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny e63cdeebb8 MdePkg: Add StackCheckLib Library Class
StackCheckLib defines the interface between a compiler
and the stack checking code. It is being converted from
a NULL library class to an actual library class to make
it easier to use for a platform and be easier to define
the expected interface with a compiler, so if there is
a compiler change it can be tracked and caught.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Oliver Smith-Denny d9715c133f MdePkg: Centralize RNDR Register Definition
RNDR is a standard register defined in the ARM ARM for
AARCH64. Move the definition from BaseRngLib to AArch64.h.

Furthermore, move the inclusion of this register definition
to the ARM specific header file.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-02-07 02:23:11 +00:00
Leif Lindholm 5c02a64823 Maintainers.txt: adding Ard and Michael to stewards team
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-02-06 23:43:22 +00:00
Chasel Chiu 1cb349e4bb IntelFsp2WrapperPkg: Remove inactive maintainer email
Remove inactive maintainer email

Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
2025-02-06 22:05:51 +00:00
Michael Kubacki edf1450f3e SecurityPkg: Add RngPei
REF:https://github.com/tianocore/edk2/issues/10529

The `RngPei` PEIM can be used if RNG should be provided over a
dynamic binary interface to other PEIMs on a platform.

Tested with:

- SecurityPkg CI
- Verify RNG linked with RngLib is executed as expected
- Verify random numbers are generated successfully with a valid
  RngLib

Integration instructions:

Use the `RngPei` module if a platform needs to produce
`gEfiRngPpiGuid`.

The platform should usually link a different `RngLib` instance to
`RngPei` than other PEIMs that may use the RNG PPI produced since
`RngPei` is responsible for producing the PPI.

For example, a `RngLib` instance that uses the rdrand instruction
may be linked against `RngPei` and a `RngLib` instance that uses
the RNG PPI may be linked against other PEIMs.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-06 20:29:15 +00:00
Michael Kubacki bcab6996a0 MdePkg: Add PeiRngLib
REF:https://github.com/tianocore/edk2/issues/10529

Adds a new PEI library instance for RngLib that uses the RNG services
provided by the RNG PPI.

This library instance will add a DEPEX on gEfiRngPpiGuid on modules
it links against. It can be used to allow PEIMs to get RNG support
over a dynamic interface.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-06 20:29:15 +00:00
Michael Kubacki de5c1198c1 MdePkg: Add Random Number Generator (RNG) PPI
REF:https://github.com/tianocore/edk2/issues/10529

Adds a new PPI that serves the same purpose as EFI_RNG_PROTOCOL in
DXE. This PPI can be produced by a PEIM to provide a dynamic interface
to RNG services in PEI.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-06 20:29:15 +00:00
Michael Kubacki 7518b93f77 MdePkg: Split RNG protocol definitions
Move the structure definition to a common location that can be shared
with the RNG PPI. Move the algorithms to a common header that can be
referenced independent of the protocol.

Include the algorithm header in the interface header since the
algorithms are directly used in the interface and for compatibility
with existing code.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-06 20:29:15 +00:00
Aaron Li 15e225d06a Maintainers.txt: add myself as PrmPkg maintainer
Signed-off-by: Aaron Li <aaron.li@intel.com>
2025-02-06 18:53:37 +00:00
Leif Lindholm 258f2d1563 ReadMe.rst: reflect bugzilla migration
We've migrated bugzilla bugs to github issues, so update the references
to specific bugs called out in the top-level readme.

Also delete the references to BZ2661 and BZ2668 which are both *closed*:
https://github.com/tianocore/edk2/issues/8453
https://github.com/tianocore/edk2/issues/8458

And drop bugzilla.tianocore.org from "references".
The server is no longer in use, and the certificate has expired,
so stop telling people to go there.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-02-04 18:41:01 +00:00
Michael Kubacki f7cf6ce299 License-History.txt: Reflect bugzilla migration
Update BZ links to corresponding GitHub issues links now that the
BZ -> GitHub issue migration is complete.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-02-04 16:57:48 +00:00
Rebecca Cran fe5c2df49e SignedCapsulePkg: make Doxygen interpret ASCII art as verbatim text
By default, Doxygen tries to nicely format all text within doc blocks.
Unfortunately this mangles ASCII art: add @verbatim statements
to EdkiiSystemFmpCapsule.h to cause Doxygen to display the text as
provided.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2025-02-04 01:08:30 +00:00
Rebecca Cran 259e1f04c6 BaseTools: Add @verbatim as allowed Doxygen tag
Per the discussion in https://github.com/tianocore/edk2/pull/6476,
update Ecc code to allow the @verbatim Doxygen tag.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2025-02-04 00:12:00 +00:00
Chasel Chiu 0664c4e3b9 UefiPayloadPkg: Revert 4KB alignment of CLANGDWARF build
With the latest GccBase.lds combining with CLANG build, there is no
need to enforce 4KB alignment of in UPL CLANGDWARF build.

This reverts commit b3bfb8f22d.

Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
2025-02-03 17:00:46 +00:00
Dionna Glaze cd87106d26 BaseTools: Add /DRIVER to CLANGPDB link flags
This quiets the warning reported in Issue #10637.

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
2025-02-03 02:03:45 +00:00
Yuquan Wang 074f61e4c6 MdePkg/IndustryStandard: add definitions for CXL CEDT
This adds #defines and struct typedefs for the various structure
types in the CXL Early Discovery Table (CEDT).

Signed-off-by: Yuquan Wang <wangyuquan1236@phytium.com.cn>
2025-02-03 00:34:06 +00:00
Michael D Kinney 62b0698309 BaseTools/AutoGen: GenMake response file quotes strings
If command line options are moved into a response file
of a GCC family build, then the file path separators are
converted from '\' to '/'. However, this can corrupt
command line options that are quoted strings.

Update GenMake to no convert '\' to '/' in quoted strings.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-02-02 19:22:42 +00:00
Ard Biesheuvel 15a7d311a8 BaseTools/tools_def: Remove no-warn-rwx-segments linker options
The linker option 'no-warn-rwx-segments' breaks both the LLVM linker and
versions of the binutils ld.bfd linker prior to 2.39.

Now that the ELF image is made up of separate R-X and RW- segments, this
warning is no longer emitted and so there is no longer a need to
suppress it either.

While at it, move GCC_DLINK_FLAGS_COMMON (which is not common but only
used by Ia32 and X64) into its only user so it can be dropped.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-02-02 09:20:53 +00:00
Ard Biesheuvel f2b42c83dd BaseTools/Scripts/GccBase.lds: Use separate R-W and RW- ELF segments
To prevent the ELF linkers from complaining about emitted ELF segments
that require both writable and executable permissions, define two
separate R-X and RW- ELF segments, and emit the output sections
explicitly into those segments as appropriate.

Note that this has no bearing on the PE image, and using a single RW-
segment would probably be fine too.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-02-02 09:20:53 +00:00
Ard Biesheuvel e5d95c786b BaseTools/Scripts: Merge GCC and Clang ELF linker scripts
The original reason for creating a separate version of the ELF linker
script for Clang was the difference between COMMONPAGESIZE and
MAXPAGESIZE, which can we provided on the command line to the respective
linkers (ld.bfd versus lld). That difference no longer exists, and both
use COMMONPAGE_SIZE. So there is no longer a need to maintain a fork,
which has already been going out of sync with the original for no good
reason.

So merge the two and call it GccBase.lds

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-02-02 09:20:53 +00:00