diff options
Diffstat (limited to 'llvm/tools/llvm-objcopy/Object.h')
-rw-r--r-- | llvm/tools/llvm-objcopy/Object.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/tools/llvm-objcopy/Object.h b/llvm/tools/llvm-objcopy/Object.h index 845d6819052..ac384c1fdfe 100644 --- a/llvm/tools/llvm-objcopy/Object.h +++ b/llvm/tools/llvm-objcopy/Object.h @@ -38,6 +38,7 @@ class GnuDebugLinkSection; class GroupSection; class Segment; class Object; +struct Symbol; class SectionTableRef { MutableArrayRef<std::unique_ptr<SectionBase>> Sections; @@ -209,6 +210,7 @@ public: virtual void initialize(SectionTableRef SecTable); virtual void finalize(); virtual void removeSectionReferences(const SectionBase *Sec); + virtual void removeSymbols(function_ref<bool(const Symbol &)> ToRemove); virtual void accept(SectionVisitor &Visitor) const = 0; }; @@ -366,12 +368,12 @@ public: const SectionBase *getStrTab() const { return SymbolNames; } const Symbol *getSymbolByIndex(uint32_t Index) const; void updateSymbols(function_ref<void(Symbol &)> Callable); - void removeSymbols(function_ref<bool(Symbol &)> ToRemove); void removeSectionReferences(const SectionBase *Sec) override; void initialize(SectionTableRef SecTable) override; void finalize() override; void accept(SectionVisitor &Visitor) const override; + void removeSymbols(function_ref<bool(const Symbol &)> ToRemove) override; static bool classof(const SectionBase *S) { return S->Type == ELF::SHT_SYMTAB; @@ -432,6 +434,7 @@ class RelocationSection public: void addRelocation(Relocation Rel) { Relocations.push_back(Rel); } void accept(SectionVisitor &Visitor) const override; + void removeSymbols(function_ref<bool(const Symbol &)> ToRemove) override; static bool classof(const SectionBase *S) { if (S->Flags & ELF::SHF_ALLOC) @@ -465,6 +468,7 @@ public: void initialize(SectionTableRef SecTable) override{}; void accept(SectionVisitor &) const override; void finalize() override; + void removeSymbols(function_ref<bool(const Symbol &)> ToRemove) override; static bool classof(const SectionBase *S) { return S->Type == ELF::SHT_GROUP; @@ -619,6 +623,7 @@ public: ConstRange<Segment> segments() const { return make_pointee_range(Segments); } void removeSections(std::function<bool(const SectionBase &)> ToRemove); + void removeSymbols(function_ref<bool(const Symbol &)> ToRemove); template <class T, class... Ts> T &addSection(Ts &&... Args) { auto Sec = llvm::make_unique<T>(std::forward<Ts>(Args)...); auto Ptr = Sec.get(); |