OLD | NEW |
1 // Copyright 2005 Google Inc. All Rights Reserved. | 1 // Copyright 2005 Google Inc. All Rights Reserved. |
2 // Author: chatham@google.com (Andrew Chatham) | 2 // Author: chatham@google.com (Andrew Chatham) |
3 // Author: satorux@google.com (Satoru Takabayashi) | 3 // Author: satorux@google.com (Satoru Takabayashi) |
4 // | 4 // |
5 // Code for reading in ELF files. | 5 // Code for reading in ELF files. |
6 // | 6 // |
7 // For information on the ELF format, see | 7 // For information on the ELF format, see |
8 // http://www.x86.org/ftp/manuals/tools/elf.pdf | 8 // http://www.x86.org/ftp/manuals/tools/elf.pdf |
9 // | 9 // |
10 // I also liked: | 10 // I also liked: |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #ifndef _GNU_SOURCE | 29 #ifndef _GNU_SOURCE |
30 #define _GNU_SOURCE // needed for pread() | 30 #define _GNU_SOURCE // needed for pread() |
31 #endif | 31 #endif |
32 | 32 |
33 #include <sys/types.h> | 33 #include <sys/types.h> |
34 #include <sys/stat.h> | 34 #include <sys/stat.h> |
35 #include <sys/mman.h> | 35 #include <sys/mman.h> |
36 #include <unistd.h> | 36 #include <unistd.h> |
37 #include <fcntl.h> | 37 #include <fcntl.h> |
38 #include <elf.h> | |
39 #include <string.h> | 38 #include <string.h> |
40 | 39 |
41 #include <algorithm> | 40 #include <algorithm> |
42 #include <map> | 41 #include <map> |
43 #include <string> | 42 #include <string> |
44 #include <vector> | 43 #include <vector> |
45 #include "zlib.h" | 44 #include "zlib.h" |
46 | 45 |
| 46 #include "common/android/include/elf.h" |
47 #include "elf_reader.h" | 47 #include "elf_reader.h" |
48 //#include "using_std_string.h" | 48 //#include "using_std_string.h" |
49 // EM_AARCH64 is not defined by elf.h of GRTE v3 on x86. | 49 // EM_AARCH64 is not defined by elf.h of GRTE v3 on x86. |
50 // TODO(dougkwan): Remove this when v17 is retired. | 50 // TODO(dougkwan): Remove this when v17 is retired. |
51 #if !defined(EM_AARCH64) | 51 #if !defined(EM_AARCH64) |
52 #define EM_AARCH64 183 /* ARM AARCH64 */ | 52 #define EM_AARCH64 183 /* ARM AARCH64 */ |
53 #endif | 53 #endif |
54 | 54 |
55 // Map Linux macros to their Apple equivalents. | 55 // Map Linux macros to their Apple equivalents. |
56 #if __APPLE__ | 56 #if __APPLE__ |
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 } | 1262 } |
1263 | 1263 |
1264 bool ElfReader::IsNonStrippedELFBinary(const string &path) { | 1264 bool ElfReader::IsNonStrippedELFBinary(const string &path) { |
1265 return IsNonStrippedELFBinaryHelper(path, false); | 1265 return IsNonStrippedELFBinaryHelper(path, false); |
1266 } | 1266 } |
1267 | 1267 |
1268 bool ElfReader::IsNonDebugStrippedELFBinary(const string &path) { | 1268 bool ElfReader::IsNonDebugStrippedELFBinary(const string &path) { |
1269 return IsNonStrippedELFBinaryHelper(path, true); | 1269 return IsNonStrippedELFBinaryHelper(path, true); |
1270 } | 1270 } |
1271 } // namespace dwarf2reader | 1271 } // namespace dwarf2reader |
OLD | NEW |