summaryrefslogtreecommitdiff
path: root/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp')
-rw-r--r--source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index a82b3fe267b3f..a81a0306671e1 100644
--- a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -1229,6 +1229,16 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
break;
}
}
+ // If this "kext" entry is actually an alias for the kernel --
+ // the kext was compiled into the kernel or something -- then
+ // we don't want to load the kernel's text section at a different
+ // address. Ignore this kext entry.
+ if (kext_summaries[new_kext].GetUUID().IsValid()
+ && m_kernel.GetUUID().IsValid()
+ && kext_summaries[new_kext].GetUUID() == m_kernel.GetUUID()) {
+ to_be_added[new_kext] = false;
+ break;
+ }
if (add_this_one) {
number_of_new_kexts_being_added++;
}
@@ -1397,7 +1407,7 @@ bool DynamicLoaderDarwinKernel::ReadAllKextSummaries() {
void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
if (log == NULL)
return;
- const uint8_t *u = (uint8_t *)m_uuid.GetBytes();
+ const uint8_t *u = static_cast<const uint8_t *>(m_uuid.GetBytes());
if (m_load_address == LLDB_INVALID_ADDRESS) {
if (u) {