Skip to content

Commit da44b3b

Browse files
makubackimergify[bot]
authored andcommitted
PrmPkg: Set DXE_RUNTIME_DRIVER section alignment
Since PRM modules are DXE_RUNTIME_DRIVER images, this change sets the linker flags to the expected section alignment values for runtime code images. This serves as an example for platforms but also results in PRM sample modules in the package having correct section alignment. Signed-off-by: Michael Kubacki <[email protected]>
1 parent baf0ae3 commit da44b3b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

PrmPkg/PrmPkg.dsc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,20 @@
149149
[BuildOptions]
150150
# Force deprecated interfaces off
151151
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
152+
153+
#
154+
# PRM Modules are DXE_RUNTIME_DRIVER modules. Platforms that build PRM Modules should
155+
# ensure sections are page aligned to 4K for X64 and 64K for AARCH64 so paging protections
156+
# can be applied to the memory ranges.
157+
#
158+
[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
159+
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
160+
CLANGPDB:*_*_*_DLINK_FLAGS = /ALIGN:4096
161+
XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000
162+
XCODE:*_*_*_MTOC_FLAGS = -align 0x1000
163+
164+
[BuildOptions.X64.EDKII.DXE_RUNTIME_DRIVER]
165+
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
166+
167+
[BuildOptions.AARCH64.EDKII.DXE_RUNTIME_DRIVER]
168+
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x10000

0 commit comments

Comments
 (0)