Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASMARM_ELF_H |
| 2 | #define __ASMARM_ELF_H |
| 3 | |
| 4 | /* |
| 5 | * ELF register definitions.. |
| 6 | */ |
| 7 | |
| 8 | #include <asm/ptrace.h> |
| 9 | #include <asm/procinfo.h> |
| 10 | |
| 11 | //FIXME - is it always 32K ? |
| 12 | |
| 13 | #define ELF_EXEC_PAGESIZE 32768 |
| 14 | #define SET_PERSONALITY(ex,ibcs2) set_personality(PER_LINUX) |
| 15 | |
| 16 | typedef unsigned long elf_greg_t; |
| 17 | typedef unsigned long elf_freg_t[3]; |
| 18 | |
| 19 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) |
| 20 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
| 21 | |
| 22 | typedef struct { void *null; } elf_fpregset_t; |
| 23 | |
| 24 | /* |
| 25 | * This is used to ensure we don't load something for the wrong architecture. |
| 26 | * We can only execute 26-bit code. |
| 27 | */ |
| 28 | |
| 29 | #define EM_ARM 40 |
| 30 | #define EF_ARM_APCS26 0x08 |
| 31 | |
| 32 | //#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && ((x)->e_flags & EF_ARM_APCS26) ) FIXME!!!!! - this looks OK, but the flags seem to be wrong. |
| 33 | #define elf_check_arch(x) (1) |
| 34 | |
| 35 | /* |
| 36 | * These are used to set parameters in the core dumps. |
| 37 | */ |
| 38 | #define ELF_CLASS ELFCLASS32 |
Mike Frysinger | 718a30a | 2005-06-03 20:52:26 +0100 | [diff] [blame] | 39 | #define ELF_DATA ELFDATA2LSB |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #define ELF_ARCH EM_ARM |
| 41 | |
| 42 | #define USE_ELF_CORE_DUMP |
| 43 | |
| 44 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical |
| 45 | use of this is to invoke "./ld.so someprog" to test out a new version of |
| 46 | the loader. We need to make sure that it is out of the way of the program |
| 47 | that it will "exec", and that there is sufficient room for the brk. */ |
| 48 | |
| 49 | #define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3) |
| 50 | |
| 51 | /* When the program starts, a1 contains a pointer to a function to be |
| 52 | registered with atexit, as per the SVR4 ABI. A value of 0 means we |
| 53 | have no such handler. */ |
| 54 | #define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0 |
| 55 | |
| 56 | /* This yields a mask that user programs can use to figure out what |
| 57 | instruction set this cpu supports. */ |
| 58 | |
| 59 | extern unsigned int elf_hwcap; |
| 60 | #define ELF_HWCAP (elf_hwcap) |
| 61 | |
| 62 | /* This yields a string that ld.so will use to load implementation |
| 63 | specific libraries for optimization. This is more specific in |
| 64 | intent than poking at uname or /proc/cpuinfo. */ |
| 65 | |
| 66 | /* For now we just provide a fairly general string that describes the |
| 67 | processor family. This could be made more specific later if someone |
| 68 | implemented optimisations that require it. 26-bit CPUs give you |
| 69 | "v1l" for ARM2 (no SWP) and "v2l" for anything else (ARM1 isn't |
| 70 | supported). |
| 71 | */ |
| 72 | |
| 73 | #define ELF_PLATFORM_SIZE 8 |
| 74 | extern char elf_platform[]; |
| 75 | #define ELF_PLATFORM (elf_platform) |
| 76 | |
| 77 | #endif |