File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
include/swift/StaticMirror Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,12 @@ class Image {
3939 uint64_t HeaderAddress;
4040 std::vector<Segment> Segments;
4141 struct DynamicRelocation {
42+ // / The symbol name that the pointer refers to. Empty if only an absolute
43+ // / address is available.
4244 StringRef Symbol;
43- uint64_t Offset;
45+ // The offset (if the symbol is available), or the resolved remote address
46+ // if the symbol is empty.
47+ uint64_t OffsetOrAddress;
4448 };
4549 llvm::DenseMap<uint64_t , DynamicRelocation> DynamicRelocations;
4650
Original file line number Diff line number Diff line change @@ -332,9 +332,13 @@ remote::RemoteAbsolutePointer Image::getDynamicSymbol(uint64_t Addr) const {
332332 auto found = DynamicRelocations.find (Addr);
333333 if (found == DynamicRelocations.end ())
334334 return nullptr ;
335- return remote::RemoteAbsolutePointer (found->second .Symbol ,
336- found->second .Offset ,
337- remote::RemoteAddress ((uint64_t )0 ));
335+ if (!found->second .Symbol .empty ())
336+ return remote::RemoteAbsolutePointer (found->second .Symbol ,
337+ found->second .OffsetOrAddress ,
338+ remote::RemoteAddress ());
339+ return remote::RemoteAbsolutePointer (
340+ remote::RemoteAddress (found->second .OffsetOrAddress ,
341+ remote::RemoteAddress::DefaultAddressSpace));
338342}
339343
340344std::pair<const Image *, uint64_t >
You can’t perform that action at this time.
0 commit comments