Blame libebl/ebl-hooks.h

Packit 032894
/* Backend hook signatures internal interface for libebl.
Packit 032894
   Copyright (C) 2000-2011, 2013, 2014, 2016, 2017 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
/* Return symbolic representation of relocation type.  */
Packit 032894
const char *EBLHOOK(reloc_type_name) (int, char *, size_t);
Packit 032894
Packit 032894
/* Check relocation type.  */
Packit 032894
bool EBLHOOK(reloc_type_check) (int);
Packit 032894
Packit 032894
/* Check if relocation type is for simple absolute relocations.  */
Packit 032894
Elf_Type EBLHOOK(reloc_simple_type) (Ebl *, int, int *);
Packit 032894
Packit 032894
/* Check relocation type use.  */
Packit 032894
bool EBLHOOK(reloc_valid_use) (Elf *, int);
Packit 032894
Packit 032894
/* Return true if the symbol type is that referencing the GOT.  */
Packit 032894
bool EBLHOOK(gotpc_reloc_check) (Elf *, int);
Packit 032894
Packit 032894
/* Return symbolic representation of segment type.  */
Packit 032894
const char *EBLHOOK(segment_type_name) (int, char *, size_t);
Packit 032894
Packit 032894
/* Return symbolic representation of section type.  */
Packit 032894
const char *EBLHOOK(section_type_name) (int, char *, size_t);
Packit 032894
Packit 032894
/* Return section name.  */
Packit 032894
const char *EBLHOOK(section_name) (int, int, char *, size_t);
Packit 032894
Packit 032894
/* Return next machine flag name.  */
Packit 032894
const char *EBLHOOK(machine_flag_name) (GElf_Word *);
Packit 032894
Packit 032894
/* Check whether machine flags are valid.  */
Packit 032894
bool EBLHOOK(machine_flag_check) (GElf_Word);
Packit 032894
Packit 032894
/* Check whether SHF_MASKPROC flag bits are valid.  */
Packit 032894
bool EBLHOOK(machine_section_flag_check) (GElf_Xword);
Packit 032894
Packit 032894
/* Check whether the section with the given index, header, and name
Packit 032894
   is a special machine section that is valid despite a combination
Packit 032894
   of flags or other details that are not generically valid.  */
Packit 032894
bool EBLHOOK(check_special_section) (Ebl *, int,
Packit 032894
				     const GElf_Shdr *, const char *);
Packit 032894
Packit 032894
/* Return symbolic representation of symbol type.  */
Packit 032894
const char *EBLHOOK(symbol_type_name) (int, char *, size_t);
Packit 032894
Packit 032894
/* Return symbolic representation of symbol binding.  */
Packit 032894
const char *EBLHOOK(symbol_binding_name) (int, char *, size_t);
Packit 032894
Packit 032894
/* Return symbolic representation of dynamic tag.  */
Packit 032894
const char *EBLHOOK(dynamic_tag_name) (int64_t, char *, size_t);
Packit 032894
Packit 032894
/* Check dynamic tag.  */
Packit 032894
bool EBLHOOK(dynamic_tag_check) (int64_t);
Packit 032894
Packit 032894
/* Return symbolic representation of OS ABI.  */
Packit 032894
const char *EBLHOOK(osabi_name) (int, char *, size_t);
Packit 032894
Packit 032894
/* Name of a note entry type for core files.  */
Packit 032894
const char *EBLHOOK(core_note_type_name) (uint32_t, char *, size_t);
Packit 032894
Packit 032894
/* Name of a note entry type for object files.  */
Packit 032894
const char *EBLHOOK(object_note_type_name) (const char *, uint32_t,
Packit 032894
					    char *, size_t);
Packit 032894
Packit 032894
/* Describe core note format.  */
Packit 032894
int EBLHOOK(core_note) (const GElf_Nhdr *, const char *,
Packit 032894
			GElf_Word *, size_t *, const Ebl_Register_Location **,
Packit 032894
			size_t *, const Ebl_Core_Item **);
Packit 032894
Packit 032894
/* Handle object file note.  */
Packit 032894
bool EBLHOOK(object_note) (const char *, uint32_t, uint32_t, const char *);
Packit 032894
Packit 032894
/* Check object attribute.  */
Packit 032894
bool EBLHOOK(check_object_attribute) (Ebl *, const char *, int, uint64_t,
Packit 032894
				      const char **, const char **);
Packit 032894
Packit 032894
/* Check reloc target section type.  */
Packit 032894
bool EBLHOOK(check_reloc_target_type) (Ebl *, Elf64_Word);
Packit 032894
Packit 032894
/* Describe auxv element type.  */
Packit 032894
int EBLHOOK(auxv_info) (GElf_Xword, const char **, const char **);
Packit 032894
Packit 032894
/* Check section name for being that of a debug informatino section.  */
Packit 032894
bool EBLHOOK(debugscn_p) (const char *);
Packit 032894
Packit 032894
/* Check whether given relocation is a copy relocation.  */
Packit 032894
bool EBLHOOK(copy_reloc_p) (int);
Packit 032894
Packit 032894
/* Check whether given relocation is a no-op relocation.  */
Packit 032894
bool EBLHOOK(none_reloc_p) (int);
Packit 032894
Packit 032894
/* Check whether given relocation is a relative relocation.  */
Packit 032894
bool EBLHOOK(relative_reloc_p) (int);
Packit 032894
Packit 032894
/* Check whether given symbol's value is ok despite normal checks.  */
Packit 032894
bool EBLHOOK(check_special_symbol) (Elf *, const GElf_Sym *,
Packit 032894
			      const char *, const GElf_Shdr *);
Packit 032894
Packit 032894
/* Check if this is a data marker symbol.  e.g. '$d' symbols for ARM.  */
Packit 032894
bool EBLHOOK(data_marker_symbol) (const GElf_Sym *sym, const char *sname);
Packit 032894
Packit 032894
/* Check whether only valid bits are set on the st_other symbol flag.
Packit 032894
   Standard ST_VISIBILITY have already been masked off.  */
Packit 032894
bool EBLHOOK(check_st_other_bits) (unsigned char st_other);
Packit 032894
Packit 032894
/* Check if backend uses a bss PLT in this file.  */
Packit 032894
bool EBLHOOK(bss_plt_p) (Elf *);
Packit 032894
Packit 032894
/* Return location expression to find return value given the
Packit 032894
   DW_AT_type DIE of a DW_TAG_subprogram DIE.  */
Packit 032894
int EBLHOOK(return_value_location) (Dwarf_Die *functypedie,
Packit 032894
				    const Dwarf_Op **locp);
Packit 032894
Packit 032894
/* Return register name information.  */
Packit 032894
ssize_t EBLHOOK(register_info) (Ebl *ebl,
Packit 032894
				int regno, char *name, size_t namelen,
Packit 032894
				const char **prefix, const char **setname,
Packit 032894
				int *bits, int *type);
Packit 032894
Packit 032894
/* Return system call ABI registers.  */
Packit 032894
int EBLHOOK(syscall_abi) (Ebl *ebl, int *sp, int *pc,
Packit 032894
			  int *callno, int args[6]);
Packit 032894
Packit 032894
/* Disassembler function.  */
Packit 032894
int EBLHOOK(disasm) (Ebl *ebl, const uint8_t **startp, const uint8_t *end,
Packit 032894
		     GElf_Addr addr, const char *fmt, DisasmOutputCB_t outcb,
Packit 032894
		     DisasmGetSymCB_t symcb, void *outcbarg, void *symcbarg);
Packit 032894
Packit 032894
/* Supply the machine-specific state of CFI before CIE initial programs.
Packit 032894
   Function returns 0 on success and -1 on error.  */
Packit 032894
int EBLHOOK(abi_cfi) (Ebl *ebl, Dwarf_CIE *abi_info);
Packit 032894
Packit 032894
/* Fetch process data from live TID and call SETFUNC one or more times.
Packit 032894
   Method should be present only when EBL_FRAME_NREGS > 0, otherwise the
Packit 032894
   backend doesn't support unwinding.  */
Packit 032894
bool EBLHOOK(set_initial_registers_tid) (pid_t tid,
Packit 032894
					 ebl_tid_registers_t *setfunc,
Packit 032894
					 void *arg);
Packit 032894
Packit 032894
/* Convert *REGNO as is in DWARF to a lower range suitable for
Packit 032894
   Dwarf_Frame->REGS indexing.  */
Packit 032894
bool EBLHOOK(dwarf_to_regno) (Ebl *ebl, unsigned *regno);
Packit 032894
Packit 032894
/* Optionally modify *PC as fetched from inferior data into valid PC
Packit 032894
   instruction pointer.  */
Packit 032894
void EBLHOOK(normalize_pc) (Ebl *ebl, Dwarf_Addr *pc);
Packit 032894
Packit 032894
/* Get previous frame state for an existing frame state.  Method is called only
Packit 032894
   if unwinder could not find CFI for current PC.  PC is for the
Packit 032894
   existing frame.  SETFUNC sets register in the previous frame.  GETFUNC gets
Packit 032894
   register from the existing frame.  Note that GETFUNC vs. SETFUNC act on
Packit 032894
   a disjunct set of registers.  READFUNC reads memory.  ARG has to be passed
Packit 032894
   for SETFUNC, GETFUNC and READFUNC.  *SIGNAL_FRAMEP is initialized to false,
Packit 032894
   it can be set to true if existing frame is a signal frame.  SIGNAL_FRAMEP is
Packit 032894
   never NULL.  */
Packit 032894
bool EBLHOOK(unwind) (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
Packit 032894
		      ebl_tid_registers_get_t *getfunc,
Packit 032894
		      ebl_pid_memory_read_t *readfunc, void *arg,
Packit 032894
		      bool *signal_framep);
Packit 032894
Packit 032894
/* Returns true if the value can be resolved to an address in an
Packit 032894
   allocated section, which will be returned in *ADDR.
Packit 032894
   (e.g. function descriptor resolving)  */
Packit 032894
bool EBLHOOK(resolve_sym_value) (Ebl *ebl, GElf_Addr *addr);
Packit 032894
Packit 032894
/* Destructor for ELF backend handle.  */
Packit 032894
void EBLHOOK(destr) (struct ebl *);