GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/elfread.c File Reference
#include "defs.h"
#include "bfd.h"
#include "elf-bfd.h"
#include "elf/common.h"
#include "elf/internal.h"
#include "elf/mips.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "buildsym.h"
#include "stabsread.h"
#include "gdb-stabs.h"
#include "complaints.h"
#include "demangle.h"
#include "psympriv.h"
#include "filenames.h"
#include "probe.h"
#include "arch-utils.h"
#include "gdbtypes.h"
#include "value.h"
#include "infcall.h"
#include "gdbthread.h"
#include "regcache.h"
#include "bcache.h"
#include "gdb_bfd.h"
#include "build-id.h"
#include "location.h"
#include "auxv.h"

Go to the source code of this file.

Classes

struct  elfinfo
 
struct  elf_gnu_ifunc_cache
 

Macros

#define SYMBOL_GOT_PLT_SUFFIX   "@got.plt"
 
#define ST_REGULAR   0
 
#define ST_DYNAMIC   1
 
#define ST_SYNTHETIC   2
 

Functions

static struct symfile_segment_dataelf_symfile_segments (bfd *abfd)
 
static void elf_locate_sections (bfd *ignore_abfd, asection *sectp, void *eip)
 
static struct minimal_symbolrecord_minimal_symbol (minimal_symbol_reader &reader, const char *name, int name_len, bool copy_name, CORE_ADDR address, enum minimal_symbol_type ms_type, asection *bfd_section, struct objfile *objfile)
 
static void elf_symtab_read (minimal_symbol_reader &reader, struct objfile *objfile, int type, long number_of_symbols, asymbol **symbol_table, bool copy_names)
 
static void elf_rel_plt_read (minimal_symbol_reader &reader, struct objfile *objfile, asymbol **dyn_symbol_table)
 
static hashval_t elf_gnu_ifunc_cache_hash (const void *a_voidp)
 
static int elf_gnu_ifunc_cache_eq (const void *a_voidp, const void *b_voidp)
 
static int elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
 
static int elf_gnu_ifunc_resolve_by_cache (const char *name, CORE_ADDR *addr_p)
 
static int elf_gnu_ifunc_resolve_by_got (const char *name, CORE_ADDR *addr_p)
 
static int elf_gnu_ifunc_resolve_name (const char *name, CORE_ADDR *addr_p)
 
static CORE_ADDR elf_gnu_ifunc_resolve_addr (struct gdbarch *gdbarch, CORE_ADDR pc)
 
static void elf_gnu_ifunc_resolver_stop (struct breakpoint *b)
 
static void elf_gnu_ifunc_resolver_return_stop (struct breakpoint *b)
 
static void elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags, const struct elfinfo *ei)
 
static void elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 
static void read_psyms (struct objfile *objfile)
 
static void elf_new_init (struct objfile *ignore)
 
static void elf_symfile_finish (struct objfile *objfile)
 
static void elf_symfile_init (struct objfile *objfile)
 
static const std::vector< probe * > & elf_get_probes (struct objfile *objfile)
 
static void probe_key_free (bfd *abfd, void *d)
 
void _initialize_elfread (void)
 

Variables

const struct sym_fns elf_sym_fns_gdb_index
 
const struct sym_fns elf_sym_fns_debug_names
 
const struct sym_fns elf_sym_fns_lazy_psyms
 
static const struct bfd_data * probe_key = NULL
 
static const struct objfile_data * elf_objfile_gnu_ifunc_cache_data
 
static const struct sym_probe_fns elf_probe_fns
 
static const struct sym_fns elf_sym_fns
 
static const struct gnu_ifunc_fns elf_gnu_ifunc_fns
 

Macro Definition Documentation

◆ ST_DYNAMIC

#define ST_DYNAMIC   1

Definition at line 224 of file elfread.c.

Referenced by elf_read_minimal_symbols(), and elf_symtab_read().

◆ ST_REGULAR

#define ST_REGULAR   0

Definition at line 223 of file elfread.c.

Referenced by elf_read_minimal_symbols().

◆ ST_SYNTHETIC

#define ST_SYNTHETIC   2

Definition at line 225 of file elfread.c.

Referenced by elf_read_minimal_symbols(), and elf_symtab_read().

◆ SYMBOL_GOT_PLT_SUFFIX

#define SYMBOL_GOT_PLT_SUFFIX   "@got.plt"

Definition at line 75 of file elfread.c.

Referenced by elf_gnu_ifunc_resolve_by_got(), and elf_rel_plt_read().

Function Documentation

◆ _initialize_elfread()

void _initialize_elfread ( void  )

◆ elf_get_probes()

static const std::vector<probe *>& elf_get_probes ( struct objfile objfile)
static

Definition at line 1326 of file elfread.c.

References all_static_probe_ops, objfile::obfd, and probe_key.

◆ elf_gnu_ifunc_cache_eq()

static int elf_gnu_ifunc_cache_eq ( const void *  a_voidp,
const void *  b_voidp 
)
static

Definition at line 638 of file elfread.c.

References elf_gnu_ifunc_cache::name.

Referenced by elf_gnu_ifunc_record_cache().

◆ elf_gnu_ifunc_cache_hash()

static hashval_t elf_gnu_ifunc_cache_hash ( const void *  a_voidp)
static

Definition at line 627 of file elfread.c.

References elf_gnu_ifunc_cache::name.

Referenced by elf_gnu_ifunc_record_cache().

◆ elf_gnu_ifunc_record_cache()

static int elf_gnu_ifunc_record_cache ( const char *  name,
CORE_ADDR  addr 
)
static

◆ elf_gnu_ifunc_resolve_addr()

static CORE_ADDR elf_gnu_ifunc_resolve_addr ( struct gdbarch gdbarch,
CORE_ADDR  pc 
)
static

◆ elf_gnu_ifunc_resolve_by_cache()

static int elf_gnu_ifunc_resolve_by_cache ( const char *  name,
CORE_ADDR addr_p 
)
static

◆ elf_gnu_ifunc_resolve_by_got()

static int elf_gnu_ifunc_resolve_by_got ( const char *  name,
CORE_ADDR addr_p 
)
static

◆ elf_gnu_ifunc_resolve_name()

static int elf_gnu_ifunc_resolve_name ( const char *  name,
CORE_ADDR addr_p 
)
static

◆ elf_gnu_ifunc_resolver_return_stop()

static void elf_gnu_ifunc_resolver_return_stop ( struct breakpoint b)
static

◆ elf_gnu_ifunc_resolver_stop()

static void elf_gnu_ifunc_resolver_stop ( struct breakpoint b)
static

◆ elf_locate_sections()

static void elf_locate_sections ( bfd *  ignore_abfd,
asection *  sectp,
void *  eip 
)
static

Definition at line 177 of file elfread.c.

References elfinfo::mdebugsect, and elfinfo::stabsect.

Referenced by elf_symfile_read().

◆ elf_new_init()

static void elf_new_init ( struct objfile ignore)
static

Definition at line 1295 of file elfread.c.

References buildsym_new_init(), and stabsread_new_init().

◆ elf_read_minimal_symbols()

static void elf_read_minimal_symbols ( struct objfile objfile,
int  symfile_flags,
const struct elfinfo ei 
)
static

◆ elf_rel_plt_read()

static void elf_rel_plt_read ( minimal_symbol_reader reader,
struct objfile objfile,
asymbol **  dyn_symbol_table 
)
static

◆ elf_symfile_finish()

static void elf_symfile_finish ( struct objfile objfile)
static

Definition at line 1307 of file elfread.c.

References dwarf2_free_objfile().

◆ elf_symfile_init()

static void elf_symfile_init ( struct objfile objfile)
static

Definition at line 1315 of file elfread.c.

References objfile::flags, and OBJF_REORDERED.

◆ elf_symfile_read()

static void elf_symfile_read ( struct objfile objfile,
symfile_add_flags  symfile_flags 
)
static

◆ elf_symfile_segments()

static struct symfile_segment_data* elf_symfile_segments ( bfd *  abfd)
static

◆ elf_symtab_read()

static void elf_symtab_read ( minimal_symbol_reader reader,
struct objfile objfile,
int  type,
long  number_of_symbols,
asymbol **  symbol_table,
bool  copy_names 
)
static

◆ probe_key_free()

static void probe_key_free ( bfd *  abfd,
void *  d 
)
static

Definition at line 1352 of file elfread.c.

Referenced by _initialize_elfread().

◆ read_psyms()

static void read_psyms ( struct objfile objfile)
static

Definition at line 1281 of file elfread.c.

References dwarf2_build_psymtabs(), and dwarf2_has_info().

◆ record_minimal_symbol()

static struct minimal_symbol* record_minimal_symbol ( minimal_symbol_reader reader,
const char *  name,
int  name_len,
bool  copy_name,
CORE_ADDR  address,
enum minimal_symbol_type  ms_type,
asection *  bfd_section,
struct objfile objfile 
)
static

Variable Documentation

◆ elf_gnu_ifunc_fns

const struct gnu_ifunc_fns elf_gnu_ifunc_fns
static
Initial value:
=
{
}
static void elf_gnu_ifunc_resolver_stop(struct breakpoint *b)
Definition: elfread.c:893
static int elf_gnu_ifunc_resolve_name(const char *name, CORE_ADDR *addr_p)
Definition: elfread.c:830
static void elf_gnu_ifunc_resolver_return_stop(struct breakpoint *b)
Definition: elfread.c:944
static CORE_ADDR elf_gnu_ifunc_resolve_addr(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition: elfread.c:847

Definition at line 1442 of file elfread.c.

Referenced by _initialize_elfread().

◆ elf_objfile_gnu_ifunc_cache_data

const struct objfile_data* elf_objfile_gnu_ifunc_cache_data
static

◆ elf_probe_fns

const struct sym_probe_fns elf_probe_fns
static
Initial value:
=
{
}
static const std::vector< probe * > & elf_get_probes(struct objfile *objfile)
Definition: elfread.c:1326

Definition at line 1366 of file elfread.c.

◆ elf_sym_fns

const struct sym_fns elf_sym_fns
static
Initial value:
=
{
NULL,
NULL,
}
static struct symfile_segment_data * elf_symfile_segments(bfd *abfd)
Definition: elfread.c:80
static const struct sym_probe_fns elf_probe_fns
Definition: elfread.c:1366
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3625
static void elf_symfile_finish(struct objfile *objfile)
Definition: elfread.c:1307
static void elf_symfile_init(struct objfile *objfile)
Definition: elfread.c:1315
static void elf_symfile_read(struct objfile *objfile, symfile_add_flags symfile_flags)
Definition: elfread.c:1168
const struct quick_symbol_functions psym_functions
Definition: psymtab.c:1541
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
Definition: symfile.c:695
static void elf_new_init(struct objfile *ignore)
Definition: elfread.c:1295

Definition at line 1373 of file elfread.c.

Referenced by _initialize_elfread().

◆ elf_sym_fns_debug_names

const struct sym_fns elf_sym_fns_debug_names
Initial value:
=
{
NULL,
NULL,
}
static struct symfile_segment_data * elf_symfile_segments(bfd *abfd)
Definition: elfread.c:80
static const struct sym_probe_fns elf_probe_fns
Definition: elfread.c:1366
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3625
static void elf_symfile_finish(struct objfile *objfile)
Definition: elfread.c:1307
static void elf_symfile_init(struct objfile *objfile)
Definition: elfread.c:1315
const struct quick_symbol_functions dwarf2_debug_names_functions
Definition: dwarf2read.c:6444
static void elf_symfile_read(struct objfile *objfile, symfile_add_flags symfile_flags)
Definition: elfread.c:1168
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
Definition: symfile.c:695
static void elf_new_init(struct objfile *ignore)
Definition: elfread.c:1295

Definition at line 1425 of file elfread.c.

Referenced by elf_symfile_read().

◆ elf_sym_fns_gdb_index

const struct sym_fns elf_sym_fns_gdb_index
Initial value:
=
{
NULL,
NULL,
}
static struct symfile_segment_data * elf_symfile_segments(bfd *abfd)
Definition: elfread.c:80
static const struct sym_probe_fns elf_probe_fns
Definition: elfread.c:1366
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3625
static void elf_symfile_finish(struct objfile *objfile)
Definition: elfread.c:1307
static void elf_symfile_init(struct objfile *objfile)
Definition: elfread.c:1315
static void elf_symfile_read(struct objfile *objfile, symfile_add_flags symfile_flags)
Definition: elfread.c:1168
const struct quick_symbol_functions dwarf2_gdb_index_functions
Definition: dwarf2read.c:5615
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
Definition: symfile.c:695
static void elf_new_init(struct objfile *ignore)
Definition: elfread.c:1295

Definition at line 1408 of file elfread.c.

Referenced by elf_symfile_read().

◆ elf_sym_fns_lazy_psyms

const struct sym_fns elf_sym_fns_lazy_psyms
Initial value:
=
{
NULL,
}
static struct symfile_segment_data * elf_symfile_segments(bfd *abfd)
Definition: elfread.c:80
static const struct sym_probe_fns elf_probe_fns
Definition: elfread.c:1366
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3625
static void read_psyms(struct objfile *objfile)
Definition: elfread.c:1281
static void elf_symfile_finish(struct objfile *objfile)
Definition: elfread.c:1307
static void elf_symfile_init(struct objfile *objfile)
Definition: elfread.c:1315
static void elf_symfile_read(struct objfile *objfile, symfile_add_flags symfile_flags)
Definition: elfread.c:1168
const struct quick_symbol_functions psym_functions
Definition: psymtab.c:1541
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
Definition: symfile.c:695
static void elf_new_init(struct objfile *ignore)
Definition: elfread.c:1295

Definition at line 1391 of file elfread.c.

Referenced by elf_symfile_read().

◆ probe_key

const struct bfd_data* probe_key = NULL
static

Definition at line 68 of file elfread.c.

Referenced by _initialize_elfread(), and elf_get_probes().