golden hour
/usr/include
⬆️ Go Up
Upload
File/Folder
Size
Actions
FlexLexer.h
6.07 KB
Del
OK
GL
-
Del
OK
KF5
-
Del
OK
X11
-
Del
OK
_G_config.h
1.26 KB
Del
OK
a.out.h
4.25 KB
Del
OK
aio.h
7.27 KB
Del
OK
aliases.h
2 KB
Del
OK
alloca.h
1.19 KB
Del
OK
apache2
-
Del
OK
ar.h
1.68 KB
Del
OK
argp.h
24.75 KB
Del
OK
argz.h
6.96 KB
Del
OK
arpa
-
Del
OK
asm
-
Del
OK
asm-generic
-
Del
OK
assert.h
3.52 KB
Del
OK
autosprintf.h
2.33 KB
Del
OK
bind9
-
Del
OK
bits
-
Del
OK
bsock
-
Del
OK
byteswap.h
1.41 KB
Del
OK
c++
-
Del
OK
com_err.h
2.07 KB
Del
OK
complex.h
3.62 KB
Del
OK
cpio.h
2.21 KB
Del
OK
cpufreq.h
5.8 KB
Del
OK
criu
-
Del
OK
crypt.h
2.22 KB
Del
OK
ctype.h
11.52 KB
Del
OK
curses.h
93.19 KB
Del
OK
cursesapp.h
6.62 KB
Del
OK
cursesf.h
27.05 KB
Del
OK
cursesm.h
19.09 KB
Del
OK
cursesp.h
8.3 KB
Del
OK
cursesw.h
48.24 KB
Del
OK
cursslk.h
7.13 KB
Del
OK
db.h
120.21 KB
Del
OK
db4.7.25
-
Del
OK
db_185.h
5.84 KB
Del
OK
dbm.h
1.37 KB
Del
OK
dirent.h
12.34 KB
Del
OK
dlfcn.h
6.88 KB
Del
OK
drm
-
Del
OK
e2p
-
Del
OK
elf.h
141.01 KB
Del
OK
endian.h
2.95 KB
Del
OK
entities.h
4.56 KB
Del
OK
envz.h
2.82 KB
Del
OK
err.h
2.18 KB
Del
OK
errno.h
2.33 KB
Del
OK
error.h
2.01 KB
Del
OK
et
-
Del
OK
eti.h
2.82 KB
Del
OK
etip.h
9.04 KB
Del
OK
execinfo.h
1.5 KB
Del
OK
expat.h
41.04 KB
Del
OK
expat_external.h
3.29 KB
Del
OK
ext2fs
-
Del
OK
fcntl.h
9.89 KB
Del
OK
features.h
12.87 KB
Del
OK
fenv.h
4.5 KB
Del
OK
fmtmsg.h
3.18 KB
Del
OK
fnmatch.h
2.27 KB
Del
OK
fontconfig
-
Del
OK
form.h
17.56 KB
Del
OK
fpu_control.h
3.5 KB
Del
OK
freetype2
-
Del
OK
fstab.h
3.04 KB
Del
OK
fts.h
5.17 KB
Del
OK
ftw.h
5.15 KB
Del
OK
gconv.h
5.16 KB
Del
OK
gcrypt-module.h
7.18 KB
Del
OK
gcrypt.h
76.51 KB
Del
OK
gd.h
32.02 KB
Del
OK
gd_io.h
1.13 KB
Del
OK
gdbm
-
Del
OK
gdbm.h
5.75 KB
Del
OK
gdcache.h
2.75 KB
Del
OK
gdfontg.h
623 B
Del
OK
gdfontl.h
621 B
Del
OK
gdfontmb.h
590 B
Del
OK
gdfonts.h
585 B
Del
OK
gdfontt.h
617 B
Del
OK
gdfx.h
2.34 KB
Del
OK
gelf.h
11.05 KB
Del
OK
getopt.h
6.53 KB
Del
OK
gettext-po.h
15.17 KB
Del
OK
glob.h
6.51 KB
Del
OK
gnu
-
Del
OK
gnu-versions.h
2.29 KB
Del
OK
google
-
Del
OK
gpg-error.h
23.66 KB
Del
OK
grp.h
6.75 KB
Del
OK
gshadow.h
4.43 KB
Del
OK
gssapi
-
Del
OK
gssapi.h
181 B
Del
OK
gssrpc
-
Del
OK
iconv.h
1.83 KB
Del
OK
idn-free.h
2.41 KB
Del
OK
idn-int.h
20 B
Del
OK
idna.h
3.48 KB
Del
OK
ieee754.h
4.81 KB
Del
OK
ifaddrs.h
2.77 KB
Del
OK
inttypes.h
11.61 KB
Del
OK
jconfig.h
1.7 KB
Del
OK
jerror.h
14.4 KB
Del
OK
jmorecfg.h
13.5 KB
Del
OK
jpeglib.h
49.12 KB
Del
OK
kadm5
-
Del
OK
kdb.h
60.12 KB
Del
OK
kde4
-
Del
OK
keyutils.h
7.08 KB
Del
OK
krad.h
8.72 KB
Del
OK
krb5
-
Del
OK
krb5.h
402 B
Del
OK
langinfo.h
15.57 KB
Del
OK
lastlog.h
126 B
Del
OK
lauxlib.h
5.64 KB
Del
OK
lber.h
14.95 KB
Del
OK
lber_types.h
1.43 KB
Del
OK
ldap.h
63.46 KB
Del
OK
ldap_cdefs.h
9.24 KB
Del
OK
ldap_features.h
1.77 KB
Del
OK
ldap_schema.h
9.23 KB
Del
OK
ldap_utf8.h
3.39 KB
Del
OK
ldif.h
4.58 KB
Del
OK
libaio.h
7.8 KB
Del
OK
libdb
-
Del
OK
libelf.h
19.11 KB
Del
OK
libexslt
-
Del
OK
libgen.h
1.37 KB
Del
OK
libintl.h
4.49 KB
Del
OK
libio.h
16.87 KB
Del
OK
libltdl
-
Del
OK
libpng15
-
Del
OK
libxml2
-
Del
OK
libxslt
-
Del
OK
limits.h
4.42 KB
Del
OK
link.h
6.99 KB
Del
OK
linux
-
Del
OK
locale.h
7.78 KB
Del
OK
ltdl.h
5.58 KB
Del
OK
lua.h
11.41 KB
Del
OK
lua.hpp
191 B
Del
OK
luaconf.h
21.64 KB
Del
OK
lualib.h
1 KB
Del
OK
lzma
-
Del
OK
lzma.h
9.51 KB
Del
OK
malloc.h
6.44 KB
Del
OK
math.h
15.7 KB
Del
OK
mcheck.h
2.4 KB
Del
OK
memory.h
962 B
Del
OK
menu.h
11.67 KB
Del
OK
misc
-
Del
OK
mntent.h
3.3 KB
Del
OK
monetary.h
1.73 KB
Del
OK
mqueue.h
3.7 KB
Del
OK
mtd
-
Del
OK
mysql
-
Del
OK
nc_tparm.h
4.05 KB
Del
OK
ncurses
-
Del
OK
ncurses.h
93.19 KB
Del
OK
ncurses_dll.h
3.83 KB
Del
OK
ncursesw
-
Del
OK
ndbm.h
2.39 KB
Del
OK
net
-
Del
OK
netash
-
Del
OK
netatalk
-
Del
OK
netax25
-
Del
OK
netdb.h
27.46 KB
Del
OK
neteconet
-
Del
OK
netinet
-
Del
OK
netipx
-
Del
OK
netiucv
-
Del
OK
netpacket
-
Del
OK
netrom
-
Del
OK
netrose
-
Del
OK
nfs
-
Del
OK
nl_types.h
1.73 KB
Del
OK
nlist.h
1.56 KB
Del
OK
nss.h
1.85 KB
Del
OK
obstack.h
18.84 KB
Del
OK
openssl
-
Del
OK
panel.h
3.97 KB
Del
OK
paths.h
2.91 KB
Del
OK
pcre.h
29.73 KB
Del
OK
pcre_scanner.h
6.45 KB
Del
OK
pcre_stringpiece.h
6.11 KB
Del
OK
pcrecpp.h
25.91 KB
Del
OK
pcrecpparg.h
6.62 KB
Del
OK
pcreposix.h
5.32 KB
Del
OK
png.h
113.36 KB
Del
OK
pngconf.h
20.94 KB
Del
OK
pnglibconf.h
6.3 KB
Del
OK
poll.h
22 B
Del
OK
pr29.h
2.07 KB
Del
OK
printf.h
6.56 KB
Del
OK
profile.h
11.87 KB
Del
OK
protobuf-c
-
Del
OK
protocols
-
Del
OK
pthread.h
39.95 KB
Del
OK
pty.h
1.51 KB
Del
OK
punycode.h
9.36 KB
Del
OK
pwd.h
5.87 KB
Del
OK
python2.7
-
Del
OK
python3.6m
-
Del
OK
quota
-
Del
OK
rdma
-
Del
OK
re_comp.h
957 B
Del
OK
regex.h
21.58 KB
Del
OK
regexp.h
6.89 KB
Del
OK
resolv.h
14.67 KB
Del
OK
rpc
-
Del
OK
rpcsvc
-
Del
OK
sasl
-
Del
OK
sched.h
4.55 KB
Del
OK
scsi
-
Del
OK
search.h
5.11 KB
Del
OK
security
-
Del
OK
selinux
-
Del
OK
semaphore.h
2.36 KB
Del
OK
sepol
-
Del
OK
setjmp.h
3.97 KB
Del
OK
sgtty.h
1.33 KB
Del
OK
shadow.h
5.1 KB
Del
OK
signal.h
13.3 KB
Del
OK
slapi-plugin.h
37.45 KB
Del
OK
sound
-
Del
OK
spawn.h
6.53 KB
Del
OK
stab.h
264 B
Del
OK
stdc-predef.h
1.59 KB
Del
OK
stdint.h
7.94 KB
Del
OK
stdio.h
30.9 KB
Del
OK
stdio_ext.h
2.74 KB
Del
OK
stdlib.h
33.23 KB
Del
OK
string.h
21.75 KB
Del
OK
stringprep.h
8 KB
Del
OK
strings.h
4.55 KB
Del
OK
sys
-
Del
OK
syscall.h
25 B
Del
OK
sysexits.h
5.11 KB
Del
OK
syslog.h
24 B
Del
OK
tar.h
3.67 KB
Del
OK
tcpd.h
11.48 KB
Del
OK
term.h
38.63 KB
Del
OK
term_entry.h
7.91 KB
Del
OK
termcap.h
3.4 KB
Del
OK
termio.h
214 B
Del
OK
termios.h
3.52 KB
Del
OK
tgmath.h
18.11 KB
Del
OK
thread_db.h
15.65 KB
Del
OK
tic.h
12.35 KB
Del
OK
tiff.h
34.95 KB
Del
OK
tiffconf-64.h
3.35 KB
Del
OK
tiffconf.h
250 B
Del
OK
tiffio.h
22.52 KB
Del
OK
tiffio.hxx
1.66 KB
Del
OK
tiffvers.h
410 B
Del
OK
time.h
13.4 KB
Del
OK
tld.h
4.54 KB
Del
OK
ttyent.h
2.44 KB
Del
OK
uapi
-
Del
OK
uchar.h
2.42 KB
Del
OK
ucontext.h
1.92 KB
Del
OK
ulimit.h
1.55 KB
Del
OK
unctrl.h
3.03 KB
Del
OK
unistd.h
41.78 KB
Del
OK
ustat.h
23 B
Del
OK
utime.h
1.5 KB
Del
OK
utmp.h
3.16 KB
Del
OK
utmpx.h
4.02 KB
Del
OK
uuid
-
Del
OK
values.h
1.92 KB
Del
OK
verto-module.h
6.48 KB
Del
OK
verto.h
18.57 KB
Del
OK
video
-
Del
OK
wait.h
22 B
Del
OK
wchar.h
31.37 KB
Del
OK
wctype.h
10.89 KB
Del
OK
wordexp.h
2.47 KB
Del
OK
xcb
-
Del
OK
xen
-
Del
OK
xlocale.h
1.66 KB
Del
OK
zconf.h
14.92 KB
Del
OK
zlib.h
84.68 KB
Del
OK
Edit: libelf.h
/* Interface for libelf. Copyright (C) 1998-2010, 2015 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify it under the terms of either * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version or * the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version or both in parallel, as here. elfutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _LIBELF_H #define _LIBELF_H 1 #include <stdint.h> #include <sys/types.h> /* Get the ELF types. */ #include <elf.h> #ifndef SHF_COMPRESSED /* Older glibc elf.h might not yet define the ELF compression types. */ #define SHF_COMPRESSED (1 << 11) /* Section with compressed data. */ /* Section compression header. Used when SHF_COMPRESSED is set. */ typedef struct { Elf32_Word ch_type; /* Compression format. */ Elf32_Word ch_size; /* Uncompressed data size. */ Elf32_Word ch_addralign; /* Uncompressed data alignment. */ } Elf32_Chdr; typedef struct { Elf64_Word ch_type; /* Compression format. */ Elf64_Word ch_reserved; Elf64_Xword ch_size; /* Uncompressed data size. */ Elf64_Xword ch_addralign; /* Uncompressed data alignment. */ } Elf64_Chdr; /* Legal values for ch_type (compression algorithm). */ #define ELFCOMPRESS_ZLIB 1 /* ZLIB/DEFLATE algorithm. */ #define ELFCOMPRESS_LOOS 0x60000000 /* Start of OS-specific. */ #define ELFCOMPRESS_HIOS 0x6fffffff /* End of OS-specific. */ #define ELFCOMPRESS_LOPROC 0x70000000 /* Start of processor-specific. */ #define ELFCOMPRESS_HIPROC 0x7fffffff /* End of processor-specific. */ #endif #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) # define __nonnull_attribute__(...) __attribute__ ((__nonnull__ (__VA_ARGS__))) # define __deprecated_attribute__ __attribute__ ((__deprecated__)) # define __pure_attribute__ __attribute__ ((__pure__)) # define __const_attribute__ __attribute__ ((__const__)) #else # define __nonnull_attribute__(...) # define __deprecated_attribute__ # define __pure_attribute__ # define __const_attribute__ #endif #if __GNUC__ < 4 #define __noreturn_attribute__ #else #define __noreturn_attribute__ __attribute__ ((noreturn)) #endif #ifdef __GNUC_STDC_INLINE__ # define __libdw_extern_inline extern __inline __attribute__ ((__gnu_inline__)) #else # define __libdw_extern_inline extern __inline #endif /* Known translation types. */ typedef enum { ELF_T_BYTE, /* unsigned char */ ELF_T_ADDR, /* Elf32_Addr, Elf64_Addr, ... */ ELF_T_DYN, /* Dynamic section record. */ ELF_T_EHDR, /* ELF header. */ ELF_T_HALF, /* Elf32_Half, Elf64_Half, ... */ ELF_T_OFF, /* Elf32_Off, Elf64_Off, ... */ ELF_T_PHDR, /* Program header. */ ELF_T_RELA, /* Relocation entry with addend. */ ELF_T_REL, /* Relocation entry. */ ELF_T_SHDR, /* Section header. */ ELF_T_SWORD, /* Elf32_Sword, Elf64_Sword, ... */ ELF_T_SYM, /* Symbol record. */ ELF_T_WORD, /* Elf32_Word, Elf64_Word, ... */ ELF_T_XWORD, /* Elf32_Xword, Elf64_Xword, ... */ ELF_T_SXWORD, /* Elf32_Sxword, Elf64_Sxword, ... */ ELF_T_VDEF, /* Elf32_Verdef, Elf64_Verdef, ... */ ELF_T_VDAUX, /* Elf32_Verdaux, Elf64_Verdaux, ... */ ELF_T_VNEED, /* Elf32_Verneed, Elf64_Verneed, ... */ ELF_T_VNAUX, /* Elf32_Vernaux, Elf64_Vernaux, ... */ ELF_T_NHDR, /* Elf32_Nhdr, Elf64_Nhdr, ... */ ELF_T_SYMINFO, /* Elf32_Syminfo, Elf64_Syminfo, ... */ ELF_T_MOVE, /* Elf32_Move, Elf64_Move, ... */ ELF_T_LIB, /* Elf32_Lib, Elf64_Lib, ... */ ELF_T_GNUHASH, /* GNU-style hash section. */ ELF_T_AUXV, /* Elf32_auxv_t, Elf64_auxv_t, ... */ ELF_T_CHDR, /* Compressed, Elf32_Chdr, Elf64_Chdr, ... */ ELF_T_NHDR8, /* Special GNU Properties note. Same as Nhdr, except padding. */ /* Keep this the last entry. */ ELF_T_NUM } Elf_Type; /* Descriptor for data to be converted to or from memory format. */ typedef struct { void *d_buf; /* Pointer to the actual data. */ Elf_Type d_type; /* Type of this piece of data. */ unsigned int d_version; /* ELF version. */ size_t d_size; /* Size in bytes. */ int64_t d_off; /* Offset into section. */ size_t d_align; /* Alignment in section. */ } Elf_Data; /* Commands for `...'. */ typedef enum { ELF_C_NULL, /* Nothing, terminate, or compute only. */ ELF_C_READ, /* Read .. */ ELF_C_RDWR, /* Read and write .. */ ELF_C_WRITE, /* Write .. */ ELF_C_CLR, /* Clear flag. */ ELF_C_SET, /* Set flag. */ ELF_C_FDDONE, /* Signal that file descriptor will not be used anymore. */ ELF_C_FDREAD, /* Read rest of data so that file descriptor is not used anymore. */ /* The following are extensions. */ ELF_C_READ_MMAP, /* Read, but mmap the file if possible. */ ELF_C_RDWR_MMAP, /* Read and write, with mmap. */ ELF_C_WRITE_MMAP, /* Write, with mmap. */ ELF_C_READ_MMAP_PRIVATE, /* Read, but memory is writable, results are not written to the file. */ ELF_C_EMPTY, /* Copy basic file data but not the content. */ /* Keep this the last entry. */ ELF_C_NUM } Elf_Cmd; /* Flags for the ELF structures. */ enum { ELF_F_DIRTY = 0x1, #define ELF_F_DIRTY ELF_F_DIRTY ELF_F_LAYOUT = 0x4, #define ELF_F_LAYOUT ELF_F_LAYOUT ELF_F_PERMISSIVE = 0x8 #define ELF_F_PERMISSIVE ELF_F_PERMISSIVE }; /* Flags for elf_compress[_gnu]. */ enum { ELF_CHF_FORCE = 0x1 #define ELF_CHF_FORCE ELF_CHF_FORCE }; /* Identification values for recognized object files. */ typedef enum { ELF_K_NONE, /* Unknown. */ ELF_K_AR, /* Archive. */ ELF_K_COFF, /* Stupid old COFF. */ ELF_K_ELF, /* ELF file. */ /* Keep this the last entry. */ ELF_K_NUM } Elf_Kind; /* Archive member header. */ typedef struct { char *ar_name; /* Name of archive member. */ time_t ar_date; /* File date. */ uid_t ar_uid; /* User ID. */ gid_t ar_gid; /* Group ID. */ mode_t ar_mode; /* File mode. */ int64_t ar_size; /* File size. */ char *ar_rawname; /* Original name of archive member. */ } Elf_Arhdr; /* Archive symbol table entry. */ typedef struct { char *as_name; /* Symbol name. */ size_t as_off; /* Offset for this file in the archive. */ unsigned long int as_hash; /* Hash value of the name. */ } Elf_Arsym; /* Descriptor for the ELF file. */ typedef struct Elf Elf; /* Descriptor for ELF file section. */ typedef struct Elf_Scn Elf_Scn; #ifdef __cplusplus extern "C" { #endif /* Return descriptor for ELF file to work according to CMD. */ extern Elf *elf_begin (int __fildes, Elf_Cmd __cmd, Elf *__ref); /* Create a clone of an existing ELF descriptor. */ extern Elf *elf_clone (Elf *__elf, Elf_Cmd __cmd); /* Create descriptor for memory region. */ extern Elf *elf_memory (char *__image, size_t __size); /* Advance archive descriptor to next element. */ extern Elf_Cmd elf_next (Elf *__elf); /* Free resources allocated for ELF. */ extern int elf_end (Elf *__elf); /* Update ELF descriptor and write file to disk. */ extern int64_t elf_update (Elf *__elf, Elf_Cmd __cmd); /* Determine what kind of file is associated with ELF. */ extern Elf_Kind elf_kind (Elf *__elf) __pure_attribute__; /* Get the base offset for an object file. */ extern int64_t elf_getbase (Elf *__elf); /* Retrieve file identification data. */ extern char *elf_getident (Elf *__elf, size_t *__nbytes); /* Retrieve class-dependent object file header. */ extern Elf32_Ehdr *elf32_getehdr (Elf *__elf); /* Similar but this time the binary calls is ELFCLASS64. */ extern Elf64_Ehdr *elf64_getehdr (Elf *__elf); /* Create ELF header if none exists. */ extern Elf32_Ehdr *elf32_newehdr (Elf *__elf); /* Similar but this time the binary calls is ELFCLASS64. */ extern Elf64_Ehdr *elf64_newehdr (Elf *__elf); /* Get the number of program headers in the ELF file. If the file uses more headers than can be represented in the e_phnum field of the ELF header the information from the sh_info field in the zeroth section header is used. */ extern int elf_getphdrnum (Elf *__elf, size_t *__dst); /* Retrieve class-dependent program header table. */ extern Elf32_Phdr *elf32_getphdr (Elf *__elf); /* Similar but this time the binary calls is ELFCLASS64. */ extern Elf64_Phdr *elf64_getphdr (Elf *__elf); /* Create ELF program header. */ extern Elf32_Phdr *elf32_newphdr (Elf *__elf, size_t __cnt); /* Similar but this time the binary calls is ELFCLASS64. */ extern Elf64_Phdr *elf64_newphdr (Elf *__elf, size_t __cnt); /* Get section at INDEX. */ extern Elf_Scn *elf_getscn (Elf *__elf, size_t __index); /* Get section at OFFSET. */ extern Elf_Scn *elf32_offscn (Elf *__elf, Elf32_Off __offset); /* Similar bug this time the binary calls is ELFCLASS64. */ extern Elf_Scn *elf64_offscn (Elf *__elf, Elf64_Off __offset); /* Get index of section. */ extern size_t elf_ndxscn (Elf_Scn *__scn); /* Get section with next section index. */ extern Elf_Scn *elf_nextscn (Elf *__elf, Elf_Scn *__scn); /* Create a new section and append it at the end of the table. */ extern Elf_Scn *elf_newscn (Elf *__elf); /* Get the section index of the extended section index table for the given symbol table. */ extern int elf_scnshndx (Elf_Scn *__scn); /* Get the number of sections in the ELF file. If the file uses more sections than can be represented in the e_shnum field of the ELF header the information from the sh_size field in the zeroth section header is used. */ extern int elf_getshdrnum (Elf *__elf, size_t *__dst); /* Sun messed up the implementation of 'elf_getshnum' in their implementation. It was agreed to make the same functionality available under a different name and obsolete the old name. */ extern int elf_getshnum (Elf *__elf, size_t *__dst) __deprecated_attribute__; /* Get the section index of the section header string table in the ELF file. If the index cannot be represented in the e_shstrndx field of the ELF header the information from the sh_link field in the zeroth section header is used. */ extern int elf_getshdrstrndx (Elf *__elf, size_t *__dst); /* Sun messed up the implementation of 'elf_getshstrndx' in their implementation. It was agreed to make the same functionality available under a different name and obsolete the old name. */ extern int elf_getshstrndx (Elf *__elf, size_t *__dst) __deprecated_attribute__; /* Retrieve section header of ELFCLASS32 binary. */ extern Elf32_Shdr *elf32_getshdr (Elf_Scn *__scn); /* Similar for ELFCLASS64. */ extern Elf64_Shdr *elf64_getshdr (Elf_Scn *__scn); /* Returns compression header for a section if section data is compressed. Returns NULL and sets elf_errno if the section isn't compressed or an error occurred. */ extern Elf32_Chdr *elf32_getchdr (Elf_Scn *__scn); extern Elf64_Chdr *elf64_getchdr (Elf_Scn *__scn); /* Compress or decompress the data of a section and adjust the section header. elf_compress works by setting or clearing the SHF_COMPRESS flag from the section Shdr and will encode or decode a Elf32_Chdr or Elf64_Chdr at the start of the section data. elf_compress_gnu will encode or decode any section, but is traditionally only used for sections that have a name starting with ".debug" when uncompressed or ".zdebug" when compressed and stores just the uncompressed size. The GNU compression method is deprecated and should only be used for legacy support. elf_compress takes a compression type that should be either zero to decompress or an ELFCOMPRESS algorithm to use for compression. Currently only ELFCOMPRESS_ZLIB is supported. elf_compress_gnu will compress in the traditional GNU compression format when compress is one and decompress the section data when compress is zero. The FLAGS argument can be zero or ELF_CHF_FORCE. If FLAGS contains ELF_CHF_FORCE then it will always compress the section, even if that would not reduce the size of the data section (including the header). Otherwise elf_compress and elf_compress_gnu will compress the section only if the total data size is reduced. On successful compression or decompression the function returns one. If (not forced) compression is requested and the data section would not actually reduce in size, the section is not actually compressed and zero is returned. Otherwise -1 is returned and elf_errno is set. It is an error to request compression for a section that already has SHF_COMPRESSED set, or (for elf_compress) to request decompression for an section that doesn't have SHF_COMPRESSED set. If a section has SHF_COMPRESSED set then calling elf_compress_gnu will result in an error. The section has to be decompressed first using elf_compress. Calling elf_compress on a section compressed with elf_compress_gnu is fine, but probably useless. It is always an error to call these functions on SHT_NOBITS sections or if the section has the SHF_ALLOC flag set. elf_compress_gnu will not check whether the section name starts with ".debug" or .zdebug". It is the responsibilty of the caller to make sure the deprecated GNU compression method is only called on correctly named sections (and to change the name of the section when using elf_compress_gnu). All previous returned Shdrs and Elf_Data buffers are invalidated by this call and should no longer be accessed. Note that although this changes the header and data returned it doesn't mark the section as dirty. To keep the changes when calling elf_update the section has to be flagged ELF_F_DIRTY. */ extern int elf_compress (Elf_Scn *scn, int type, unsigned int flags); extern int elf_compress_gnu (Elf_Scn *scn, int compress, unsigned int flags); /* Set or clear flags for ELF file. */ extern unsigned int elf_flagelf (Elf *__elf, Elf_Cmd __cmd, unsigned int __flags); /* Similarly for the ELF header. */ extern unsigned int elf_flagehdr (Elf *__elf, Elf_Cmd __cmd, unsigned int __flags); /* Similarly for the ELF program header. */ extern unsigned int elf_flagphdr (Elf *__elf, Elf_Cmd __cmd, unsigned int __flags); /* Similarly for the given ELF section. */ extern unsigned int elf_flagscn (Elf_Scn *__scn, Elf_Cmd __cmd, unsigned int __flags); /* Similarly for the given ELF data. */ extern unsigned int elf_flagdata (Elf_Data *__data, Elf_Cmd __cmd, unsigned int __flags); /* Similarly for the given ELF section header. */ extern unsigned int elf_flagshdr (Elf_Scn *__scn, Elf_Cmd __cmd, unsigned int __flags); /* Get data from section while translating from file representation to memory representation. The Elf_Data d_type is set based on the section type if known. Otherwise d_type is set to ELF_T_BYTE. If the section contains compressed data then d_type is always set to ELF_T_CHDR. */ extern Elf_Data *elf_getdata (Elf_Scn *__scn, Elf_Data *__data); /* Get uninterpreted section content. */ extern Elf_Data *elf_rawdata (Elf_Scn *__scn, Elf_Data *__data); /* Create new data descriptor for section SCN. */ extern Elf_Data *elf_newdata (Elf_Scn *__scn); /* Get data translated from a chunk of the file contents as section data would be for TYPE. The resulting Elf_Data pointer is valid until elf_end (ELF) is called. */ extern Elf_Data *elf_getdata_rawchunk (Elf *__elf, int64_t __offset, size_t __size, Elf_Type __type); /* Return pointer to string at OFFSET in section INDEX. */ extern char *elf_strptr (Elf *__elf, size_t __index, size_t __offset); /* Return header of archive. */ extern Elf_Arhdr *elf_getarhdr (Elf *__elf); /* Return offset in archive for current file ELF. */ extern int64_t elf_getaroff (Elf *__elf); /* Select archive element at OFFSET. */ extern size_t elf_rand (Elf *__elf, size_t __offset); /* Get symbol table of archive. */ extern Elf_Arsym *elf_getarsym (Elf *__elf, size_t *__narsyms); /* Control ELF descriptor. */ extern int elf_cntl (Elf *__elf, Elf_Cmd __cmd); /* Retrieve uninterpreted file contents. */ extern char *elf_rawfile (Elf *__elf, size_t *__nbytes); /* Return size of array of COUNT elements of the type denoted by TYPE in the external representation. The binary class is taken from ELF. The result is based on version VERSION of the ELF standard. */ extern size_t elf32_fsize (Elf_Type __type, size_t __count, unsigned int __version) __const_attribute__; /* Similar but this time the binary calls is ELFCLASS64. */ extern size_t elf64_fsize (Elf_Type __type, size_t __count, unsigned int __version) __const_attribute__; /* Convert data structure from the representation in the file represented by ELF to their memory representation. */ extern Elf_Data *elf32_xlatetom (Elf_Data *__dest, const Elf_Data *__src, unsigned int __encode); /* Same for 64 bit class. */ extern Elf_Data *elf64_xlatetom (Elf_Data *__dest, const Elf_Data *__src, unsigned int __encode); /* Convert data structure from to the representation in memory represented by ELF file representation. */ extern Elf_Data *elf32_xlatetof (Elf_Data *__dest, const Elf_Data *__src, unsigned int __encode); /* Same for 64 bit class. */ extern Elf_Data *elf64_xlatetof (Elf_Data *__dest, const Elf_Data *__src, unsigned int __encode); /* Return error code of last failing function call. This value is kept separately for each thread. */ extern int elf_errno (void); /* Return error string for ERROR. If ERROR is zero, return error string for most recent error or NULL is none occurred. If ERROR is -1 the behaviour is similar to the last case except that not NULL but a legal string is returned. */ extern const char *elf_errmsg (int __error); /* Coordinate ELF library and application versions. */ extern unsigned int elf_version (unsigned int __version); /* Set fill bytes used to fill holes in data structures. */ extern void elf_fill (int __fill); /* Compute hash value. */ extern unsigned long int elf_hash (const char *__string) __pure_attribute__; /* Compute hash value using the GNU-specific hash function. */ extern unsigned long int elf_gnu_hash (const char *__string) __pure_attribute__; /* Compute simple checksum from permanent parts of the ELF file. */ extern long int elf32_checksum (Elf *__elf); /* Similar but this time the binary calls is ELFCLASS64. */ extern long int elf64_checksum (Elf *__elf); #ifdef __cplusplus } #endif #endif /* libelf.h */
Save