Skip to content

Commit 2211d9f

Browse files
authored
Merge pull request #82981 from augusto2112/fix-remote-mirr
2 parents 3a54cf5 + b6ce889 commit 2211d9f

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

include/swift/StaticMirror/ObjectFileContext.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

lib/StaticMirror/ObjectFileContext.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,13 @@ remote::RemoteAbsolutePointer Image::getDynamicSymbol(uint64_t Addr) const {
333333
auto found = DynamicRelocations.find(Addr);
334334
if (found == DynamicRelocations.end())
335335
return nullptr;
336+
if (!found->second.Symbol.empty())
337+
return remote::RemoteAbsolutePointer(found->second.Symbol,
338+
found->second.OffsetOrAddress,
339+
remote::RemoteAddress());
336340
return remote::RemoteAbsolutePointer(
337-
found->second.Symbol, found->second.Offset, remote::RemoteAddress());
341+
remote::RemoteAddress(found->second.OffsetOrAddress,
342+
remote::RemoteAddress::DefaultAddressSpace));
338343
}
339344

340345
std::pair<const Image *, uint64_t>

test/Reflection/conformance_descriptors.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//
66
// Temporarily disable on AArch64 Linux (rdar://88451721)
77
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
8-
// XFAIL: OS=linux-android
98

109
// rdar://100558042
1110
// UNSUPPORTED: CPU=arm64e

test/Reflection/typeref_decoding.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// FIXME: rdar://127796117
1212
// UNSUPPORTED: OS=linux-gnu && CPU=aarch64
13-
// XFAIL: OS=linux-android
1413

1514
// RUN: %target-build-swift -target %target-swift-5.2-abi-triple -Xfrontend -enable-anonymous-context-mangled-names %S/Inputs/ConcreteTypes.swift %S/Inputs/GenericTypes.swift %S/Inputs/Protocols.swift %S/Inputs/Extensions.swift %S/Inputs/Closures.swift -parse-as-library -emit-module -emit-library %no-fixup-chains -module-name TypesToReflect -o %t/%target-library-name(TypesToReflect)
1615
// RUN: %target-build-swift -target %target-swift-5.2-abi-triple -Xfrontend -enable-anonymous-context-mangled-names %S/Inputs/ConcreteTypes.swift %S/Inputs/GenericTypes.swift %S/Inputs/Protocols.swift %S/Inputs/Extensions.swift %S/Inputs/Closures.swift %S/Inputs/main.swift -emit-module -emit-executable %no-fixup-chains -module-name TypesToReflect -o %t/TypesToReflect

0 commit comments

Comments
 (0)