blob: f4c8d36ebecbd2dcad76db454edc64686cfae292 [file] [log] [blame]
Vineet Gupta3be80aa2013-01-18 15:12:17 +05301/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
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.
7 */
8
9#ifndef __ASM_ARC_ELF_H
10#define __ASM_ARC_ELF_H
11
Vineet Gupta8ccfe662013-02-27 18:27:13 +053012#include <linux/types.h>
13#include <uapi/asm/elf.h>
Vineet Gupta3be80aa2013-01-18 15:12:17 +053014
Vineet Gupta8ccfe662013-02-27 18:27:13 +053015/* These ELF defines belong to uapi but libc elf.h already defines them */
Vineet Gupta3be80aa2013-01-18 15:12:17 +053016#define EM_ARCOMPACT 93
17
Vineet Gupta3be80aa2013-01-18 15:12:17 +053018/* ARC Relocations (kernel Modules only) */
19#define R_ARC_32 0x4
20#define R_ARC_32_ME 0x1B
21#define R_ARC_S25H_PCREL 0x10
22#define R_ARC_S25W_PCREL 0x11
23
Vineet Gupta8ccfe662013-02-27 18:27:13 +053024/*to set parameters in the core dumps */
Vineet Gupta3be80aa2013-01-18 15:12:17 +053025#define ELF_ARCH EM_ARCOMPACT
26#define ELF_CLASS ELFCLASS32
27
28#ifdef CONFIG_CPU_BIG_ENDIAN
29#define ELF_DATA ELFDATA2MSB
30#else
31#define ELF_DATA ELFDATA2LSB
32#endif
33
Vineet Gupta8ccfe662013-02-27 18:27:13 +053034/*
35 * To ensure that
36 * -we don't load something for the wrong architecture.
37 * -The userspace is using the correct syscall ABI
38 */
39struct elf32_hdr;
40extern int elf_check_arch(const struct elf32_hdr *);
41#define elf_check_arch elf_check_arch
Vineet Gupta3be80aa2013-01-18 15:12:17 +053042
43#define CORE_DUMP_USE_REGSET
44
45#define ELF_EXEC_PAGESIZE PAGE_SIZE
46
47/*
48 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
49 * use of this is to invoke "./ld.so someprog" to test out a new version of
50 * the loader. We need to make sure that it is out of the way of the program
51 * that it will "exec", and that there is sufficient room for the brk.
52 */
53#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
54
55/*
56 * When the program starts, a1 contains a pointer to a function to be
57 * registered with atexit, as per the SVR4 ABI. A value of 0 means we
58 * have no such handler.
59 */
60#define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)
61
62/*
63 * This yields a mask that user programs can use to figure out what
64 * instruction set this cpu supports.
65 */
66#define ELF_HWCAP (0)
67
68/*
69 * This yields a string that ld.so will use to load implementation
70 * specific libraries for optimization. This is more specific in
71 * intent than poking at uname or /proc/cpuinfo.
72 */
73#define ELF_PLATFORM (NULL)
74
75#define SET_PERSONALITY(ex) \
76 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
77
Vineet Gupta3be80aa2013-01-18 15:12:17 +053078#endif