OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
KxldState.c File Reference
#include <Base.h>
#include <IndustryStandard/AppleKxldState.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcAppleKernelLib.h>
#include <Library/OcMachoLib.h>
#include <Library/OcStringLib.h>
#include <Library/OcXmlLib.h>
#include "PrelinkedInternal.h"

Go to the source code of this file.

Functions

STATIC CONST KXLD_LINK_STATE_HEADERInternalGetKxldHeader (IN CONST VOID *KxldState, IN UINT32 KxldStateSize, IN MACH_CPU_TYPE CpuType)
 
STATIC CONST KXLD_VTABLE_HEADERInternalGetKxldVtables (IN CONST VOID *KxldState, IN UINT32 KxldStateSize, IN MACH_CPU_TYPE CpuType, OUT UINT32 *NumVtables)
 
STATIC CONST VOID * InternalGetKxldSymbols (IN CONST VOID *KxldState, IN UINT32 KxldStateSize, IN MACH_CPU_TYPE CpuType, OUT UINT32 *NumSymbols)
 
STATIC CONST CHAR8 * InternalGetKxldString (IN CONST VOID *KxldState, IN UINT32 KxldStateSize, IN UINT32 Offset)
 
EFI_STATUS InternalKxldStateBuildLinkedSymbolTable (IN OUT PRELINKED_KEXT *Kext, IN PRELINKED_CONTEXT *Context)
 
EFI_STATUS InternalKxldStateBuildLinkedVtables (IN OUT PRELINKED_KEXT *Kext, IN PRELINKED_CONTEXT *Context)
 
STATIC EFI_STATUS InternalKxldStateRebasePlist (IN OUT PRELINKED_CONTEXT *Context, IN INT64 Delta)
 
EFI_STATUS InternalKxldStateRebuild (IN OUT PRELINKED_CONTEXT *Context)
 
UINT64 InternalKxldSolveSymbol (IN BOOLEAN Is32Bit, IN CONST VOID *KxldState, IN UINT32 KxldStateSize, IN CONST CHAR8 *Name)
 

Detailed Description

Copyright (C) 2020, vit9696. All rights reserved.

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 KxldState.c.

Function Documentation

◆ InternalGetKxldHeader()

STATIC CONST KXLD_LINK_STATE_HEADER * InternalGetKxldHeader ( IN CONST VOID * KxldState,
IN UINT32 KxldStateSize,
IN MACH_CPU_TYPE CpuType )

Definition at line 32 of file KxldState.c.

◆ InternalGetKxldString()

STATIC CONST CHAR8 * InternalGetKxldString ( IN CONST VOID * KxldState,
IN UINT32 KxldStateSize,
IN UINT32 Offset )

Definition at line 164 of file KxldState.c.

◆ InternalGetKxldSymbols()

STATIC CONST VOID * InternalGetKxldSymbols ( IN CONST VOID * KxldState,
IN UINT32 KxldStateSize,
IN MACH_CPU_TYPE CpuType,
OUT UINT32 * NumSymbols )

Definition at line 118 of file KxldState.c.

◆ InternalGetKxldVtables()

STATIC CONST KXLD_VTABLE_HEADER * InternalGetKxldVtables ( IN CONST VOID * KxldState,
IN UINT32 KxldStateSize,
IN MACH_CPU_TYPE CpuType,
OUT UINT32 * NumVtables )

Definition at line 60 of file KxldState.c.

◆ InternalKxldSolveSymbol()

UINT64 InternalKxldSolveSymbol ( IN BOOLEAN Is32Bit,
IN CONST VOID * KxldState,
IN UINT32 KxldStateSize,
IN CONST CHAR8 * Name )

Solve symbol through KXLD state.

Parameters
[in]Is32BitKXLD is 32-bit.
[in]KxldStateKXLD state.
[in]KxldStateSizeKXLD state size.
[in]NameSymbol name.
Return values
Addresson success.
0on failure.

Definition at line 579 of file KxldState.c.

◆ InternalKxldStateBuildLinkedSymbolTable()

EFI_STATUS InternalKxldStateBuildLinkedSymbolTable ( IN OUT PRELINKED_KEXT * Kext,
IN PRELINKED_CONTEXT * Context )

Build symbol table from KXLD state.

Parameters
[in,out]KextKext dependency.
[in]ContextPrelinking context.
Return values
EFI_SUCCESSon success.

Definition at line 192 of file KxldState.c.

◆ InternalKxldStateBuildLinkedVtables()

EFI_STATUS InternalKxldStateBuildLinkedVtables ( IN OUT PRELINKED_KEXT * Kext,
IN PRELINKED_CONTEXT * Context )

Build virtual tables from KXLD state.

Parameters
[in,out]KextKext dependency.
[in]ContextPrelinking context.
Return values
EFI_SUCCESSon success.

Definition at line 292 of file KxldState.c.

◆ InternalKxldStateRebasePlist()

STATIC EFI_STATUS InternalKxldStateRebasePlist ( IN OUT PRELINKED_CONTEXT * Context,
IN INT64 Delta )

Definition at line 400 of file KxldState.c.

◆ InternalKxldStateRebuild()

EFI_STATUS InternalKxldStateRebuild ( IN OUT PRELINKED_CONTEXT * Context)

Update KXLD state in the resulting image.

Parameters
[in,out]ContextPrelinking context.
Return values
EFI_SUCCESSon success.

Definition at line 459 of file KxldState.c.