[Lldb-commits] [PATCH] D147642: [lldb][ObjectFileELF] Support AArch32 in ApplyRelocations
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Apr 28 04:47:48 PDT 2023
labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.
================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2663
+ // the actual range check below.
+ if (addend < 0 && static_cast<uint32_t>(std::abs(addend)) > value) {
+ LLDB_LOGF(log, "Debug info relocation overflow: 0x%" PRIx64,
----------------
================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2660
+ // Implicit addend is stored inline as a signed value.
+ int32_t addend = *reinterpret_cast<int32_t *>(dst);
+ // The sum must be positive. This extra check prevents UB from overflow in
----------------
sgraenitz wrote:
> IIUC we'd want to account for an endianness difference between debugger and target (in theory). However, non of the other cases seems to do it, so I didn't start with it either.
We probably should.
What we also should do (and what other cases seem to get mostly right) is avoid dereferencing type-punned pointers (use memcpy to read).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147642/new/
https://reviews.llvm.org/D147642
More information about the lldb-commits
mailing list