LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
ELF
NoteDetails
properties
X86ISA.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_NOTE_DETAILS_PROPERTIES_X86ISA_H
17
#define LIEF_ELF_NOTE_DETAILS_PROPERTIES_X86ISA_H
18
#include <vector>
19
#include <utility>
20
21
#include "
LIEF/ELF/NoteDetails/NoteGnuProperty.hpp
"
22
#include "
LIEF/visibility.h
"
23
24
namespace
LIEF
{
25
namespace
ELF
{
26
35
class
LIEF_API
X86ISA :
public
NoteGnuProperty::Property
{
36
public
:
37
enum class
FLAG
{
38
NONE
= 0,
39
USED,
40
NEEDED,
41
};
42
enum class
ISA
{
43
UNKNOWN = 0,
44
BASELINE,
45
V2,
46
V3,
47
V4,
48
49
CMOV,
50
FMA,
51
I486,
52
I586,
53
I686,
54
SSE,
55
SSE2,
56
SSE3,
57
SSSE3,
58
SSE4_1,
59
SSE4_2,
60
AVX,
61
AVX2,
62
AVX512F,
63
AVX512CD,
64
AVX512ER,
65
AVX512PF,
66
AVX512VL,
67
AVX512DQ,
68
AVX512BW,
69
AVX512_4FMAPS,
70
AVX512_4VNNIW,
71
AVX512_BITALG,
72
AVX512_IFMA,
73
AVX512_VBMI,
74
AVX512_VBMI2,
75
AVX512_VNNI,
76
AVX512_BF16,
77
};
78
using
values_t
= std::vector<std::pair<FLAG, ISA>>;
79
80
static
bool
classof
(
const
NoteGnuProperty::Property
* prop) {
81
return
prop->
type
() ==
NoteGnuProperty::Property::TYPE::X86_ISA
;
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
108
LIEF_API
const
char
*
to_string
(
X86ISA::FLAG
flag);
109
LIEF_API
const
char
*
to_string
(
X86ISA::ISA
isa);
110
111
}
112
}
113
114
#endif
NoteGnuProperty.hpp
LIEF::BinaryStream
Class that is used to a read stream of data from different sources.
Definition
BinaryStream.hpp:33
LIEF::ELF::NoteGnuProperty::Property
This class wraps the different properties that can be used in a NT_GNU_PROPERTY_TYPE_0 note.
Definition
NoteGnuProperty.hpp:35
LIEF::ELF::NoteGnuProperty::Property::TYPE
TYPE
LIEF's mirror types of the original GNU_PROPERTY_ values.
Definition
NoteGnuProperty.hpp:39
LIEF::ELF::NoteGnuProperty::Property::TYPE::X86_ISA
@ X86_ISA
Mirror of GNU_PROPERTY_X86_ISA_1_* and GNU_PROPERTY_X86_COMPAT_*.
Definition
NoteGnuProperty.hpp:46
LIEF::ELF::NoteGnuProperty::Property::type
TYPE type() const
Return the LIEF's mirror type of the note.
Definition
NoteGnuProperty.hpp:52
LIEF::ELF::NoteGnuProperty
Class that wraps the NT_GNU_PROPERTY_TYPE_0 note.
Definition
NoteGnuProperty.hpp:30
LIEF::ELF::X86ISA::dump
void dump(std::ostream &os) const override
LIEF::ELF::X86ISA::ISA
ISA
Definition
X86ISA.hpp:42
LIEF::ELF::X86ISA::create
static std::unique_ptr< X86ISA > create(uint32_t type, BinaryStream &stream)
LIEF::ELF::X86ISA::~X86ISA
~X86ISA() override=default
LIEF::ELF::X86ISA::values_t
std::vector< std::pair< FLAG, ISA > > values_t
Definition
X86ISA.hpp:78
LIEF::ELF::X86ISA::FLAG
FLAG
Definition
X86ISA.hpp:37
LIEF::ELF::X86ISA::values
const values_t & values() const
List of the ISA values in this property.
Definition
X86ISA.hpp:87
LIEF::ELF::X86ISA::classof
static bool classof(const NoteGnuProperty::Property *prop)
Definition
X86ISA.hpp:80
LIEF::ELF
Namespace related to the LIEF's ELF module.
Definition
Abstract/Header.hpp:28
LIEF::ELF::to_string
const char * to_string(DynamicEntry::TAG e)
LIEF::ELF::ARCH::NONE
@ NONE
Definition
ELF/enums.hpp:31
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0