LIEF: Library to Instrument Executable Formats
Version 0.16.0
Loading...
Searching...
No Matches
LIEF-0.16.0-Linux-x86_64
include
LIEF
ELF
ProcessorFlags.hpp
Go to the documentation of this file.
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_PROCESSOR_FLAGS_H
17
#define LIEF_ELF_PROCESSOR_FLAGS_H
18
#include <cstdint>
19
#include "
LIEF/visibility.h
"
20
21
namespace
LIEF
{
22
namespace
ELF
{
23
24
static
constexpr
uint64_t PFLAGS_BIT = 43;
25
static
constexpr
uint64_t PFLAGS_MASK = (1LLU << PFLAGS_BIT) - 1;
26
static
constexpr
uint64_t PF_ARM_ID = 1;
27
static
constexpr
uint64_t PF_HEX_ID = 2;
28
static
constexpr
uint64_t PF_LOONGARCH_ID = 3;
29
static
constexpr
uint64_t PF_MIPS_ID = 4;
30
static
constexpr
uint64_t PF_RISCV_ID = 5;
31
32
enum class
PROCESSOR_FLAGS
: uint64_t {
33
ARM_EABI_UNKNOWN
= 0x00000000 | (PF_ARM_ID << PFLAGS_BIT),
34
ARM_SOFT_FLOAT
= 0x00000200 | (PF_ARM_ID << PFLAGS_BIT),
35
ARM_VFP_FLOAT
= 0x00000400 | (PF_ARM_ID << PFLAGS_BIT),
36
ARM_EABI_VER1
= 0x01000000 | (PF_ARM_ID << PFLAGS_BIT),
37
ARM_EABI_VER2
= 0x02000000 | (PF_ARM_ID << PFLAGS_BIT),
38
ARM_EABI_VER3
= 0x03000000 | (PF_ARM_ID << PFLAGS_BIT),
39
ARM_EABI_VER4
= 0x04000000 | (PF_ARM_ID << PFLAGS_BIT),
40
ARM_EABI_VER5
= 0x05000000 | (PF_ARM_ID << PFLAGS_BIT),
41
42
HEXAGON_MACH_V2
= 0x00000001 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V2
43
HEXAGON_MACH_V3
= 0x00000002 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V3
44
HEXAGON_MACH_V4
= 0x00000003 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V4
45
HEXAGON_MACH_V5
= 0x00000004 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V5
46
47
HEXAGON_ISA_V2
= 0x00000010 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V2 ISA
48
HEXAGON_ISA_V3
= 0x00000020 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V3 ISA
49
HEXAGON_ISA_V4
= 0x00000030 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V4 ISA
50
HEXAGON_ISA_V5
= 0x00000040 | (PF_HEX_ID << PFLAGS_BIT),
// Hexagon V5 ISA
51
52
LOONGARCH_ABI_SOFT_FLOAT
= 0x1 | (PF_LOONGARCH_ID << PFLAGS_BIT),
53
LOONGARCH_ABI_SINGLE_FLOAT
= 0x2 | (PF_LOONGARCH_ID << PFLAGS_BIT),
54
LOONGARCH_ABI_DOUBLE_FLOAT
= 0x3 | (PF_LOONGARCH_ID << PFLAGS_BIT),
55
56
MIPS_NOREORDER
= 0x00000001 | (PF_MIPS_ID << PFLAGS_BIT),
/* Don't reorder instructions */
57
MIPS_PIC
= 0x00000002 | (PF_MIPS_ID << PFLAGS_BIT),
/* Position independent code */
58
MIPS_CPIC
= 0x00000004 | (PF_MIPS_ID << PFLAGS_BIT),
/* Call object with Position independent code */
59
MIPS_ABI2
= 0x00000020 | (PF_MIPS_ID << PFLAGS_BIT),
/* File uses N32 ABI */
60
MIPS_32BITMODE
= 0x00000100 | (PF_MIPS_ID << PFLAGS_BIT),
/* Code compiled for a 64-bit machine */
61
/* in 32-bit mode */
62
MIPS_FP64
= 0x00000200 | (PF_MIPS_ID << PFLAGS_BIT),
/* Code compiled for a 32-bit machine */
63
/* but uses 64-bit FP registers */
64
MIPS_NAN2008
= 0x00000400 | (PF_MIPS_ID << PFLAGS_BIT),
/* Uses IEE 754-2008 NaN encoding */
65
66
/* ABI flags */
67
MIPS_ABI_O32
= 0x00001000 | (PF_MIPS_ID << PFLAGS_BIT),
/* This file follows the first MIPS 32 bit ABI */
68
MIPS_ABI_O64
= 0x00002000 | (PF_MIPS_ID << PFLAGS_BIT),
/* O32 ABI extended for 64-bit architecture. */
69
MIPS_ABI_EABI32
= 0x00003000 | (PF_MIPS_ID << PFLAGS_BIT),
/* EABI in 32 bit mode. */
70
MIPS_ABI_EABI64
= 0x00004000 | (PF_MIPS_ID << PFLAGS_BIT),
/* EABI in 64 bit mode. */
71
72
/* MIPS machine variant */
73
MIPS_MACH_3900
= 0x00810000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Toshiba R3900 */
74
MIPS_MACH_4010
= 0x00820000 | (PF_MIPS_ID << PFLAGS_BIT),
/* LSI R4010 */
75
MIPS_MACH_4100
= 0x00830000 | (PF_MIPS_ID << PFLAGS_BIT),
/* NEC VR4100 */
76
MIPS_MACH_4650
= 0x00850000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS R4650 */
77
MIPS_MACH_4120
= 0x00870000 | (PF_MIPS_ID << PFLAGS_BIT),
/* NEC VR4120 */
78
MIPS_MACH_4111
= 0x00880000 | (PF_MIPS_ID << PFLAGS_BIT),
/* NEC VR4111/VR4181 */
79
MIPS_MACH_SB1
= 0x008a0000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Broadcom SB-1 */
80
MIPS_MACH_OCTEON
= 0x008b0000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Cavium Networks Octeon */
81
MIPS_MACH_XLR
= 0x008c0000 | (PF_MIPS_ID << PFLAGS_BIT),
/* RMI Xlr */
82
MIPS_MACH_OCTEON2
= 0x008d0000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Cavium Networks Octeon2 */
83
MIPS_MACH_OCTEON3
= 0x008e0000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Cavium Networks Octeon3 */
84
MIPS_MACH_5400
= 0x00910000 | (PF_MIPS_ID << PFLAGS_BIT),
/* NEC VR5400 */
85
MIPS_MACH_5900
= 0x00920000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS R5900 */
86
MIPS_MACH_5500
= 0x00980000 | (PF_MIPS_ID << PFLAGS_BIT),
/* NEC VR5500 */
87
MIPS_MACH_9000
= 0x00990000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Unknown */
88
MIPS_MACH_LS2E
= 0x00a00000 | (PF_MIPS_ID << PFLAGS_BIT),
/* ST Microelectronics Loongson 2E */
89
MIPS_MACH_LS2F
= 0x00a10000 | (PF_MIPS_ID << PFLAGS_BIT),
/* ST Microelectronics Loongson 2F */
90
MIPS_MACH_LS3A
= 0x00a20000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Loongson 3A */
91
92
/* ARCH_ASE */
93
MIPS_MICROMIPS
= 0x02000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* microMIPS */
94
MIPS_ARCH_ASE_M16
= 0x04000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Has Mips-16 ISA extensions */
95
MIPS_ARCH_ASE_MDMX
= 0x08000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* Has MDMX multimedia extensions */
96
97
/* ARCH */
98
MIPS_ARCH_1
= 0x00000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS1 instruction set */
99
MIPS_ARCH_2
= 0x10000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS2 instruction set */
100
MIPS_ARCH_3
= 0x20000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS3 instruction set */
101
MIPS_ARCH_4
= 0x30000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS4 instruction set */
102
MIPS_ARCH_5
= 0x40000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS5 instruction set */
103
MIPS_ARCH_32
= 0x50000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS32 instruction set per linux not elf.h */
104
MIPS_ARCH_64
= 0x60000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* MIPS64 instruction set per linux not elf.h */
105
MIPS_ARCH_32R2
= 0x70000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* mips32r2, mips32r3, mips32r5 */
106
MIPS_ARCH_64R2
= 0x80000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* mips64r2, mips64r3, mips64r5 */
107
MIPS_ARCH_32R6
= 0x90000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* mips32r6 */
108
MIPS_ARCH_64R6
= 0xa0000000 | (PF_MIPS_ID << PFLAGS_BIT),
/* mips64r6 */
109
110
RISCV_RVC
= 0x00000001 | (PF_RISCV_ID << PFLAGS_BIT),
111
112
RISCV_FLOAT_ABI_SOFT
= 0x00000000 | (PF_RISCV_ID << PFLAGS_BIT),
113
RISCV_FLOAT_ABI_SINGLE
= 0x00000002 | (PF_RISCV_ID << PFLAGS_BIT),
114
RISCV_FLOAT_ABI_DOUBLE
= 0x00000004 | (PF_RISCV_ID << PFLAGS_BIT),
115
RISCV_FLOAT_ABI_QUAD
= 0x00000006 | (PF_RISCV_ID << PFLAGS_BIT),
116
117
RISCV_FLOAT_ABI_RVE
= 0x00000008 | (PF_RISCV_ID << PFLAGS_BIT),
118
RISCV_FLOAT_ABI_TSO
= 0x00000010 | (PF_RISCV_ID << PFLAGS_BIT),
119
};
120
121
LIEF_API
const
char
*
to_string
(
PROCESSOR_FLAGS
flag);
122
123
124
}
125
}
126
#endif
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::PROCESSOR_FLAGS
PROCESSOR_FLAGS
Definition
ProcessorFlags.hpp:32
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MICROMIPS
@ MIPS_MICROMIPS
Definition
ProcessorFlags.hpp:93
LIEF::ELF::PROCESSOR_FLAGS::MIPS_PIC
@ MIPS_PIC
Definition
ProcessorFlags.hpp:57
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_4120
@ MIPS_MACH_4120
Definition
ProcessorFlags.hpp:77
LIEF::ELF::PROCESSOR_FLAGS::MIPS_FP64
@ MIPS_FP64
Definition
ProcessorFlags.hpp:62
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_3
@ MIPS_ARCH_3
Definition
ProcessorFlags.hpp:100
LIEF::ELF::PROCESSOR_FLAGS::MIPS_32BITMODE
@ MIPS_32BITMODE
Definition
ProcessorFlags.hpp:60
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_3900
@ MIPS_MACH_3900
Definition
ProcessorFlags.hpp:73
LIEF::ELF::PROCESSOR_FLAGS::RISCV_FLOAT_ABI_RVE
@ RISCV_FLOAT_ABI_RVE
Definition
ProcessorFlags.hpp:117
LIEF::ELF::PROCESSOR_FLAGS::ARM_EABI_VER3
@ ARM_EABI_VER3
Definition
ProcessorFlags.hpp:38
LIEF::ELF::PROCESSOR_FLAGS::LOONGARCH_ABI_SINGLE_FLOAT
@ LOONGARCH_ABI_SINGLE_FLOAT
Definition
ProcessorFlags.hpp:53
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_LS2F
@ MIPS_MACH_LS2F
Definition
ProcessorFlags.hpp:89
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_ISA_V3
@ HEXAGON_ISA_V3
Definition
ProcessorFlags.hpp:48
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_4650
@ MIPS_MACH_4650
Definition
ProcessorFlags.hpp:76
LIEF::ELF::PROCESSOR_FLAGS::RISCV_FLOAT_ABI_SOFT
@ RISCV_FLOAT_ABI_SOFT
Definition
ProcessorFlags.hpp:112
LIEF::ELF::PROCESSOR_FLAGS::MIPS_NOREORDER
@ MIPS_NOREORDER
Definition
ProcessorFlags.hpp:56
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_2
@ MIPS_ARCH_2
Definition
ProcessorFlags.hpp:99
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_5400
@ MIPS_MACH_5400
Definition
ProcessorFlags.hpp:84
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_OCTEON3
@ MIPS_MACH_OCTEON3
Definition
ProcessorFlags.hpp:83
LIEF::ELF::PROCESSOR_FLAGS::ARM_EABI_VER1
@ ARM_EABI_VER1
Definition
ProcessorFlags.hpp:36
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_ISA_V2
@ HEXAGON_ISA_V2
Definition
ProcessorFlags.hpp:47
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_4111
@ MIPS_MACH_4111
Definition
ProcessorFlags.hpp:78
LIEF::ELF::PROCESSOR_FLAGS::ARM_EABI_VER5
@ ARM_EABI_VER5
Definition
ProcessorFlags.hpp:40
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_MACH_V2
@ HEXAGON_MACH_V2
Definition
ProcessorFlags.hpp:42
LIEF::ELF::PROCESSOR_FLAGS::RISCV_FLOAT_ABI_QUAD
@ RISCV_FLOAT_ABI_QUAD
Definition
ProcessorFlags.hpp:115
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_ISA_V4
@ HEXAGON_ISA_V4
Definition
ProcessorFlags.hpp:49
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_4
@ MIPS_ARCH_4
Definition
ProcessorFlags.hpp:101
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_OCTEON
@ MIPS_MACH_OCTEON
Definition
ProcessorFlags.hpp:80
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ABI_EABI32
@ MIPS_ABI_EABI32
Definition
ProcessorFlags.hpp:69
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_9000
@ MIPS_MACH_9000
Definition
ProcessorFlags.hpp:87
LIEF::ELF::PROCESSOR_FLAGS::RISCV_FLOAT_ABI_SINGLE
@ RISCV_FLOAT_ABI_SINGLE
Definition
ProcessorFlags.hpp:113
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_OCTEON2
@ MIPS_MACH_OCTEON2
Definition
ProcessorFlags.hpp:82
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_5
@ MIPS_ARCH_5
Definition
ProcessorFlags.hpp:102
LIEF::ELF::PROCESSOR_FLAGS::RISCV_FLOAT_ABI_DOUBLE
@ RISCV_FLOAT_ABI_DOUBLE
Definition
ProcessorFlags.hpp:114
LIEF::ELF::PROCESSOR_FLAGS::MIPS_NAN2008
@ MIPS_NAN2008
Definition
ProcessorFlags.hpp:64
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ABI_O32
@ MIPS_ABI_O32
Definition
ProcessorFlags.hpp:67
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_32
@ MIPS_ARCH_32
Definition
ProcessorFlags.hpp:103
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ABI2
@ MIPS_ABI2
Definition
ProcessorFlags.hpp:59
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_4010
@ MIPS_MACH_4010
Definition
ProcessorFlags.hpp:74
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_ASE_MDMX
@ MIPS_ARCH_ASE_MDMX
Definition
ProcessorFlags.hpp:95
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_4100
@ MIPS_MACH_4100
Definition
ProcessorFlags.hpp:75
LIEF::ELF::PROCESSOR_FLAGS::ARM_SOFT_FLOAT
@ ARM_SOFT_FLOAT
Definition
ProcessorFlags.hpp:34
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ABI_EABI64
@ MIPS_ABI_EABI64
Definition
ProcessorFlags.hpp:70
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_LS3A
@ MIPS_MACH_LS3A
Definition
ProcessorFlags.hpp:90
LIEF::ELF::PROCESSOR_FLAGS::ARM_EABI_VER4
@ ARM_EABI_VER4
Definition
ProcessorFlags.hpp:39
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_64R6
@ MIPS_ARCH_64R6
Definition
ProcessorFlags.hpp:108
LIEF::ELF::PROCESSOR_FLAGS::LOONGARCH_ABI_DOUBLE_FLOAT
@ LOONGARCH_ABI_DOUBLE_FLOAT
Definition
ProcessorFlags.hpp:54
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_64
@ MIPS_ARCH_64
Definition
ProcessorFlags.hpp:104
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_XLR
@ MIPS_MACH_XLR
Definition
ProcessorFlags.hpp:81
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_MACH_V5
@ HEXAGON_MACH_V5
Definition
ProcessorFlags.hpp:45
LIEF::ELF::PROCESSOR_FLAGS::LOONGARCH_ABI_SOFT_FLOAT
@ LOONGARCH_ABI_SOFT_FLOAT
Definition
ProcessorFlags.hpp:52
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_32R2
@ MIPS_ARCH_32R2
Definition
ProcessorFlags.hpp:105
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_1
@ MIPS_ARCH_1
Definition
ProcessorFlags.hpp:98
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ABI_O64
@ MIPS_ABI_O64
Definition
ProcessorFlags.hpp:68
LIEF::ELF::PROCESSOR_FLAGS::ARM_EABI_VER2
@ ARM_EABI_VER2
Definition
ProcessorFlags.hpp:37
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_MACH_V4
@ HEXAGON_MACH_V4
Definition
ProcessorFlags.hpp:44
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_SB1
@ MIPS_MACH_SB1
Definition
ProcessorFlags.hpp:79
LIEF::ELF::PROCESSOR_FLAGS::ARM_EABI_UNKNOWN
@ ARM_EABI_UNKNOWN
Definition
ProcessorFlags.hpp:33
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_LS2E
@ MIPS_MACH_LS2E
Definition
ProcessorFlags.hpp:88
LIEF::ELF::PROCESSOR_FLAGS::RISCV_FLOAT_ABI_TSO
@ RISCV_FLOAT_ABI_TSO
Definition
ProcessorFlags.hpp:118
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_64R2
@ MIPS_ARCH_64R2
Definition
ProcessorFlags.hpp:106
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_32R6
@ MIPS_ARCH_32R6
Definition
ProcessorFlags.hpp:107
LIEF::ELF::PROCESSOR_FLAGS::MIPS_ARCH_ASE_M16
@ MIPS_ARCH_ASE_M16
Definition
ProcessorFlags.hpp:94
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_5500
@ MIPS_MACH_5500
Definition
ProcessorFlags.hpp:86
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_MACH_V3
@ HEXAGON_MACH_V3
Definition
ProcessorFlags.hpp:43
LIEF::ELF::PROCESSOR_FLAGS::MIPS_CPIC
@ MIPS_CPIC
Definition
ProcessorFlags.hpp:58
LIEF::ELF::PROCESSOR_FLAGS::ARM_VFP_FLOAT
@ ARM_VFP_FLOAT
Definition
ProcessorFlags.hpp:35
LIEF::ELF::PROCESSOR_FLAGS::RISCV_RVC
@ RISCV_RVC
Definition
ProcessorFlags.hpp:110
LIEF::ELF::PROCESSOR_FLAGS::HEXAGON_ISA_V5
@ HEXAGON_ISA_V5
Definition
ProcessorFlags.hpp:50
LIEF::ELF::PROCESSOR_FLAGS::MIPS_MACH_5900
@ MIPS_MACH_5900
Definition
ProcessorFlags.hpp:85
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.13.0