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