OpenBSD manual page server

Manual Page Search Parameters

ELF_GETBASE(3) Library Functions Manual ELF_GETBASE(3)

elf_getbaseget the base offset for an object file

library “libelf”

#include <libelf.h>

off_t
elf_getbase(Elf *elf);

Function () returns the file offset to the first byte of the object referenced by ELF descriptor elf.

For descriptors referencing members of archives, the returned offset is the file offset of the member in its containing archive. For descriptors to regular objects, the returned offset is (vacuously) zero.

Function elf_getbase() returns a valid file offset if successful, or (off_t) -1 in case of an error.

Function elf_getbase() may fail with the following errors:

[]
Argument elf was NULL.

elf(3), elf_getarhdr(3), elf_getident(3), elf_rawfile(3), gelf(3)

June 6, 2010 OpenBSD-7.6