LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
SymbolVersionAuxRequirement.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 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 <ostream>
20#include <cstdint>
21
22#include "LIEF/visibility.h"
23
25
26namespace LIEF {
27namespace ELF {
28namespace details {
29struct Elf64_Vernaux;
30struct Elf32_Vernaux;
31}
32
34 public:
36
37 SymbolVersionAuxRequirement(const details::Elf64_Vernaux& header);
38 SymbolVersionAuxRequirement(const details::Elf32_Vernaux& header);
40
44
45 ~SymbolVersionAuxRequirement() override = default;
46
48 uint32_t hash() const {
49 return hash_;
50 }
51
53 uint16_t flags() const {
54 return flags_;
55 }
56
61 uint16_t other() const {
62 return other_;
63 }
64
65 void hash(uint32_t hash) {
66 hash_ = hash;
67 }
68
69 void flags(uint16_t flags) {
70 flags_ = flags;
71 }
72
73 void other(uint16_t other) {
74 other_ = other;
75 }
76
77 void accept(Visitor& visitor) const override;
78
79 LIEF_API friend std::ostream&
80 operator<<(std::ostream& os, const SymbolVersionAuxRequirement& aux) {
81 os << aux.name();
82 return os;
83 }
84
85 private:
86 uint32_t hash_ = 0;
87 uint16_t flags_ = 0;
88 uint16_t other_ = 0;
89};
90}
91}
92#endif
void flags(uint16_t flags)
Definition SymbolVersionAuxRequirement.hpp:69
uint32_t hash() const
Hash value of the dependency name (use ELF hashing function).
Definition SymbolVersionAuxRequirement.hpp:48
uint16_t other() const
It returns the unique version index for the file which is used in the version symbol table....
Definition SymbolVersionAuxRequirement.hpp:61
void other(uint16_t other)
Definition SymbolVersionAuxRequirement.hpp:73
SymbolVersionAuxRequirement(const SymbolVersionAuxRequirement &)=default
friend std::ostream & operator<<(std::ostream &os, const SymbolVersionAuxRequirement &aux)
Definition SymbolVersionAuxRequirement.hpp:80
SymbolVersionAuxRequirement & operator=(const SymbolVersionAuxRequirement &)=default
void hash(uint32_t hash)
Definition SymbolVersionAuxRequirement.hpp:65
void accept(Visitor &visitor) const override
SymbolVersionAuxRequirement(const details::Elf32_Vernaux &header)
SymbolVersionAuxRequirement(const details::Elf64_Vernaux &header)
const std::string & name() const
Symbol's aux name (e.g. GLIBC_2.2.5).
Definition SymbolVersionAux.hpp:43
uint16_t flags() const
Bitmask of flags.
Definition SymbolVersionAuxRequirement.hpp:53
~SymbolVersionAuxRequirement() override=default
const std::string & name() const
Symbol's aux name (e.g. GLIBC_2.2.5).
Definition SymbolVersionAux.hpp:43
SymbolVersionAux(std::string name)
Definition SymbolVersionAux.hpp:34
Definition Visitor.hpp:212
Definition DynamicEntry.hpp:29
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:41
#define LIEF_API
Definition visibility.h:45