@@ -846,6 +846,7 @@ bool ObjcCategoryMerger::emitAndLinkProtocolList(Defined *parentSym,
846
846
*infoCategoryWriter.catPtrListInfo .inputSection , bodyData,
847
847
infoCategoryWriter.catPtrListInfo .align );
848
848
listSec->parent = infoCategoryWriter.catPtrListInfo .outputSection ;
849
+ listSec->live = true ;
849
850
allInputSections.push_back (listSec);
850
851
851
852
listSec->parent = infoCategoryWriter.catPtrListInfo .outputSection ;
@@ -861,6 +862,7 @@ bool ObjcCategoryMerger::emitAndLinkProtocolList(Defined *parentSym,
861
862
/* includeInSymtab=*/ true , /* isReferencedDynamically=*/ false ,
862
863
/* noDeadStrip=*/ false , /* isWeakDefCanBeHidden=*/ false );
863
864
865
+ ptrListSym->used = true ;
864
866
getGenObjFile ()->symbols .push_back (ptrListSym);
865
867
866
868
if (!createSymbolReference (parentSym, ptrListSym, linkAtOffset,
@@ -910,6 +912,7 @@ bool ObjcCategoryMerger::emitAndLinkPointerList(Defined *parentSym,
910
912
*infoCategoryWriter.catPtrListInfo .inputSection , bodyData,
911
913
infoCategoryWriter.catPtrListInfo .align );
912
914
listSec->parent = infoCategoryWriter.catPtrListInfo .outputSection ;
915
+ listSec->live = true ;
913
916
allInputSections.push_back (listSec);
914
917
915
918
listSec->parent = infoCategoryWriter.catPtrListInfo .outputSection ;
@@ -925,6 +928,7 @@ bool ObjcCategoryMerger::emitAndLinkPointerList(Defined *parentSym,
925
928
/* includeInSymtab=*/ true , /* isReferencedDynamically=*/ false ,
926
929
/* noDeadStrip=*/ false , /* isWeakDefCanBeHidden=*/ false );
927
930
931
+ ptrListSym->used = true ;
928
932
getGenObjFile ()->symbols .push_back (ptrListSym);
929
933
930
934
if (!createSymbolReference (parentSym, ptrListSym, linkAtOffset,
@@ -955,6 +959,7 @@ bool ObjcCategoryMerger::emitCatListEntrySec(std::string &forCateogryName,
955
959
make<ConcatInputSection>(*infoCategoryWriter.catListInfo .inputSection ,
956
960
bodyData, infoCategoryWriter.catListInfo .align );
957
961
newCatList->parent = infoCategoryWriter.catListInfo .outputSection ;
962
+ newCatList->live = true ;
958
963
allInputSections.push_back (newCatList);
959
964
960
965
newCatList->parent = infoCategoryWriter.catListInfo .outputSection ;
@@ -971,6 +976,7 @@ bool ObjcCategoryMerger::emitCatListEntrySec(std::string &forCateogryName,
971
976
/* isReferencedDynamically=*/ false , /* noDeadStrip=*/ false ,
972
977
/* isWeakDefCanBeHidden=*/ false );
973
978
979
+ catListSym->used = true ;
974
980
getGenObjFile ()->symbols .push_back (catListSym);
975
981
return true ;
976
982
}
@@ -993,6 +999,7 @@ bool ObjcCategoryMerger::emitCategoryBody(std::string &name, Defined *nameSym,
993
999
make<ConcatInputSection>(*infoCategoryWriter.catBodyInfo .inputSection ,
994
1000
bodyData, infoCategoryWriter.catBodyInfo .align );
995
1001
newBodySec->parent = infoCategoryWriter.catBodyInfo .outputSection ;
1002
+ newBodySec->live = true ;
996
1003
allInputSections.push_back (newBodySec);
997
1004
998
1005
newBodySec->parent = infoCategoryWriter.catBodyInfo .outputSection ;
@@ -1007,6 +1014,7 @@ bool ObjcCategoryMerger::emitCategoryBody(std::string &name, Defined *nameSym,
1007
1014
/* isReferencedDynamically=*/ false , /* noDeadStrip=*/ false ,
1008
1015
/* isWeakDefCanBeHidden=*/ false );
1009
1016
1017
+ catBodySym->used = true ;
1010
1018
getGenObjFile ()->symbols .push_back (catBodySym);
1011
1019
1012
1020
if (!createSymbolReference (catBodySym, nameSym, catLayout.nameOffset ,
@@ -1046,6 +1054,7 @@ bool ObjcCategoryMerger::emitCategoryName(std::string &name,
1046
1054
/* includeInSymtab=*/ false , /* isReferencedDynamically=*/ false ,
1047
1055
/* noDeadStrip=*/ false , /* isWeakDefCanBeHidden=*/ false );
1048
1056
1057
+ catNamdeSym->used = true ;
1049
1058
getGenObjFile ()->symbols .push_back (catNamdeSym);
1050
1059
return true ;
1051
1060
}
@@ -1184,7 +1193,7 @@ bool ObjcCategoryMerger::collectAndValidateCategoriesData() {
1184
1193
(a.offCatListIsec < b.offCatListIsec );
1185
1194
};
1186
1195
1187
- std::stable_sort (entry.second . begin (), entry. second . end () , cmpFn);
1196
+ llvm::sort (entry.second , cmpFn);
1188
1197
}
1189
1198
}
1190
1199
@@ -1209,6 +1218,7 @@ bool ObjcCategoryMerger::generateCatListForNonErasedCategories(
1209
1218
make<ConcatInputSection>(*infoCategoryWriter.catListInfo .inputSection ,
1210
1219
bodyData, infoCategoryWriter.catListInfo .align );
1211
1220
listSec->parent = infoCategoryWriter.catListInfo .outputSection ;
1221
+ listSec->live = true ;
1212
1222
allInputSections.push_back (listSec);
1213
1223
1214
1224
Defined *mergedCatListSym = make<Defined>(
@@ -1218,6 +1228,7 @@ bool ObjcCategoryMerger::generateCatListForNonErasedCategories(
1218
1228
/* includeInSymtab=*/ false , /* isReferencedDynamically=*/ false ,
1219
1229
/* noDeadStrip=*/ false , /* isWeakDefCanBeHidden=*/ false );
1220
1230
1231
+ mergedCatListSym->used = true ;
1221
1232
getGenObjFile ()->symbols .push_back (mergedCatListSym);
1222
1233
1223
1234
uint32_t outSecOffset = 0 ;
0 commit comments