Changeset e16e2ba4 in mainline


Ignore:
Timestamp:
2011-07-23T16:01:35Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
65b4aac1, 8fd04ba9
Parents:
1facf8e
Message:

Eliminate userspace copy of elf.h (ELF format definitions).

Files:
2 added
6 edited

Legend:

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

    r1facf8e re16e2ba4  
    4242 * current ELF version
    4343 */
    44 #define EV_CURRENT  1
     44#define EV_CURRENT      1
    4545
    4646/**
    4747 * ELF types
    4848 */
    49 #define ET_NONE    0       /* No type */
    50 #define ET_REL     1       /* Relocatable file */
    51 #define ET_EXEC    2       /* Executable */
    52 #define ET_DYN     3       /* Shared object */
    53 #define ET_CORE    4       /* Core */
    54 #define ET_LOPROC  0xff00  /* Processor specific */
    55 #define ET_HIPROC  0xffff  /* Processor specific */
     49#define ET_NONE         0       /* No type */
     50#define ET_REL          1       /* Relocatable file */
     51#define ET_EXEC         2       /* Executable */
     52#define ET_DYN          3       /* Shared object */
     53#define ET_CORE         4       /* Core */
     54#define ET_LOPROC       0xff00  /* Processor specific */
     55#define ET_HIPROC       0xffff  /* Processor specific */
    5656
    5757/**
    5858 * ELF machine types
    5959 */
    60 #define EM_NO           0   /* No machine */
    61 #define EM_SPARC        2   /* SPARC */
    62 #define EM_386          3   /* i386 */
    63 #define EM_MIPS         8   /* MIPS RS3000 */
    64 #define EM_MIPS_RS3_LE  10  /* MIPS RS3000 LE */
    65 #define EM_PPC          20  /* PPC32 */
    66 #define EM_PPC64        21  /* PPC64 */
    67 #define EM_ARM          40  /* ARM */
    68 #define EM_SPARCV9      43  /* SPARC64 */
    69 #define EM_IA_64        50  /* IA-64 */
    70 #define EM_X86_64       62  /* AMD64/EMT64 */
     60#define EM_NO           0       /* No machine */
     61#define EM_SPARC        2       /* SPARC */
     62#define EM_386          3       /* i386 */
     63#define EM_MIPS         8       /* MIPS RS3000 */
     64#define EM_MIPS_RS3_LE  10      /* MIPS RS3000 LE */
     65#define EM_PPC          20      /* PPC32 */
     66#define EM_PPC64        21      /* PPC64 */
     67#define EM_ARM          40      /* ARM */
     68#define EM_SPARCV9      43      /* SPARC64 */
     69#define EM_IA_64        50      /* IA-64 */
     70#define EM_X86_64       62      /* AMD64/EMT64 */
    7171
    7272/**
    7373 * ELF identification indexes
    7474 */
    75 #define EI_MAG0        0
    76 #define EI_MAG1        1
    77 #define EI_MAG2        2
    78 #define EI_MAG3        3
    79 #define EI_CLASS       4   /* File class */
    80 #define EI_DATA        5   /* Data encoding */
    81 #define EI_VERSION     6   /* File version */
    82 #define EI_OSABI       7
    83 #define EI_ABIVERSION  8
    84 #define EI_PAD         9   /* Start of padding bytes */
    85 #define EI_NIDENT      16  /* ELF identification table size */
     75#define EI_MAG0         0
     76#define EI_MAG1         1
     77#define EI_MAG2         2
     78#define EI_MAG3         3
     79#define EI_CLASS        4               /* File class */
     80#define EI_DATA         5               /* Data encoding */
     81#define EI_VERSION      6               /* File version */
     82#define EI_OSABI        7
     83#define EI_ABIVERSION   8
     84#define EI_PAD          9               /* Start of padding bytes */
     85#define EI_NIDENT       16              /* ELF identification table size */
    8686
    8787/**
    8888 * ELF magic number
    8989 */
    90 #define ELFMAG0  0x7f
    91 #define ELFMAG1  'E'
    92 #define ELFMAG2  'L'
    93 #define ELFMAG3  'F'
     90#define ELFMAG0         0x7f
     91#define ELFMAG1         'E'
     92#define ELFMAG2         'L'
     93#define ELFMAG3         'F'
    9494
    9595/**
    9696 * ELF file classes
    9797 */
    98 #define ELFCLASSNONE  0
    99 #define ELFCLASS32    1
    100 #define ELFCLASS64    2
     98#define ELFCLASSNONE    0
     99#define ELFCLASS32      1
     100#define ELFCLASS64      2
    101101
    102102/**
    103103 * ELF data encoding types
    104104 */
    105 #define ELFDATANONE  0
    106 #define ELFDATA2LSB  1  /* Least significant byte first (little endian) */
    107 #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
     105#define ELFDATANONE     0
     106#define ELFDATA2LSB     1               /* Least significant byte first (little endian) */
     107#define ELFDATA2MSB     2               /* Most signigicant byte first (big endian) */
    119108
    120109/**
    121110 * ELF section types
    122111 */
    123 #define SHT_NULL      0
    124 #define SHT_PROGBITS  1
    125 #define SHT_SYMTAB    2
    126 #define SHT_STRTAB    3
    127 #define SHT_RELA      4
    128 #define SHT_HASH      5
    129 #define SHT_DYNAMIC   6
    130 #define SHT_NOTE      7
    131 #define SHT_NOBITS    8
    132 #define SHT_REL       9
    133 #define SHT_SHLIB     10
    134 #define SHT_DYNSYM    11
    135 #define SHT_LOOS      0x60000000
    136 #define SHT_HIOS      0x6fffffff
    137 #define SHT_LOPROC    0x70000000
    138 #define SHT_HIPROC    0x7fffffff
    139 #define SHT_LOUSER    0x80000000
    140 #define SHT_HIUSER    0xffffffff
     112#define SHT_NULL                0
     113#define SHT_PROGBITS            1
     114#define SHT_SYMTAB              2
     115#define SHT_STRTAB              3
     116#define SHT_RELA                4
     117#define SHT_HASH                5
     118#define SHT_DYNAMIC             6
     119#define SHT_NOTE                7
     120#define SHT_NOBITS              8
     121#define SHT_REL                 9
     122#define SHT_SHLIB               10
     123#define SHT_DYNSYM              11
     124#define SHT_LOOS                0x60000000
     125#define SHT_HIOS                0x6fffffff
     126#define SHT_LOPROC              0x70000000
     127#define SHT_HIPROC              0x7fffffff
     128#define SHT_LOUSER              0x80000000
     129#define SHT_HIUSER              0xffffffff
    141130
    142131/**
    143132 * ELF section flags
    144133 */
    145 #define SHF_WRITE      0x1
    146 #define SHF_ALLOC      0x2
    147 #define SHF_EXECINSTR  0x4
    148 #define SHF_TLS        0x400
    149 #define SHF_MASKPROC   0xf0000000
     134#define SHF_WRITE               0x1
     135#define SHF_ALLOC               0x2
     136#define SHF_EXECINSTR           0x4
     137#define SHF_TLS                 0x400
     138#define SHF_MASKPROC            0xf0000000
     139
     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))
    150144
    151145/**
    152146 * Symbol binding
    153147 */
    154 #define STB_LOCAL   0
    155 #define STB_GLOBAL  1
    156 #define STB_WEAK    2
    157 #define STB_LOPROC  13
    158 #define STB_HIPROC  15
     148#define STB_LOCAL               0
     149#define STB_GLOBAL              1
     150#define STB_WEAK                2
     151#define STB_LOPROC              13
     152#define STB_HIPROC              15
    159153
    160154/**
    161155 * Symbol types
    162156 */
    163 #define STT_NOTYPE   0
    164 #define STT_OBJECT   1
    165 #define STT_FUNC     2
    166 #define STT_SECTION  3
    167 #define STT_FILE     4
    168 #define STT_LOPROC   13
    169 #define STT_HIPROC   15
     157#define STT_NOTYPE              0
     158#define STT_OBJECT              1
     159#define STT_FUNC                2
     160#define STT_SECTION             3
     161#define STT_FILE                4
     162#define STT_LOPROC              13
     163#define STT_HIPROC              15
    170164
    171165/**
    172166 * Program segment types
    173167 */
    174 #define PT_NULL     0
    175 #define PT_LOAD     1
    176 #define PT_DYNAMIC  2
    177 #define PT_INTERP   3
    178 #define PT_NOTE     4
    179 #define PT_SHLIB    5
    180 #define PT_PHDR     6
    181 #define PT_LOPROC   0x70000000
    182 #define PT_HIPROC   0x7fffffff
     168#define PT_NULL                 0
     169#define PT_LOAD                 1
     170#define PT_DYNAMIC              2
     171#define PT_INTERP               3
     172#define PT_NOTE                 4
     173#define PT_SHLIB                5
     174#define PT_PHDR                 6
     175#define PT_LOPROC               0x70000000
     176#define PT_HIPROC               0x7fffffff
    183177
    184178/**
    185179 * Program segment attributes.
    186180 */
    187 #define PF_X  1
    188 #define PF_W  2
    189 #define PF_R  4
     181#define PF_X    1
     182#define PF_W    2
     183#define PF_R    4
    190184
    191185/**
     
    195189 * ELF object file specifications. They are the only types used
    196190 * in ELF header.
    197  *
    198191 */
    199192typedef uint64_t elf_xword;
     
    207200 *
    208201 * These types are specific for 32-bit format.
    209  *
    210202 */
    211203typedef uint32_t elf32_addr;
     
    216208 *
    217209 * These types are specific for 64-bit format.
    218  *
    219210 */
    220211typedef uint64_t elf64_addr;
     
    238229        elf_half e_shstrndx;
    239230};
    240 
    241231struct elf64_header {
    242232        uint8_t e_ident[EI_NIDENT];
     
    256246};
    257247
    258 /**
     248/*
    259249 * ELF segment header.
    260250 * Segments headers are also known as program headers.
     
    270260        elf_word p_align;
    271261};
    272 
    273262struct elf64_segment_header {
    274263        elf_word p_type;
     
    282271};
    283272
    284 /**
     273/*
    285274 * ELF section header
    286275 */
     
    297286        elf_word sh_entsize;
    298287};
    299 
    300288struct elf64_section_header {
    301289        elf_word sh_name;
     
    311299};
    312300
    313 /**
     301/*
    314302 * ELF symbol table entry
    315303 */
     
    322310        elf_half st_shndx;
    323311};
    324 
    325312struct elf64_symbol {
    326313        elf_word st_name;
     
    332319};
    333320
     321/*
     322 * ELF note segment entry
     323 */
     324struct elf32_note {
     325        elf_word namesz;
     326        elf_word descsz;
     327        elf_word type;
     328};
     329struct elf64_note {
     330        elf_xword namesz;
     331        elf_xword descsz;
     332        elf_xword type;
     333};
     334
    334335#ifdef __32_BITS__
    335336typedef struct elf32_header elf_header_t;
     
    337338typedef struct elf32_section_header elf_section_header_t;
    338339typedef struct elf32_symbol elf_symbol_t;
     340typedef struct elf32_note elf_note_t;
    339341#endif
    340 
    341342#ifdef __64_BITS__
    342343typedef struct elf64_header elf_header_t;
     
    344345typedef struct elf64_section_header elf_section_header_t;
    345346typedef struct elf64_symbol elf_symbol_t;
     347typedef struct elf64_note elf_note_t;
    346348#endif
    347 
    348 extern const char *elf_error(unsigned int rc);
    349349
    350350/** Interpreter string used to recognize the program loader */
  • kernel/generic/include/mm/as.h

    r1facf8e re16e2ba4  
    307307extern mem_backend_t phys_backend;
    308308
    309 /**
    310  * This flags is passed when running the loader, otherwise elf_load()
    311  * would return with a EE_LOADER error code.
    312  *
    313  */
    314 #define ELD_F_NONE    0
    315 #define ELD_F_LOADER  1
    316 
    317 extern unsigned int elf_load(elf_header_t *, as_t *, unsigned int);
    318 
    319309/* Address space area related syscalls. */
    320310extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int);
  • kernel/generic/src/lib/elf.c

    r1facf8e re16e2ba4  
    4747#include <macros.h>
    4848#include <arch.h>
     49
     50#include <lib/elf_load.h>
    4951
    5052static const char *error_codes[] = {
  • kernel/generic/src/proc/program.c

    r1facf8e re16e2ba4  
    4848#include <ipc/ipcrsc.h>
    4949#include <security/cap.h>
    50 #include <lib/elf.h>
     50#include <lib/elf_load.h>
    5151#include <errno.h>
    5252#include <print.h>
  • uspace/lib/c/include/elf/elf.h

    r1facf8e re16e2ba4  
    11/*
    2  * Copyright (c) 2006 Sergey Bondari
     2 * Copyright (c) 2011 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    3636#define LIBC_ELF_H_
    3737
    38 #include <arch/elf.h>
    39 #include <sys/types.h>
    40 
    41 /**
    42  * current ELF version
    43  */
    44 #define EV_CURRENT      1
    45 
    46 /**
    47  * ELF types
    48  */
    49 #define ET_NONE         0       /* No type */
    50 #define ET_REL          1       /* Relocatable file */
    51 #define ET_EXEC         2       /* Executable */
    52 #define ET_DYN          3       /* Shared object */
    53 #define ET_CORE         4       /* Core */
    54 #define ET_LOPROC       0xff00  /* Processor specific */
    55 #define ET_HIPROC       0xffff  /* Processor specific */
    56 
    57 /**
    58  * ELF machine types
    59  */
    60 #define EM_NO           0       /* No machine */
    61 #define EM_SPARC        2       /* SPARC */
    62 #define EM_386          3       /* i386 */
    63 #define EM_MIPS         8       /* MIPS RS3000 */
    64 #define EM_MIPS_RS3_LE  10      /* MIPS RS3000 LE */
    65 #define EM_PPC          20      /* PPC32 */
    66 #define EM_PPC64        21      /* PPC64 */
    67 #define EM_ARM          40      /* ARM */
    68 #define EM_SPARCV9      43      /* SPARC64 */
    69 #define EM_IA_64        50      /* IA-64 */
    70 #define EM_X86_64       62      /* AMD64/EMT64 */
    71 
    72 /**
    73  * ELF identification indexes
    74  */
    75 #define EI_MAG0         0
    76 #define EI_MAG1         1
    77 #define EI_MAG2         2
    78 #define EI_MAG3         3
    79 #define EI_CLASS        4               /* File class */
    80 #define EI_DATA         5               /* Data encoding */
    81 #define EI_VERSION      6               /* File version */
    82 #define EI_OSABI        7
    83 #define EI_ABIVERSION   8
    84 #define EI_PAD          9               /* Start of padding bytes */
    85 #define EI_NIDENT       16              /* ELF identification table size */
    86 
    87 /**
    88  * ELF magic number
    89  */
    90 #define ELFMAG0         0x7f
    91 #define ELFMAG1         'E'
    92 #define ELFMAG2         'L'
    93 #define ELFMAG3         'F'
    94 
    95 /**
    96  * ELF file classes
    97  */
    98 #define ELFCLASSNONE    0
    99 #define ELFCLASS32      1
    100 #define ELFCLASS64      2
    101 
    102 /**
    103  * ELF data encoding types
    104  */
    105 #define ELFDATANONE     0
    106 #define ELFDATA2LSB     1               /* Least significant byte first (little endian) */
    107 #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_IRRECOVERABLE        5
    118 
    119 /**
    120  * ELF section types
    121  */
    122 #define SHT_NULL                0
    123 #define SHT_PROGBITS            1
    124 #define SHT_SYMTAB              2
    125 #define SHT_STRTAB              3
    126 #define SHT_RELA                4
    127 #define SHT_HASH                5
    128 #define SHT_DYNAMIC             6
    129 #define SHT_NOTE                7
    130 #define SHT_NOBITS              8
    131 #define SHT_REL                 9
    132 #define SHT_SHLIB               10
    133 #define SHT_DYNSYM              11
    134 #define SHT_LOOS                0x60000000
    135 #define SHT_HIOS                0x6fffffff
    136 #define SHT_LOPROC              0x70000000
    137 #define SHT_HIPROC              0x7fffffff
    138 #define SHT_LOUSER              0x80000000
    139 #define SHT_HIUSER              0xffffffff
    140 
    141 /**
    142  * ELF section flags
    143  */
    144 #define SHF_WRITE               0x1
    145 #define SHF_ALLOC               0x2
    146 #define SHF_EXECINSTR           0x4
    147 #define SHF_TLS                 0x400
    148 #define SHF_MASKPROC            0xf0000000
    149 
    150 /** Macros for decomposing elf_symbol.st_info into binging and type */
    151 #define ELF_ST_BIND(i)          ((i) >> 4)
    152 #define ELF_ST_TYPE(i)          ((i) & 0x0f)
    153 #define ELF_ST_INFO(b, t)       (((b) << 4) + ((t) & 0x0f))
    154 
    155 /**
    156  * Symbol binding
    157  */
    158 #define STB_LOCAL               0
    159 #define STB_GLOBAL              1
    160 #define STB_WEAK                2
    161 #define STB_LOPROC              13
    162 #define STB_HIPROC              15
    163 
    164 /**
    165  * Symbol types
    166  */
    167 #define STT_NOTYPE              0
    168 #define STT_OBJECT              1
    169 #define STT_FUNC                2
    170 #define STT_SECTION             3
    171 #define STT_FILE                4
    172 #define STT_LOPROC              13
    173 #define STT_HIPROC              15
    174 
    175 /**
    176  * Program segment types
    177  */
    178 #define PT_NULL                 0
    179 #define PT_LOAD                 1
    180 #define PT_DYNAMIC              2
    181 #define PT_INTERP               3
    182 #define PT_NOTE                 4
    183 #define PT_SHLIB                5
    184 #define PT_PHDR                 6
    185 #define PT_LOPROC               0x70000000
    186 #define PT_HIPROC               0x7fffffff
    187 
    188 /**
    189  * Program segment attributes.
    190  */
    191 #define PF_X    1
    192 #define PF_W    2
    193 #define PF_R    4
    194 
    195 /**
    196  * ELF data types
    197  *
    198  * These types are found to be identical in both 32-bit and 64-bit
    199  * ELF object file specifications. They are the only types used
    200  * in ELF header.
    201  */
    202 typedef uint64_t elf_xword;
    203 typedef int64_t elf_sxword;
    204 typedef uint32_t elf_word;
    205 typedef int32_t elf_sword;
    206 typedef uint16_t elf_half;
    207 
    208 /**
    209  * 32-bit ELF data types.
    210  *
    211  * These types are specific for 32-bit format.
    212  */
    213 typedef uint32_t elf32_addr;
    214 typedef uint32_t elf32_off;
    215 
    216 /**
    217  * 64-bit ELF data types.
    218  *
    219  * These types are specific for 64-bit format.
    220  */
    221 typedef uint64_t elf64_addr;
    222 typedef uint64_t elf64_off;
    223 
    224 /** ELF header */
    225 struct elf32_header {
    226         uint8_t e_ident[EI_NIDENT];
    227         elf_half e_type;
    228         elf_half e_machine;
    229         elf_word e_version;
    230         elf32_addr e_entry;
    231         elf32_off e_phoff;
    232         elf32_off e_shoff;
    233         elf_word e_flags;
    234         elf_half e_ehsize;
    235         elf_half e_phentsize;
    236         elf_half e_phnum;
    237         elf_half e_shentsize;
    238         elf_half e_shnum;
    239         elf_half e_shstrndx;
    240 };
    241 struct elf64_header {
    242         uint8_t e_ident[EI_NIDENT];
    243         elf_half e_type;
    244         elf_half e_machine;
    245         elf_word e_version;
    246         elf64_addr e_entry;
    247         elf64_off e_phoff;
    248         elf64_off e_shoff;
    249         elf_word e_flags;
    250         elf_half e_ehsize;
    251         elf_half e_phentsize;
    252         elf_half e_phnum;
    253         elf_half e_shentsize;
    254         elf_half e_shnum;
    255         elf_half e_shstrndx;
    256 };
    257 
    258 /*
    259  * ELF segment header.
    260  * Segments headers are also known as program headers.
    261  */
    262 struct elf32_segment_header {
    263         elf_word p_type;
    264         elf32_off p_offset;
    265         elf32_addr p_vaddr;
    266         elf32_addr p_paddr;
    267         elf_word p_filesz;
    268         elf_word p_memsz;
    269         elf_word p_flags;
    270         elf_word p_align;
    271 };
    272 struct elf64_segment_header {
    273         elf_word p_type;
    274         elf_word p_flags;
    275         elf64_off p_offset;
    276         elf64_addr p_vaddr;
    277         elf64_addr p_paddr;
    278         elf_xword p_filesz;
    279         elf_xword p_memsz;
    280         elf_xword p_align;
    281 };
    282 
    283 /*
    284  * ELF section header
    285  */
    286 struct elf32_section_header {
    287         elf_word sh_name;
    288         elf_word sh_type;
    289         elf_word sh_flags;
    290         elf32_addr sh_addr;
    291         elf32_off sh_offset;
    292         elf_word sh_size;
    293         elf_word sh_link;
    294         elf_word sh_info;
    295         elf_word sh_addralign;
    296         elf_word sh_entsize;
    297 };
    298 struct elf64_section_header {
    299         elf_word sh_name;
    300         elf_word sh_type;
    301         elf_xword sh_flags;
    302         elf64_addr sh_addr;
    303         elf64_off sh_offset;
    304         elf_xword sh_size;
    305         elf_word sh_link;
    306         elf_word sh_info;
    307         elf_xword sh_addralign;
    308         elf_xword sh_entsize;
    309 };
    310 
    311 /*
    312  * ELF symbol table entry
    313  */
    314 struct elf32_symbol {
    315         elf_word st_name;
    316         elf32_addr st_value;
    317         elf_word st_size;
    318         uint8_t st_info;
    319         uint8_t st_other;
    320         elf_half st_shndx;
    321 };
    322 struct elf64_symbol {
    323         elf_word st_name;
    324         uint8_t st_info;
    325         uint8_t st_other;
    326         elf_half st_shndx;
    327         elf64_addr st_value;
    328         elf_xword st_size;
    329 };
    330 
    331 /*
    332  * ELF note segment entry
    333  */
    334 struct elf32_note {
    335         elf_word namesz;
    336         elf_word descsz;
    337         elf_word type;
    338 };
    339 struct elf64_note {
    340         elf_xword namesz;
    341         elf_xword descsz;
    342         elf_xword type;
    343 };
    344 
    345 #ifdef __32_BITS__
    346 typedef struct elf32_header elf_header_t;
    347 typedef struct elf32_segment_header elf_segment_header_t;
    348 typedef struct elf32_section_header elf_section_header_t;
    349 typedef struct elf32_symbol elf_symbol_t;
    350 typedef struct elf32_note elf_note_t;
    351 #endif
    352 #ifdef __64_BITS__
    353 typedef struct elf64_header elf_header_t;
    354 typedef struct elf64_segment_header elf_segment_header_t;
    355 typedef struct elf64_section_header elf_section_header_t;
    356 typedef struct elf64_symbol elf_symbol_t;
    357 typedef struct elf64_note elf_note_t;
    358 #endif
     38#include <kernel/lib/elf.h>
    35939
    36040#endif
  • uspace/lib/c/include/elf/elf_load.h

    r1facf8e re16e2ba4  
    11/*
     2 * Copyright (c) 2006 Sergey Bondari
    23 * Copyright (c) 2008 Jiri Svoboda
    34 * All rights reserved.
     
    4243#include <loader/pcb.h>
    4344
     45/**
     46 * ELF error return codes
     47 */
     48#define EE_OK                   0       /* No error */
     49#define EE_INVALID              1       /* Invalid ELF image */
     50#define EE_MEMORY               2       /* Cannot allocate address space */
     51#define EE_INCOMPATIBLE         3       /* ELF image is not compatible with current architecture */
     52#define EE_UNSUPPORTED          4       /* Non-supported ELF (e.g. dynamic ELFs) */
     53#define EE_LOADER               5       /* The image is actually a program loader. */
     54#define EE_IRRECOVERABLE        6
    4455
    4556typedef enum {
Note: See TracChangeset for help on using the changeset viewer.