@@ -919,13 +919,13 @@ void ObjFile<ELFT>::initializeSections(bool ignoreComdats,
919
919
}
920
920
921
921
template <typename ELFT>
922
- static void parseGnuPropertyNote (Ctx &ctx, uint32_t &featureAndType ,
923
- ArrayRef< uint8_t > &desc, ELFFileBase *f ,
924
- const uint8_t *base,
922
+ static void parseGnuPropertyNote (Ctx &ctx, ELFFileBase &f ,
923
+ uint32_t featureAndType ,
924
+ ArrayRef< uint8_t > &desc, const uint8_t *base,
925
925
ArrayRef<uint8_t > *data = nullptr ) {
926
926
auto err = [&](const uint8_t *place) -> ELFSyncStream {
927
927
auto diag = Err (ctx);
928
- diag << f-> getName () << " :(" << " .note.gnu.property+0x"
928
+ diag << &f << " :(" << " .note.gnu.property+0x"
929
929
<< Twine::utohexstr (place - base) << " ): " ;
930
930
return diag;
931
931
};
@@ -946,15 +946,15 @@ static void parseGnuPropertyNote(Ctx &ctx, uint32_t &featureAndType,
946
946
// accumulate the bits set.
947
947
if (size < 4 )
948
948
return void (err (place) << " FEATURE_1_AND entry is too short" );
949
- f-> andFeatures |= read32<ELFT::Endianness>(desc.data ());
949
+ f. andFeatures |= read32<ELFT::Endianness>(desc.data ());
950
950
} else if (ctx.arg .emachine == EM_AARCH64 &&
951
951
type == GNU_PROPERTY_AARCH64_FEATURE_PAUTH) {
952
952
// If the file being parsed is a SharedFile, we cannot pass in
953
953
// the data variable as there is no InputSection to collect the
954
954
// data from. As such, these are ignored. They are needed either
955
955
// when loading a shared library oject.
956
956
ArrayRef<uint8_t > contents = data ? *data : desc;
957
- if (!f-> aarch64PauthAbiCoreInfo .empty ()) {
957
+ if (!f. aarch64PauthAbiCoreInfo .empty ()) {
958
958
return void (
959
959
err (contents.data ())
960
960
<< " multiple GNU_PROPERTY_AARCH64_FEATURE_PAUTH entries are "
@@ -965,7 +965,7 @@ static void parseGnuPropertyNote(Ctx &ctx, uint32_t &featureAndType,
965
965
" is invalid: expected 16 bytes, but got "
966
966
<< size);
967
967
}
968
- f-> aarch64PauthAbiCoreInfo = desc;
968
+ f. aarch64PauthAbiCoreInfo = desc;
969
969
}
970
970
971
971
// Padding is present in the note descriptor, if necessary.
@@ -1010,7 +1010,7 @@ static void readGnuProperty(Ctx &ctx, const InputSection &sec,
1010
1010
// Read a body of a NOTE record, which consists of type-length-value fields.
1011
1011
ArrayRef<uint8_t > desc = note.getDesc (sec.addralign );
1012
1012
const uint8_t *base = sec.content ().data ();
1013
- parseGnuPropertyNote<ELFT>(ctx, featureAndType, desc, &f , base, &data);
1013
+ parseGnuPropertyNote<ELFT>(ctx, f, featureAndType, desc , base, &data);
1014
1014
1015
1015
// Go to next NOTE record to look for more FEATURE_1_AND descriptions.
1016
1016
data = data.slice (nhdr->getSize (sec.addralign ));
@@ -1465,7 +1465,7 @@ void SharedFile::parseGnuAndFeatures(const uint8_t *base,
1465
1465
1466
1466
// Read a body of a NOTE record, which consists of type-length-value fields.
1467
1467
ArrayRef<uint8_t > desc = note.getDesc (headers[i].p_align );
1468
- parseGnuPropertyNote<ELFT>(ctx, featureAndType, desc, this , base);
1468
+ parseGnuPropertyNote<ELFT>(ctx, * this , featureAndType, desc , base);
1469
1469
}
1470
1470
}
1471
1471
0 commit comments