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 BaseOverflowLib
DebugLib DebugLib
MemoryAllocationLib MemoryAllocationLib
UefiImageExtraActionLib
[FixedPcd] [FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRtRelocAllowTargetMismatch gEfiMdePkgTokenSpaceGuid.PcdImageLoaderRtRelocAllowTargetMismatch

View File

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

View File

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

View File

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

View File

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

View File

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