Blame libebl/libeblP.h

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