Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/lib/elf.h

    ra8bb38c r666f492  
    106106#define ELFDATA2LSB  1  /* Least significant byte first (little endian) */
    107107#define ELFDATA2MSB  2  /* Most signigicant byte first (big endian) */
     108
     109/**
     110 * ELF error return codes
     111 */
     112#define EE_OK             0  /* No error */
     113#define EE_INVALID        1  /* Invalid ELF image */
     114#define EE_MEMORY         2  /* Cannot allocate address space */
     115#define EE_INCOMPATIBLE   3  /* ELF image is not compatible with current architecture */
     116#define EE_UNSUPPORTED    4  /* Non-supported ELF (e.g. dynamic ELFs) */
     117#define EE_LOADER         5  /* The image is actually a program loader */
     118#define EE_IRRECOVERABLE  6
    108119
    109120/**
     
    138149#define SHF_MASKPROC   0xf0000000
    139150
    140 /** Macros for decomposing elf_symbol.st_info into binging and type */
    141 #define ELF_ST_BIND(i)     ((i) >> 4)
    142 #define ELF_ST_TYPE(i)     ((i) & 0x0f)
    143 #define ELF_ST_INFO(b, t)  (((b) << 4) + ((t) & 0x0f))
    144 
    145151/**
    146152 * Symbol binding
     
    189195 * ELF object file specifications. They are the only types used
    190196 * in ELF header.
     197 *
    191198 */
    192199typedef uint64_t elf_xword;
     
    200207 *
    201208 * These types are specific for 32-bit format.
     209 *
    202210 */
    203211typedef uint32_t elf32_addr;
     
    208216 *
    209217 * These types are specific for 64-bit format.
     218 *
    210219 */
    211220typedef uint64_t elf64_addr;
     
    323332};
    324333
    325 /*
    326  * ELF note segment entry
    327  */
    328 struct elf32_note {
    329         elf_word namesz;
    330         elf_word descsz;
    331         elf_word type;
    332 };
    333 
    334 /*
    335  * NOTE: namesz, descsz and type should be 64-bits wide (elf_xword)
    336  * per the 64-bit ELF spec. The Linux kernel however screws up and
    337  * defines them as Elf64_Word, which is 32-bits wide(!). We are trying
    338  * to make our core files compatible with Linux GDB target so we copy
    339  * the blunder here.
    340  */
    341 struct elf64_note {
    342         elf_word namesz;
    343         elf_word descsz;
    344         elf_word type;
    345 };
    346 
    347334#ifdef __32_BITS__
    348335typedef struct elf32_header elf_header_t;
     
    350337typedef struct elf32_section_header elf_section_header_t;
    351338typedef struct elf32_symbol elf_symbol_t;
    352 typedef struct elf32_note elf_note_t;
    353339#endif
    354340
     
    358344typedef struct elf64_section_header elf_section_header_t;
    359345typedef struct elf64_symbol elf_symbol_t;
    360 typedef struct elf64_note elf_note_t;
    361346#endif
     347
     348extern const char *elf_error(unsigned int rc);
    362349
    363350/** Interpreter string used to recognize the program loader */
Note: See TracChangeset for help on using the changeset viewer.