Fix: nm: SEGV on unknow address at nm.c:718 in print_symname
[binutils-gdb.git] / include / elf / kvx_elfids.h
blob449f1d8d601507fa401e8f85f117181bc08495fe
1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
3 /* KVX ELF IDs definitions.
5 Copyright (C) 2009-2023 Free Software Foundation, Inc.
6 Contributed by Kalray SA.
8 This file is part of GNU Binutils.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the license, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; see the file COPYING3. If not,
22 see <http://www.gnu.org/licenses/>. */
24 /* This file holds definitions specific to the KV3 ELF IDs. */
26 #ifndef _KVX_ELFIDS_H_
27 #define _KVX_ELFIDS_H_
29 /* 16.15 8.7 4.3 0 */
30 /* +----------------------------+ */
31 /* | CUT | CORE |PIC |ABI | */
32 /* +----------------------------+ */
35 #define KVX_CUT_MASK 0x00ff0000
36 #define KVX_CORE_MASK 0x0000ff00
37 #define KVX_ABI_MASK 0x000000ff
38 #define KVX_MACH_MASK (KVX_CUT_MASK | KVX_CORE_MASK | KVX_ABI_MASK)
41 * Machine private data :
42 * - byte 0 = ABI specific (PIC, OS, ...)
43 * - bit 0..3 = ABI ident
44 * - bit 4 = 32/64 bits addressing
45 * - bit 5 = PIC
46 * - byte 1 = Core info :
47 * - bits 0..3 = Core Major Version
48 * - bit 4..7 = Core Minor Version
51 /* Core */
52 #define ELF_KVX_CORE_BIT_SHIFT (8)
53 #define ELF_KVX_CORE_MASK (0x7f<<ELF_KVX_CORE_BIT_SHIFT)
55 #define ELF_KVX_CORE_MAJOR_MASK (0x0F << ELF_KVX_CORE_BIT_SHIFT)
56 #define ELF_KVX_CORE_MINOR_MASK (0xF0 << ELF_KVX_CORE_BIT_SHIFT)
57 #define ELF_KVX_CORE_MAJOR_SHIFT (0 + ELF_KVX_CORE_BIT_SHIFT)
58 #define ELF_KVX_CORE_MINOR_SHIFT (4 + ELF_KVX_CORE_BIT_SHIFT)
60 #define ELF_KVX_CORE_KV3 (0x03 << ELF_KVX_CORE_BIT_SHIFT)
61 #define ELF_KVX_CORE_KV4 (0x04 << ELF_KVX_CORE_BIT_SHIFT)
63 #define ELF_KVX_CORE_KV3_1 (ELF_KVX_CORE_KV3 | (1 << (ELF_KVX_CORE_MINOR_SHIFT)))
64 #define ELF_KVX_CORE_KV3_2 (ELF_KVX_CORE_KV3 | (2 << (ELF_KVX_CORE_MINOR_SHIFT)))
65 #define ELF_KVX_CORE_KV4_1 (ELF_KVX_CORE_KV4 | (1 << (ELF_KVX_CORE_MINOR_SHIFT)))
67 #define ELF_KVX_IS_KV3(flags) (((flags) & ELF_KVX_CORE_MAJOR_MASK) == (ELF_KVX_CORE_KV3))
68 #define ELF_KVX_IS_KV4(flags) (((flags) & ELF_KVX_CORE_MAJOR_MASK) == (ELF_KVX_CORE_KV4))
69 #define ELF_KVX_CHECK_CORE(flags,m) (((flags) & ELF_KVX_CORE_MASK)==(m))
71 #define ELF_KVX_ABI_MASK (0xFF)
73 #define ELF_KVX_ABI_IDENT_MASK (0x7)
74 #define ELF_KVX_ABI_REGULAR (0x1)
75 #define ELF_KVX_ABI_UNDEF (0x0)
77 #define ELF_KVX_ABI_64B_ADDR_BIT (0x08)
79 #define ELF_KVX_ABI_PIC_BIT (0x10)
81 #endif /* _KVX_ELFIDS_H_ */