|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
45 while (*p != 0 && *p != delimiter)
62 char *
path = (
char *)
format (0,
"%s/%s%c", dir, file, 0);
66 yes = (stat (
path, &s) >= 0
67 && S_ISREG (s.st_mode)
68 && 0 != (s.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)));
83 if (file[0] ==
'.' || file[0] ==
'/')
86 if (getenv (
"PATH") == 0)
97 result = (
char *)
format (0,
"%s/%s%c", ps.
path[
i], file, 0);
106 char *file_name,
void *link_address)
112 uword mmap_length = 0;
118 fd = open (file_name, 0);
125 if (fstat (fd, &fd_stat) < 0)
130 mmap_length = fd_stat.st_size;
132 data = mmap (0, mmap_length, PROT_READ, MAP_SHARED, fd, 0);
146 uword section_name_start_len = strlen (section_name_start);
156 if (strcmp ((
char *)
name, section_name_start))
159 name += section_name_start_len;
174 b->lo = link_address + s->
header.exec_address;
175 b->hi =
b->lo + s->
header.file_size;
199 if (s->
header.type != ELF_SECTION_STRING_TABLE)
210 munmap (
data, mmap_length);
222 char *
name = (
char *) info->dlpi_name;
223 void *
addr = (
void *) info->dlpi_addr;
226 is_main = strlen (
name) == 0;
248 if (!is_main &&
name[0] !=
'/' &&
error->code == ENOENT)
309 if (by_address >= x->value && by_address < x->
value + x->size)
367 s =
format (s,
"%s + 0x%wx",
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
clib_error_t * elf_parse(elf_main_t *em, void *data, uword data_bytes)
void elf_parse_symbols(elf_main_t *em)
static uword pointer_to_uword(const void *p)
static void path_search_free(path_search_t *p)
static void elf_main_free(elf_main_t *em)
format_function_t format_elf_symbol
#define hash_create_string(elts, value_bytes)
#define clib_error_report(e)
static clib_error_t * clib_elf_parse_file(clib_elf_main_t *cem, char *file_name, void *link_address)
elf_symbol_table_t * symbol_tables
#define vec_elt(v, i)
Get vector value at index i.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define CLIB_ELF_SECTION_ADD_PREFIX(n)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
uword clib_elf_symbol_by_address(uword by_address, clib_elf_symbol_t *s)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static char ** split_string(char *string, u8 delimiter)
static int file_exists_and_is_executable(char *dir, char *file)
static u8 * elf_section_name(elf_main_t *em, elf_section_t *s)
#define hash_set_mem(h, key, value)
static char * path_search(char *file)
sll srl srl sll sra u16x4 i
manual_print typedef address
static clib_elf_main_t clib_elf_main
elf64_section_header_t header
#define vec_free(V)
Free vector's memory (no header).
#define hash_get_mem(h, key)
description fragment has unexpected format
__clib_export u8 * format_clib_elf_symbol_with_address(u8 *s, va_list *args)
__clib_export void clib_elf_main_init(char *exec_path)
static int add_section(struct dl_phdr_info *info, size_t size, void *opaque)
#define vec_foreach(var, vec)
Vector iterator.
#define clib_error_return_unix(e, args...)
#define clib_error(format, args...)
u8 * format_clib_elf_symbol(u8 *s, va_list *args)
static u8 * elf_symbol_name(elf_symbol_table_t *t, elf64_symbol_t *sym)
#define clib_error_free(e)
clib_elf_section_t * sections
static uword symbol_by_address_or_name(char *by_name, uword by_address, clib_elf_symbol_t *s)
uword clib_elf_symbol_by_name(char *by_name, clib_elf_symbol_t *s)
clib_elf_section_bounds_t * bounds
clib_elf_section_bounds_t * clib_elf_get_section_bounds(char *name)