[Runtime] Reference ObjC class objects indirectly in conformance records.

Within conformance records, reference Objective-C class objects
indirectly so the runtime can update those references appropriately.
We don't need to do this for classes with Swift metadata.

Make all OBJC_CLASS_REF symbols object-local using "\01l", which
prevents the linker from producing incorrect relative addresses.

Fixes the ABI-affecting part of rdar://problem/36310179.
This commit is contained in:
Doug Gregor
2018-03-19 15:56:04 -07:00
parent 44e230b91a
commit cd617dce4a
7 changed files with 22 additions and 10 deletions

View File

@@ -191,7 +191,7 @@ std::string LinkEntity::mangleAsString() const {
case Kind::ObjCClassRef: {
llvm::SmallString<64> tempBuffer;
StringRef name = cast<ClassDecl>(getDecl())->getObjCRuntimeName(tempBuffer);
std::string Result("OBJC_CLASS_REF_$_");
std::string Result("\01l_OBJC_CLASS_REF_$_");
Result.append(name.data(), name.size());
return Result;
}