/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)3*/45#ifndef __ASM_ARC_ELF_H6#define __ASM_ARC_ELF_H78#include <linux/types.h>9#include <linux/elf-em.h>10#include <uapi/asm/elf.h>1112#define EM_ARC_INUSE (IS_ENABLED(CONFIG_ISA_ARCOMPACT) ? \13EM_ARCOMPACT : EM_ARCV2)1415/* ARC Relocations (kernel Modules only) */16#define R_ARC_32 0x417#define R_ARC_32_ME 0x1B18#define R_ARC_32_PCREL 0x311920/*to set parameters in the core dumps */21#define ELF_ARCH EM_ARC_INUSE22#define ELF_CLASS ELFCLASS322324#ifdef CONFIG_CPU_BIG_ENDIAN25#define ELF_DATA ELFDATA2MSB26#else27#define ELF_DATA ELFDATA2LSB28#endif2930/*31* To ensure that32* -we don't load something for the wrong architecture.33* -The userspace is using the correct syscall ABI34*/35struct elf32_hdr;36extern int elf_check_arch(const struct elf32_hdr *);37#define elf_check_arch elf_check_arch3839#define CORE_DUMP_USE_REGSET4041#define ELF_EXEC_PAGESIZE PAGE_SIZE4243/*44* This is the location that an ET_DYN program is loaded if exec'ed. Typical45* use of this is to invoke "./ld.so someprog" to test out a new version of46* the loader. We need to make sure that it is out of the way of the program47* that it will "exec", and that there is sufficient room for the brk.48*/49#define ELF_ET_DYN_BASE (2UL * TASK_SIZE / 3)5051/*52* When the program starts, a1 contains a pointer to a function to be53* registered with atexit, as per the SVR4 ABI. A value of 0 means we54* have no such handler.55*/56#define ELF_PLAT_INIT(_r, load_addr) ((_r)->r0 = 0)5758/*59* This yields a mask that user programs can use to figure out what60* instruction set this cpu supports.61*/62#define ELF_HWCAP (0)6364/*65* This yields a string that ld.so will use to load implementation66* specific libraries for optimization. This is more specific in67* intent than poking at uname or /proc/cpuinfo.68*/69#define ELF_PLATFORM (NULL)7071#endif727374