]>
Commit | Line | Data |
---|---|---|
848fa4a9 | 1 | /* Run-time dynamic linker data structures for loaded ELF shared objects. |
04277e02 | 2 | Copyright (C) 2010-2019 Free Software Foundation, Inc. |
848fa4a9 JM |
3 | This file is part of the GNU C Library. |
4 | ||
5 | The GNU C Library is free software; you can redistribute it and/or | |
6 | modify it under the terms of the GNU Lesser General Public | |
7 | License as published by the Free Software Foundation; either | |
8 | version 2.1 of the License, or (at your option) any later version. | |
9 | ||
10 | The GNU C Library is distributed in the hope that it will be useful, | |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | Lesser General Public License for more details. | |
14 | ||
15 | You should have received a copy of the GNU Lesser General Public | |
ab84e3ff PE |
16 | License along with the GNU C Library. If not, see |
17 | <http://www.gnu.org/licenses/>. */ | |
848fa4a9 JM |
18 | |
19 | #ifndef _ARM_LINUX_LDSODEFS_H | |
20 | #define _ARM_LINUX_LDSODEFS_H 1 | |
21 | ||
22 | #include_next <ldsodefs.h> | |
23 | ||
24 | #undef VALID_ELF_HEADER | |
25 | #undef VALID_ELF_OSABI | |
c325f0f2 | 26 | #undef MORE_ELF_HEADER_DATA |
848fa4a9 | 27 | |
848fa4a9 | 28 | #define EXTRA_OSABI ELFOSABI_ARM_AEABI |
848fa4a9 | 29 | |
d3bafbc9 SM |
30 | #ifdef __ARM_PCS_VFP |
31 | # define VALID_FLOAT_ABI(x) \ | |
32 | ((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \ | |
33 | || !((x) & EF_ARM_ABI_FLOAT_SOFT)) | |
34 | #else | |
35 | # define VALID_FLOAT_ABI(x) \ | |
36 | ((EF_ARM_EABI_VERSION ((x)) != EF_ARM_EABI_VER5) \ | |
37 | || !((x) & EF_ARM_ABI_FLOAT_HARD)) | |
38 | #endif | |
39 | ||
40 | #undef VALID_ELF_HEADER | |
848fa4a9 | 41 | #define VALID_ELF_HEADER(hdr,exp,size) \ |
d3bafbc9 SM |
42 | ((memcmp (hdr, exp, size) == 0 \ |
43 | || memcmp (hdr, expected2, size) == 0 \ | |
44 | || memcmp (hdr, expected3, size) == 0) \ | |
45 | && VALID_FLOAT_ABI (ehdr->e_flags)) | |
848fa4a9 | 46 | #define VALID_ELF_OSABI(osabi) (osabi == ELFOSABI_SYSV \ |
c54290cf TS |
47 | || osabi == ELFOSABI_GNU \ |
48 | || osabi == EXTRA_OSABI) | |
848fa4a9 JM |
49 | #define MORE_ELF_HEADER_DATA \ |
50 | static const unsigned char expected2[EI_PAD] = \ | |
51 | { \ | |
52 | [EI_MAG0] = ELFMAG0, \ | |
53 | [EI_MAG1] = ELFMAG1, \ | |
54 | [EI_MAG2] = ELFMAG2, \ | |
55 | [EI_MAG3] = ELFMAG3, \ | |
56 | [EI_CLASS] = ELFW(CLASS), \ | |
57 | [EI_DATA] = byteorder, \ | |
58 | [EI_VERSION] = EV_CURRENT, \ | |
c54290cf | 59 | [EI_OSABI] = ELFOSABI_GNU \ |
848fa4a9 JM |
60 | }; \ |
61 | static const unsigned char expected3[EI_PAD] = \ | |
62 | { \ | |
63 | [EI_MAG0] = ELFMAG0, \ | |
64 | [EI_MAG1] = ELFMAG1, \ | |
65 | [EI_MAG2] = ELFMAG2, \ | |
66 | [EI_MAG3] = ELFMAG3, \ | |
67 | [EI_CLASS] = ELFW(CLASS), \ | |
68 | [EI_DATA] = byteorder, \ | |
69 | [EI_VERSION] = EV_CURRENT, \ | |
70 | [EI_OSABI] = EXTRA_OSABI \ | |
71 | } | |
72 | ||
73 | #endif |