Skip to content

Commit

Permalink
Build: Make PE loader strip X bit in WX sections
Browse files Browse the repository at this point in the history
This is required to support Apple-made images that have .data with RWX
permissions. Found in EfiBoot, APFS, HFS, ExFat, etc.

closes acidanthera/bugtracker#2190
  • Loading branch information
vit9696 committed Jan 4, 2023
1 parent 76b59df commit 092af5d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ OpenCore Changelog
==================
#### v0.8.9
- Improved debug logging when applying ACPI patches
- Fixed loading macOS with legacy boot without Apple Secure Boot

#### v0.8.8
- Updated underlying EDK II package to edk2-stable202211
Expand Down
1 change: 1 addition & 0 deletions OpenDuetPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0x0
gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x0
gOpenCorePkgTokenSpaceGuid.PcdCanaryAllowRdtscFallback|TRUE
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRemoveXForWX|TRUE

[BuildOptions]
MSFT:NOOPT_*_*_CC_FLAGS = -D OC_TARGET_RELEASE=1 /FAcs -Dinline=__inline /GS /kernel
Expand Down
2 changes: 2 additions & 0 deletions User/Include/UserPcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ extern BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderSupportArmThumb;
extern BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderForceLoadDebug;
extern BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderTolerantLoad;
extern BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderSupportDebug;
extern BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderRemoveXForWX;
extern UINT8 _gPcd_FixedAtBuild_PcdUefiVariableDefaultLang[4];
extern UINT8 _gPcd_FixedAtBuild_PcdUefiVariableDefaultPlatformLang[6];
extern UINT32 _gPcd_BinaryPatch_PcdSerialRegisterStride;
Expand Down Expand Up @@ -93,5 +94,6 @@ extern UINT32 _gPcd_BinaryPatch_PcdSerialRegisterStride;
#define _PCD_GET_MODE_BOOL_PcdImageLoaderForceLoadDebug _gPcd_FixedAtBuild_PcdImageLoaderForceLoadDebug
#define _PCD_GET_MODE_BOOL_PcdImageLoaderTolerantLoad _gPcd_FixedAtBuild_PcdImageLoaderTolerantLoad
#define _PCD_GET_MODE_BOOL_PcdImageLoaderSupportDebug _gPcd_FixedAtBuild_PcdImageLoaderSupportDebug
#define _PCD_GET_MODE_BOOL_PcdImageLoaderRemoveXForWX _gPcd_FixedAtBuild_PcdImageLoaderRemoveXForWX

#endif // OC_USER_PCD_H
1 change: 1 addition & 0 deletions User/Library/UserPcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderSupportArmThumb = FALSE;
BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderForceLoadDebug = FALSE;
BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderTolerantLoad = TRUE;
BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderSupportDebug = FALSE;
BOOLEAN _gPcd_FixedAtBuild_PcdImageLoaderRemoveXForWX = FALSE;
UINT32 _gPcd_BinaryPatch_PcdSerialRegisterStride = 0;

0 comments on commit 092af5d

Please sign in to comment.