Ignore:
Timestamp:
Jul 18, 2017, 12:32:31 PM (7 years ago)
Author:
max@…
Message:

use Elf64 for 64bit architectures (x86_64)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/elf.c

    r204 r227  
    3838// - return false with an error message if illegal header.
    3939///////////////////////////////////////////////////////////////////
    40 static bool_t elf_isValidHeader(Elf32_Ehdr *header)
     40static bool_t elf_isValidHeader(Elf_Ehdr *header)
    4141{
    4242        if((header->e_ident[EI_CLASS] == ELFCLASS32)
     
    9898        }
    9999
    100         Elf32_Ehdr * header = (Elf32_Ehdr *)buffer;
     100        Elf_Ehdr * header = (Elf_Ehdr *)buffer;
    101101
    102102        if( (header->e_ident[EI_MAG0] != ELFMAG0) ||
     
    141141        vseg_t     * vseg;
    142142
    143         Elf32_Phdr * seg_ptr = (Elf32_Phdr *)segs_base;
     143        Elf_Phdr * seg_ptr = (Elf_Phdr *)segs_base;
    144144
    145145        // loop on segments
     
    223223{
    224224        kmem_req_t   req;              // kmem request for program header
    225         Elf32_Ehdr   header;           // local buffer for .elf header
     225        Elf_Ehdr     header;           // local buffer for .elf header
    226226        void       * segs_base;        // pointer on buffer for segment descriptors array
    227227        uint32_t     segs_size;        // size of buffer for segment descriptors array
     
    255255        error = elf_header_load( file_xp ,
    256256                                 &header,
    257                                  sizeof(Elf32_Ehdr) );
     257                                 sizeof(Elf_Ehdr) );
    258258        if( error )
    259259        {
     
    273273
    274274        // compute buffer size for segment descriptors array
    275         segs_size = sizeof(Elf32_Phdr) * header.e_phnum;
     275        segs_size = sizeof(Elf_Phdr) * header.e_phnum;
    276276
    277277        // allocate memory for segment descriptors array
Note: See TracChangeset for help on using the changeset viewer.