提交 bd2d3f29 编写于 作者: M Marvin Häuser 提交者: Marvin Häuser

OcAppleKernelLib: Do not locate __PRELINK_INFO for Kernel Collections

As of macOS 13 Developer Beta 3, the __PRELINK_INFO marker segment is
broken. It is not actually used in the Kernel Collection paths, so
just don't locate it at all to avoid future mistakes.
上级 d916dd65
......@@ -200,7 +200,9 @@ typedef struct {
//
MACH_SECTION_ANY *PrelinkedInfoSection;
//
// Pointer to PRELINK_TEXT_SEGMENT.
// Pointer to PRELINK_TEXT_SEGMENT (for prelinkedkernel, NULL for KC).
// As of macOS 13 Developer Beta 3, this segment may have corrupted
// information.
//
MACH_SEGMENT_COMMAND_ANY *PrelinkedTextSegment;
//
......
......@@ -292,23 +292,6 @@ PrelinkedContextInit (
return Status;
}
Context->PrelinkedTextSegment = MachoGetSegmentByName (
&Context->PrelinkedMachContext,
PRELINK_TEXT_SEGMENT
);
if (Context->PrelinkedTextSegment == NULL) {
return EFI_NOT_FOUND;
}
Context->PrelinkedTextSection = MachoGetSectionByName (
&Context->PrelinkedMachContext,
Context->PrelinkedTextSegment,
PRELINK_TEXT_SECTION
);
if (Context->PrelinkedTextSection == NULL) {
return EFI_NOT_FOUND;
}
if (Context->IsKernelCollection) {
//
// Additionally process special entries for KC.
......@@ -337,6 +320,23 @@ PrelinkedContextInit (
if (Context->LinkEditSegment == NULL) {
return EFI_NOT_FOUND;
}
} else {
Context->PrelinkedTextSegment = MachoGetSegmentByName (
&Context->PrelinkedMachContext,
PRELINK_TEXT_SEGMENT
);
if (Context->PrelinkedTextSegment == NULL) {
return EFI_NOT_FOUND;
}
Context->PrelinkedTextSection = MachoGetSectionByName (
&Context->PrelinkedMachContext,
Context->PrelinkedTextSegment,
PRELINK_TEXT_SECTION
);
if (Context->PrelinkedTextSection == NULL) {
return EFI_NOT_FOUND;
}
}
Context->PrelinkedInfo = Context->Is32Bit ?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册