mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcMachoLib: Update GetSymbolByRelocOffset interface to report Relocation existance.
This commit is contained in:
parent
eda77537cc
commit
0ce7e1ec99
@ -322,14 +322,18 @@ MachoIsSymbolValueInRange64 (
|
||||
|
||||
@param[in,out] Context Context of the Mach-O.
|
||||
@param[in] Address Address to search for.
|
||||
@param[out] Symbol Buffer to output the symbol referenced by the
|
||||
Relocation into. The output is undefined when FALSE
|
||||
is returned. May be NULL.
|
||||
|
||||
@returns NULL NULL is returned on failure.
|
||||
@returns Whether the Relocation exists.
|
||||
|
||||
**/
|
||||
MACH_NLIST_64 *
|
||||
BOOLEAN
|
||||
MachoGetSymbolByExternRelocationOffset64 (
|
||||
IN OUT OC_MACHO_CONTEXT *Context,
|
||||
IN UINT64 Address
|
||||
IN UINT64 Address,
|
||||
OUT MACH_NLIST_64 **Symbol
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@ -569,6 +569,9 @@ MachoGetMetaclassSymbolFromSmcpSymbol64 (
|
||||
IN CONST MACH_NLIST_64 *Smcp
|
||||
)
|
||||
{
|
||||
MACH_NLIST_64 *Symbol;
|
||||
BOOLEAN Result;
|
||||
|
||||
ASSERT (Context != NULL);
|
||||
ASSERT (Smcp != NULL);
|
||||
|
||||
@ -576,10 +579,16 @@ MachoGetMetaclassSymbolFromSmcpSymbol64 (
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return MachoGetSymbolByExternRelocationOffset64 (
|
||||
Result = MachoGetSymbolByExternRelocationOffset64 (
|
||||
Context,
|
||||
Smcp->Value
|
||||
Smcp->Value,
|
||||
&Symbol
|
||||
);
|
||||
if (Result) {
|
||||
return Symbol;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -297,14 +297,18 @@ MachoGetIndirectSymbolName64 (
|
||||
|
||||
@param[in,out] Context Context of the Mach-O.
|
||||
@param[in] Address Address to search for.
|
||||
@param[out] Symbol Buffer to output the symbol referenced by the
|
||||
Relocation into. The output is undefined when FALSE
|
||||
is returned. May be NULL.
|
||||
|
||||
@returns NULL NULL is returned on failure.
|
||||
@returns Whether the Relocation exists.
|
||||
|
||||
**/
|
||||
MACH_NLIST_64 *
|
||||
BOOLEAN
|
||||
MachoGetSymbolByExternRelocationOffset64 (
|
||||
IN OUT OC_MACHO_CONTEXT *Context,
|
||||
IN UINT64 Address
|
||||
IN UINT64 Address,
|
||||
OUT MACH_NLIST_64 **Symbol
|
||||
)
|
||||
{
|
||||
CONST MACH_RELOCATION_INFO *Relocation;
|
||||
@ -313,10 +317,11 @@ MachoGetSymbolByExternRelocationOffset64 (
|
||||
|
||||
Relocation = InternalGetExternalRelocationByOffset (Context, Address);
|
||||
if (Relocation != NULL) {
|
||||
return MachoGetSymbolByIndex64 (Context, Relocation->SymbolNumber);
|
||||
*Symbol = MachoGetSymbolByIndex64 (Context, Relocation->SymbolNumber);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user