Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:30:07

0001 /* Interface for libelf.
0002    Copyright (C) 1998-2010, 2015 Red Hat, Inc.
0003    This file is part of elfutils.
0004 
0005    This file is free software; you can redistribute it and/or modify
0006    it under the terms of either
0007 
0008      * the GNU Lesser General Public License as published by the Free
0009        Software Foundation; either version 3 of the License, or (at
0010        your option) any later version
0011 
0012    or
0013 
0014      * the GNU General Public License as published by the Free
0015        Software Foundation; either version 2 of the License, or (at
0016        your option) any later version
0017 
0018    or both in parallel, as here.
0019 
0020    elfutils is distributed in the hope that it will be useful, but
0021    WITHOUT ANY WARRANTY; without even the implied warranty of
0022    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0023    General Public License for more details.
0024 
0025    You should have received copies of the GNU General Public License and
0026    the GNU Lesser General Public License along with this program.  If
0027    not, see <http://www.gnu.org/licenses/>.  */
0028 
0029 #ifndef _LIBELF_H
0030 #define _LIBELF_H 1
0031 
0032 #include <stdint.h>
0033 #include <sys/types.h>
0034 
0035 /* Get the ELF types.  */
0036 #include <elf.h>
0037 
0038 #ifndef SHF_COMPRESSED
0039  /* Older glibc elf.h might not yet define the ELF compression types.  */
0040  #define SHF_COMPRESSED      (1 << 11)  /* Section with compressed data. */
0041 
0042  /* Section compression header.  Used when SHF_COMPRESSED is set.  */
0043 
0044  typedef struct
0045  {
0046    Elf32_Word   ch_type;        /* Compression format.  */
0047    Elf32_Word   ch_size;        /* Uncompressed data size.  */
0048    Elf32_Word   ch_addralign;   /* Uncompressed data alignment.  */
0049  } Elf32_Chdr;
0050 
0051  typedef struct
0052  {
0053    Elf64_Word   ch_type;        /* Compression format.  */
0054    Elf64_Word   ch_reserved;
0055    Elf64_Xword  ch_size;        /* Uncompressed data size.  */
0056    Elf64_Xword  ch_addralign;   /* Uncompressed data alignment.  */
0057  } Elf64_Chdr;
0058 
0059  /* Legal values for ch_type (compression algorithm).  */
0060  #define ELFCOMPRESS_ZLIB       1          /* ZLIB/DEFLATE algorithm.  */
0061  #define ELFCOMPRESS_LOOS       0x60000000 /* Start of OS-specific.  */
0062  #define ELFCOMPRESS_HIOS       0x6fffffff /* End of OS-specific.  */
0063  #define ELFCOMPRESS_LOPROC     0x70000000 /* Start of processor-specific.  */
0064  #define ELFCOMPRESS_HIPROC     0x7fffffff /* End of processor-specific.  */
0065 #endif
0066 
0067 #ifndef ELFCOMPRESS_ZSTD
0068  /* So ZSTD compression can be used even with an old system elf.h.  */
0069  #define ELFCOMPRESS_ZSTD       2          /* Zstandard algorithm.  */
0070 #endif
0071 
0072 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
0073 # define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__)))
0074 # define __deprecated_attribute__ __attribute__ ((__deprecated__))
0075 # define __pure_attribute__ __attribute__ ((__pure__))
0076 # define __const_attribute__ __attribute__ ((__const__))
0077 #else
0078 # define __nonnull_attribute__(...)
0079 # define __deprecated_attribute__
0080 # define __pure_attribute__
0081 # define __const_attribute__
0082 #endif
0083 
0084 #if __GNUC__ < 4
0085 #define __noreturn_attribute__
0086 #else
0087 #define __noreturn_attribute__ __attribute__ ((noreturn))
0088 #endif
0089 
0090 #ifdef __GNUC_STDC_INLINE__
0091 # define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__))
0092 #else
0093 # define __libdw_extern_inline extern __inline
0094 #endif
0095 
0096 /* Known translation types.  */
0097 typedef enum
0098 {
0099   ELF_T_BYTE,                   /* unsigned char */
0100   ELF_T_ADDR,                   /* Elf32_Addr, Elf64_Addr, ... */
0101   ELF_T_DYN,                    /* Dynamic section record.  */
0102   ELF_T_EHDR,                   /* ELF header.  */
0103   ELF_T_HALF,                   /* Elf32_Half, Elf64_Half, ... */
0104   ELF_T_OFF,                    /* Elf32_Off, Elf64_Off, ... */
0105   ELF_T_PHDR,                   /* Program header.  */
0106   ELF_T_RELA,                   /* Relocation entry with addend.  */
0107   ELF_T_REL,                    /* Relocation entry.  */
0108   ELF_T_SHDR,                   /* Section header.  */
0109   ELF_T_SWORD,                  /* Elf32_Sword, Elf64_Sword, ... */
0110   ELF_T_SYM,                    /* Symbol record.  */
0111   ELF_T_WORD,                   /* Elf32_Word, Elf64_Word, ... */
0112   ELF_T_XWORD,                  /* Elf32_Xword, Elf64_Xword, ... */
0113   ELF_T_SXWORD,                 /* Elf32_Sxword, Elf64_Sxword, ... */
0114   ELF_T_VDEF,                   /* Elf32_Verdef, Elf64_Verdef, ... */
0115   ELF_T_VDAUX,                  /* Elf32_Verdaux, Elf64_Verdaux, ... */
0116   ELF_T_VNEED,                  /* Elf32_Verneed, Elf64_Verneed, ... */
0117   ELF_T_VNAUX,                  /* Elf32_Vernaux, Elf64_Vernaux, ... */
0118   ELF_T_NHDR,                   /* Elf32_Nhdr, Elf64_Nhdr, ... */
0119   ELF_T_SYMINFO,        /* Elf32_Syminfo, Elf64_Syminfo, ... */
0120   ELF_T_MOVE,           /* Elf32_Move, Elf64_Move, ... */
0121   ELF_T_LIB,            /* Elf32_Lib, Elf64_Lib, ... */
0122   ELF_T_GNUHASH,        /* GNU-style hash section.  */
0123   ELF_T_AUXV,           /* Elf32_auxv_t, Elf64_auxv_t, ... */
0124   ELF_T_CHDR,           /* Compressed, Elf32_Chdr, Elf64_Chdr, ... */
0125   ELF_T_NHDR8,          /* Special GNU Properties note.  Same as Nhdr,
0126                    except padding.  */
0127   /* Keep this the last entry.  */
0128   ELF_T_NUM
0129 } Elf_Type;
0130 
0131 /* Descriptor for data to be converted to or from memory format.  */
0132 typedef struct
0133 {
0134   void *d_buf;          /* Pointer to the actual data.  */
0135   Elf_Type d_type;      /* Type of this piece of data.  */
0136   unsigned int d_version;   /* ELF version.  */
0137   size_t d_size;        /* Size in bytes.  */
0138   int64_t d_off;        /* Offset into section.  */
0139   size_t d_align;       /* Alignment in section.  */
0140 } Elf_Data;
0141 
0142 
0143 /* Commands for `...'.  */
0144 typedef enum
0145 {
0146   ELF_C_NULL,           /* Nothing, terminate, or compute only.  */
0147   ELF_C_READ,           /* Read .. */
0148   ELF_C_RDWR,           /* Read and write .. */
0149   ELF_C_WRITE,          /* Write .. */
0150   ELF_C_CLR,            /* Clear flag.  */
0151   ELF_C_SET,            /* Set flag.  */
0152   ELF_C_FDDONE,         /* Signal that file descriptor will not be
0153                    used anymore.  */
0154   ELF_C_FDREAD,         /* Read rest of data so that file descriptor
0155                    is not used anymore.  */
0156   /* The following are extensions.  */
0157   ELF_C_READ_MMAP,      /* Read, but mmap the file if possible.  */
0158   ELF_C_RDWR_MMAP,      /* Read and write, with mmap.  */
0159   ELF_C_WRITE_MMAP,     /* Write, with mmap.  */
0160   ELF_C_READ_MMAP_PRIVATE,  /* Read, but memory is writable, results are
0161                    not written to the file.  */
0162   ELF_C_EMPTY,          /* Copy basic file data but not the content. */
0163   /* Keep this the last entry.  */
0164   ELF_C_NUM
0165 } Elf_Cmd;
0166 
0167 
0168 /* Flags for the ELF structures.  */
0169 enum
0170 {
0171   ELF_F_DIRTY = 0x1,
0172 #define ELF_F_DIRTY     ELF_F_DIRTY
0173   ELF_F_LAYOUT = 0x4,
0174 #define ELF_F_LAYOUT        ELF_F_LAYOUT
0175   ELF_F_PERMISSIVE = 0x8
0176 #define ELF_F_PERMISSIVE    ELF_F_PERMISSIVE
0177 };
0178 
0179 /* Flags for elf_compress[_gnu].  */
0180 enum
0181 {
0182   ELF_CHF_FORCE = 0x1
0183 #define ELF_CHF_FORCE ELF_CHF_FORCE
0184 };
0185 
0186 /* Identification values for recognized object files.  */
0187 typedef enum
0188 {
0189   ELF_K_NONE,           /* Unknown.  */
0190   ELF_K_AR,         /* Archive.  */
0191   ELF_K_COFF,           /* Stupid old COFF.  */
0192   ELF_K_ELF,            /* ELF file.  */
0193   /* Keep this the last entry.  */
0194   ELF_K_NUM
0195 } Elf_Kind;
0196 
0197 
0198 /* Archive member header.  */
0199 typedef struct
0200 {
0201   char *ar_name;        /* Name of archive member.  */
0202   time_t ar_date;       /* File date.  */
0203   uid_t ar_uid;         /* User ID.  */
0204   gid_t ar_gid;         /* Group ID.  */
0205   mode_t ar_mode;       /* File mode.  */
0206   int64_t ar_size;      /* File size.  */
0207   char *ar_rawname;     /* Original name of archive member.  */
0208 } Elf_Arhdr;
0209 
0210 
0211 /* Archive symbol table entry.  */
0212 typedef struct
0213 {
0214   char *as_name;        /* Symbol name.  */
0215   size_t as_off;        /* Offset for this file in the archive.  */
0216   unsigned long int as_hash;    /* Hash value of the name.  */
0217 } Elf_Arsym;
0218 
0219 
0220 /* Descriptor for the ELF file.  */
0221 typedef struct Elf Elf;
0222 
0223 /* Descriptor for ELF file section.  */
0224 typedef struct Elf_Scn Elf_Scn;
0225 
0226 
0227 #ifdef __cplusplus
0228 extern "C" {
0229 #endif
0230 
0231 /* Return descriptor for ELF file to work according to CMD.  */
0232 extern Elf *elf_begin (int __fildes, Elf_Cmd __cmd, Elf *__ref);
0233 
0234 /* Create a clone of an existing ELF descriptor.  */
0235   extern Elf *elf_clone (Elf *__elf, Elf_Cmd __cmd);
0236 
0237 /* Create descriptor for memory region.  */
0238 extern Elf *elf_memory (char *__image, size_t __size);
0239 
0240 /* Advance archive descriptor to next element.  */
0241 extern Elf_Cmd elf_next (Elf *__elf);
0242 
0243 /* Free resources allocated for ELF.  */
0244 extern int elf_end (Elf *__elf);
0245 
0246 /* Update ELF descriptor and write file to disk.  */
0247 extern int64_t elf_update (Elf *__elf, Elf_Cmd __cmd);
0248 
0249 /* Determine what kind of file is associated with ELF.  */
0250 extern Elf_Kind elf_kind (Elf *__elf) __pure_attribute__;
0251 
0252 /* Get the base offset for an object file.  */
0253 extern int64_t elf_getbase (Elf *__elf);
0254 
0255 
0256 /* Retrieve file identification data.  */
0257 extern char *elf_getident (Elf *__elf, size_t *__nbytes);
0258 
0259 /* Retrieve class-dependent object file header.  */
0260 extern Elf32_Ehdr *elf32_getehdr (Elf *__elf);
0261 /* Similar but this time the binary calls is ELFCLASS64.  */
0262 extern Elf64_Ehdr *elf64_getehdr (Elf *__elf);
0263 
0264 /* Create ELF header if none exists.  */
0265 extern Elf32_Ehdr *elf32_newehdr (Elf *__elf);
0266 /* Similar but this time the binary calls is ELFCLASS64.  */
0267 extern Elf64_Ehdr *elf64_newehdr (Elf *__elf);
0268 
0269 /* Get the number of program headers in the ELF file.  If the file uses
0270    more headers than can be represented in the e_phnum field of the ELF
0271    header the information from the sh_info field in the zeroth section
0272    header is used.  */
0273 extern int elf_getphdrnum (Elf *__elf, size_t *__dst);
0274 
0275 /* Retrieve class-dependent program header table.  */
0276 extern Elf32_Phdr *elf32_getphdr (Elf *__elf);
0277 /* Similar but this time the binary calls is ELFCLASS64.  */
0278 extern Elf64_Phdr *elf64_getphdr (Elf *__elf);
0279 
0280 /* Create ELF program header.  */
0281 extern Elf32_Phdr *elf32_newphdr (Elf *__elf, size_t __cnt);
0282 /* Similar but this time the binary calls is ELFCLASS64.  */
0283 extern Elf64_Phdr *elf64_newphdr (Elf *__elf, size_t __cnt);
0284 
0285 
0286 /* Get section at INDEX.  */
0287 extern Elf_Scn *elf_getscn (Elf *__elf, size_t __index);
0288 
0289 /* Get section at OFFSET.  */
0290 extern Elf_Scn *elf32_offscn (Elf *__elf, Elf32_Off __offset);
0291 /* Similar bug this time the binary calls is ELFCLASS64.  */
0292 extern Elf_Scn *elf64_offscn (Elf *__elf, Elf64_Off __offset);
0293 
0294 /* Get index of section.  */
0295 extern size_t elf_ndxscn (Elf_Scn *__scn);
0296 
0297 /* Get section with next section index.  */
0298 extern Elf_Scn *elf_nextscn (Elf *__elf, Elf_Scn *__scn);
0299 
0300 /* Create a new section and append it at the end of the table.  */
0301 extern Elf_Scn *elf_newscn (Elf *__elf);
0302 
0303 /* Get the section index of the extended section index table for the
0304    given symbol table.  */
0305 extern int elf_scnshndx (Elf_Scn *__scn);
0306 
0307 /* Get the number of sections in the ELF file.  If the file uses more
0308    sections than can be represented in the e_shnum field of the ELF
0309    header the information from the sh_size field in the zeroth section
0310    header is used.  */
0311 extern int elf_getshdrnum (Elf *__elf, size_t *__dst);
0312 /* Sun messed up the implementation of 'elf_getshnum' in their implementation.
0313    It was agreed to make the same functionality available under a different
0314    name and obsolete the old name.  */
0315 extern int elf_getshnum (Elf *__elf, size_t *__dst)
0316      __deprecated_attribute__;
0317 
0318 
0319 /* Get the section index of the section header string table in the ELF
0320    file.  If the index cannot be represented in the e_shstrndx field of
0321    the ELF header the information from the sh_link field in the zeroth
0322    section header is used.  */
0323 extern int elf_getshdrstrndx (Elf *__elf, size_t *__dst);
0324 /* Sun messed up the implementation of 'elf_getshstrndx' in their
0325    implementation.  It was agreed to make the same functionality available
0326    under a different name and obsolete the old name.  */
0327 extern int elf_getshstrndx (Elf *__elf, size_t *__dst)
0328      __deprecated_attribute__;
0329 
0330 
0331 /* Retrieve section header of ELFCLASS32 binary.  */
0332 extern Elf32_Shdr *elf32_getshdr (Elf_Scn *__scn);
0333 /* Similar for ELFCLASS64.  */
0334 extern Elf64_Shdr *elf64_getshdr (Elf_Scn *__scn);
0335 
0336 /* Returns compression header for a section if section data is
0337    compressed.  Returns NULL and sets elf_errno if the section isn't
0338    compressed or an error occurred.  */
0339 extern Elf32_Chdr *elf32_getchdr (Elf_Scn *__scn);
0340 extern Elf64_Chdr *elf64_getchdr (Elf_Scn *__scn);
0341 
0342 /* Compress or decompress the data of a section and adjust the section
0343    header.
0344 
0345    elf_compress works by setting or clearing the SHF_COMPRESS flag
0346    from the section Shdr and will encode or decode a Elf32_Chdr or
0347    Elf64_Chdr at the start of the section data.  elf_compress_gnu will
0348    encode or decode any section, but is traditionally only used for
0349    sections that have a name starting with ".debug" when
0350    uncompressed or ".zdebug" when compressed and stores just the
0351    uncompressed size.  The GNU compression method is deprecated and
0352    should only be used for legacy support.
0353 
0354    elf_compress takes a compression type that should be either zero to
0355    decompress or an ELFCOMPRESS algorithm to use for compression.
0356    Currently ELFCOMPRESS_ZLIB and ELFCOMPRESS_ZSTD are supported.
0357    elf_compress_gnu will compress in the traditional GNU compression
0358    format when compress is one and decompress the section data when
0359    compress is zero.
0360 
0361    The FLAGS argument can be zero or ELF_CHF_FORCE.  If FLAGS contains
0362    ELF_CHF_FORCE then it will always compress the section, even if
0363    that would not reduce the size of the data section (including the
0364    header).  Otherwise elf_compress and elf_compress_gnu will compress
0365    the section only if the total data size is reduced.
0366 
0367    On successful compression or decompression the function returns
0368    one.  If (not forced) compression is requested and the data section
0369    would not actually reduce in size, the section is not actually
0370    compressed and zero is returned.  Otherwise -1 is returned and
0371    elf_errno is set.
0372 
0373    It is an error to request compression for a section that already
0374    has SHF_COMPRESSED set, or (for elf_compress) to request
0375    decompression for an section that doesn't have SHF_COMPRESSED set.
0376    If a section has SHF_COMPRESSED set then calling elf_compress_gnu
0377    will result in an error.  The section has to be decompressed first
0378    using elf_compress.  Calling elf_compress on a section compressed
0379    with elf_compress_gnu is fine, but probably useless.
0380 
0381    It is always an error to call these functions on SHT_NOBITS
0382    sections or if the section has the SHF_ALLOC flag set.
0383    elf_compress_gnu will not check whether the section name starts
0384    with ".debug" or .zdebug".  It is the responsibility of the caller
0385    to make sure the deprecated GNU compression method is only called
0386    on correctly named sections (and to change the name of the section
0387    when using elf_compress_gnu).
0388 
0389    All previous returned Shdrs and Elf_Data buffers are invalidated by
0390    this call and should no longer be accessed.
0391 
0392    Note that although this changes the header and data returned it
0393    doesn't mark the section as dirty.  To keep the changes when
0394    calling elf_update the section has to be flagged ELF_F_DIRTY.  */
0395 extern int elf_compress (Elf_Scn *scn, int type, unsigned int flags);
0396 extern int elf_compress_gnu (Elf_Scn *scn, int compress, unsigned int flags);
0397 
0398 /* Set or clear flags for ELF file.  */
0399 extern unsigned int elf_flagelf (Elf *__elf, Elf_Cmd __cmd,
0400                  unsigned int __flags);
0401 /* Similarly for the ELF header.  */
0402 extern unsigned int elf_flagehdr (Elf *__elf, Elf_Cmd __cmd,
0403                   unsigned int __flags);
0404 /* Similarly for the ELF program header.  */
0405 extern unsigned int elf_flagphdr (Elf *__elf, Elf_Cmd __cmd,
0406                   unsigned int __flags);
0407 /* Similarly for the given ELF section.  */
0408 extern unsigned int elf_flagscn (Elf_Scn *__scn, Elf_Cmd __cmd,
0409                  unsigned int __flags);
0410 /* Similarly for the given ELF data.  */
0411 extern unsigned int elf_flagdata (Elf_Data *__data, Elf_Cmd __cmd,
0412                   unsigned int __flags);
0413 /* Similarly for the given ELF section header.  */
0414 extern unsigned int elf_flagshdr (Elf_Scn *__scn, Elf_Cmd __cmd,
0415                   unsigned int __flags);
0416 
0417 
0418 /* Get data from section while translating from file representation to
0419    memory representation.  The Elf_Data d_type is set based on the
0420    section type if known.  Otherwise d_type is set to ELF_T_BYTE.  If
0421    the section contains compressed data then d_type is always set to
0422    ELF_T_CHDR.  */
0423 extern Elf_Data *elf_getdata (Elf_Scn *__scn, Elf_Data *__data);
0424 
0425 /* Get uninterpreted section content.  */
0426 extern Elf_Data *elf_rawdata (Elf_Scn *__scn, Elf_Data *__data);
0427 
0428 /* Create new data descriptor for section SCN.  */
0429 extern Elf_Data *elf_newdata (Elf_Scn *__scn);
0430 
0431 /* Get data translated from a chunk of the file contents as section data
0432    would be for TYPE.  The resulting Elf_Data pointer is valid until
0433    elf_end (ELF) is called.  */
0434 extern Elf_Data *elf_getdata_rawchunk (Elf *__elf,
0435                        int64_t __offset, size_t __size,
0436                        Elf_Type __type);
0437 
0438 
0439 /* Return pointer to string at OFFSET in section INDEX.  */
0440 extern char *elf_strptr (Elf *__elf, size_t __index, size_t __offset);
0441 
0442 
0443 /* Return header of archive.  */
0444 extern Elf_Arhdr *elf_getarhdr (Elf *__elf);
0445 
0446 /* Return offset in archive for current file ELF.  */
0447 extern int64_t elf_getaroff (Elf *__elf);
0448 
0449 /* Select archive element at OFFSET.  */
0450 extern size_t elf_rand (Elf *__elf, size_t __offset);
0451 
0452 /* Get symbol table of archive.  */
0453 extern Elf_Arsym *elf_getarsym (Elf *__elf, size_t *__narsyms);
0454 
0455 
0456 /* Control ELF descriptor.  */
0457 extern int elf_cntl (Elf *__elf, Elf_Cmd __cmd);
0458 
0459 /* Retrieve uninterpreted file contents.  */
0460 extern char *elf_rawfile (Elf *__elf, size_t *__nbytes);
0461 
0462 
0463 /* Return size of array of COUNT elements of the type denoted by TYPE
0464    in the external representation.  The binary class is taken from ELF.
0465    The result is based on version VERSION of the ELF standard.  */
0466 extern size_t elf32_fsize (Elf_Type __type, size_t __count,
0467                unsigned int __version)
0468        __const_attribute__;
0469 /* Similar but this time the binary calls is ELFCLASS64.  */
0470 extern size_t elf64_fsize (Elf_Type __type, size_t __count,
0471                unsigned int __version)
0472        __const_attribute__;
0473 
0474 
0475 /* Convert data structure from the representation in the file represented
0476    by ELF to their memory representation.  */
0477 extern Elf_Data *elf32_xlatetom (Elf_Data *__dest, const Elf_Data *__src,
0478                  unsigned int __encode);
0479 /* Same for 64 bit class.  */
0480 extern Elf_Data *elf64_xlatetom (Elf_Data *__dest, const Elf_Data *__src,
0481                  unsigned int __encode);
0482 
0483 /* Convert data structure from to the representation in memory
0484    represented by ELF file representation.  */
0485 extern Elf_Data *elf32_xlatetof (Elf_Data *__dest, const Elf_Data *__src,
0486                  unsigned int __encode);
0487 /* Same for 64 bit class.  */
0488 extern Elf_Data *elf64_xlatetof (Elf_Data *__dest, const Elf_Data *__src,
0489                  unsigned int __encode);
0490 
0491 
0492 /* Return error code of last failing function call.  This value is kept
0493    separately for each thread.  */
0494 extern int elf_errno (void);
0495 
0496 /* Return error string for ERROR.  If ERROR is zero, return error string
0497    for most recent error or NULL is none occurred.  If ERROR is -1 the
0498    behaviour is similar to the last case except that not NULL but a legal
0499    string is returned.  */
0500 extern const char *elf_errmsg (int __error);
0501 
0502 
0503 /* Coordinate ELF library and application versions.  */
0504 extern unsigned int elf_version (unsigned int __version);
0505 
0506 /* Set fill bytes used to fill holes in data structures.  */
0507 extern void elf_fill (int __fill);
0508 
0509 /* Compute hash value.  */
0510 extern unsigned long int elf_hash (const char *__string)
0511        __pure_attribute__;
0512 
0513 /* Compute hash value using the GNU-specific hash function.  */
0514 extern unsigned long int elf_gnu_hash (const char *__string)
0515        __pure_attribute__;
0516 
0517 
0518 /* Compute simple checksum from permanent parts of the ELF file.  */
0519 extern long int elf32_checksum (Elf *__elf);
0520 /* Similar but this time the binary calls is ELFCLASS64.  */
0521 extern long int elf64_checksum (Elf *__elf);
0522 
0523 #ifdef __cplusplus
0524 }
0525 #endif
0526 
0527 #endif  /* libelf.h */