Blame libebl/libeblP.h

Packit 032894
/* Internal definitions for interface for libebl.
Packit 032894
   Copyright (C) 2000-2009, 2013, 2014 Red Hat, Inc.
Packit 032894
   This file is part of elfutils.
Packit 032894
Packit 032894
   This file is free software; you can redistribute it and/or modify
Packit 032894
   it under the terms of either
Packit 032894
Packit 032894
     * the GNU Lesser General Public License as published by the Free
Packit 032894
       Software Foundation; either version 3 of the License, or (at
Packit 032894
       your option) any later version
Packit 032894
Packit 032894
   or
Packit 032894
Packit 032894
     * the GNU General Public License as published by the Free
Packit 032894
       Software Foundation; either version 2 of the License, or (at
Packit 032894
       your option) any later version
Packit 032894
Packit 032894
   or both in parallel, as here.
Packit 032894
Packit 032894
   elfutils is distributed in the hope that it will be useful, but
Packit 032894
   WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 032894
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 032894
   General Public License for more details.
Packit 032894
Packit 032894
   You should have received copies of the GNU General Public License and
Packit 032894
   the GNU Lesser General Public License along with this program.  If
Packit 032894
   not, see <http://www.gnu.org/licenses/>.  */
Packit 032894
Packit 032894
#ifndef _LIBEBLP_H
Packit 032894
#define _LIBEBLP_H 1
Packit 032894
Packit 032894
#include <gelf.h>
Packit 032894
#include <libasm.h>
Packit 032894
#include <libebl.h>
Packit 032894
#include <libintl.h>
Packit 032894
Packit 032894
Packit 032894
/* Backend handle.  */
Packit 032894
struct ebl
Packit 032894
{
Packit 032894
  /* Emulation name.  */
Packit 032894
  const char *emulation;
Packit 032894
Packit 032894
  /* ELF machine, class, and data encoding.  */
Packit 032894
  uint_fast16_t machine;
Packit 032894
  uint_fast8_t class;
Packit 032894
  uint_fast8_t data;
Packit 032894
Packit 032894
  /* The libelf handle (if known).  */
Packit 032894
  Elf *elf;
Packit 032894
Packit 032894
  /* See ebl-hooks.h for the declarations of the hook functions.  */
Packit 032894
# define EBLHOOK(name) (*name)
Packit 032894
# include "ebl-hooks.h"
Packit 032894
# undef EBLHOOK
Packit 032894
Packit 032894
  /* Size of entry in Sysv-style hash table.  */
Packit 032894
  int sysvhash_entrysize;
Packit 032894
Packit 032894
  /* Number of registers to allocate for ebl_set_initial_registers_tid.
Packit 032894
     Ebl architecture can unwind iff FRAME_NREGS > 0.  */
Packit 032894
  size_t frame_nregs;
Packit 032894
Packit 032894
  /* Offset to apply to the value of the return_address_register, as
Packit 032894
     fetched from a Dwarf CFI.  This is used by some backends, where
Packit 032894
     the return_address_register actually contains the call
Packit 032894
     address.  */
Packit 032894
  int ra_offset;
Packit 032894
Packit 032894
  /* Mask to use to turn a function value into a real function address
Packit 032894
     in case the architecture adds some extra non-address bits to it.
Packit 032894
     If not initialized (0) then ebl_func_addr_mask will return ~0,
Packit 032894
     otherwise it should be the actual mask to use.  */
Packit 032894
  GElf_Addr func_addr_mask;
Packit 032894
Packit 032894
  /* Function descriptor load address and table as used by
Packit 032894
     ebl_resolve_sym_value if available for this arch.  */
Packit 032894
  GElf_Addr fd_addr;
Packit 032894
  Elf_Data *fd_data;
Packit 032894
};
Packit 032894
Packit 032894
Packit Service 35cfd5
/* Type of the initialization functions in the backend modules.
Packit Service 35cfd5
   The init function returns the given Ebl * or NULL if it couldn't
Packit Service 35cfd5
   initialize for the given Elf or machine.  */
Packit Service 35cfd5
typedef Ebl *(*ebl_bhinit_t) (Elf *, GElf_Half, Ebl *);
Packit 032894
Packit 032894
Packit 032894
/* gettext helper macros.  */
Packit 032894
#undef _
Packit 032894
#define _(Str) dgettext ("elfutils", Str)
Packit 032894
Packit 032894
Packit 032894
/* LEB128 constant helper macros.  */
Packit 032894
#define ULEB128_7(x)	(BUILD_BUG_ON_ZERO ((x) >= (1U << 7)) + (x))
Packit 032894
Packit 032894
#define BUILD_BUG_ON_ZERO(x) (sizeof (char [(x) ? -1 : 1]) - 1)
Packit 032894
Packit 032894
#endif	/* libeblP.h */