2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
9 #ifndef __ASM_ARC_ELF_H
10 #define __ASM_ARC_ELF_H
12 #include <asm/ptrace.h>
14 #define EM_ARCOMPACT 93
16 /* Machine specific ELF Hdr flags */
17 #define EF_ARC_OSABI_MSK 0x00000f00
18 #define EF_ARC_OSABI_ORIG 0x00000000 /* MUST be zero for back-compat */
19 #define EF_ARC_OSABI_CURRENT 0x00000300 /* v3 (no legacy syscalls) */
21 /* ARC Relocations (kernel Modules only) */
23 #define R_ARC_32_ME 0x1B
24 #define R_ARC_S25H_PCREL 0x10
25 #define R_ARC_S25W_PCREL 0x11
27 typedef unsigned long elf_greg_t;
28 typedef unsigned long elf_fpregset_t;
30 #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
31 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
35 * -we don't load something for the wrong architecture.
36 * -The userspace is using the correct syscall ABI
39 extern int elf_check_arch(const struct elf32_hdr *);
40 #define elf_check_arch elf_check_arch
43 * These are used to set parameters in the core dumps.
45 #define ELF_ARCH EM_ARCOMPACT
46 #define ELF_CLASS ELFCLASS32
48 #ifdef CONFIG_CPU_BIG_ENDIAN
49 #define ELF_DATA ELFDATA2MSB
51 #define ELF_DATA ELFDATA2LSB
56 #define CORE_DUMP_USE_REGSET
58 #define ELF_EXEC_PAGESIZE PAGE_SIZE
61 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
62 * use of this is to invoke "./ld.so someprog" to test out a new version of
63 * the loader. We need to make sure that it is out of the way of the program
64 * that it will "exec", and that there is sufficient room for the brk.
66 #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
69 * When the program starts, a1 contains a pointer to a function to be
70 * registered with atexit, as per the SVR4 ABI. A value of 0 means we
71 * have no such handler.
73 #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
76 * This yields a mask that user programs can use to figure out what
77 * instruction set this cpu supports.
82 * This yields a string that ld.so will use to load implementation
83 * specific libraries for optimization. This is more specific in
84 * intent than poking at uname or /proc/cpuinfo.
86 #define ELF_PLATFORM (NULL)
88 #define SET_PERSONALITY(ex) \
89 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
91 #endif /* __KERNEL__ */