toolsandutils/e32tools/checklib/object/elf/elf_file_header.h
changeset 0 83f4b4db085c
child 1 d4b442d23379
equal deleted inserted replaced
-1:000000000000 0:83f4b4db085c
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef ELF_FILE_HEADER_H
       
    17 #define ELF_FILE_HEADER_H
       
    18 
       
    19 #include "elftools/inc/elfdefs.h"
       
    20 #include <stdint.h>
       
    21 
       
    22 
       
    23 namespace elf
       
    24 {
       
    25     class File_header
       
    26     {
       
    27     public:
       
    28         File_header(const char*, const char*, bool = 0);
       
    29     public:
       
    30         // e_ident[]
       
    31         // No functions are defined; they shouldn't be needed.
       
    32 
       
    33         // e_type
       
    34         bool is_type_rel() const;
       
    35         bool is_type_exec() const;
       
    36         bool is_type_dyn() const;
       
    37         
       
    38         // e_machine
       
    39         bool is_machine_none() const;
       
    40         bool is_machine_arm() const;
       
    41         bool is_machine_386() const;
       
    42 
       
    43         // e_version
       
    44         // No functions necessary.
       
    45 
       
    46         uint32_t get_entry() const;
       
    47         uint32_t get_phoff() const;
       
    48         uint32_t get_shoff() const;
       
    49         uint32_t get_flags() const;
       
    50         uint16_t get_ehsize() const;
       
    51         uint16_t get_phentsize() const;
       
    52         uint16_t get_phnum() const;
       
    53         uint16_t get_shentsize() const;
       
    54         uint16_t get_shnum() const;
       
    55         uint16_t get_shstrndx() const;
       
    56 
       
    57     private:
       
    58         const Elf32_Ehdr* m_data;
       
    59     };
       
    60 }
       
    61 
       
    62 
       
    63 
       
    64 
       
    65 #endif
       
    66