LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
SymbolVersionAuxRequirement.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 Quarkslab
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef LIEF_ELF_SYMBOL_VERSION_AUX_REQUIREMENT_H
17#define LIEF_ELF_SYMBOL_VERSION_AUX_REQUIREMENT_H
18
19#include <string>
20#include <ostream>
21#include <cstdint>
22
23#include "LIEF/visibility.h"
24#include "LIEF/iterators.hpp"
25
27
28namespace LIEF {
29namespace ELF {
30namespace details {
31struct Elf64_Vernaux;
32struct Elf32_Vernaux;
33}
34
36 public:
37 using SymbolVersionAux::name;
38
39 SymbolVersionAuxRequirement(const details::Elf64_Vernaux& header);
40 SymbolVersionAuxRequirement(const details::Elf32_Vernaux& header);
42
43 SymbolVersionAuxRequirement& operator=(const SymbolVersionAuxRequirement&) = default;
44 SymbolVersionAuxRequirement(const SymbolVersionAuxRequirement&) = default;
45
46 ~SymbolVersionAuxRequirement() override = default;
47 uint32_t hash() const {
50 return hash_;
51 }
52 uint16_t flags() const {
55 return flags_;
56 }
57 uint16_t other() const {
63 return other_;
64 }
65
66 void hash(uint32_t hash) {
67 hash_ = hash;
68 }
69
70 void flags(uint16_t flags) {
71 flags_ = flags;
72 }
73
74 void other(uint16_t other) {
75 other_ = other;
76 }
77
78 void accept(Visitor& visitor) const override;
79
80 LIEF_API friend
81 std::ostream& operator<<(std::ostream& os, const SymbolVersionAuxRequirement& aux) {
82 os << aux.name();
83 return os;
84 }
85
86 private:
87 uint32_t hash_ = 0;
88 uint16_t flags_ = 0;
89 uint16_t other_ = 0;
90};
91}
92}
93#endif
SymbolVersionAux.hpp
LIEF::ELF::SymbolVersionAuxRequirement
Definition SymbolVersionAuxRequirement.hpp:35
LIEF::ELF::SymbolVersionAuxRequirement::flags
void flags(uint16_t flags)
Definition SymbolVersionAuxRequirement.hpp:70
LIEF::ELF::SymbolVersionAuxRequirement::hash
uint32_t hash() const
Hash value of the dependency name (use ELF hashing function)
Definition SymbolVersionAuxRequirement.hpp:49
LIEF::ELF::SymbolVersionAuxRequirement::other
uint16_t other() const
It returns the unique version index for the file which is used in the version symbol table....
Definition SymbolVersionAuxRequirement.hpp:62
LIEF::ELF::SymbolVersionAuxRequirement::other
void other(uint16_t other)
Definition SymbolVersionAuxRequirement.hpp:74
LIEF::ELF::SymbolVersionAuxRequirement::SymbolVersionAuxRequirement
SymbolVersionAuxRequirement(const SymbolVersionAuxRequirement &)=default
LIEF::ELF::SymbolVersionAuxRequirement::operator<<
friend std::ostream & operator<<(std::ostream &os, const SymbolVersionAuxRequirement &aux)
Definition SymbolVersionAuxRequirement.hpp:81
LIEF::ELF::SymbolVersionAuxRequirement::operator=
SymbolVersionAuxRequirement & operator=(const SymbolVersionAuxRequirement &)=default
LIEF::ELF::SymbolVersionAuxRequirement::hash
void hash(uint32_t hash)
Definition SymbolVersionAuxRequirement.hpp:66
LIEF::ELF::SymbolVersionAuxRequirement::SymbolVersionAuxRequirement
SymbolVersionAuxRequirement()=default
LIEF::ELF::SymbolVersionAuxRequirement::accept
void accept(Visitor &visitor) const override
LIEF::ELF::SymbolVersionAuxRequirement::SymbolVersionAuxRequirement
SymbolVersionAuxRequirement(const details::Elf32_Vernaux &header)
LIEF::ELF::SymbolVersionAuxRequirement::SymbolVersionAuxRequirement
SymbolVersionAuxRequirement(const details::Elf64_Vernaux &header)
LIEF::ELF::SymbolVersionAuxRequirement::name
const std::string & name() const
Symbol's aux name (e.g. GLIBC_2.2.5)
Definition SymbolVersionAux.hpp:43
LIEF::ELF::SymbolVersionAuxRequirement::flags
uint16_t flags() const
Bitmask of flags.
Definition SymbolVersionAuxRequirement.hpp:54
LIEF::ELF::SymbolVersionAuxRequirement::~SymbolVersionAuxRequirement
~SymbolVersionAuxRequirement() override=default
LIEF::ELF::SymbolVersionAux
Class which represents an Auxiliary Symbol version.
Definition SymbolVersionAux.hpp:30
iterators.hpp
LIEF::ELF::details
Definition DynamicEntry.hpp:29
LIEF::ELF
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
LIEF::hash
Hash::value_type hash(const Object &v)
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41