VirtualBox

source: vbox/trunk/include/iprt/formats/elf.h

Last change on this file was 98103, checked in by vboxsync, 17 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
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"
45typedef Elf64_Addr Elf_Addr;
46typedef Elf64_Half Elf_Half;
47typedef Elf64_Off Elf_Off;
48typedef Elf64_Sword Elf_Sword;
49typedef Elf64_Word Elf_Word;
50typedef Elf64_Size Elf_Size;
51typedef Elf64_Hashelt Elf_Hashelt;
52typedef Elf64_Ehdr Elf_Ehdr;
53typedef Elf64_Shdr Elf_Shdr;
54typedef Elf64_Phdr Elf_Phdr;
55typedef Elf64_Nhdr Elf_Nhdr;
56typedef Elf64_Dyn Elf_Dyn;
57typedef Elf64_Rel Elf_Rel;
58typedef Elf64_Rela Elf_Rela;
59typedef 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"
70typedef Elf32_Addr Elf_Addr;
71typedef Elf32_Half Elf_Half;
72typedef Elf32_Off Elf_Off;
73typedef Elf32_Sword Elf_Sword;
74typedef Elf32_Word Elf_Word;
75typedef Elf32_Size Elf_Size;
76typedef Elf32_Hashelt Elf_Hashelt;
77typedef Elf32_Ehdr Elf_Ehdr;
78typedef Elf32_Shdr Elf_Shdr;
79typedef Elf32_Phdr Elf_Phdr;
80typedef Elf32_Nhdr Elf_Nhdr;
81typedef Elf32_Dyn Elf_Dyn;
82typedef Elf32_Rel Elf_Rel;
83typedef Elf32_Rela Elf_Rela;
84typedef 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
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use