diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h --- a/bolt/include/bolt/Core/BinaryContext.h +++ b/bolt/include/bolt/Core/BinaryContext.h @@ -989,10 +989,10 @@ BinarySection & registerOrUpdateNoteSection(const Twine &Name, uint8_t *Data = nullptr, uint64_t Size = 0, unsigned Alignment = 1, - bool IsReadOnly = true, + bool IsWritable = false, unsigned ELFType = ELF::SHT_PROGBITS) { return registerOrUpdateSection(Name, ELFType, - BinarySection::getFlags(!IsReadOnly), Data, + BinarySection::getFlags(IsWritable), Data, Size, Alignment); } diff --git a/bolt/lib/Passes/Instrumentation.cpp b/bolt/lib/Passes/Instrumentation.cpp --- a/bolt/lib/Passes/Instrumentation.cpp +++ b/bolt/lib/Passes/Instrumentation.cpp @@ -501,7 +501,7 @@ BC.registerOrUpdateNoteSection(".bolt.instr.tables", nullptr, 0, /*Alignment=*/1, - /*IsReadOnly=*/true, ELF::SHT_NOTE); + /*IsWritable=*/false, ELF::SHT_NOTE); Summary->IndCallCounterFuncPtr = BC.Ctx->getOrCreateSymbol("__bolt_ind_call_counter_func_pointer"); diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp --- a/bolt/lib/Rewrite/RewriteInstance.cpp +++ b/bolt/lib/Rewrite/RewriteInstance.cpp @@ -4446,7 +4446,7 @@ // Set/modify section info. BinarySection &NewSection = BC->registerOrUpdateNoteSection( SectionName, SectionData, Size, Section.sh_addralign, - !BSec->isWritable(), BSec->getELFType()); + BSec->isWritable(), BSec->getELFType()); NewSection.setOutputAddress(0); NewSection.setOutputFileOffset(NextAvailableOffset); @@ -4490,7 +4490,7 @@ DataCopy, SHStrTabSize, /*Alignment=*/1, - /*IsReadOnly=*/true, + /*IsWritable=*/false, ELF::SHT_STRTAB); } @@ -4510,14 +4510,14 @@ BC->registerOrUpdateNoteSection(".note.bolt_info", copyByteArray(BoltInfo), BoltInfo.size(), /*Alignment=*/1, - /*IsReadOnly=*/true, ELF::SHT_NOTE); + /*IsWritable=*/false, ELF::SHT_NOTE); } void RewriteInstance::addBATSection() { BC->registerOrUpdateNoteSection(BoltAddressTranslation::SECTION_NAME, nullptr, 0, /*Alignment=*/1, - /*IsReadOnly=*/true, ELF::SHT_NOTE); + /*IsWritable=*/false, ELF::SHT_NOTE); } void RewriteInstance::encodeBATSection() { @@ -4532,7 +4532,7 @@ BC->registerOrUpdateNoteSection(BoltAddressTranslation::SECTION_NAME, copyByteArray(BoltInfo), BoltInfo.size(), /*Alignment=*/1, - /*IsReadOnly=*/true, ELF::SHT_NOTE); + /*IsWritable=*/false, ELF::SHT_NOTE); } template @@ -5259,14 +5259,14 @@ copyByteArray(NewContents), NewContents.size(), /*Alignment=*/1, - /*IsReadOnly=*/true, + /*IsWritable=*/false, ELF::SHT_SYMTAB); BC->registerOrUpdateNoteSection(StrSecName, copyByteArray(NewStrTab), NewStrTab.size(), /*Alignment=*/1, - /*IsReadOnly=*/true, + /*IsWritable=*/false, ELF::SHT_STRTAB); } diff --git a/bolt/lib/RuntimeLibs/InstrumentationRuntimeLibrary.cpp b/bolt/lib/RuntimeLibs/InstrumentationRuntimeLibrary.cpp --- a/bolt/lib/RuntimeLibs/InstrumentationRuntimeLibrary.cpp +++ b/bolt/lib/RuntimeLibs/InstrumentationRuntimeLibrary.cpp @@ -328,5 +328,5 @@ BC.registerOrUpdateNoteSection(".bolt.instr.tables", copyByteArray(BoltInfo), BoltInfo.size(), /*Alignment=*/1, - /*IsReadOnly=*/true, ELF::SHT_NOTE); + /*IsWritable=*/false, ELF::SHT_NOTE); }