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