1*7304104dSAndroid Build Coastguard Worker /* This file defines generic ELF types, structures, and macros. 2*7304104dSAndroid Build Coastguard Worker Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2015 Red Hat, Inc. 3*7304104dSAndroid Build Coastguard Worker This file is part of elfutils. 4*7304104dSAndroid Build Coastguard Worker 5*7304104dSAndroid Build Coastguard Worker This file is free software; you can redistribute it and/or modify 6*7304104dSAndroid Build Coastguard Worker it under the terms of either 7*7304104dSAndroid Build Coastguard Worker 8*7304104dSAndroid Build Coastguard Worker * the GNU Lesser General Public License as published by the Free 9*7304104dSAndroid Build Coastguard Worker Software Foundation; either version 3 of the License, or (at 10*7304104dSAndroid Build Coastguard Worker your option) any later version 11*7304104dSAndroid Build Coastguard Worker 12*7304104dSAndroid Build Coastguard Worker or 13*7304104dSAndroid Build Coastguard Worker 14*7304104dSAndroid Build Coastguard Worker * the GNU General Public License as published by the Free 15*7304104dSAndroid Build Coastguard Worker Software Foundation; either version 2 of the License, or (at 16*7304104dSAndroid Build Coastguard Worker your option) any later version 17*7304104dSAndroid Build Coastguard Worker 18*7304104dSAndroid Build Coastguard Worker or both in parallel, as here. 19*7304104dSAndroid Build Coastguard Worker 20*7304104dSAndroid Build Coastguard Worker elfutils is distributed in the hope that it will be useful, but 21*7304104dSAndroid Build Coastguard Worker WITHOUT ANY WARRANTY; without even the implied warranty of 22*7304104dSAndroid Build Coastguard Worker MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 23*7304104dSAndroid Build Coastguard Worker General Public License for more details. 24*7304104dSAndroid Build Coastguard Worker 25*7304104dSAndroid Build Coastguard Worker You should have received copies of the GNU General Public License and 26*7304104dSAndroid Build Coastguard Worker the GNU Lesser General Public License along with this program. If 27*7304104dSAndroid Build Coastguard Worker not, see <http://www.gnu.org/licenses/>. */ 28*7304104dSAndroid Build Coastguard Worker 29*7304104dSAndroid Build Coastguard Worker #ifndef _GELF_H 30*7304104dSAndroid Build Coastguard Worker #define _GELF_H 1 31*7304104dSAndroid Build Coastguard Worker 32*7304104dSAndroid Build Coastguard Worker #include <libelf.h> 33*7304104dSAndroid Build Coastguard Worker 34*7304104dSAndroid Build Coastguard Worker 35*7304104dSAndroid Build Coastguard Worker #ifdef __cplusplus 36*7304104dSAndroid Build Coastguard Worker extern "C" { 37*7304104dSAndroid Build Coastguard Worker #endif 38*7304104dSAndroid Build Coastguard Worker 39*7304104dSAndroid Build Coastguard Worker /* Class independent type definitions. Correctly speaking this is not 40*7304104dSAndroid Build Coastguard Worker true. We assume that 64-bit binaries are the largest class and 41*7304104dSAndroid Build Coastguard Worker therefore all other classes can be represented without loss. */ 42*7304104dSAndroid Build Coastguard Worker 43*7304104dSAndroid Build Coastguard Worker /* Type for a 16-bit quantity. */ 44*7304104dSAndroid Build Coastguard Worker typedef Elf64_Half GElf_Half; 45*7304104dSAndroid Build Coastguard Worker 46*7304104dSAndroid Build Coastguard Worker /* Types for signed and unsigned 32-bit quantities. */ 47*7304104dSAndroid Build Coastguard Worker typedef Elf64_Word GElf_Word; 48*7304104dSAndroid Build Coastguard Worker typedef Elf64_Sword GElf_Sword; 49*7304104dSAndroid Build Coastguard Worker 50*7304104dSAndroid Build Coastguard Worker /* Types for signed and unsigned 64-bit quantities. */ 51*7304104dSAndroid Build Coastguard Worker typedef Elf64_Xword GElf_Xword; 52*7304104dSAndroid Build Coastguard Worker typedef Elf64_Sxword GElf_Sxword; 53*7304104dSAndroid Build Coastguard Worker 54*7304104dSAndroid Build Coastguard Worker /* Type of addresses. */ 55*7304104dSAndroid Build Coastguard Worker typedef Elf64_Addr GElf_Addr; 56*7304104dSAndroid Build Coastguard Worker 57*7304104dSAndroid Build Coastguard Worker /* Type of file offsets. */ 58*7304104dSAndroid Build Coastguard Worker typedef Elf64_Off GElf_Off; 59*7304104dSAndroid Build Coastguard Worker 60*7304104dSAndroid Build Coastguard Worker 61*7304104dSAndroid Build Coastguard Worker /* The ELF file header. This appears at the start of every ELF file. */ 62*7304104dSAndroid Build Coastguard Worker typedef Elf64_Ehdr GElf_Ehdr; 63*7304104dSAndroid Build Coastguard Worker 64*7304104dSAndroid Build Coastguard Worker /* Section header. */ 65*7304104dSAndroid Build Coastguard Worker typedef Elf64_Shdr GElf_Shdr; 66*7304104dSAndroid Build Coastguard Worker 67*7304104dSAndroid Build Coastguard Worker /* Section index. */ 68*7304104dSAndroid Build Coastguard Worker /* XXX This should probably be a larger type in preparation of times when 69*7304104dSAndroid Build Coastguard Worker regular section indices can be larger. */ 70*7304104dSAndroid Build Coastguard Worker typedef Elf64_Section GElf_Section; 71*7304104dSAndroid Build Coastguard Worker 72*7304104dSAndroid Build Coastguard Worker /* Symbol table entry. */ 73*7304104dSAndroid Build Coastguard Worker typedef Elf64_Sym GElf_Sym; 74*7304104dSAndroid Build Coastguard Worker 75*7304104dSAndroid Build Coastguard Worker /* The syminfo section if available contains additional information about 76*7304104dSAndroid Build Coastguard Worker every dynamic symbol. */ 77*7304104dSAndroid Build Coastguard Worker typedef Elf64_Syminfo GElf_Syminfo; 78*7304104dSAndroid Build Coastguard Worker 79*7304104dSAndroid Build Coastguard Worker /* Relocation table entry without addend (in section of type SHT_REL). */ 80*7304104dSAndroid Build Coastguard Worker typedef Elf64_Rel GElf_Rel; 81*7304104dSAndroid Build Coastguard Worker 82*7304104dSAndroid Build Coastguard Worker /* Relocation table entry with addend (in section of type SHT_RELA). */ 83*7304104dSAndroid Build Coastguard Worker typedef Elf64_Rela GElf_Rela; 84*7304104dSAndroid Build Coastguard Worker 85*7304104dSAndroid Build Coastguard Worker /* Relative relocation entry (in section of type SHT_RELR). */ 86*7304104dSAndroid Build Coastguard Worker typedef Elf64_Relr GElf_Relr; 87*7304104dSAndroid Build Coastguard Worker 88*7304104dSAndroid Build Coastguard Worker /* Program segment header. */ 89*7304104dSAndroid Build Coastguard Worker typedef Elf64_Phdr GElf_Phdr; 90*7304104dSAndroid Build Coastguard Worker 91*7304104dSAndroid Build Coastguard Worker /* Header of a compressed section. */ 92*7304104dSAndroid Build Coastguard Worker typedef Elf64_Chdr GElf_Chdr; 93*7304104dSAndroid Build Coastguard Worker 94*7304104dSAndroid Build Coastguard Worker /* Dynamic section entry. */ 95*7304104dSAndroid Build Coastguard Worker typedef Elf64_Dyn GElf_Dyn; 96*7304104dSAndroid Build Coastguard Worker 97*7304104dSAndroid Build Coastguard Worker 98*7304104dSAndroid Build Coastguard Worker /* Version definition sections. */ 99*7304104dSAndroid Build Coastguard Worker typedef Elf64_Verdef GElf_Verdef; 100*7304104dSAndroid Build Coastguard Worker 101*7304104dSAndroid Build Coastguard Worker /* Auxiliary version information. */ 102*7304104dSAndroid Build Coastguard Worker typedef Elf64_Verdaux GElf_Verdaux; 103*7304104dSAndroid Build Coastguard Worker 104*7304104dSAndroid Build Coastguard Worker /* Version dependency section. */ 105*7304104dSAndroid Build Coastguard Worker typedef Elf64_Verneed GElf_Verneed; 106*7304104dSAndroid Build Coastguard Worker 107*7304104dSAndroid Build Coastguard Worker /* Auxiliary needed version information. */ 108*7304104dSAndroid Build Coastguard Worker typedef Elf64_Vernaux GElf_Vernaux; 109*7304104dSAndroid Build Coastguard Worker 110*7304104dSAndroid Build Coastguard Worker 111*7304104dSAndroid Build Coastguard Worker /* Type for version symbol information. */ 112*7304104dSAndroid Build Coastguard Worker typedef Elf64_Versym GElf_Versym; 113*7304104dSAndroid Build Coastguard Worker 114*7304104dSAndroid Build Coastguard Worker 115*7304104dSAndroid Build Coastguard Worker /* Auxiliary vector. */ 116*7304104dSAndroid Build Coastguard Worker typedef Elf64_auxv_t GElf_auxv_t; 117*7304104dSAndroid Build Coastguard Worker 118*7304104dSAndroid Build Coastguard Worker 119*7304104dSAndroid Build Coastguard Worker /* Note section contents. */ 120*7304104dSAndroid Build Coastguard Worker typedef Elf64_Nhdr GElf_Nhdr; 121*7304104dSAndroid Build Coastguard Worker 122*7304104dSAndroid Build Coastguard Worker 123*7304104dSAndroid Build Coastguard Worker /* Move structure. */ 124*7304104dSAndroid Build Coastguard Worker typedef Elf64_Move GElf_Move; 125*7304104dSAndroid Build Coastguard Worker 126*7304104dSAndroid Build Coastguard Worker 127*7304104dSAndroid Build Coastguard Worker /* Library list structure. */ 128*7304104dSAndroid Build Coastguard Worker typedef Elf64_Lib GElf_Lib; 129*7304104dSAndroid Build Coastguard Worker 130*7304104dSAndroid Build Coastguard Worker 131*7304104dSAndroid Build Coastguard Worker /* How to extract and insert information held in the st_info field. */ 132*7304104dSAndroid Build Coastguard Worker 133*7304104dSAndroid Build Coastguard Worker #define GELF_ST_BIND(val) ELF64_ST_BIND (val) 134*7304104dSAndroid Build Coastguard Worker #define GELF_ST_TYPE(val) ELF64_ST_TYPE (val) 135*7304104dSAndroid Build Coastguard Worker #define GELF_ST_INFO(bind, type) ELF64_ST_INFO (bind, type) 136*7304104dSAndroid Build Coastguard Worker 137*7304104dSAndroid Build Coastguard Worker /* How to extract information held in the st_other field. */ 138*7304104dSAndroid Build Coastguard Worker 139*7304104dSAndroid Build Coastguard Worker #define GELF_ST_VISIBILITY(val) ELF64_ST_VISIBILITY (val) 140*7304104dSAndroid Build Coastguard Worker 141*7304104dSAndroid Build Coastguard Worker 142*7304104dSAndroid Build Coastguard Worker /* How to extract and insert information held in the r_info field. */ 143*7304104dSAndroid Build Coastguard Worker 144*7304104dSAndroid Build Coastguard Worker #define GELF_R_SYM(info) ELF64_R_SYM (info) 145*7304104dSAndroid Build Coastguard Worker #define GELF_R_TYPE(info) ELF64_R_TYPE (info) 146*7304104dSAndroid Build Coastguard Worker #define GELF_R_INFO(sym, type) ELF64_R_INFO (sym, type) 147*7304104dSAndroid Build Coastguard Worker 148*7304104dSAndroid Build Coastguard Worker 149*7304104dSAndroid Build Coastguard Worker /* How to extract and insert information held in the m_info field. */ 150*7304104dSAndroid Build Coastguard Worker #define GELF_M_SYM(info) ELF64_M_SYM (info) 151*7304104dSAndroid Build Coastguard Worker #define GELF_M_SIZE(info) ELF64_M_SIZE (info) 152*7304104dSAndroid Build Coastguard Worker #define GELF_M_INFO(sym, size) ELF64_M_INFO (sym, size) 153*7304104dSAndroid Build Coastguard Worker 154*7304104dSAndroid Build Coastguard Worker 155*7304104dSAndroid Build Coastguard Worker /* Get class of the file associated with ELF. */ 156*7304104dSAndroid Build Coastguard Worker extern int gelf_getclass (Elf *__elf); 157*7304104dSAndroid Build Coastguard Worker 158*7304104dSAndroid Build Coastguard Worker 159*7304104dSAndroid Build Coastguard Worker /* Return size of array of COUNT elements of the type denoted by TYPE 160*7304104dSAndroid Build Coastguard Worker in the external representation. The binary class is taken from ELF. 161*7304104dSAndroid Build Coastguard Worker The result is based on version VERSION of the ELF standard. */ 162*7304104dSAndroid Build Coastguard Worker extern size_t gelf_fsize (Elf *__elf, Elf_Type __type, size_t __count, 163*7304104dSAndroid Build Coastguard Worker unsigned int __version); 164*7304104dSAndroid Build Coastguard Worker 165*7304104dSAndroid Build Coastguard Worker /* Retrieve object file header. */ 166*7304104dSAndroid Build Coastguard Worker extern GElf_Ehdr *gelf_getehdr (Elf *__elf, GElf_Ehdr *__dest); 167*7304104dSAndroid Build Coastguard Worker 168*7304104dSAndroid Build Coastguard Worker /* Update the ELF header. */ 169*7304104dSAndroid Build Coastguard Worker extern int gelf_update_ehdr (Elf *__elf, GElf_Ehdr *__src); 170*7304104dSAndroid Build Coastguard Worker 171*7304104dSAndroid Build Coastguard Worker /* Create new ELF header if none exists. Creates an Elf32_Ehdr if CLASS 172*7304104dSAndroid Build Coastguard Worker is ELFCLASS32 or an Elf64_Ehdr if CLASS is ELFCLASS64. Returns NULL 173*7304104dSAndroid Build Coastguard Worker on error. */ 174*7304104dSAndroid Build Coastguard Worker extern void *gelf_newehdr (Elf *__elf, int __class); 175*7304104dSAndroid Build Coastguard Worker 176*7304104dSAndroid Build Coastguard Worker /* Get section at OFFSET. */ 177*7304104dSAndroid Build Coastguard Worker extern Elf_Scn *gelf_offscn (Elf *__elf, GElf_Off __offset); 178*7304104dSAndroid Build Coastguard Worker 179*7304104dSAndroid Build Coastguard Worker /* Retrieve section header. */ 180*7304104dSAndroid Build Coastguard Worker extern GElf_Shdr *gelf_getshdr (Elf_Scn *__scn, GElf_Shdr *__dst); 181*7304104dSAndroid Build Coastguard Worker 182*7304104dSAndroid Build Coastguard Worker /* Update section header. */ 183*7304104dSAndroid Build Coastguard Worker extern int gelf_update_shdr (Elf_Scn *__scn, GElf_Shdr *__src); 184*7304104dSAndroid Build Coastguard Worker 185*7304104dSAndroid Build Coastguard Worker /* Retrieve program header table entry. */ 186*7304104dSAndroid Build Coastguard Worker extern GElf_Phdr *gelf_getphdr (Elf *__elf, int __ndx, GElf_Phdr *__dst); 187*7304104dSAndroid Build Coastguard Worker 188*7304104dSAndroid Build Coastguard Worker /* Update the program header. */ 189*7304104dSAndroid Build Coastguard Worker extern int gelf_update_phdr (Elf *__elf, int __ndx, GElf_Phdr *__src); 190*7304104dSAndroid Build Coastguard Worker 191*7304104dSAndroid Build Coastguard Worker /* Create new program header with PHNUM entries. Creates either an 192*7304104dSAndroid Build Coastguard Worker Elf32_Phdr or an Elf64_Phdr depending on whether the given ELF is 193*7304104dSAndroid Build Coastguard Worker ELFCLASS32 or ELFCLASS64. Returns NULL on error. */ 194*7304104dSAndroid Build Coastguard Worker extern void *gelf_newphdr (Elf *__elf, size_t __phnum); 195*7304104dSAndroid Build Coastguard Worker 196*7304104dSAndroid Build Coastguard Worker /* Get compression header of section if any. Returns NULL and sets 197*7304104dSAndroid Build Coastguard Worker elf_errno if the section isn't compressed or an error occurred. */ 198*7304104dSAndroid Build Coastguard Worker extern GElf_Chdr *gelf_getchdr (Elf_Scn *__scn, GElf_Chdr *__dst); 199*7304104dSAndroid Build Coastguard Worker 200*7304104dSAndroid Build Coastguard Worker /* Convert data structure from the representation in the file represented 201*7304104dSAndroid Build Coastguard Worker by ELF to their memory representation. */ 202*7304104dSAndroid Build Coastguard Worker extern Elf_Data *gelf_xlatetom (Elf *__elf, Elf_Data *__dest, 203*7304104dSAndroid Build Coastguard Worker const Elf_Data *__src, unsigned int __encode); 204*7304104dSAndroid Build Coastguard Worker 205*7304104dSAndroid Build Coastguard Worker /* Convert data structure from to the representation in memory 206*7304104dSAndroid Build Coastguard Worker represented by ELF file representation. */ 207*7304104dSAndroid Build Coastguard Worker extern Elf_Data *gelf_xlatetof (Elf *__elf, Elf_Data *__dest, 208*7304104dSAndroid Build Coastguard Worker const Elf_Data *__src, unsigned int __encode); 209*7304104dSAndroid Build Coastguard Worker 210*7304104dSAndroid Build Coastguard Worker 211*7304104dSAndroid Build Coastguard Worker /* Retrieve REL relocation info at the given index. */ 212*7304104dSAndroid Build Coastguard Worker extern GElf_Rel *gelf_getrel (Elf_Data *__data, int __ndx, GElf_Rel *__dst); 213*7304104dSAndroid Build Coastguard Worker 214*7304104dSAndroid Build Coastguard Worker /* Retrieve RELA relocation info at the given index. */ 215*7304104dSAndroid Build Coastguard Worker extern GElf_Rela *gelf_getrela (Elf_Data *__data, int __ndx, GElf_Rela *__dst); 216*7304104dSAndroid Build Coastguard Worker 217*7304104dSAndroid Build Coastguard Worker /* Update REL relocation information at given index. */ 218*7304104dSAndroid Build Coastguard Worker extern int gelf_update_rel (Elf_Data *__dst, int __ndx, GElf_Rel *__src); 219*7304104dSAndroid Build Coastguard Worker 220*7304104dSAndroid Build Coastguard Worker /* Update RELA relocation information at given index. */ 221*7304104dSAndroid Build Coastguard Worker extern int gelf_update_rela (Elf_Data *__dst, int __ndx, GElf_Rela *__src); 222*7304104dSAndroid Build Coastguard Worker 223*7304104dSAndroid Build Coastguard Worker 224*7304104dSAndroid Build Coastguard Worker /* Retrieve symbol information from the symbol table at the given index. */ 225*7304104dSAndroid Build Coastguard Worker extern GElf_Sym *gelf_getsym (Elf_Data *__data, int __ndx, GElf_Sym *__dst); 226*7304104dSAndroid Build Coastguard Worker 227*7304104dSAndroid Build Coastguard Worker /* Update symbol information in the symbol table at the given index. */ 228*7304104dSAndroid Build Coastguard Worker extern int gelf_update_sym (Elf_Data *__data, int __ndx, GElf_Sym *__src); 229*7304104dSAndroid Build Coastguard Worker 230*7304104dSAndroid Build Coastguard Worker 231*7304104dSAndroid Build Coastguard Worker /* Retrieve symbol information and separate section index from the 232*7304104dSAndroid Build Coastguard Worker symbol table at the given index. */ 233*7304104dSAndroid Build Coastguard Worker extern GElf_Sym *gelf_getsymshndx (Elf_Data *__symdata, Elf_Data *__shndxdata, 234*7304104dSAndroid Build Coastguard Worker int __ndx, GElf_Sym *__sym, 235*7304104dSAndroid Build Coastguard Worker Elf32_Word *__xshndx); 236*7304104dSAndroid Build Coastguard Worker 237*7304104dSAndroid Build Coastguard Worker /* Update symbol information and separate section index in the symbol 238*7304104dSAndroid Build Coastguard Worker table at the given index. */ 239*7304104dSAndroid Build Coastguard Worker extern int gelf_update_symshndx (Elf_Data *__symdata, Elf_Data *__shndxdata, 240*7304104dSAndroid Build Coastguard Worker int __ndx, GElf_Sym *__sym, 241*7304104dSAndroid Build Coastguard Worker Elf32_Word __xshndx); 242*7304104dSAndroid Build Coastguard Worker 243*7304104dSAndroid Build Coastguard Worker 244*7304104dSAndroid Build Coastguard Worker /* Retrieve additional symbol information from the symbol table at the 245*7304104dSAndroid Build Coastguard Worker given index. */ 246*7304104dSAndroid Build Coastguard Worker extern GElf_Syminfo *gelf_getsyminfo (Elf_Data *__data, int __ndx, 247*7304104dSAndroid Build Coastguard Worker GElf_Syminfo *__dst); 248*7304104dSAndroid Build Coastguard Worker 249*7304104dSAndroid Build Coastguard Worker /* Update additional symbol information in the symbol table at the 250*7304104dSAndroid Build Coastguard Worker given index. */ 251*7304104dSAndroid Build Coastguard Worker extern int gelf_update_syminfo (Elf_Data *__data, int __ndx, 252*7304104dSAndroid Build Coastguard Worker GElf_Syminfo *__src); 253*7304104dSAndroid Build Coastguard Worker 254*7304104dSAndroid Build Coastguard Worker 255*7304104dSAndroid Build Coastguard Worker /* Get information from dynamic table at the given index. */ 256*7304104dSAndroid Build Coastguard Worker extern GElf_Dyn *gelf_getdyn (Elf_Data *__data, int __ndx, GElf_Dyn *__dst); 257*7304104dSAndroid Build Coastguard Worker 258*7304104dSAndroid Build Coastguard Worker /* Update information in dynamic table at the given index. */ 259*7304104dSAndroid Build Coastguard Worker extern int gelf_update_dyn (Elf_Data *__dst, int __ndx, GElf_Dyn *__src); 260*7304104dSAndroid Build Coastguard Worker 261*7304104dSAndroid Build Coastguard Worker 262*7304104dSAndroid Build Coastguard Worker /* Get move structure at the given index. */ 263*7304104dSAndroid Build Coastguard Worker extern GElf_Move *gelf_getmove (Elf_Data *__data, int __ndx, GElf_Move *__dst); 264*7304104dSAndroid Build Coastguard Worker 265*7304104dSAndroid Build Coastguard Worker /* Update move structure at the given index. */ 266*7304104dSAndroid Build Coastguard Worker extern int gelf_update_move (Elf_Data *__data, int __ndx, 267*7304104dSAndroid Build Coastguard Worker GElf_Move *__src); 268*7304104dSAndroid Build Coastguard Worker 269*7304104dSAndroid Build Coastguard Worker 270*7304104dSAndroid Build Coastguard Worker /* Get library from table at the given index. */ 271*7304104dSAndroid Build Coastguard Worker extern GElf_Lib *gelf_getlib (Elf_Data *__data, int __ndx, GElf_Lib *__dst); 272*7304104dSAndroid Build Coastguard Worker 273*7304104dSAndroid Build Coastguard Worker /* Update library in table at the given index. */ 274*7304104dSAndroid Build Coastguard Worker extern int gelf_update_lib (Elf_Data *__data, int __ndx, GElf_Lib *__src); 275*7304104dSAndroid Build Coastguard Worker 276*7304104dSAndroid Build Coastguard Worker 277*7304104dSAndroid Build Coastguard Worker 278*7304104dSAndroid Build Coastguard Worker /* Retrieve symbol version information at given index. */ 279*7304104dSAndroid Build Coastguard Worker extern GElf_Versym *gelf_getversym (Elf_Data *__data, int __ndx, 280*7304104dSAndroid Build Coastguard Worker GElf_Versym *__dst); 281*7304104dSAndroid Build Coastguard Worker 282*7304104dSAndroid Build Coastguard Worker /* Update symbol version information. */ 283*7304104dSAndroid Build Coastguard Worker extern int gelf_update_versym (Elf_Data *__data, int __ndx, 284*7304104dSAndroid Build Coastguard Worker GElf_Versym *__src); 285*7304104dSAndroid Build Coastguard Worker 286*7304104dSAndroid Build Coastguard Worker 287*7304104dSAndroid Build Coastguard Worker /* Retrieve required symbol version information at given offset. */ 288*7304104dSAndroid Build Coastguard Worker extern GElf_Verneed *gelf_getverneed (Elf_Data *__data, int __offset, 289*7304104dSAndroid Build Coastguard Worker GElf_Verneed *__dst); 290*7304104dSAndroid Build Coastguard Worker 291*7304104dSAndroid Build Coastguard Worker /* Update required symbol version information. */ 292*7304104dSAndroid Build Coastguard Worker extern int gelf_update_verneed (Elf_Data *__data, int __offset, 293*7304104dSAndroid Build Coastguard Worker GElf_Verneed *__src); 294*7304104dSAndroid Build Coastguard Worker 295*7304104dSAndroid Build Coastguard Worker /* Retrieve additional required symbol version information at given offset. */ 296*7304104dSAndroid Build Coastguard Worker extern GElf_Vernaux *gelf_getvernaux (Elf_Data *__data, int __offset, 297*7304104dSAndroid Build Coastguard Worker GElf_Vernaux *__dst); 298*7304104dSAndroid Build Coastguard Worker 299*7304104dSAndroid Build Coastguard Worker /* Update additional required symbol version information. */ 300*7304104dSAndroid Build Coastguard Worker extern int gelf_update_vernaux (Elf_Data *__data, int __offset, 301*7304104dSAndroid Build Coastguard Worker GElf_Vernaux *__src); 302*7304104dSAndroid Build Coastguard Worker 303*7304104dSAndroid Build Coastguard Worker 304*7304104dSAndroid Build Coastguard Worker /* Retrieve symbol version definition information at given offset. */ 305*7304104dSAndroid Build Coastguard Worker extern GElf_Verdef *gelf_getverdef (Elf_Data *__data, int __offset, 306*7304104dSAndroid Build Coastguard Worker GElf_Verdef *__dst); 307*7304104dSAndroid Build Coastguard Worker 308*7304104dSAndroid Build Coastguard Worker /* Update symbol version definition information. */ 309*7304104dSAndroid Build Coastguard Worker extern int gelf_update_verdef (Elf_Data *__data, int __offset, 310*7304104dSAndroid Build Coastguard Worker GElf_Verdef *__src); 311*7304104dSAndroid Build Coastguard Worker 312*7304104dSAndroid Build Coastguard Worker /* Retrieve additional symbol version definition information at given 313*7304104dSAndroid Build Coastguard Worker offset. */ 314*7304104dSAndroid Build Coastguard Worker extern GElf_Verdaux *gelf_getverdaux (Elf_Data *__data, int __offset, 315*7304104dSAndroid Build Coastguard Worker GElf_Verdaux *__dst); 316*7304104dSAndroid Build Coastguard Worker 317*7304104dSAndroid Build Coastguard Worker /* Update additional symbol version definition information. */ 318*7304104dSAndroid Build Coastguard Worker extern int gelf_update_verdaux (Elf_Data *__data, int __offset, 319*7304104dSAndroid Build Coastguard Worker GElf_Verdaux *__src); 320*7304104dSAndroid Build Coastguard Worker 321*7304104dSAndroid Build Coastguard Worker 322*7304104dSAndroid Build Coastguard Worker /* Get auxv entry at the given index. */ 323*7304104dSAndroid Build Coastguard Worker extern GElf_auxv_t *gelf_getauxv (Elf_Data *__data, int __ndx, 324*7304104dSAndroid Build Coastguard Worker GElf_auxv_t *__dst); 325*7304104dSAndroid Build Coastguard Worker 326*7304104dSAndroid Build Coastguard Worker /* Update auxv entry at the given index. */ 327*7304104dSAndroid Build Coastguard Worker extern int gelf_update_auxv (Elf_Data *__data, int __ndx, GElf_auxv_t *__src); 328*7304104dSAndroid Build Coastguard Worker 329*7304104dSAndroid Build Coastguard Worker 330*7304104dSAndroid Build Coastguard Worker /* Get note header at the given offset into the data, and the offsets of 331*7304104dSAndroid Build Coastguard Worker the note's name and descriptor data. Returns the offset of the next 332*7304104dSAndroid Build Coastguard Worker note header, or 0 for an invalid offset or corrupt note header. */ 333*7304104dSAndroid Build Coastguard Worker extern size_t gelf_getnote (Elf_Data *__data, size_t __offset, 334*7304104dSAndroid Build Coastguard Worker GElf_Nhdr *__result, 335*7304104dSAndroid Build Coastguard Worker size_t *__name_offset, size_t *__desc_offset); 336*7304104dSAndroid Build Coastguard Worker 337*7304104dSAndroid Build Coastguard Worker 338*7304104dSAndroid Build Coastguard Worker /* Compute simple checksum from permanent parts of the ELF file. */ 339*7304104dSAndroid Build Coastguard Worker extern long int gelf_checksum (Elf *__elf); 340*7304104dSAndroid Build Coastguard Worker 341*7304104dSAndroid Build Coastguard Worker #ifdef __cplusplus 342*7304104dSAndroid Build Coastguard Worker } 343*7304104dSAndroid Build Coastguard Worker #endif 344*7304104dSAndroid Build Coastguard Worker 345*7304104dSAndroid Build Coastguard Worker #endif /* gelf.h */ 346