LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
X86ISA.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2025 R. Thomas
2 * Copyright 2017 - 2025 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_NOTE_DETAILS_PROPERTIES_X86ISA_H
17#define LIEF_ELF_NOTE_DETAILS_PROPERTIES_X86ISA_H
18#include <vector>
19#include <utility>
20
22#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace ELF {
26
35class LIEF_API X86ISA : public NoteGnuProperty::Property {
36 public:
37 enum class FLAG {
38 NONE = 0,
41 };
78 using values_t = std::vector<std::pair<FLAG, ISA>>;
79
80 static bool classof(const NoteGnuProperty::Property* prop) {
82 }
83
84 static std::unique_ptr<X86ISA> create(uint32_t type, BinaryStream& stream);
85
87 const values_t& values() const {
88 return values_;
89 }
90
91 ~X86ISA() override = default;
92
93 void dump(std::ostream &os) const override;
94
95 protected:
96 inline static std::unique_ptr<X86ISA>
97 create_isa_1(FLAG flag, BinaryStream& stream);
98 inline static std::unique_ptr<X86ISA>
99 create_compat_isa_1(FLAG flag, BinaryStream& stream, bool is_compat2);
100 X86ISA(values_t values) :
101 NoteGnuProperty::Property(NoteGnuProperty::Property::TYPE::X86_ISA),
102 values_(std::move(values))
103 {}
104
105 values_t values_;
106};
107
110
111}
112}
113
114#endif
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:33
This class wraps the different properties that can be used in a NT_GNU_PROPERTY_TYPE_0 note.
Definition NoteGnuProperty.hpp:35
TYPE
LIEF's mirror types of the original GNU_PROPERTY_ values.
Definition NoteGnuProperty.hpp:39
@ X86_ISA
Mirror of GNU_PROPERTY_X86_ISA_1_* and GNU_PROPERTY_X86_COMPAT_*.
Definition NoteGnuProperty.hpp:46
TYPE type() const
Return the LIEF's mirror type of the note.
Definition NoteGnuProperty.hpp:52
Class that wraps the NT_GNU_PROPERTY_TYPE_0 note.
Definition NoteGnuProperty.hpp:30
void dump(std::ostream &os) const override
ISA
Definition X86ISA.hpp:42
@ AVX512VL
Definition X86ISA.hpp:66
@ AVX512ER
Definition X86ISA.hpp:64
@ AVX512_IFMA
Definition X86ISA.hpp:72
@ I486
Definition X86ISA.hpp:51
@ SSSE3
Definition X86ISA.hpp:57
@ BASELINE
Definition X86ISA.hpp:44
@ SSE4_2
Definition X86ISA.hpp:59
@ AVX
Definition X86ISA.hpp:60
@ AVX512_4FMAPS
Definition X86ISA.hpp:69
@ AVX512_VBMI
Definition X86ISA.hpp:73
@ I586
Definition X86ISA.hpp:52
@ SSE
Definition X86ISA.hpp:54
@ UNKNOWN
Definition X86ISA.hpp:43
@ AVX512_VBMI2
Definition X86ISA.hpp:74
@ AVX512_4VNNIW
Definition X86ISA.hpp:70
@ AVX512_BITALG
Definition X86ISA.hpp:71
@ SSE4_1
Definition X86ISA.hpp:58
@ AVX512F
Definition X86ISA.hpp:62
@ V4
Definition X86ISA.hpp:47
@ AVX512PF
Definition X86ISA.hpp:65
@ AVX512_VNNI
Definition X86ISA.hpp:75
@ SSE3
Definition X86ISA.hpp:56
@ I686
Definition X86ISA.hpp:53
@ SSE2
Definition X86ISA.hpp:55
@ AVX512DQ
Definition X86ISA.hpp:67
@ V3
Definition X86ISA.hpp:46
@ AVX512CD
Definition X86ISA.hpp:63
@ AVX512BW
Definition X86ISA.hpp:68
@ V2
Definition X86ISA.hpp:45
@ AVX512_BF16
Definition X86ISA.hpp:76
@ AVX2
Definition X86ISA.hpp:61
@ CMOV
Definition X86ISA.hpp:49
@ FMA
Definition X86ISA.hpp:50
static std::unique_ptr< X86ISA > create(uint32_t type, BinaryStream &stream)
~X86ISA() override=default
std::vector< std::pair< FLAG, ISA > > values_t
Definition X86ISA.hpp:78
FLAG
Definition X86ISA.hpp:37
@ NEEDED
Definition X86ISA.hpp:40
@ NONE
Definition X86ISA.hpp:38
@ USED
Definition X86ISA.hpp:39
const values_t & values() const
List of the ISA values in this property.
Definition X86ISA.hpp:87
static bool classof(const NoteGnuProperty::Property *prop)
Definition X86ISA.hpp:80
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
const char * to_string(DynamicEntry::TAG e)
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:41