@@ -876,7 +876,8 @@ int64_t ARM::getImplicitAddend(const uint8_t *buf, RelType type) const {
876876 switch (type) {
877877 default :
878878 internalLinkerError (getErrorLoc (ctx, buf),
879- " cannot read addend for relocation " + toString (type));
879+ " cannot read addend for relocation " +
880+ toStr (ctx, type));
880881 return 0 ;
881882 case R_ARM_ABS32:
882883 case R_ARM_BASE_PREL:
@@ -1199,7 +1200,7 @@ template <class ELFT> void ObjFile<ELFT>::importCmseSymbols() {
11991200 ArrayRef<Elf_Sym> eSyms = getELFSyms<ELFT>();
12001201 // Error for local symbols. The symbol at index 0 is LOCAL. So skip it.
12011202 for (size_t i = 1 , end = firstGlobal; i != end; ++i) {
1202- Err (ctx) << " CMSE symbol '" << CHECK (eSyms[i].getName (stringTable), this )
1203+ Err (ctx) << " CMSE symbol '" << CHECK2 (eSyms[i].getName (stringTable), this )
12031204 << " ' in import library '" << this << " ' is not global" ;
12041205 }
12051206
@@ -1209,7 +1210,7 @@ template <class ELFT> void ObjFile<ELFT>::importCmseSymbols() {
12091210
12101211 // Initialize symbol fields.
12111212 memset (static_cast <void *>(sym), 0 , sizeof (Symbol));
1212- sym->setName (CHECK (eSyms[i].getName (stringTable), this ));
1213+ sym->setName (CHECK2 (eSyms[i].getName (stringTable), this ));
12131214 sym->value = eSym.st_value ;
12141215 sym->size = eSym.st_size ;
12151216 sym->type = eSym.getType ();
@@ -1248,15 +1249,16 @@ template <class ELFT> void ObjFile<ELFT>::importCmseSymbols() {
12481249
12491250// Check symbol attributes of the acleSeSym, sym pair.
12501251// Both symbols should be global/weak Thumb code symbol definitions.
1251- static std::string checkCmseSymAttributes (Symbol *acleSeSym, Symbol *sym) {
1252- auto check = [](Symbol *s, StringRef type) -> std::optional<std::string> {
1252+ static std::string checkCmseSymAttributes (Ctx &ctx, Symbol *acleSeSym,
1253+ Symbol *sym) {
1254+ auto check = [&](Symbol *s, StringRef type) -> std::optional<std::string> {
12531255 auto d = dyn_cast_or_null<Defined>(s);
12541256 if (!(d && d->isFunc () && (d->value & 1 )))
1255- return (Twine (toString ( s->file )) + " : cmse " + type + " symbol '" +
1257+ return (Twine (toStr (ctx, s->file )) + " : cmse " + type + " symbol '" +
12561258 s->getName () + " ' is not a Thumb function definition" )
12571259 .str ();
12581260 if (!d->section )
1259- return (Twine (toString ( s->file )) + " : cmse " + type + " symbol '" +
1261+ return (Twine (toStr (ctx, s->file )) + " : cmse " + type + " symbol '" +
12601262 s->getName () + " ' cannot be an absolute symbol" )
12611263 .str ();
12621264 return std::nullopt ;
@@ -1305,7 +1307,7 @@ void elf::processArmCmseSymbols(Ctx &ctx) {
13051307 continue ;
13061308 }
13071309
1308- std::string errMsg = checkCmseSymAttributes (acleSeSym, sym);
1310+ std::string errMsg = checkCmseSymAttributes (ctx, acleSeSym, sym);
13091311 if (!errMsg.empty ()) {
13101312 ErrAlways (ctx) << errMsg;
13111313 continue ;
0 commit comments