X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=inline;f=Kernel%2Fbin%2Felf.h;h=13724eb3b4b8803fde748506dc2531b41339e466;hb=26e66aa0a682e2f1a5d9328b6037b5779310f8f3;hp=a2ba3945f6992b7eee204f7747271d16f2d176ef;hpb=1e7db40300bc594cf708bb6082a6e05a268da946;p=tpg%2Facess2.git diff --git a/Kernel/bin/elf.h b/Kernel/bin/elf.h index a2ba3945..13724eb3 100644 --- a/Kernel/bin/elf.h +++ b/Kernel/bin/elf.h @@ -1,16 +1,15 @@ /** - Acess v1 - \file bin_elf.h - \brief ELF Exeutable Loader -*/ + * \file elf.h + * \brief ELF Exeutable Loader + */ #ifndef _BIN_ELF_H #define _BIN_ELF_H /** - \struct elf_header_s - \brief ELF File Header -*/ -struct sElf32_Ehdr { + * \brief ELF File Header + */ +struct sElf32_Ehdr +{ union { char ident[16]; //!< Identifier Bytes struct { @@ -33,20 +32,21 @@ struct sElf32_Ehdr { Uint16 shentsize; //!< Section Header Entry Size Uint16 shentcount; //!< Section Header Entry Count Uint16 shstrindex; //!< Section Header String Table Index -}; +} __attribute__ ((packed)); /** - \name Executable Types - \{ -*/ -#define ET_NONE 0 //!< NULL Type -#define ET_REL 1 //!< Relocatable (Object) -#define ET_EXEC 2 //!< Executable -#define ET_DYN 3 //!< Dynamic Library -#define ET_CORE 4 //!< Core? -#define ET_LOPROC 0xFF00 //!< Low Impl Defined -#define ET_HIPROC 0xFFFF //!< High Impl Defined -//! \} + * \brief Executable Types + */ +enum eElf32_ExecTypes +{ + ET_NONE = 0, //!< NULL Type + ET_REL = 1, //!< Relocatable (Object) + ET_EXEC = 2, //!< Executable + ET_DYN = 3, //!< Dynamic Library + ET_CORE = 4, //!< Core? + ET_LOPROC = 0xFF00, //!< Low Impl Defined + ET_HIPROC = 0xFFFF //!< High Impl Defined +}; /** \name Section IDs @@ -101,7 +101,7 @@ struct sElf32_Shent { Uint32 info; Uint32 addralign; Uint32 entsize; -}; //sizeof = 40 +} __attribute__ ((packed)); //sizeof = 40 struct elf_sym_s { union { @@ -113,7 +113,7 @@ struct elf_sym_s { Uint8 info; Uint8 other; Uint16 shndx; -}; +} __attribute__ ((packed)); #define STN_UNDEF 0 // Undefined Symbol enum { @@ -130,25 +130,25 @@ enum { struct sElf32_Phdr { Uint32 Type; - Uint Offset; - Uint VAddr; - Uint PAddr; + Uint32 Offset; + Uint32 VAddr; + Uint32 PAddr; Uint32 FileSize; Uint32 MemSize; Uint32 Flags; Uint32 Align; -}; +} __attribute__ ((packed)); struct elf32_rel_s { Uint32 r_offset; Uint32 r_info; -}; +} __attribute__ ((packed)); struct elf32_rela_s { Uint32 r_offset; Uint32 r_info; Sint32 r_addend; -}; +} __attribute__ ((packed)); enum { R_386_NONE = 0, // none @@ -172,7 +172,7 @@ enum { struct elf32_dyn_s { Uint32 d_tag; Uint32 d_val; //Also d_ptr -}; +} __attribute__ ((packed)); enum { DT_NULL, //!< Marks End of list