[JITLink] Fix section start address calculation in eh-frame recorder.
Section atoms are not sorted, so we need to scan the whole section to find the
start address.
No test case: Found by inspection, and any reproduction would depend on pointer
ordering.
llvm-svn: 358865
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp
index 2aa4a45..38c537b 100644
--- a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp
+++ b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp
@@ -516,6 +516,9 @@
for (auto &S : G.sections())
if (S.getName() == EHFrameSectionName && !S.atoms_empty()) {
Addr = (*S.atoms().begin())->getAddress();
+ for (auto *DA : S.atoms())
+ if (DA->getAddress() < Addr)
+ Addr = DA->getAddress();
break;
}