diff options
| author | Pavel Labath <pavel@labath.sk> | 2019-10-31 14:31:42 +0100 | 
|---|---|---|
| committer | Pavel Labath <pavel@labath.sk> | 2019-11-05 10:21:39 +0100 | 
| commit | b4c5b8f3f51206bac2282a8b483e76ad59a5aed5 (patch) | |
| tree | 2540364a5d24115e172f56757711baa7217621b0 /llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | |
| parent | 0d14656b9d8ca38b8ea321c7047eaeec43c5b2ef (diff) | |
| download | bcm5719-llvm-b4c5b8f3f51206bac2282a8b483e76ad59a5aed5.tar.gz bcm5719-llvm-b4c5b8f3f51206bac2282a8b483e76ad59a5aed5.zip | |
DWARFDebugLoclists: Make it possible to read relocated addresses
Summary:
Handling relocations was not needed when the loclists section was a
DWO-only thing. But since DWARF5, it is possible to use it in regular
objects too, and the standard permits embedding addresses into the
section directly. These addresses need to be relocated in unlinked
files.
Reviewers: JDevlieghere, dblaikie, probinson
Subscribers: aprantl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68271
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp | 9 | 
1 files changed, 5 insertions, 4 deletions
| diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp index 4f7b01130a4..032feb9088c 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp @@ -140,7 +140,7 @@ void DWARFDebugLoc::parse(const DWARFDataExtractor &data) {  }  Expected<DWARFDebugLoclists::LocationList> -DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data, +DWARFDebugLoclists::parseOneLocationList(const DWARFDataExtractor &Data,                                           uint64_t *Offset, unsigned Version) {    LocationList LL;    LL.Offset = *Offset; @@ -165,7 +165,7 @@ DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data,          E.Value1 = Data.getULEB128(C);        break;      case dwarf::DW_LLE_start_length: -      E.Value0 = Data.getAddress(C); +      E.Value0 = Data.getRelocatedAddress(C);        E.Value1 = Data.getULEB128(C);        break;      case dwarf::DW_LLE_offset_pair: @@ -173,7 +173,7 @@ DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data,        E.Value1 = Data.getULEB128(C);        break;      case dwarf::DW_LLE_base_address: -      E.Value0 = Data.getAddress(C); +      E.Value0 = Data.getRelocatedAddress(C);        break;      default:        cantFail(C.takeError()); @@ -200,7 +200,8 @@ DWARFDebugLoclists::parseOneLocationList(const DataExtractor &Data,    return LL;  } -void DWARFDebugLoclists::parse(DataExtractor data, uint64_t Offset, uint64_t EndOffset, uint16_t Version) { +void DWARFDebugLoclists::parse(const DWARFDataExtractor &data, uint64_t Offset, +                               uint64_t EndOffset, uint16_t Version) {    IsLittleEndian = data.isLittleEndian();    AddressSize = data.getAddressSize(); | 

