GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
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 "stabsread.h"
#include "demangle.h"
#include "filenames.h"
#include "probe.h"
#include "arch-utils.h"
#include "gdbtypes.h"
#include "value.h"
#include "infcall.h"
#include "gdbthread.h"
#include "inferior.h"
#include "regcache.h"
#include "bcache.h"
#include "gdb_bfd.h"
#include "build-id.h"
#include "location.h"
#include "auxv.h"
#include "mdebugread.h"
#include "ctfread.h"
#include "gdbsupport/gdb_string_view.h"
#include "gdbsupport/scoped_fd.h"
#include "debuginfod-support.h"
#include "dwarf2/public.h"
#include "cli/cli-cmds.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
 

Typedefs

typedef std::vector< std::unique_ptr< probe > > elfread_data
 

Functions

static symfile_segment_data_up elf_symfile_segments (bfd *abfd)
 
static void elf_locate_sections (asection *sectp, struct elfinfo *ei)
 
static struct minimal_symbolrecord_minimal_symbol (minimal_symbol_reader &reader, gdb::string_view name, bool copy_name, unrelocated_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 bool 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 (code_breakpoint *b)
 
static void elf_gnu_ifunc_resolver_return_stop (code_breakpoint *b)
 
static void elf_read_minimal_symbols (struct objfile *objfile, int symfile_flags, const struct elfinfo *ei)
 
static bool elf_symfile_read_dwarf2 (struct objfile *objfile, symfile_add_flags symfile_flags)
 
static void elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
 
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 elfread_dataelf_get_probes (struct objfile *objfile)
 
void _initialize_elfread ()
 

Variables

static bool always_read_ctf
 
static const registry< bfd >::key< elfread_dataprobe_key
 
static const registry< objfile >::key< htab, htab_deleter > 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 238 of file elfread.c.

Referenced by elf_read_minimal_symbols(), and elf_symtab_read().

◆ ST_REGULAR

#define ST_REGULAR   0

Definition at line 237 of file elfread.c.

Referenced by elf_read_minimal_symbols().

◆ ST_SYNTHETIC

#define ST_SYNTHETIC   2

Definition at line 239 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 82 of file elfread.c.

Referenced by elf_gnu_ifunc_resolve_by_got(), and elf_rel_plt_read().

Typedef Documentation

◆ elfread_data

typedef std::vector<std::unique_ptr<probe> > elfread_data

Definition at line 71 of file elfread.c.

Function Documentation

◆ _initialize_elfread()

void _initialize_elfread ( )

Definition at line 1457 of file elfread.c.

Referenced by initialize_all_files().

◆ elf_get_probes()

static const elfread_data & elf_get_probes ( struct objfile * objfile)
static

Definition at line 1404 of file elfread.c.

References all_static_probe_ops, registry< T >::get(), 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 678 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 667 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 bool 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 ( code_breakpoint * b)
static

◆ elf_gnu_ifunc_resolver_stop()

static void elf_gnu_ifunc_resolver_stop ( code_breakpoint * b)
static

◆ elf_locate_sections()

static void elf_locate_sections ( asection * sectp,
struct elfinfo * ei )
static

Definition at line 182 of file elfread.c.

References elfinfo::ctfsect, 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 1380 of file elfread.c.

◆ 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 1390 of file elfread.c.

◆ elf_symfile_init()

static void elf_symfile_init ( struct objfile * objfile)
static

Definition at line 1397 of file elfread.c.

◆ elf_symfile_read()

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

◆ elf_symfile_read_dwarf2()

static bool elf_symfile_read_dwarf2 ( struct objfile * objfile,
symfile_add_flags symfile_flags )
static

◆ elf_symfile_segments()

static symfile_segment_data_up elf_symfile_segments ( bfd * abfd)
static

Definition at line 87 of file elfread.c.

◆ 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

◆ record_minimal_symbol()

static struct minimal_symbol * record_minimal_symbol ( minimal_symbol_reader & reader,
gdb::string_view name,
bool copy_name,
unrelocated_addr address,
enum minimal_symbol_type ms_type,
asection * bfd_section,
struct objfile * objfile )
static

Variable Documentation

◆ always_read_ctf

bool always_read_ctf
static

Definition at line 56 of file elfread.c.

Referenced by elf_symfile_read().

◆ elf_gnu_ifunc_fns

const struct gnu_ifunc_fns elf_gnu_ifunc_fns
static
Initial value:
=
{
}
static void elf_gnu_ifunc_resolver_stop(code_breakpoint *b)
Definition elfread.c:956
static CORE_ADDR elf_gnu_ifunc_resolve_addr(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition elfread.c:910
static void elf_gnu_ifunc_resolver_return_stop(code_breakpoint *b)
Definition elfread.c:1007
static bool elf_gnu_ifunc_resolve_name(const char *name, CORE_ADDR *addr_p)
Definition elfread.c:893

Definition at line 1447 of file elfread.c.

◆ elf_objfile_gnu_ifunc_cache_data

const registry<objfile>::key<htab, htab_deleter> elf_objfile_gnu_ifunc_cache_data
static

Definition at line 652 of file elfread.c.

Referenced by elf_gnu_ifunc_record_cache(), and elf_gnu_ifunc_resolve_by_cache().

◆ elf_probe_fns

const struct sym_probe_fns elf_probe_fns
static
Initial value:
=
{
}
static const elfread_data & elf_get_probes(struct objfile *objfile)
Definition elfread.c:1404

Definition at line 1425 of file elfread.c.

◆ elf_sym_fns

const struct sym_fns elf_sym_fns
static
Initial value:
=
{
NULL,
}
static void elf_new_init(struct objfile *ignore)
Definition elfread.c:1380
static void elf_symfile_init(struct objfile *objfile)
Definition elfread.c:1397
static symfile_segment_data_up elf_symfile_segments(bfd *abfd)
Definition elfread.c:87
static void elf_symfile_finish(struct objfile *objfile)
Definition elfread.c:1390
static void elf_symfile_read(struct objfile *objfile, symfile_add_flags symfile_flags)
Definition elfread.c:1304
static const struct sym_probe_fns elf_probe_fns
Definition elfread.c:1425
void default_symfile_offsets(struct objfile *objfile, const section_addr_info &addrs)
Definition symfile.c:625
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition symfile.c:3595

Definition at line 1432 of file elfread.c.

◆ probe_key

const registry<bfd>::key<elfread_data> probe_key
static

Definition at line 75 of file elfread.c.

Referenced by elf_get_probes().