diff options
Diffstat (limited to 'llvm/tools/llvm-objcopy/Object.h')
-rw-r--r-- | llvm/tools/llvm-objcopy/Object.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/llvm/tools/llvm-objcopy/Object.h b/llvm/tools/llvm-objcopy/Object.h index 74ef5a7ebcc..ac384c1fdfe 100644 --- a/llvm/tools/llvm-objcopy/Object.h +++ b/llvm/tools/llvm-objcopy/Object.h @@ -344,7 +344,6 @@ struct Symbol { uint8_t Type; uint64_t Value; uint8_t Visibility; - uint32_t ReferenceCount; uint16_t getShndx() const; }; @@ -368,7 +367,6 @@ public: void addSymbolNames(); const SectionBase *getStrTab() const { return SymbolNames; } const Symbol *getSymbolByIndex(uint32_t Index) const; - Symbol *getSymbolByIndex(uint32_t Index); void updateSymbols(function_ref<void(Symbol &)> Callable); void removeSectionReferences(const SectionBase *Sec) override; @@ -383,7 +381,7 @@ public: }; struct Relocation { - Symbol *RelocSymbol = nullptr; + const Symbol *RelocSymbol = nullptr; uint64_t Offset; uint64_t Addend; uint32_t Type; @@ -434,7 +432,6 @@ class RelocationSection std::vector<Relocation> Relocations; public: - ~RelocationSection(); void addRelocation(Relocation Rel) { Relocations.push_back(Rel); } void accept(SectionVisitor &Visitor) const override; void removeSymbols(function_ref<bool(const Symbol &)> ToRemove) override; @@ -452,7 +449,7 @@ public: class GroupSection : public SectionBase { MAKE_SEC_WRITER_FRIEND const SymbolTableSection *SymTab = nullptr; - Symbol *Sym = nullptr; + const Symbol *Sym = nullptr; ELF::Elf32_Word FlagWord; SmallVector<SectionBase *, 3> GroupMembers; @@ -462,16 +459,9 @@ public: ArrayRef<uint8_t> Contents; explicit GroupSection(ArrayRef<uint8_t> Data) : Contents(Data) {} - ~GroupSection() { - if (Sym) - --Sym->ReferenceCount; - } void setSymTab(const SymbolTableSection *SymTabSec) { SymTab = SymTabSec; } - void setSymbol(Symbol *S) { - Sym = S; - ++Sym->ReferenceCount; - } + void setSymbol(const Symbol *S) { Sym = S; } void setFlagWord(ELF::Elf32_Word W) { FlagWord = W; } void addMember(SectionBase *Sec) { GroupMembers.push_back(Sec); } |