1 | /* $Id: elf.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * ELF types, current architecture.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | #ifndef IPRT_INCLUDED_formats_elf_h
|
---|
38 | #define IPRT_INCLUDED_formats_elf_h
|
---|
39 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
40 | # pragma once
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_ARM64)
|
---|
44 | # include "elf64.h"
|
---|
45 | typedef Elf64_Addr Elf_Addr;
|
---|
46 | typedef Elf64_Half Elf_Half;
|
---|
47 | typedef Elf64_Off Elf_Off;
|
---|
48 | typedef Elf64_Sword Elf_Sword;
|
---|
49 | typedef Elf64_Word Elf_Word;
|
---|
50 | typedef Elf64_Size Elf_Size;
|
---|
51 | typedef Elf64_Hashelt Elf_Hashelt;
|
---|
52 | typedef Elf64_Ehdr Elf_Ehdr;
|
---|
53 | typedef Elf64_Shdr Elf_Shdr;
|
---|
54 | typedef Elf64_Phdr Elf_Phdr;
|
---|
55 | typedef Elf64_Nhdr Elf_Nhdr;
|
---|
56 | typedef Elf64_Dyn Elf_Dyn;
|
---|
57 | typedef Elf64_Rel Elf_Rel;
|
---|
58 | typedef Elf64_Rela Elf_Rela;
|
---|
59 | typedef Elf64_Sym Elf_Sym;
|
---|
60 |
|
---|
61 | #define ELF_R_SYM ELF64_R_SYM
|
---|
62 | #define ELF_R_TYPE ELF64_R_TYPE
|
---|
63 | #define ELF_R_INFO ELF64_R_INFO
|
---|
64 | #define ELF_ST_BIND ELF64_ST_BIND
|
---|
65 | #define ELF_ST_TYPE ELF64_ST_TYPE
|
---|
66 | #define ELF_ST_INFO ELF64_ST_INFO
|
---|
67 |
|
---|
68 | #elif defined(RT_ARCH_X86)
|
---|
69 | # include "elf32.h"
|
---|
70 | typedef Elf32_Addr Elf_Addr;
|
---|
71 | typedef Elf32_Half Elf_Half;
|
---|
72 | typedef Elf32_Off Elf_Off;
|
---|
73 | typedef Elf32_Sword Elf_Sword;
|
---|
74 | typedef Elf32_Word Elf_Word;
|
---|
75 | typedef Elf32_Size Elf_Size;
|
---|
76 | typedef Elf32_Hashelt Elf_Hashelt;
|
---|
77 | typedef Elf32_Ehdr Elf_Ehdr;
|
---|
78 | typedef Elf32_Shdr Elf_Shdr;
|
---|
79 | typedef Elf32_Phdr Elf_Phdr;
|
---|
80 | typedef Elf32_Nhdr Elf_Nhdr;
|
---|
81 | typedef Elf32_Dyn Elf_Dyn;
|
---|
82 | typedef Elf32_Rel Elf_Rel;
|
---|
83 | typedef Elf32_Rela Elf_Rela;
|
---|
84 | typedef Elf32_Sym Elf_Sym;
|
---|
85 |
|
---|
86 | #define ELF_R_SYM ELF32_R_SYM
|
---|
87 | #define ELF_R_TYPE ELF32_R_TYPE
|
---|
88 | #define ELF_R_INFO ELF32_R_INFO
|
---|
89 | #define ELF_ST_BIND ELF32_ST_BIND
|
---|
90 | #define ELF_ST_TYPE ELF32_ST_TYPE
|
---|
91 | #define ELF_ST_INFO ELF32_ST_INFO
|
---|
92 |
|
---|
93 | #else
|
---|
94 | # error Unknown arch!
|
---|
95 | #endif
|
---|
96 |
|
---|
97 | #endif /* !IPRT_INCLUDED_formats_elf_h */
|
---|
98 |
|
---|