MdePkg/BasePeCoffLib2: Move ExtraAction to UefiImageLib

This commit is contained in:
Marvin Häuser 2023-03-21 16:19:54 +01:00
parent 0cd5908c7f
commit b74a1336a5
6 changed files with 25 additions and 15 deletions

View File

@ -34,7 +34,6 @@
BaseOverflowLib
DebugLib
MemoryAllocationLib
UefiImageExtraActionLib
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRtRelocAllowTargetMismatch

View File

@ -19,7 +19,6 @@
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiImageExtraActionLib.h>
#include <Library/PcdLib.h>
#include <Library/PeCoffLib2.h>
@ -451,7 +450,6 @@ PeCoffRelocateImage (
// Verify the Relocation Directory is not empty.
//
if (Context->RelocDirSize == 0) {
UefiImageLoaderRelocateImageExtraAction (Context);
return RETURN_SUCCESS;
}
//
@ -467,7 +465,6 @@ PeCoffRelocateImage (
// prefered location.
//
if (RuntimeContext == NULL && Adjust == 0) {
UefiImageLoaderRelocateImageExtraAction (Context);
return RETURN_SUCCESS;
}
//
@ -623,7 +620,6 @@ PeCoffRelocateImage (
);
}
UefiImageLoaderRelocateImageExtraAction (Context);
return RETURN_SUCCESS;
}

View File

@ -31,6 +31,7 @@
DebugLib
MemoryAllocationLib
PeCoffLib2
UefiImageExtraActionLib
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderAlignmentPolicy

View File

@ -31,6 +31,7 @@
DebugLib
MemoryAllocationLib
UeImageLib
UefiImageExtraActionLib
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugRaisePropertyMask

View File

@ -22,6 +22,7 @@
#include <Library/PcdLib.h>
#include <Library/PeCoffLib2.h>
#include <Library/UefiImageLib.h>
#include <Library/UefiImageExtraActionLib.h>
#include "PeCoffSupport.h"
@ -106,12 +107,19 @@ UefiImageRelocateImage (
IN UINT32 RuntimeContextSize
)
{
return PeCoffRelocateImage (
Context,
BaseAddress,
RuntimeContext,
RuntimeContextSize
);
RETURN_STATUS Status;
Status = PeCoffRelocateImage (
Context,
BaseAddress,
RuntimeContext,
RuntimeContextSize
);
if (!RETURN_ERROR (Status)) {
UefiImageLoaderRelocateImageExtraAction (Context);
}
return Status;
}
RETURN_STATUS

View File

@ -22,6 +22,7 @@
#include <Library/PcdLib.h>
#include <Library/UeImageLib.h>
#include <Library/UefiImageLib.h>
#include <Library/UefiImageExtraActionLib.h>
#include "UeSupport.h"
@ -100,10 +101,14 @@ UefiImageRelocateImage (
IN UINT32 RuntimeContextSize
)
{
return UeRelocateImage (
Context,
BaseAddress
);
RETURN_STATUS Status;
Status = UeRelocateImage (Context, BaseAddress);
if (!RETURN_ERROR (Status)) {
UefiImageLoaderRelocateImageExtraAction (Context);
}
return Status;
}
RETURN_STATUS