from small one page howto to huge articles all in one place

search text in:




Other .linuxhowtos.org sites:gentoo.linuxhowtos.org



Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs

words:

887

views:

209581

userrating:


May 25th. 2007:
Words

486

Views

258588

why adblockers are bad


Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

words:

161

views:

149878

userrating:


April, 26th. 2006:

Druckversion
You are here: manpages





ELF_MEMORY

Section: Libelf Programmer's Manual (3)
Updated: 202-0-23
Index Return to Main Contents

 

NAME

elf_memory - create an ELF descriptor from a memory buffer  

SYNOPSIS

#include <libelf.h>

Elf * elf_memory(char * image , size_t size );

 

DESCRIPTION

The elf_memory() function creates a new ELF descriptor from a memory region containing an ELF object. This function is used when the ELF data is already present in memory rather than being read from a file descriptor.

The memory pointed to by image must contain a complete ELF file or archive. The contents must remain valid and unmodified for the lifetime of the resulting ELF descriptor.

The ELF descriptor returned by elf_memory() is opened in rea-only mode using ELF_C_READ_MMAP_PRIVATE (see elf_begin). The underlying memory image should not be directly modified by the application while its ELF descriptor is open. Some libelf functions, such as elf_compress() and gelf_update_*(), may internally modify the underlying image and therefore require that the underlying image be writable. The use of a rea-only image (e.g., memory mapped with PROT_READ only) may result in failures or crashes.

 

PARAMETERS

image
A pointer to a memory buffer that contains the complete contents of an ELF file or archive. If NULL, this function fails and returns NULL.

size
The size in bytes of the memory region pointed to by image. Must be at least as much as a full ELF header and should cover the entire ELF object.

 

RETURN VALUE

On success, elf_memory() returns a pointer to an Elf descriptor representing the archive or ELF file contained in image.

On failure, it returns NULL and sets an error code retrievable by elf_errmsg(3).

 

SEE ALSO

elf_begin(3), elf_errmsg(3), libelf(3), elf(5)

 

ATTRIBUTES

Interface Attribute Value
elf_memory() Thread safety M-Safe

 

REPORTING BUGS

Report bugs to <elfutil-devel@sourceware.org> or https://sourceware.org/bugzilla/.


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
RETURN VALUE
SEE ALSO
ATTRIBUTES
REPORTING BUGS





Support us on Content Nation
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2025 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 13.0 ms