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 {
39
39
uint64_t HeaderAddress;
40
40
std::vector<Segment> Segments;
41
41
struct DynamicRelocation {
42
+ // / The symbol name that the pointer refers to. Empty if only an absolute
43
+ // / address is available.
42
44
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;
44
48
};
45
49
llvm::DenseMap<uint64_t , DynamicRelocation> DynamicRelocations;
46
50
Original file line number Diff line number Diff line change @@ -332,9 +332,13 @@ remote::RemoteAbsolutePointer Image::getDynamicSymbol(uint64_t Addr) const {
332
332
auto found = DynamicRelocations.find (Addr);
333
333
if (found == DynamicRelocations.end ())
334
334
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));
338
342
}
339
343
340
344
std::pair<const Image *, uint64_t >
You can’t perform that action at this time.
0 commit comments