diff --git a/lld/ELF/AArch64ErrataFix.cpp b/lld/ELF/AArch64ErrataFix.cpp index 966013a33b8b..6ec7e338cd47 100644 --- a/lld/ELF/AArch64ErrataFix.cpp +++ b/lld/ELF/AArch64ErrataFix.cpp @@ -369,7 +369,7 @@ static uint64_t scanCortexA53Errata843419(InputSection *isec, uint64_t &off, return patchOff; } -class elf::Patch843419Section : public SyntheticSection { +class elf::Patch843419Section final : public SyntheticSection { public: Patch843419Section(InputSection *p, uint64_t off); diff --git a/lld/ELF/ARMErrataFix.cpp b/lld/ELF/ARMErrataFix.cpp index 985a8e808c82..9fbff869397c 100644 --- a/lld/ELF/ARMErrataFix.cpp +++ b/lld/ELF/ARMErrataFix.cpp @@ -68,7 +68,7 @@ using namespace lld::elf; // 00001002 2 - bytes padding // 00001004 __CortexA8657417_00000FFE: B.w func -class elf::Patch657417Section : public SyntheticSection { +class elf::Patch657417Section final : public SyntheticSection { public: Patch657417Section(InputSection *p, uint64_t off, uint32_t instr, bool isARM); diff --git a/lld/ELF/SyntheticSections.h b/lld/ELF/SyntheticSections.h index 9a3adfd5d3c7..3dc9c8e0d269 100644 --- a/lld/ELF/SyntheticSections.h +++ b/lld/ELF/SyntheticSections.h @@ -95,7 +95,7 @@ private: llvm::DenseMap, Symbol *>, CieRecord *> cieMap; }; -class GotSection : public SyntheticSection { +class GotSection final : public SyntheticSection { public: GotSection(); size_t getSize() const override { return size; } @@ -135,7 +135,7 @@ public: size_t getSize() const override { return 0; } }; -class GnuPropertySection : public SyntheticSection { +class GnuPropertySection final : public SyntheticSection { public: GnuPropertySection(); void writeTo(uint8_t *buf) override; @@ -1036,7 +1036,7 @@ private: // of executable file which is pointed to by the DT_MIPS_RLD_MAP entry. // See "Dynamic section" in Chapter 5 in the following document: // ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf -class MipsRldMapSection : public SyntheticSection { +class MipsRldMapSection final : public SyntheticSection { public: MipsRldMapSection(); size_t getSize() const override { return config->wordsize; } @@ -1119,7 +1119,7 @@ private: // A container for one or more linker generated thunks. Instances of these // thunks including ARM interworking and Mips LA25 PI to non-PI thunks. -class ThunkSection : public SyntheticSection { +class ThunkSection final : public SyntheticSection { public: // ThunkSection in OS, with desired outSecOff of Off ThunkSection(OutputSection *os, uint64_t off); @@ -1176,7 +1176,7 @@ private: }; template -class PartitionElfHeaderSection : public SyntheticSection { +class PartitionElfHeaderSection final : public SyntheticSection { public: PartitionElfHeaderSection(); size_t getSize() const override; @@ -1184,14 +1184,14 @@ public: }; template -class PartitionProgramHeadersSection : public SyntheticSection { +class PartitionProgramHeadersSection final : public SyntheticSection { public: PartitionProgramHeadersSection(); size_t getSize() const override; void writeTo(uint8_t *buf) override; }; -class PartitionIndexSection : public SyntheticSection { +class PartitionIndexSection final : public SyntheticSection { public: PartitionIndexSection(); size_t getSize() const override; @@ -1202,7 +1202,7 @@ public: // See the following link for the Android-specific loader code that operates on // this section: // https://cs.android.com/android/platform/superproject/+/master:bionic/libc/bionic/libc_init_static.cpp;drc=9425b16978f9c5aa8f2c50c873db470819480d1d;l=192 -class MemtagAndroidNote : public SyntheticSection { +class MemtagAndroidNote final : public SyntheticSection { public: MemtagAndroidNote() : SyntheticSection(llvm::ELF::SHF_ALLOC, llvm::ELF::SHT_NOTE, @@ -1211,7 +1211,7 @@ public: size_t getSize() const override; }; -class PackageMetadataNote : public SyntheticSection { +class PackageMetadataNote final : public SyntheticSection { public: PackageMetadataNote() : SyntheticSection(llvm::ELF::SHF_ALLOC, llvm::ELF::SHT_NOTE,