[PATCH] D153080: Emit DW_LLE_base_address + DW_LLE_offset_pairs instead of DW_LLE_start_length in debug_loclists section

Shubham Sandeep Rastogi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 16:51:18 PDT 2023


rastogishubham added inline comments.


================
Comment at: llvm/lib/DWARFLinker/DWARFStreamer.cpp:644
+      LocListsSectionSize +=
+          MS->emitULEB128IntValue(LocExpression.Range->LowPC);
 
----------------
aprantl wrote:
> Don't we need to subtract the base address here?
No, we already adjusted the address on line 1984 - line 1989, in DWARFLinker.cpp


```
        uint64_t LowPCVal = CurExpression.Range->LowPC +
                            CurLocAttr.RelocAdjustment -
                            LinkedLocationExpressionsFrag.BaseAddress;
        assert(LowPCVal >= 0 && "Low PC value should not be negative!");
        LinkedExpression.Range = {
            LowPCVal, CurExpression.Range->HighPC + CurLocAttr.RelocAdjustment -
                          LinkedLocationExpressionsFrag.BaseAddress};
```


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

https://reviews.llvm.org/D153080



More information about the llvm-commits mailing list