sgraenitz added a comment.

Adding an abstraction for reading implicit addend or somehow integrate it into 
`ELFRelocation::RelocAddend32()` might be more confusing for the reader than 
keeping it in the function inline. What do you think?



================
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
----------------
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.


================
Comment at: lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2711
+          ApplyELF32ABS32Relocation(symtab, rel, debug_data, rel_section);
+          break;
+        default:
----------------
In think debug info relocations have been `R_ARM_ABS32` in all  ARM/Thumb, 
pic/non-pic variations I tried. @peter.smith Does that hold in general? 
Otherwise, I'd like to report errors for the other cases and not let them run 
into the assert(false) below.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147642/new/

https://reviews.llvm.org/D147642

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to