File indexing completed on 2024-05-19 05:44:09

0001 /*
0002     Copyright (C) 2015 Volker Krause <vkrause@kde.org>
0003 
0004     This program is free software; you can redistribute it and/or modify it
0005     under the terms of the GNU Library General Public License as published by
0006     the Free Software Foundation; either version 2 of the License, or (at your
0007     option) any later version.
0008 
0009     This program is distributed in the hope that it will be useful, but WITHOUT
0010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
0012     License for more details.
0013 
0014     You should have received a copy of the GNU General Public License
0015     along with this program.  If not, see <https://www.gnu.org/licenses/>.
0016 */
0017 
0018 #ifndef ELFGNUSYMBOLVERSIONDEFINITION_H
0019 #define ELFGNUSYMBOLVERSIONDEFINITION_H
0020 
0021 #include "elfgnusymbolversiondefinitionssection.h"
0022 
0023 #include <elf.h>
0024 
0025 class ElfGNUSymbolVersionDefinitionAuxiliaryEntry;
0026 
0027 class ElfGNUSymbolVersionDefinition
0028 {
0029 public:
0030     ElfGNUSymbolVersionDefinition(const ElfGNUSymbolVersionDefinition&) = delete;
0031     explicit ElfGNUSymbolVersionDefinition(ElfGNUSymbolVersionDefinitionsSection *section, uint32_t offset);
0032     ~ElfGNUSymbolVersionDefinition();
0033 
0034     ElfGNUSymbolVersionDefinition& operator=(ElfGNUSymbolVersionDefinition&) = delete;
0035 
0036     ElfGNUSymbolVersionDefinitionsSection* section() const;
0037 
0038     uint16_t flags() const;
0039     uint16_t versionIndex() const;
0040     uint16_t auxiliarySize() const;
0041     uint32_t hash() const;
0042     uint32_t auxiliaryOffset() const;
0043     uint32_t nextOffset() const;
0044 
0045     /** Size of this entry including its aux entries. Next one follows right afterwards. */
0046     uint32_t size() const;
0047 
0048     ElfGNUSymbolVersionDefinitionAuxiliaryEntry* auxiliaryEntry(uint32_t index) const;
0049 
0050     const unsigned char* rawData() const;
0051 
0052 private:
0053     ElfGNUSymbolVersionDefinitionsSection *m_section;
0054     const Elf64_Verdef* const m_verDef;
0055     QVector<ElfGNUSymbolVersionDefinitionAuxiliaryEntry*> m_auxEntries;
0056 };
0057 
0058 #endif // ELFGNUSYMBOLVERSIONDEFINITION_H