/*
Copyright (C) 2000,2001,2002,2005,2006 Silicon Graphics, Inc. All Rights Reserved.
Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved.
Portions Copyright 2008-2010 Arxan Technologies, Inc. All rights reserved.
under the terms of version 2.1 of the GNU Lesser General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it would be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Further, this software is distributed without any warranty that it is
free of the rightful claim of any third person regarding infringement
or the like. Any license provided herein, whether implied or
otherwise, applies only to this software file. Patent licenses, if
any, provided herein do not apply to combinations of this program with
other software, or any other product whatsoever.
You should have received a copy of the GNU Lesser General Public
License along with this program; if not, write the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston MA 02110-1301,
USA.
Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
Mountain View, CA 94043, or:
For further information regarding this notice, see:
*/
#include "config.h"
#include "dwarf_incl.h"
#include "dwarf_elf_access.h"
#ifdef HAVE_ELF_H
#include <elf.h>
#endif
#ifdef HAVE_LIBELF_H
#include <libelf.h>
#else
#ifdef HAVE_LIBELF_LIBELF_H
#endif
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define FALSE 0
static int
int libdwarf_owns_elf,
Dwarf_Error * error);
/*
The basic dwarf initializer function for consumers using
libelf.
Return a libdwarf error code on error, return DW_DLV_OK
if this succeeds.
*/
int
{
/* ELF_C_READ is a portable value */
#if !defined(S_ISREG)
#endif
}
}
if (access != DW_DLC_READ) {
}
/* changed to mmap request per bug 281217. 6/95 */
#ifdef HAVE_ELF_C_READ_MMAP
/* ELF_C_READ_MMAP is an SGI IRIX specific enum value from IRIX
libelf.h meaning read but use mmap */
#endif /* !HAVE_ELF_C_READ_MMAP */
if (elf_file_pointer == NULL) {
}
TRUE,
error);
}
/*
An alternate dwarf setup call for consumers using
libelf.
When the caller has opened libelf already, so the
caller must free libelf.
*/
int
{
error);
}
/*
Initialize the ELF object access for libdwarf.
*/
static int
int libdwarf_owns_elf,
Dwarf_Error * error)
{
/* ELF is no longer tied to libdwarf. */
int err = 0;
if (access != DW_DLC_READ) {
}
/* This allocates and fills in *binary_interface. */
&err);
}
/* This mallocs space and returns pointer thru ret_dbg,
saving the binary interface in 'ret-dbg' */
}
return res;
}
/*
Frees all memory that was not previously freed
by dwarf_dealloc.
Aside from certain categories.
This is only applicable when dwarf_init() or dwarf_elf_init()
was used to init 'dbg'.
*/
int
{
}