diff options
author | Lang Hames <lhames@gmail.com> | 2019-04-22 01:35:16 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2019-04-22 01:35:16 +0000 |
commit | d3dac47aa20d30de35f691c5c6893be06dc0938d (patch) | |
tree | 3f99d20b755ff91e5530e4f64a69b868b00da83e /llvm/lib/ExecutionEngine | |
parent | 405e62b805b03b7f25ef669af498ca4b22dcc464 (diff) | |
download | bcm5719-llvm-d3dac47aa20d30de35f691c5c6893be06dc0938d.tar.gz bcm5719-llvm-d3dac47aa20d30de35f691c5c6893be06dc0938d.zip |
[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
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp index 2aa4a45600c..38c537b5c78 100644 --- a/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/JITLink_EHFrameSupport.cpp @@ -516,6 +516,9 @@ AtomGraphPassFunction createEHFrameRecorderPass(const Triple &TT, 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; } |