[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


elf_end Subroutine

Purpose

Finish using an object file

Library

cc [flag...] file... -lelf [library]...
#include <libelf.h>

Syntax


int elf_end(Elf * elf);

Description

A program uses elf_end to terminate an ELF descriptor, elf, and to deallocate data associated with the descriptor. Until the program terminates a descriptor, the data remain allocated.

Parameters

elf should be a value previously returned by elf_begin; a null pointer is allowed as an argument, to simplify error handling. If the program wishes to write data associated with the ELF descriptor to the file, it must use elf_update before calling elf_end.

Return Values

As described for the elf_begin subroutine, a descriptor can have more than one activation. Calling elf_end removes one activation and returns the remaining activation count. The library does not terminate the descriptor until the activation count reaches zero. Consequently, a zero return value indicates the ELF descriptor is no longer valid.

Related Information

The elf_begin (elf_begin Subroutine) subroutine, elf_update (elf_update Subroutine) subroutine.

Introduction to ELF Subroutines.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]