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

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

Issue 23717023: Android: Add chrome-specific dynamic linker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to fix build. Created 7 years, 3 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 #include <sys/exec_elf.h>
12
13 // ELF is a traits structure used to provide convenient aliases for
14 // 32/64 bit Elf types, depending on the target CPU bitness.
15 #if __SIZEOF_POINTER__ == 4
16 struct ELF {
17 typedef Elf32_Ehdr Ehdr;
18 typedef Elf32_Phdr Phdr;
19 typedef Elf32_Word Word;
20 typedef Elf32_Addr Addr;
21 typedef Elf32_Dyn Dyn;
22 typedef Elf32_Sym Sym;
23 typedef Elf32_Rel Rel;
24 typedef Elf32_auxv_t auxv_t;
25 };
26 #elif __SIZEOF_POINTER__ == 8
27 struct ELF {
28 typedef Elf64_Ehdr Ehdr;
29 typedef Elf64_Phdr Phdr;
30 typedef Elf64_Word Word;
31 typedef Elf64_Addr Addr;
32 typedef Elf64_Dyn Dyn;
33 typedef Elf64_Sym Sym;
34 typedef Elf64_Rel Rel;
35 typedef Elf64_auxv_t auxv_t;
36 };
37 #else
38 #error "Unsupported target CPU bitness"
39 #endif
40
41 #ifdef __arm__
42 #define ELF_MACHINE EM_ARM
43 #elif defined(__i386__)
44 #define ELF_MACHINE EM_386
45 #elif defined(__mips__)
46 #define ELF_MACHINE EM_MIPS
47 #else
48 #error "Unsupported target CPU architecture"
49 #endif
50
51 #endif // _ELF_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698