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 <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:
38
39 SymbolVersionAuxRequirement(const details::Elf64_Vernaux& header);
40 SymbolVersionAuxRequirement(const details::Elf32_Vernaux& header);
42
46
47 ~SymbolVersionAuxRequirement() override = default;
48
50 uint32_t hash() const {
51 return hash_;
52 }
53
55 uint16_t flags() const {
56 return flags_;
57 }
58
63 uint16_t other() const {
64 return other_;
65 }
66
67 void hash(uint32_t hash) {
68 hash_ = hash;
69 }
70
71 void flags(uint16_t flags) {
72 flags_ = flags;
73 }
74
75 void other(uint16_t other) {
76 other_ = other;
77 }
78
79 void accept(Visitor& visitor) const override;
80
81 LIEF_API friend std::ostream&
82 operator<<(std::ostream& os, const SymbolVersionAuxRequirement& aux) {
83 os << aux.name();
84 return os;
85 }
86
87 private:
88 uint32_t hash_ = 0;
89 uint16_t flags_ = 0;
90 uint16_t other_ = 0;
91};
92}
93}
94#endif
void flags(uint16_t flags)
Definition SymbolVersionAuxRequirement.hpp:71
uint32_t hash() const
Hash value of the dependency name (use ELF hashing function).
Definition SymbolVersionAuxRequirement.hpp:50
uint16_t other() const
It returns the unique version index for the file which is used in the version symbol table....
Definition SymbolVersionAuxRequirement.hpp:63
void other(uint16_t other)
Definition SymbolVersionAuxRequirement.hpp:75
SymbolVersionAuxRequirement(const SymbolVersionAuxRequirement &)=default
friend std::ostream & operator<<(std::ostream &os, const SymbolVersionAuxRequirement &aux)
Definition SymbolVersionAuxRequirement.hpp:82
SymbolVersionAuxRequirement & operator=(const SymbolVersionAuxRequirement &)=default
void hash(uint32_t hash)
Definition SymbolVersionAuxRequirement.hpp:67
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:55
~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:40
#define LIEF_API
Definition visibility.h:43