'\"macro stdmacro
.if n .pH g3e.elf_getbase @(#)elf_getbase	40.9 of 10/27/89
.\" Copyright 1989 AT&T
.\"#ident	"@(#)ci5-doc:req/libelf/getbase.man	1.3"
.nr X
.if \nX=0 .ds x} elf_getbase 3E "ELF Library" "\&"
.if \nX=1 .ds x} elf_getbase 3E "ELF Library"
.if \nX=2 .ds x} elf_getbase 3E "" "\&"
.if \nX=3 .ds x} elf_getbase "" "" "\&"
.TH \*(x}
.SH NAME
\f4elf_getbase\f1 \- get the base offset for an object file
.SH SYNOPSIS
\f4cc\f1
[\f2flag\fP \|.\|.\|.] \f2file\fP \|.\|.\|.
\f4\-lelf\f1
[\f2library\fP \|.\|.\|.]
.PP
.nf
.na
.ft 4
#include <libelf.h>
.sp 0.5
off_t elf_getbase(Elf \(**elf);
.ft 1
.ad
.fi
.SH DESCRIPTION
\f4elf_getbase\fP
returns the file offset of the
first byte of the file or archive member
associated with
.IR elf ,
if it is known or obtainable, and \-1 otherwise.
A null
.I elf
is allowed, to simplify error handling; the return
value in this case is \-1.
The base offset of an archive member is the beginning
of the member's information,
.I not
the beginning of the archive member header.
.SH "SEE ALSO"
.na
\f4elf\fP(3E),
\f4elf_begin\fP(3E),
\f4ar\fP(4).
