LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
SymbolVersionAuxRequirement.hpp
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
26#include "LIEF/ELF/SymbolVersionAux.hpp"
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
45
46 ~SymbolVersionAuxRequirement() override = default;
47
49 uint32_t hash() const {
50 return hash_;
51 }
52
54 uint16_t flags() const {
55 return flags_;
56 }
57
62 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
Definition SymbolVersionAuxRequirement.hpp:35
uint32_t hash() const
Hash value of the dependency name (use ELF hashing function)
Definition SymbolVersionAuxRequirement.hpp:49
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
uint16_t flags() const
Bitmask of flags.
Definition SymbolVersionAuxRequirement.hpp:54
Class which represents an Auxiliary Symbol version.
Definition SymbolVersionAux.hpp:30
LIEF namespace.
Definition Abstract/Binary.hpp:32