diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
| commit | 344a3780b2e33f6ca763666c380202b18aab72a3 (patch) | |
| tree | f0b203ee6eb71d7fdd792373e3c81eb18d6934dd /lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp | |
| parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) | |
vendor/llvm-project/llvmorg-13-init-16847-g88e66fa60ae5vendor/llvm-project/llvmorg-12.0.1-rc2-0-ge7dac564cd0evendor/llvm-project/llvmorg-12.0.1-0-gfed41342a82f
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp')
| -rw-r--r-- | lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp index c1fceeb1482c..8a5528f1e474 100644 --- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp +++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp @@ -10,6 +10,7 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Target.h" #include "DynamicLoaderStatic.h" @@ -105,6 +106,15 @@ void DynamicLoaderStatic::LoadAllImagesAtFileAddresses() { // the file... SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx)); if (section_sp) { + // If this section already has a load address set in the target, + // don't re-set it to the file address. Something may have + // set it to a more correct value already. + if (m_process->GetTarget() + .GetSectionLoadList() + .GetSectionLoadAddress(section_sp) != + LLDB_INVALID_ADDRESS) { + continue; + } if (m_process->GetTarget().SetSectionLoadAddress( section_sp, section_sp->GetFileAddress())) changed = true; |
