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_V2 0x00000200
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;
31 /* core dump regs is in the order pt_regs, callee_regs, stop_pc (for gdb) */
32 #define ELF_NGREG ((sizeof(struct pt_regs) + sizeof(struct callee_regs) \
33 + sizeof(unsigned long)) / sizeof(elf_greg_t))
35 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
39 * -we don't load something for the wrong architecture.
40 * -The userspace is using the correct syscall ABI
43 extern int elf_check_arch(const struct elf32_hdr *);
44 #define elf_check_arch elf_check_arch
47 * These are used to set parameters in the core dumps.
49 #define ELF_ARCH EM_ARCOMPACT
50 #define ELF_CLASS ELFCLASS32
52 #ifdef CONFIG_CPU_BIG_ENDIAN
53 #define ELF_DATA ELFDATA2MSB
55 #define ELF_DATA ELFDATA2LSB
60 #define CORE_DUMP_USE_REGSET
62 #define ELF_EXEC_PAGESIZE PAGE_SIZE
65 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
66 * use of this is to invoke "./ld.so someprog" to test out a new version of
67 * the loader. We need to make sure that it is out of the way of the program
68 * that it will "exec", and that there is sufficient room for the brk.
70 #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
73 * When the program starts, a1 contains a pointer to a function to be
74 * registered with atexit, as per the SVR4 ABI. A value of 0 means we
75 * have no such handler.
77 #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
80 * This yields a mask that user programs can use to figure out what
81 * instruction set this cpu supports.
86 * This yields a string that ld.so will use to load implementation
87 * specific libraries for optimization. This is more specific in
88 * intent than poking at uname or /proc/cpuinfo.
90 #define ELF_PLATFORM (NULL)
92 #define SET_PERSONALITY(ex) \
93 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
95 #endif /* __KERNEL__ */