OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Relocations.c File Reference
#include <Uefi.h>
#include <IndustryStandard/AppleMachoImage.h>
#include <Library/DebugLib.h>
#include <Library/OcMachoLib.h>
#include "OcMachoLibInternal.h"

Go to the source code of this file.

Functions

BOOLEAN MachoRelocationIsPairIntel32 (IN UINT8 Type)
 
BOOLEAN MachoRelocationIsPairIntel64 (IN UINT8 Type)
 
BOOLEAN MachoIsRelocationPairTypeIntel64 (IN UINT8 Type)
 
BOOLEAN MachoPreserveRelocationIntel64 (IN UINT8 Type)
 
STATIC MACH_RELOCATION_INFOInternalLookupRelocationByOffset (IN UINT64 Address, IN UINT32 NumRelocs, IN MACH_RELOCATION_INFO *Relocs)
 
STATIC MACH_RELOCATION_INFOInternalLookupSectionRelocationByOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address, IN BOOLEAN External)
 
MACH_RELOCATION_INFOInternalGetExternRelocationByOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address)
 
MACH_RELOCATION_INFOInternalGetLocalRelocationByOffset (IN OUT OC_MACHO_CONTEXT *Context, IN UINT64 Address)
 

Detailed Description

Provides services for Relocations.

Copyright (c) 2018, Download-Fritz. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php.

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file Relocations.c.

Function Documentation

◆ InternalGetExternRelocationByOffset()

MACH_RELOCATION_INFO * InternalGetExternRelocationByOffset ( IN OUT OC_MACHO_CONTEXT * Context,
IN UINT64 Address )

Retrieves an extern Relocation by the address it targets.

Parameters
[in,out]ContextContext of the Mach-O.
[in]AddressThe address to search for.
Return values
NULLNULL is returned on failure.

Definition at line 211 of file Relocations.c.

◆ InternalGetLocalRelocationByOffset()

MACH_RELOCATION_INFO * InternalGetLocalRelocationByOffset ( IN OUT OC_MACHO_CONTEXT * Context,
IN UINT64 Address )

Retrieves an extern Relocation by the address it targets.

Parameters
[in,out]ContextContext of the Mach-O.
[in]AddressThe address to search for.
Return values
NULLNULL is returned on failure.

Definition at line 244 of file Relocations.c.

◆ InternalLookupRelocationByOffset()

STATIC MACH_RELOCATION_INFO * InternalLookupRelocationByOffset ( IN UINT64 Address,
IN UINT32 NumRelocs,
IN MACH_RELOCATION_INFO * Relocs )

Retrieves an extern Relocation by the address it targets.

Parameters
[in]AddressThe address to search for.
Return values
NULLNULL is returned on failure.

Definition at line 93 of file Relocations.c.

◆ InternalLookupSectionRelocationByOffset()

STATIC MACH_RELOCATION_INFO * InternalLookupSectionRelocationByOffset ( IN OUT OC_MACHO_CONTEXT * Context,
IN UINT64 Address,
IN BOOLEAN External )

Definition at line 136 of file Relocations.c.

◆ MachoIsRelocationPairTypeIntel64()

BOOLEAN MachoIsRelocationPairTypeIntel64 ( IN UINT8 Type)

Returns whether the Relocation's type matches a Pair's for the Intel 64 platform.

Parameters
[in]TypeThe Relocation's type to verify.

Definition at line 62 of file Relocations.c.

◆ MachoPreserveRelocationIntel64()

BOOLEAN MachoPreserveRelocationIntel64 ( IN UINT8 Type)

Returns whether the Relocation shall be preserved for the Intel 64 platform.

Parameters
[in]TypeThe Relocation's type to verify.

Definition at line 76 of file Relocations.c.

◆ MachoRelocationIsPairIntel32()

BOOLEAN MachoRelocationIsPairIntel32 ( IN UINT8 Type)

Returns whether the Relocation's type indicates a Pair for the Intel 32 platform.

Parameters
[in]TypeThe Relocation's type to verify.

Definition at line 32 of file Relocations.c.

◆ MachoRelocationIsPairIntel64()

BOOLEAN MachoRelocationIsPairIntel64 ( IN UINT8 Type)

Returns whether the Relocation's type indicates a Pair for the Intel 64 platform.

Parameters
[in]TypeThe Relocation's type to verify.

Definition at line 47 of file Relocations.c.