| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_ELFGEN_H_ | 5 #ifndef VM_ELFGEN_H_ |
| 6 #define VM_ELFGEN_H_ | 6 #define VM_ELFGEN_H_ |
| 7 | 7 |
| 8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 WriteByte(&header_, 0); // EI_PAD | 396 WriteByte(&header_, 0); // EI_PAD |
| 397 WriteInt(&header_, 0); // EI_PAD | 397 WriteInt(&header_, 0); // EI_PAD |
| 398 WriteInt(&header_, 0); // EI_PAD | 398 WriteInt(&header_, 0); // EI_PAD |
| 399 WriteShort(&header_, kET_DYN); // e_type, fake a shared object. | 399 WriteShort(&header_, kET_DYN); // e_type, fake a shared object. |
| 400 #if defined(TARGET_ARCH_IA32) | 400 #if defined(TARGET_ARCH_IA32) |
| 401 WriteShort(&header_, kEM_386); // e_machine | 401 WriteShort(&header_, kEM_386); // e_machine |
| 402 #elif defined(TARGET_ARCH_X64) | 402 #elif defined(TARGET_ARCH_X64) |
| 403 WriteShort(&header_, kEM_X86_64); // e_machine | 403 WriteShort(&header_, kEM_X86_64); // e_machine |
| 404 #elif defined(TARGET_ARCH_ARM) | 404 #elif defined(TARGET_ARCH_ARM) |
| 405 WriteShort(&header_, kEM_ARM); // e_machine | 405 WriteShort(&header_, kEM_ARM); // e_machine |
| 406 #elif defined(TARGET_ARCH_ARM64) |
| 407 // TODO(zra): Find the right ARM64 constant. |
| 408 WriteShort(&header_, kEM_ARM); // e_machine |
| 406 #elif defined(TARGET_ARCH_MIPS) | 409 #elif defined(TARGET_ARCH_MIPS) |
| 407 WriteShort(&header_, kEM_MIPS); // e_machine | 410 WriteShort(&header_, kEM_MIPS); // e_machine |
| 408 #else | 411 #else |
| 409 #error Unknown architecture. | 412 #error Unknown architecture. |
| 410 #endif | 413 #endif |
| 411 WriteInt(&header_, kEV_CURRENT); // e_version | 414 WriteInt(&header_, kEV_CURRENT); // e_version |
| 412 WriteWord(&header_, 0); // e_entry: none | 415 WriteWord(&header_, 0); // e_entry: none |
| 413 WriteWord(&header_, 0); // e_phoff: no program header table. | 416 WriteWord(&header_, 0); // e_phoff: no program header table. |
| 414 WriteWord(&header_, shoff); // e_shoff: section header table offset. | 417 WriteWord(&header_, shoff); // e_shoff: section header table offset. |
| 415 WriteInt(&header_, 0); // e_flags: no flags. | 418 WriteInt(&header_, 0); // e_flags: no flags. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 ASSERT(offset == shoff); | 499 ASSERT(offset == shoff); |
| 497 offset += (*writer)(handle, sheaders_); | 500 offset += (*writer)(handle, sheaders_); |
| 498 ASSERT(offset == shoff + kNumSections * kSectionHeaderEntrySize); | 501 ASSERT(offset == shoff + kNumSections * kSectionHeaderEntrySize); |
| 499 | 502 |
| 500 return true; | 503 return true; |
| 501 } | 504 } |
| 502 | 505 |
| 503 } // namespace dart | 506 } // namespace dart |
| 504 | 507 |
| 505 #endif // VM_ELFGEN_H_ | 508 #endif // VM_ELFGEN_H_ |
| OLD | NEW |