Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 1 | /* |
| 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 Gupta | 8ccfe66 | 2013-02-27 18:27:13 +0530 | [diff] [blame] | 12 | #include <linux/types.h> |
| 13 | #include <uapi/asm/elf.h> |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 14 | |
Vineet Gupta | 8ccfe66 | 2013-02-27 18:27:13 +0530 | [diff] [blame] | 15 | /* These ELF defines belong to uapi but libc elf.h already defines them */ |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 16 | #define EM_ARCOMPACT 93 |
| 17 | |
Vineet Gupta | 1f6ccff | 2013-05-13 18:30:41 +0530 | [diff] [blame] | 18 | #define EM_ARCV2 195 /* ARCv2 Cores */ |
| 19 | |
| 20 | #define EM_ARC_INUSE (IS_ENABLED(CONFIG_ISA_ARCOMPACT) ? \ |
| 21 | EM_ARCOMPACT : EM_ARCV2) |
| 22 | |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 23 | /* ARC Relocations (kernel Modules only) */ |
| 24 | #define R_ARC_32 0x4 |
| 25 | #define R_ARC_32_ME 0x1B |
Vineet Gupta | 94f4fb0 | 2016-09-12 16:50:50 -0700 | [diff] [blame] | 26 | #define R_ARC_32_PCREL 0x31 |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 27 | |
Vineet Gupta | 8ccfe66 | 2013-02-27 18:27:13 +0530 | [diff] [blame] | 28 | /*to set parameters in the core dumps */ |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 29 | #define ELF_ARCH EM_ARCOMPACT |
| 30 | #define ELF_CLASS ELFCLASS32 |
| 31 | |
| 32 | #ifdef CONFIG_CPU_BIG_ENDIAN |
| 33 | #define ELF_DATA ELFDATA2MSB |
| 34 | #else |
| 35 | #define ELF_DATA ELFDATA2LSB |
| 36 | #endif |
| 37 | |
Vineet Gupta | 8ccfe66 | 2013-02-27 18:27:13 +0530 | [diff] [blame] | 38 | /* |
| 39 | * To ensure that |
| 40 | * -we don't load something for the wrong architecture. |
| 41 | * -The userspace is using the correct syscall ABI |
| 42 | */ |
| 43 | struct elf32_hdr; |
| 44 | extern int elf_check_arch(const struct elf32_hdr *); |
| 45 | #define elf_check_arch elf_check_arch |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 46 | |
| 47 | #define CORE_DUMP_USE_REGSET |
| 48 | |
| 49 | #define ELF_EXEC_PAGESIZE PAGE_SIZE |
| 50 | |
| 51 | /* |
| 52 | * This is the location that an ET_DYN program is loaded if exec'ed. Typical |
| 53 | * use of this is to invoke "./ld.so someprog" to test out a new version of |
| 54 | * the loader. We need to make sure that it is out of the way of the program |
| 55 | * that it will "exec", and that there is sufficient room for the brk. |
| 56 | */ |
Vineet Gupta | 1dec785 | 2016-10-19 14:38:50 -0700 | [diff] [blame] | 57 | #define ELF_ET_DYN_BASE (2UL * TASK_SIZE / 3) |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 58 | |
| 59 | /* |
| 60 | * When the program starts, a1 contains a pointer to a function to be |
| 61 | * registered with atexit, as per the SVR4 ABI. A value of 0 means we |
| 62 | * have no such handler. |
| 63 | */ |
| 64 | #define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0) |
| 65 | |
| 66 | /* |
| 67 | * This yields a mask that user programs can use to figure out what |
| 68 | * instruction set this cpu supports. |
| 69 | */ |
| 70 | #define ELF_HWCAP (0) |
| 71 | |
| 72 | /* |
| 73 | * This yields a string that ld.so will use to load implementation |
| 74 | * specific libraries for optimization. This is more specific in |
| 75 | * intent than poking at uname or /proc/cpuinfo. |
| 76 | */ |
| 77 | #define ELF_PLATFORM (NULL) |
| 78 | |
Vineet Gupta | 3be80aa | 2013-01-18 15:12:17 +0530 | [diff] [blame] | 79 | #endif |