Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: third_party/android_crazy_linker/src/src/elf_traits.h

Issue 322433006: Fork of the Android NDK crazy linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a required license header to a cpp module, missing in the original. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef _ELF_TRAITS_H_
6 #define _ELF_TRAITS_H_
7
8 // NOTE: <stdint.h> is required here before <elf.h>. This is a NDK header bug.
9 #include <stdint.h>
10 #include <elf.h>
11
12 // ELF is a traits structure used to provide convenient aliases for
13 // 32/64 bit Elf types, depending on the target CPU bitness.
14 #if __SIZEOF_POINTER__ == 4
15 struct ELF {
16 typedef Elf32_Ehdr Ehdr;
17 typedef Elf32_Phdr Phdr;
18 typedef Elf32_Word Word;
19 typedef Elf32_Addr Addr;
20 typedef Elf32_Dyn Dyn;
21 typedef Elf32_Sym Sym;
22 typedef Elf32_Rel Rel;
23 typedef Elf32_auxv_t auxv_t;
24
25 enum { kElfClass = ELFCLASS32 };
26 enum { kElfBits = 32 };
27 };
28 #elif __SIZEOF_POINTER__ == 8
29 struct ELF {
30 typedef Elf64_Ehdr Ehdr;
31 typedef Elf64_Phdr Phdr;
32 typedef Elf64_Word Word;
33 typedef Elf64_Addr Addr;
34 typedef Elf64_Dyn Dyn;
35 typedef Elf64_Sym Sym;
36 typedef Elf64_Rel Rel;
37 typedef Elf64_auxv_t auxv_t;
38
39 enum { kElfClass = ELFCLASS64 };
40 enum { kElfBits = 64 };
41 };
42 #else
43 #error "Unsupported target CPU bitness"
44 #endif
45
46 #ifdef __arm__
47 #define ELF_MACHINE EM_ARM
48 #elif defined(__i386__)
49 #define ELF_MACHINE EM_386
50 #elif defined(__mips__)
51 #define ELF_MACHINE EM_MIPS
52 #else
53 #error "Unsupported target CPU architecture"
54 #endif
55
56 #endif // _ELF_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698