diff options
Diffstat (limited to 'include/linux/elf.h')
-rw-r--r-- | include/linux/elf.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/include/linux/elf.h b/include/linux/elf.h index 0cc4d55151b7..597858418051 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -50,6 +50,28 @@ typedef __s64 Elf64_Sxword; | |||
50 | 50 | ||
51 | #define PT_GNU_STACK (PT_LOOS + 0x474e551) | 51 | #define PT_GNU_STACK (PT_LOOS + 0x474e551) |
52 | 52 | ||
53 | /* | ||
54 | * Extended Numbering | ||
55 | * | ||
56 | * If the real number of program header table entries is larger than | ||
57 | * or equal to PN_XNUM(0xffff), it is set to sh_info field of the | ||
58 | * section header at index 0, and PN_XNUM is set to e_phnum | ||
59 | * field. Otherwise, the section header at index 0 is zero | ||
60 | * initialized, if it exists. | ||
61 | * | ||
62 | * Specifications are available in: | ||
63 | * | ||
64 | * - Sun microsystems: Linker and Libraries. | ||
65 | * Part No: 817-1984-17, September 2008. | ||
66 | * URL: http://docs.sun.com/app/docs/doc/817-1984 | ||
67 | * | ||
68 | * - System V ABI AMD64 Architecture Processor Supplement | ||
69 | * Draft Version 0.99., | ||
70 | * May 11, 2009. | ||
71 | * URL: http://www.x86-64.org/ | ||
72 | */ | ||
73 | #define PN_XNUM 0xffff | ||
74 | |||
53 | /* These constants define the different elf file types */ | 75 | /* These constants define the different elf file types */ |
54 | #define ET_NONE 0 | 76 | #define ET_NONE 0 |
55 | #define ET_REL 1 | 77 | #define ET_REL 1 |
@@ -286,7 +308,7 @@ typedef struct elf64_phdr { | |||
286 | #define SHN_COMMON 0xfff2 | 308 | #define SHN_COMMON 0xfff2 |
287 | #define SHN_HIRESERVE 0xffff | 309 | #define SHN_HIRESERVE 0xffff |
288 | 310 | ||
289 | typedef struct { | 311 | typedef struct elf32_shdr { |
290 | Elf32_Word sh_name; | 312 | Elf32_Word sh_name; |
291 | Elf32_Word sh_type; | 313 | Elf32_Word sh_type; |
292 | Elf32_Word sh_flags; | 314 | Elf32_Word sh_flags; |
@@ -349,7 +371,11 @@ typedef struct elf64_shdr { | |||
349 | #define ELF_OSABI ELFOSABI_NONE | 371 | #define ELF_OSABI ELFOSABI_NONE |
350 | #endif | 372 | #endif |
351 | 373 | ||
352 | /* Notes used in ET_CORE */ | 374 | /* |
375 | * Notes used in ET_CORE. Architectures export some of the arch register sets | ||
376 | * using the corresponding note types via the PTRACE_GETREGSET and | ||
377 | * PTRACE_SETREGSET requests. | ||
378 | */ | ||
353 | #define NT_PRSTATUS 1 | 379 | #define NT_PRSTATUS 1 |
354 | #define NT_PRFPREG 2 | 380 | #define NT_PRFPREG 2 |
355 | #define NT_PRPSINFO 3 | 381 | #define NT_PRPSINFO 3 |
@@ -361,7 +387,13 @@ typedef struct elf64_shdr { | |||
361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ | 387 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ |
362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 388 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | 389 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ |
390 | #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ | ||
364 | #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ | 391 | #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ |
392 | #define NT_S390_TIMER 0x301 /* s390 timer register */ | ||
393 | #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ | ||
394 | #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ | ||
395 | #define NT_S390_CTRS 0x304 /* s390 control registers */ | ||
396 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | ||
365 | 397 | ||
366 | 398 | ||
367 | /* Note header in a PT_NOTE section */ | 399 | /* Note header in a PT_NOTE section */ |
@@ -384,16 +416,20 @@ typedef struct elf64_note { | |||
384 | extern Elf32_Dyn _DYNAMIC []; | 416 | extern Elf32_Dyn _DYNAMIC []; |
385 | #define elfhdr elf32_hdr | 417 | #define elfhdr elf32_hdr |
386 | #define elf_phdr elf32_phdr | 418 | #define elf_phdr elf32_phdr |
419 | #define elf_shdr elf32_shdr | ||
387 | #define elf_note elf32_note | 420 | #define elf_note elf32_note |
388 | #define elf_addr_t Elf32_Off | 421 | #define elf_addr_t Elf32_Off |
422 | #define Elf_Half Elf32_Half | ||
389 | 423 | ||
390 | #else | 424 | #else |
391 | 425 | ||
392 | extern Elf64_Dyn _DYNAMIC []; | 426 | extern Elf64_Dyn _DYNAMIC []; |
393 | #define elfhdr elf64_hdr | 427 | #define elfhdr elf64_hdr |
394 | #define elf_phdr elf64_phdr | 428 | #define elf_phdr elf64_phdr |
429 | #define elf_shdr elf64_shdr | ||
395 | #define elf_note elf64_note | 430 | #define elf_note elf64_note |
396 | #define elf_addr_t Elf64_Off | 431 | #define elf_addr_t Elf64_Off |
432 | #define Elf_Half Elf64_Half | ||
397 | 433 | ||
398 | #endif | 434 | #endif |
399 | 435 | ||