FD.io VPP  v21.01.1
Vector Packet Processing
elf.c File Reference
+ Include dependency graph for elf.c:

Go to the source code of this file.

Data Structures

struct  string_table_builder_t
 

Functions

static void elf_swap_first_header (elf_main_t *em, elf_first_header_t *h)
 
static void elf_swap_verneed (elf_dynamic_version_need_t *n)
 
static void elf_swap_verneed_aux (elf_dynamic_version_need_aux_t *n)
 
__clib_export clib_error_telf_get_section_by_name (elf_main_t *em, char *section_name, elf_section_t **result)
 
elf_section_telf_get_section_by_start_address_no_check (elf_main_t *em, uword start_address)
 
clib_error_telf_get_section_by_start_address (elf_main_t *em, uword start_address, elf_section_t **result)
 
static u8format_elf_section_type (u8 *s, va_list *args)
 
static u8format_elf_section (u8 *s, va_list *args)
 
static u8format_elf_segment_type (u8 *s, va_list *args)
 
static u8format_elf_segment (u8 *s, va_list *args)
 
static u8format_elf_symbol_binding_and_type (u8 *s, va_list *args)
 
static u8format_elf_symbol_visibility (u8 *s, va_list *args)
 
static u8format_elf_symbol_section_name (u8 *s, va_list *args)
 
u8format_elf_symbol (u8 *s, va_list *args)
 
static u8format_elf_relocation_type (u8 *s, va_list *args)
 
static u8format_elf_relocation (u8 *s, va_list *args)
 
static u8format_elf_dynamic_entry_type (u8 *s, va_list *args)
 
static u8format_elf_dynamic_entry (u8 *s, va_list *args)
 
static u8format_elf_architecture (u8 *s, va_list *args)
 
static u8format_elf_abi (u8 *s, va_list *args)
 
static u8format_elf_file_class (u8 *s, va_list *args)
 
static u8format_elf_file_type (u8 *s, va_list *args)
 
static u8format_elf_data_encoding (u8 *s, va_list *args)
 
static int elf_section_offset_compare (void *a1, void *a2)
 
static int elf_segment_va_compare (void *a1, void *a2)
 
u8format_elf_main (u8 *s, va_list *args)
 
static void elf_parse_segments (elf_main_t *em, void *data)
 
static void elf_parse_sections (elf_main_t *em, void *data)
 
static void add_symbol_table (elf_main_t *em, elf_section_t *s)
 
static void add_relocation_table (elf_main_t *em, elf_section_t *s)
 
void elf_parse_symbols (elf_main_t *em)
 
void elf_set_dynamic_entries (elf_main_t *em)
 
clib_error_telf_parse (elf_main_t *em, void *data, uword data_bytes)
 
static void add_dynamic_entries (elf_main_t *em, elf_section_t *s)
 
static void byte_swap_verneed (elf_main_t *em, elf_dynamic_version_need_union_t *vus)
 
static void set_dynamic_verneed (elf_main_t *em)
 
static void set_symbol_table (elf_main_t *em, u32 table_index)
 
static char * elf_find_interpreter (elf_main_t *em, void *data)
 
static void * elf_get_section_contents_with_starting_address (elf_main_t *em, uword start_address, uword elt_size, u32 *section_index_result)
 
static void elf_parse_dynamic (elf_main_t *em)
 
__clib_export clib_error_telf_read_file (elf_main_t *em, char *file_name)
 
static u32 string_table_add_name (string_table_builder_t *b, u8 *n)
 
static u32 string_table_add_name_index (string_table_builder_t *b, u32 index)
 
static void string_table_init (string_table_builder_t *b, u8 *old_table)
 
static u8string_table_done (string_table_builder_t *b)
 
static void layout_sections (elf_main_t *em)
 
clib_error_telf_write_file (elf_main_t *em, char *file_name)
 
clib_error_telf_delete_named_section (elf_main_t *em, char *section_name)
 
void elf_create_section_with_contents (elf_main_t *em, char *section_name, elf64_section_header_t *header, void *contents, uword n_content_bytes)
 
uword elf_delete_segment_with_type (elf_main_t *em, elf_segment_type_t segment_type)
 

Function Documentation

◆ add_dynamic_entries()

static void add_dynamic_entries ( elf_main_t em,
elf_section_t s 
)
static

Definition at line 1056 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_relocation_table()

static void add_relocation_table ( elf_main_t em,
elf_section_t s 
)
static

Definition at line 811 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add_symbol_table()

static void add_symbol_table ( elf_main_t em,
elf_section_t s 
)
static

Definition at line 753 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ byte_swap_verneed()

static void byte_swap_verneed ( elf_main_t em,
elf_dynamic_version_need_union_t vus 
)
static

Definition at line 1096 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_create_section_with_contents()

void elf_create_section_with_contents ( elf_main_t em,
char *  section_name,
elf64_section_header_t header,
void *  contents,
uword  n_content_bytes 
)

Definition at line 1965 of file elf.c.

◆ elf_delete_named_section()

clib_error_t* elf_delete_named_section ( elf_main_t em,
char *  section_name 
)

Definition at line 1950 of file elf.c.

+ Here is the call graph for this function:

◆ elf_delete_segment_with_type()

uword elf_delete_segment_with_type ( elf_main_t em,
elf_segment_type_t  segment_type 
)

Definition at line 2016 of file elf.c.

◆ elf_find_interpreter()

static char* elf_find_interpreter ( elf_main_t em,
void *  data 
)
static

Definition at line 1193 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_get_section_by_name()

__clib_export clib_error_t* elf_get_section_by_name ( elf_main_t em,
char *  section_name,
elf_section_t **  result 
)

Definition at line 47 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_get_section_by_start_address()

clib_error_t* elf_get_section_by_start_address ( elf_main_t em,
uword  start_address,
elf_section_t **  result 
)

Definition at line 69 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_get_section_by_start_address_no_check()

elf_section_t* elf_get_section_by_start_address_no_check ( elf_main_t em,
uword  start_address 
)

Definition at line 61 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_get_section_contents_with_starting_address()

static void* elf_get_section_contents_with_starting_address ( elf_main_t em,
uword  start_address,
uword  elt_size,
u32 section_index_result 
)
static

Definition at line 1217 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_parse()

clib_error_t* elf_parse ( elf_main_t em,
void *  data,
uword  data_bytes 
)

Definition at line 978 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_parse_dynamic()

static void elf_parse_dynamic ( elf_main_t em)
static

Definition at line 1239 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_parse_sections()

static void elf_parse_sections ( elf_main_t em,
void *  data 
)
static

Definition at line 699 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_parse_segments()

static void elf_parse_segments ( elf_main_t em,
void *  data 
)
static

Definition at line 667 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_parse_symbols()

void elf_parse_symbols ( elf_main_t em)

Definition at line 869 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_read_file()

__clib_export clib_error_t* elf_read_file ( elf_main_t em,
char *  file_name 
)

Definition at line 1329 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_section_offset_compare()

static int elf_section_offset_compare ( void *  a1,
void *  a2 
)
static

Definition at line 526 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_segment_va_compare()

static int elf_segment_va_compare ( void *  a1,
void *  a2 
)
static

Definition at line 535 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_set_dynamic_entries()

void elf_set_dynamic_entries ( elf_main_t em)

Definition at line 899 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_swap_first_header()

static void elf_swap_first_header ( elf_main_t em,
elf_first_header_t h 
)
inlinestatic

Definition at line 23 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ elf_swap_verneed()

static void elf_swap_verneed ( elf_dynamic_version_need_t n)
inlinestatic

Definition at line 31 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_swap_verneed_aux()

static void elf_swap_verneed_aux ( elf_dynamic_version_need_aux_t n)
inlinestatic

Definition at line 39 of file elf.c.

+ Here is the caller graph for this function:

◆ elf_write_file()

clib_error_t* elf_write_file ( elf_main_t em,
char *  file_name 
)

Definition at line 1754 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_abi()

static u8* format_elf_abi ( u8 s,
va_list *  args 
)
static

Definition at line 448 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_architecture()

static u8* format_elf_architecture ( u8 s,
va_list *  args 
)
static

Definition at line 430 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_data_encoding()

static u8* format_elf_data_encoding ( u8 s,
va_list *  args 
)
static

Definition at line 508 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_dynamic_entry()

static u8* format_elf_dynamic_entry ( u8 s,
va_list *  args 
)
static

Definition at line 383 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_dynamic_entry_type()

static u8* format_elf_dynamic_entry_type ( u8 s,
va_list *  args 
)
static

Definition at line 364 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_file_class()

static u8* format_elf_file_class ( u8 s,
va_list *  args 
)
static

Definition at line 466 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_file_type()

static u8* format_elf_file_type ( u8 s,
va_list *  args 
)
static

Definition at line 484 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_main()

u8* format_elf_main ( u8 s,
va_list *  args 
)

Definition at line 545 of file elf.c.

+ Here is the call graph for this function:

◆ format_elf_relocation()

static u8* format_elf_relocation ( u8 s,
va_list *  args 
)
static

Definition at line 326 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_relocation_type()

static u8* format_elf_relocation_type ( u8 s,
va_list *  args 
)
static

Definition at line 291 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_section()

static u8* format_elf_section ( u8 s,
va_list *  args 
)
static

Definition at line 102 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_section_type()

static u8* format_elf_section_type ( u8 s,
va_list *  args 
)
static

Definition at line 82 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_segment()

static u8* format_elf_segment ( u8 s,
va_list *  args 
)
static

Definition at line 153 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_segment_type()

static u8* format_elf_segment_type ( u8 s,
va_list *  args 
)
static

Definition at line 133 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_symbol()

u8* format_elf_symbol ( u8 s,
va_list *  args 
)

Definition at line 269 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_symbol_binding_and_type()

static u8* format_elf_symbol_binding_and_type ( u8 s,
va_list *  args 
)
static

Definition at line 179 of file elf.c.

+ Here is the caller graph for this function:

◆ format_elf_symbol_section_name()

static u8* format_elf_symbol_section_name ( u8 s,
va_list *  args 
)
static

Definition at line 237 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_elf_symbol_visibility()

static u8* format_elf_symbol_visibility ( u8 s,
va_list *  args 
)
static

Definition at line 218 of file elf.c.

+ Here is the caller graph for this function:

◆ layout_sections()

static void layout_sections ( elf_main_t em)
static

Definition at line 1455 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_dynamic_verneed()

static void set_dynamic_verneed ( elf_main_t em)
static

Definition at line 1137 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_symbol_table()

static void set_symbol_table ( elf_main_t em,
u32  table_index 
)
static

Definition at line 1156 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ string_table_add_name()

static u32 string_table_add_name ( string_table_builder_t b,
u8 n 
)
static

Definition at line 1397 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ string_table_add_name_index()

static u32 string_table_add_name_index ( string_table_builder_t b,
u32  index 
)
static

Definition at line 1429 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ string_table_done()

static u8 * string_table_done ( string_table_builder_t b)
static

Definition at line 1448 of file elf.c.

+ Here is the caller graph for this function:

◆ string_table_init()

static void string_table_init ( string_table_builder_t b,
u8 old_table 
)
static

Definition at line 1438 of file elf.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: