Skip to content

Commit

Permalink
[ELF] Add final to some SyntheticSection derived classes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Dec 3, 2022
1 parent 8c7c20f commit 00272ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lld/ELF/AArch64ErrataFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion lld/ELF/ARMErrataFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
18 changes: 9 additions & 9 deletions lld/ELF/SyntheticSections.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class EhFrameSection final : public SyntheticSection {
llvm::DenseMap<std::pair<ArrayRef<uint8_t>, Symbol *>, CieRecord *> cieMap;
};

class GotSection : public SyntheticSection {
class GotSection final : public SyntheticSection {
public:
GotSection();
size_t getSize() const override { return size; }
Expand Down Expand Up @@ -135,7 +135,7 @@ class GnuStackSection : public SyntheticSection {
size_t getSize() const override { return 0; }
};

class GnuPropertySection : public SyntheticSection {
class GnuPropertySection final : public SyntheticSection {
public:
GnuPropertySection();
void writeTo(uint8_t *buf) override;
Expand Down Expand Up @@ -1036,7 +1036,7 @@ template <class ELFT> class MipsReginfoSection final : public SyntheticSection {
// 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; }
Expand Down Expand Up @@ -1119,7 +1119,7 @@ class ARMExidxSyntheticSection : public SyntheticSection {

// 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);
Expand Down Expand Up @@ -1176,22 +1176,22 @@ class PPC64LongBranchTargetSection final : public SyntheticSection {
};

template <typename ELFT>
class PartitionElfHeaderSection : public SyntheticSection {
class PartitionElfHeaderSection final : public SyntheticSection {
public:
PartitionElfHeaderSection();
size_t getSize() const override;
void writeTo(uint8_t *buf) override;
};

template <typename ELFT>
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;
Expand All @@ -1202,7 +1202,7 @@ class PartitionIndexSection : public SyntheticSection {
// 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,
Expand All @@ -1211,7 +1211,7 @@ class MemtagAndroidNote : public SyntheticSection {
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,
Expand Down

0 comments on commit 00272ad

Please sign in to comment.