OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/nacl/loader/nonsfi/elf_loader.h" | 5 #include "components/nacl/loader/nonsfi/elf_loader.h" |
6 | 6 |
7 #include <elf.h> | 7 #include <elf.h> |
8 #include <link.h> | 8 #include <link.h> |
9 | 9 |
10 #include <cstring> | 10 #include <cstring> |
11 #include <string> | 11 #include <string> |
12 #include <sys/mman.h> | 12 #include <sys/mman.h> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "native_client/src/include/portability.h" | 16 #include "native_client/src/include/portability.h" |
17 #include "native_client/src/shared/platform/nacl_host_desc.h" | |
18 #include "native_client/src/trusted/desc/nacl_desc_base.h" | 17 #include "native_client/src/trusted/desc/nacl_desc_base.h" |
19 #include "native_client/src/trusted/desc/nacl_desc_effector_trusted_mem.h" | 18 #include "native_client/src/trusted/desc/nacl_desc_effector_trusted_mem.h" |
20 #include "native_client/src/trusted/service_runtime/include/bits/mman.h" | 19 #include "native_client/src/trusted/service_runtime/include/bits/mman.h" |
21 | 20 |
22 // Extracted from native_client/src/trusted/service_runtime/nacl_config.h. | 21 // Extracted from native_client/src/trusted/service_runtime/nacl_config.h. |
23 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 | 22 #if NACL_ARCH(NACL_BUILD_ARCH) == NACL_x86 |
24 # if NACL_BUILD_SUBARCH == 64 | 23 # if NACL_BUILD_SUBARCH == 64 |
25 # define NACL_ELF_E_MACHINE EM_X86_64 | 24 # define NACL_ELF_E_MACHINE EM_X86_64 |
26 # elif NACL_BUILD_SUBARCH == 32 | 25 # elif NACL_BUILD_SUBARCH == 32 |
27 # define NACL_ELF_E_MACHINE EM_386 | 26 # define NACL_ELF_E_MACHINE EM_386 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 if (error != LOAD_OK) { | 326 if (error != LOAD_OK) { |
328 LOG(ERROR) << "ElfImage::Load: Failed to load segments"; | 327 LOG(ERROR) << "ElfImage::Load: Failed to load segments"; |
329 return error; | 328 return error; |
330 } | 329 } |
331 | 330 |
332 return LOAD_OK; | 331 return LOAD_OK; |
333 } | 332 } |
334 | 333 |
335 } // namespace nonsfi | 334 } // namespace nonsfi |
336 } // namespace nacl | 335 } // namespace nacl |
OLD | NEW |