mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcAppleKernelLib: Fix linking against injected kexts
This commit is contained in:
parent
0ff97ad01c
commit
ef8fdce8cd
@ -688,7 +688,7 @@ KcKextApplyFileDelta (
|
||||
//
|
||||
// Rebase the segment itself.
|
||||
//
|
||||
if (Segment->FileOffset != 0) {
|
||||
if (Segment->FileOffset != 0 || Segment->FileSize != 0) {
|
||||
Segment->FileOffset += Delta;
|
||||
}
|
||||
|
||||
@ -741,5 +741,11 @@ KcKextApplyFileDelta (
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Update the container offset to make sure we can link against this
|
||||
// kext later as well.
|
||||
//
|
||||
Context->ContainerOffset = Delta;
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@ -892,9 +892,11 @@ PrelinkedInjectKext (
|
||||
//
|
||||
// For KC, our KEXTs have their own segment - do not mod __PRELINK_INFO.
|
||||
// Integrate the KEXT into KC by indexing its fixups and rebasing.
|
||||
// Note, we are no longer using ExecutableContext here, as the context
|
||||
// ownership was transferred by InternalLinkPrelinkedKext.
|
||||
//
|
||||
KcKextIndexFixups (Context, &ExecutableContext);
|
||||
Status = KcKextApplyFileDelta (&ExecutableContext, KextOffset);
|
||||
KcKextIndexFixups (Context, &PrelinkedKext->Context.MachContext);
|
||||
Status = KcKextApplyFileDelta (&PrelinkedKext->Context.MachContext, KextOffset);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((
|
||||
DEBUG_WARN,
|
||||
|
||||
@ -215,6 +215,7 @@ InternalScanCurrentPrelinkedKextLinkInfo (
|
||||
}
|
||||
|
||||
if (Kext->SymbolTable == NULL) {
|
||||
DEBUG ((DEBUG_VERBOSE, "OCAK: Requesting SymbolTable for %a\n", Kext->Identifier));
|
||||
Kext->NumberOfSymbols = MachoGetSymbolTable (
|
||||
&Kext->Context.MachContext,
|
||||
&Kext->SymbolTable,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user