Xv6 with picoc & Linkage editor
v1.0
The project delineate mutual cohesion between c library, linkage editor ( linker), interpreter and operating system by porting the same on xv6 kernel
|
00001 /* 00002 * gelf.h - public header file for libelf. 00003 * Copyright (C) 2000 - 2006 Michael Riepe 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 */ 00019 00020 /* @(#) $Id: gelf.h,v 1.14 2006/04/25 16:26:39 michael Exp $ */ 00021 00022 #ifndef _GELF_H 00023 #define _GELF_H 00024 00025 #if __LIBELF_INTERNAL__ 00026 #include <libelf.h> 00027 #else /* __LIBELF_INTERNAL__ */ 00028 #include <libelf/libelf.h> 00029 #endif /* __LIBELF_INTERNAL__ */ 00030 00031 #if __LIBELF_NEED_LINK_H 00032 #include <link.h> 00033 #endif /* __LIBELF_NEED_LINK_H */ 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif /* __cplusplus */ 00038 00039 #ifndef __P 00040 # if (__STDC__ + 0) || defined(__cplusplus) || defined(_WIN32) 00041 # define __P(args) args 00042 # else /* __STDC__ || defined(__cplusplus) */ 00043 # define __P(args) () 00044 # endif /* __STDC__ || defined(__cplusplus) */ 00045 #endif /* __P */ 00046 00047 #if !__LIBELF64 00048 00049 #error "GElf is not supported on this system." 00050 00051 #else /* __LIBELF64 */ 00052 00053 typedef Elf64_Addr GElf_Addr; 00054 typedef Elf64_Half GElf_Half; 00055 typedef Elf64_Off GElf_Off; 00056 typedef Elf64_Sword GElf_Sword; 00057 typedef Elf64_Word GElf_Word; 00058 typedef Elf64_Sxword GElf_Sxword; 00059 typedef Elf64_Xword GElf_Xword; 00060 00061 typedef Elf64_Ehdr GElf_Ehdr; 00062 typedef Elf64_Phdr GElf_Phdr; 00063 typedef Elf64_Shdr GElf_Shdr; 00064 typedef Elf64_Dyn GElf_Dyn; 00065 typedef Elf64_Rel GElf_Rel; 00066 typedef Elf64_Rela GElf_Rela; 00067 typedef Elf64_Sym GElf_Sym; 00068 00069 /* 00070 * Symbol versioning 00071 */ 00072 #if __LIBELF_SYMBOL_VERSIONS 00073 typedef Elf64_Verdef GElf_Verdef; 00074 typedef Elf64_Verneed GElf_Verneed; 00075 typedef Elf64_Verdaux GElf_Verdaux; 00076 typedef Elf64_Vernaux GElf_Vernaux; 00077 #endif /* __LIBELF_SYMBOL_VERSIONS */ 00078 00079 /* 00080 * These types aren't implemented (yet) 00081 * 00082 typedef Elf64_Move GElf_Move; 00083 typedef Elf64_Syminfo GElf_Syminfo; 00084 */ 00085 00086 /* 00087 * Generic macros 00088 */ 00089 #define GELF_ST_BIND ELF64_ST_BIND 00090 #define GELF_ST_TYPE ELF64_ST_TYPE 00091 #define GELF_ST_INFO ELF64_ST_INFO 00092 00093 #define GELF_R_TYPE ELF64_R_TYPE 00094 #define GELF_R_SYM ELF64_R_SYM 00095 #define GELF_R_INFO ELF64_R_INFO 00096 00097 /* 00098 * Function declarations 00099 */ 00100 extern int gelf_getclass __P((Elf *__elf)); 00101 00102 extern size_t gelf_fsize __P((Elf *__elf, Elf_Type __type, size_t __count, unsigned __ver)); 00103 00104 extern Elf_Data *gelf_xlatetof __P((Elf *__elf, Elf_Data *__dst, const Elf_Data *__src, unsigned __encode)); 00105 extern Elf_Data *gelf_xlatetom __P((Elf *__elf, Elf_Data *__dst, const Elf_Data *__src, unsigned __encode)); 00106 00107 extern GElf_Ehdr *gelf_getehdr __P((Elf *__elf, GElf_Ehdr *__dst)); 00108 extern int gelf_update_ehdr __P((Elf *__elf, GElf_Ehdr *__src)); 00109 extern unsigned long gelf_newehdr __P((Elf *__elf, int __elfclass)); 00110 00111 extern GElf_Phdr *gelf_getphdr __P((Elf *__elf, int ndx, GElf_Phdr *__dst)); 00112 extern int gelf_update_phdr __P((Elf *__elf, int ndx, GElf_Phdr *__src)); 00113 extern unsigned long gelf_newphdr __P((Elf *__elf, size_t __phnum)); 00114 00115 extern GElf_Shdr *gelf_getshdr __P((Elf_Scn *__scn, GElf_Shdr *__dst)); 00116 extern int gelf_update_shdr __P((Elf_Scn *__scn, GElf_Shdr *__src)); 00117 00118 extern GElf_Dyn *gelf_getdyn __P((Elf_Data *__src, int __ndx, GElf_Dyn *__dst)); 00119 extern int gelf_update_dyn __P((Elf_Data *__dst, int __ndx, GElf_Dyn *__src)); 00120 00121 extern GElf_Rel *gelf_getrel __P((Elf_Data *__src, int __ndx, GElf_Rel *__dst)); 00122 extern int gelf_update_rel __P((Elf_Data *__dst, int __ndx, GElf_Rel *__src)); 00123 00124 extern GElf_Rela *gelf_getrela __P((Elf_Data *__src, int __ndx, GElf_Rela *__dst)); 00125 extern int gelf_update_rela __P((Elf_Data *__dst, int __ndx, GElf_Rela *__src)); 00126 00127 extern GElf_Sym *gelf_getsym __P((Elf_Data *__src, int __ndx, GElf_Sym *__dst)); 00128 extern int gelf_update_sym __P((Elf_Data *__dst, int __ndx, GElf_Sym *__src)); 00129 00130 extern long gelf_checksum __P((Elf *__elf)); 00131 00132 /* 00133 * These functions aren't implemented (yet) 00134 * 00135 extern GElf_Move *gelf_getmove __P((Elf_Data *__src, int __ndx, GElf_Move *__src)); 00136 extern int gelf_update_move __P((Elf_Data *__dst, int __ndx, GElf_Move *__src)); 00137 * 00138 extern GElf_Syminfo* gelf_getsyminfo __P((Elf_Data *__src, int __ndx, GElf_Syminfo *__dst)); 00139 extern int gelf_update_syminfo __P((Elf_Data *__dst, int __ndx, GElf_Syminfo *__src)); 00140 */ 00141 00142 /* 00143 * Extensions (not available in other versions of libelf) 00144 */ 00145 extern size_t gelf_msize __P((Elf *__elf, Elf_Type __type, size_t __count, unsigned __ver)); 00146 00147 #endif /* __LIBELF64 */ 00148 00149 #ifdef __cplusplus 00150 } 00151 #endif /* __cplusplus */ 00152 00153 #endif /* _GELF_H */