@@ -1119,28 +1119,21 @@ void ObjCProcessor::ApplyMethodTypes(Class& cls)
11191119 }
11201120}
11211121
1122- Ref<Section> ObjCProcessor::GetSectionForImage (std::optional<std::string> imageName, const char * sectionName)
1122+ Ref<Section> ObjCProcessor::GetSectionWithName ( const char * sectionName)
11231123{
1124- if (imageName)
1125- {
1126- return m_data->GetSectionByName (*imageName + " ::" + sectionName);
1127- }
1128- else
1129- {
1130- return m_data->GetSectionByName (sectionName);
1131- }
1124+ return m_data->GetSectionByName (sectionName);
11321125}
11331126
1134- void ObjCProcessor::PostProcessObjCSections (ObjCReader* reader, std::optional<std::string> imageName )
1127+ void ObjCProcessor::PostProcessObjCSections (ObjCReader* reader)
11351128{
11361129 auto ptrSize = m_data->GetAddressSize ();
1137- if (auto imageInfo = GetSectionForImage (imageName, " __objc_imageinfo" ))
1130+ if (auto imageInfo = GetSectionWithName ( " __objc_imageinfo" ))
11381131 {
11391132 auto start = imageInfo->GetStart ();
11401133 auto type = Type::NamedType (m_data, m_typeNames.imageInfo );
11411134 m_data->DefineDataVariable (start, type);
11421135 }
1143- if (auto selrefs = GetSectionForImage (imageName, " __objc_selrefs" ))
1136+ if (auto selrefs = GetSectionWithName ( " __objc_selrefs" ))
11441137 {
11451138 auto start = selrefs->GetStart ();
11461139 auto end = selrefs->GetEnd ();
@@ -1163,7 +1156,7 @@ void ObjCProcessor::PostProcessObjCSections(ObjCReader* reader, std::optional<st
11631156 DefineObjCSymbol (DataSymbol, type, " selRef_" + sel, i, true );
11641157 }
11651158 }
1166- if (auto superRefs = GetSectionForImage (imageName, " __objc_classrefs" ))
1159+ if (auto superRefs = GetSectionWithName ( " __objc_classrefs" ))
11671160 {
11681161 auto start = superRefs->GetStart ();
11691162 auto end = superRefs->GetEnd ();
@@ -1181,7 +1174,7 @@ void ObjCProcessor::PostProcessObjCSections(ObjCReader* reader, std::optional<st
11811174 }
11821175 }
11831176 }
1184- if (auto superRefs = GetSectionForImage (imageName, " __objc_superrefs" ))
1177+ if (auto superRefs = GetSectionWithName ( " __objc_superrefs" ))
11851178 {
11861179 auto start = superRefs->GetStart ();
11871180 auto end = superRefs->GetEnd ();
@@ -1199,7 +1192,7 @@ void ObjCProcessor::PostProcessObjCSections(ObjCReader* reader, std::optional<st
11991192 }
12001193 }
12011194 }
1202- if (auto protoRefs = GetSectionForImage (imageName, " __objc_protorefs" ))
1195+ if (auto protoRefs = GetSectionWithName ( " __objc_protorefs" ))
12031196 {
12041197 auto start = protoRefs->GetStart ();
12051198 auto end = protoRefs->GetEnd ();
@@ -1217,7 +1210,7 @@ void ObjCProcessor::PostProcessObjCSections(ObjCReader* reader, std::optional<st
12171210 }
12181211 }
12191212 }
1220- if (auto ivars = GetSectionForImage (imageName, " __objc_ivar" ))
1213+ if (auto ivars = GetSectionWithName ( " __objc_ivar" ))
12211214 {
12221215 auto start = ivars->GetStart ();
12231216 auto end = ivars->GetEnd ();
@@ -1258,7 +1251,7 @@ Ref<Symbol> ObjCProcessor::GetSymbol(uint64_t address)
12581251 return m_data->GetSymbolByAddress (address);
12591252}
12601253
1261- void ObjCProcessor::ProcessObjCData (std::optional<std::string> imageName )
1254+ void ObjCProcessor::ProcessObjCData ()
12621255{
12631256 m_symbolQueue = new SymbolQueue ();
12641257 auto addrSize = m_data->GetAddressSize ();
@@ -1426,26 +1419,26 @@ void ObjCProcessor::ProcessObjCData(std::optional<std::string> imageName)
14261419 m_typeNames.protocol = finalizeStructureBuilder (m_data, protocolBuilder, " objc_protocol_t" ).first ;
14271420
14281421 m_data->BeginBulkModifySymbols ();
1429- if (auto classList = GetSectionForImage (imageName, " __objc_classlist" ))
1422+ if (auto classList = GetSectionWithName ( " __objc_classlist" ))
14301423 LoadClasses (reader.get (), classList);
1431- if (auto nonLazyClassList = GetSectionForImage (imageName, " __objc_nlclslist" ))
1424+ if (auto nonLazyClassList = GetSectionWithName ( " __objc_nlclslist" ))
14321425 LoadClasses (reader.get (), nonLazyClassList); // See: https://stackoverflow.com/a/15318325
14331426
14341427 GenerateClassTypes ();
14351428 for (auto & [_, cls] : m_classes)
14361429 ApplyMethodTypes (cls);
14371430
1438- if (auto catList = GetSectionForImage (imageName, " __objc_catlist" )) // Do this after loading class type data.
1431+ if (auto catList = GetSectionWithName ( " __objc_catlist" )) // Do this after loading class type data.
14391432 LoadCategories (reader.get (), catList);
1440- if (auto nonLazyCatList = GetSectionForImage (imageName, " __objc_nlcatlist" )) // Do this after loading class type data.
1433+ if (auto nonLazyCatList = GetSectionWithName ( " __objc_nlcatlist" )) // Do this after loading class type data.
14411434 LoadCategories (reader.get (), nonLazyCatList);
14421435 for (auto & [_, cat] : m_categories)
14431436 ApplyMethodTypes (cat);
14441437
1445- if (auto protoList = GetSectionForImage (imageName, " __objc_protolist" ))
1438+ if (auto protoList = GetSectionWithName ( " __objc_protolist" ))
14461439 LoadProtocols (reader.get (), protoList);
14471440
1448- PostProcessObjCSections (reader.get (), imageName );
1441+ PostProcessObjCSections (reader.get ());
14491442
14501443 auto id = m_data->BeginUndoActions ();
14511444 m_symbolQueue->Process ();
@@ -1460,7 +1453,7 @@ void ObjCProcessor::ProcessObjCData(std::optional<std::string> imageName)
14601453}
14611454
14621455
1463- void ObjCProcessor::ProcessCFStrings (std::optional<std::string> imageName )
1456+ void ObjCProcessor::ProcessCFStrings ()
14641457{
14651458 m_symbolQueue = new SymbolQueue ();
14661459 uint64_t ptrSize = m_data->GetAddressSize ();
@@ -1495,7 +1488,7 @@ void ObjCProcessor::ProcessCFStrings(std::optional<std::string> imageName)
14951488 m_typeNames.cfStringUTF16 = type.first ;
14961489
14971490 auto reader = GetReader ();
1498- if (auto cfstrings = GetSectionForImage (imageName, " __cfstring" ))
1491+ if (auto cfstrings = GetSectionWithName ( " __cfstring" ))
14991492 {
15001493 auto start = cfstrings->GetStart ();
15011494 auto end = cfstrings->GetEnd ();
0 commit comments