OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008, Google Inc. | 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. |
3 * All rights reserved. | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * | 4 * found in the LICENSE file. |
5 * Redistribution and use in source and binary forms, with or without | |
6 * modification, are permitted provided that the following conditions are | |
7 * met: | |
8 * | |
9 * * Redistributions of source code must retain the above copyright | |
10 * notice, this list of conditions and the following disclaimer. | |
11 * * Redistributions in binary form must reproduce the above | |
12 * copyright notice, this list of conditions and the following disclaimer | |
13 * in the documentation and/or other materials provided with the | |
14 * distribution. | |
15 * * Neither the name of Google Inc. nor the names of its | |
16 * contributors may be used to endorse or promote products derived from | |
17 * this software without specific prior written permission. | |
18 * | |
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 */ | 5 */ |
31 | 6 |
32 | 7 |
33 /* @file | 8 /* @file |
34 * | 9 * |
35 * Defines common constants used in ELF files, used by elf32.h, elf64.h | 10 * Defines common constants used in ELF files, used by elf32.h, elf64.h |
36 * and elf.h | 11 * and elf.h |
37 * | 12 * |
38 * (Re)Created from the ELF specification at | 13 * (Re)Created from the ELF specification at |
39 * http://x86.ddj.com/ftp/manuals/tools/elf.pdf which is referenced | 14 * http://x86.ddj.com/ftp/manuals/tools/elf.pdf which is referenced |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 #define PT_INTERP 3 /* Program interpreter path name */ | 94 #define PT_INTERP 3 /* Program interpreter path name */ |
120 #define PT_NOTE 4 /* Note section */ | 95 #define PT_NOTE 4 /* Note section */ |
121 #define PT_SHLIB 5 /* Reserved */ | 96 #define PT_SHLIB 5 /* Reserved */ |
122 #define PT_PHDR 6 /* Program header table */ | 97 #define PT_PHDR 6 /* Program header table */ |
123 #define PT_LOOS 0x60000000 /* Environment-specific low */ | 98 #define PT_LOOS 0x60000000 /* Environment-specific low */ |
124 #define PT_HIOS 0x6fffffff /* Environment-specific high */ | 99 #define PT_HIOS 0x6fffffff /* Environment-specific high */ |
125 #define PT_LOPROC 0x70000000 /* Processor-specific low */ | 100 #define PT_LOPROC 0x70000000 /* Processor-specific low */ |
126 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm | 101 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm |
127 #define PT_ARM_EXIDX 0x70000001 /* Exception unwind tables */ | 102 #define PT_ARM_EXIDX 0x70000001 /* Exception unwind tables */ |
128 #endif | 103 #endif |
| 104 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_mips |
| 105 #define PT_MIPS_REGINFO 0x70000000 /* Register usage, MIPS only, unused */ |
| 106 #endif |
129 #define PT_HIPROC 0x7fffffff /* Processor-specific high */ | 107 #define PT_HIPROC 0x7fffffff /* Processor-specific high */ |
130 /* | 108 /* |
131 * These are from linux elf.h, for code usage | 109 * These are from linux elf.h, for code usage |
132 * compatibility. | 110 * compatibility. |
133 */ | 111 */ |
134 #define PT_TLS 7 | 112 #define PT_TLS 7 |
135 #define PT_GNU_STACK 0x6474e551 | 113 #define PT_GNU_STACK 0x6474e551 |
136 #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ | 114 #define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ |
137 #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ | 115 #define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ |
138 | 116 |
139 | 117 |
140 #define PF_X 1 | 118 #define PF_X 1 |
141 #define PF_W 2 | 119 #define PF_W 2 |
142 #define PF_R 4 | 120 #define PF_R 4 |
143 /* | 121 /* |
144 * PF_MASKOS is from linux elf.h, for code usage compatibility | 122 * PF_MASKOS is from linux elf.h, for code usage compatibility |
145 */ | 123 */ |
146 #define PF_MASKOS 0x0ff00000 /* os specific */ | 124 #define PF_MASKOS 0x0ff00000 /* os specific */ |
147 | 125 |
148 #define SHF_WRITE 0x1 /* Has writable data */ | 126 #define SHF_WRITE 0x1 /* Has writable data */ |
149 #define SHF_ALLOC 0x2 /* Allocated in memory image of program */ | 127 #define SHF_ALLOC 0x2 /* Allocated in memory image of program */ |
150 #define SHF_EXECINSTR 0x4 /* Contains executable instructions */ | 128 #define SHF_EXECINSTR 0x4 /* Contains executable instructions */ |
151 #define SHF_MASKOS 0x0f000000 /* Environment-specific use */ | 129 #define SHF_MASKOS 0x0f000000 /* Environment-specific use */ |
152 #define SHF_MASKPROC 0xf0000000 /* Processor-specific use */ | 130 #define SHF_MASKPROC 0xf0000000 /* Processor-specific use */ |
153 | 131 |
154 EXTERN_C_END | 132 EXTERN_C_END |
155 | 133 |
156 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ELF_CONSTANTS_H_ */ | 134 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ELF_CONSTANTS_H_ */ |
OLD | NEW |