|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
33 #define _(t,f) n->f = clib_byte_swap_##t (n->f);
41 #define _(t,f) n->f = clib_byte_swap_##t (n->f);
89 #define _(f,i) case ELF_SECTION_##f: t = #f; break;
109 return format (s,
"%=40s%=10s%=20s%=8s%=16s%=16s%=16s",
110 "Name",
"Index",
"Type",
"Size",
"Align",
"Address",
113 s =
format (s,
"%-40s%10d%=20U%8Lx%16d%16Lx %Lx-%Lx",
119 h->exec_address,
h->file_offset,
h->file_offset +
h->file_size);
124 if (h->flags & ELF_SECTION_FLAG_##f) s = format (s, " %s", #f);
140 #define _(f,i) case ELF_SEGMENT_##f: t = #f; break;
159 return format (s,
"%=16s%=16s%=16s%=16s",
160 "Type",
"Virt. Address",
"Phys. Address",
"Size");
162 s =
format (s,
"%=16U%16Lx%16Lx%16Lx%16Lx",
165 h->physical_address,
h->memory_size,
h->file_offset);
170 if (h->flags & ELF_SEGMENT_FLAG_##f) s = format (s, " %s", #f);
181 int bt = va_arg (*args,
int);
183 char *type_string = 0;
184 char *binding_string = 0;
186 switch ((
b = ((bt >> 4) & 0xf)))
188 #define _(f,n) case n: binding_string = #f; break;
195 switch ((t = ((bt >> 0) & 0xf)))
197 #define _(f,n) case n: type_string = #f; break;
205 s =
format (s,
"%s", binding_string);
207 s =
format (s,
"binding 0x%x",
b);
210 s =
format (s,
" %s", type_string);
212 s =
format (s,
" type 0x%x", t);
220 int visibility = va_arg (*args,
int);
225 #define _(f,n) case n: t = #f; break;
231 return format (s,
"%s", t);
233 return format (s,
"unknown 0x%x", visibility);
240 int si = va_arg (*args,
int);
254 #define _(f,n) case n: t = #f; break;
263 return format (s,
"%s", t);
265 return format (s,
"unknown 0x%x",
si);
276 return format (s,
"%=32s%=16s%=16s%=16s%=16s%=16s",
277 "Symbol",
"Size",
"Value",
"Type",
"Visibility",
280 s =
format (s,
"%-32s%16Ld%16Lx%=16U%=16U%U",
282 sym->size, sym->value,
294 int type = va_arg (*args,
int);
299 #define _(f,i) [i] = #f,
301 case ELF_ARCH_X86_64:
303 static char *tab[] = {
335 return format (s,
"%=16s%=16s%=16s",
"Address",
"Type",
"Symbol");
340 s =
format (s,
"%16Lx%16U",
344 if (sym->section_index != 0)
357 s =
format (s,
" %c 0x%Lx",
a > 0 ?
'+' :
'-',
a > 0 ?
a : -
a);
370 #define _(f,n) case n: t = #f; break;
377 return format (s,
"%s", t);
389 return format (s,
"%=40s%=16s",
"Type",
"Data");
394 case ELF_DYNAMIC_ENTRY_NEEDED_LIBRARY:
395 case ELF_DYNAMIC_ENTRY_RPATH:
396 case ELF_DYNAMIC_ENTRY_RUN_PATH:
400 case ELF_DYNAMIC_ENTRY_INIT_FUNCTION:
401 case ELF_DYNAMIC_ENTRY_FINI_FUNCTION:
402 case ELF_DYNAMIC_ENTRY_SYMBOL_HASH:
403 case ELF_DYNAMIC_ENTRY_GNU_HASH:
404 case ELF_DYNAMIC_ENTRY_STRING_TABLE:
405 case ELF_DYNAMIC_ENTRY_SYMBOL_TABLE:
406 case ELF_DYNAMIC_ENTRY_PLT_GOT:
407 case ELF_DYNAMIC_ENTRY_PLT_RELOCATION_ADDRESS:
408 case ELF_DYNAMIC_ENTRY_RELA_ADDRESS:
409 case ELF_DYNAMIC_ENTRY_VERSION_NEED:
410 case ELF_DYNAMIC_ENTRY_VERSYM:
417 s =
format (s,
"0x%Lx", e->data);
422 s =
format (s,
"0x%Lx", e->data);
432 int a = va_arg (*args,
int);
437 #define _(f,n) case n: t = #f; break;
441 return format (s,
"unknown 0x%x",
a);
444 return format (s,
"%s", t);
450 int a = va_arg (*args,
int);
455 #define _(f,n) case n: t = #f; break;
459 return format (s,
"unknown 0x%x",
a);
462 return format (s,
"%s", t);
468 int a = va_arg (*args,
int);
473 #define _(f) case ELF_##f: t = #f; break;
477 return format (s,
"unknown 0x%x",
a);
480 return format (s,
"%s", t);
486 int a = va_arg (*args,
int);
489 if (
a >= ELF_ARCH_SPECIFIC_LO &&
a <= ELF_ARCH_SPECIFIC_HI)
490 return format (s,
"arch-specific 0x%x",
a - ELF_ARCH_SPECIFIC_LO);
492 if (
a >= ELF_OS_SPECIFIC_LO &&
a <= ELF_OS_SPECIFIC_HI)
493 return format (s,
"os-specific 0x%x",
a - ELF_OS_SPECIFIC_LO);
497 #define _(f,n) case n: t = #f; break;
501 return format (s,
"unknown 0x%x",
a);
504 return format (s,
"%s", t);
510 int a = va_arg (*args,
int);
515 #define _(f) case ELF_##f: t = #f; break;
519 return format (s,
"unknown 0x%x",
a);
522 return format (s,
"%s", t);
540 return ((
i64) s1->
header.virtual_address -
548 u32 verbose = va_arg (*args,
u32);
553 "File header: machine: %U, file type/class %U/%U, data-encoding: %U, abi: %U version %d\n",
561 s =
format (s,
" entry 0x%Lx, arch-flags 0x%x",
576 s =
format (s,
"\nSections %d at file offset 0x%Lx-0x%Lx:\n",
577 fh->section_header_count,
578 fh->section_header_file_offset,
579 fh->section_header_file_offset +
580 (
u64) fh->section_header_count * fh->section_header_size);
592 if (
h->header.type != ELF_SEGMENT_UNUSED &&
h->header.type != ~0)
598 s =
format (s,
"\nSegments: %d at file offset 0x%Lx-0x%Lx:\n",
599 fh->segment_header_count,
600 fh->segment_header_file_offset,
601 (
u64) fh->segment_header_file_offset +
602 (
u64) fh->segment_header_count *
603 (
u64) fh->segment_header_size);
621 format (s,
"\nSymbols for section %s:\n",
641 s =
format (s,
"\nRelocations for section %s:\n",
656 s =
format (s,
"\nDynamic linker information:\n");
675 for (
i = 0;
i < n;
i++)
682 #define _(t,f) em->segments[i].header.f = elf_swap_##t (em, h->f);
690 #define _(t,f) em->segments[i].header.f = elf_swap_##t (em, h->f);
703 void *d =
data + fh->section_header_file_offset;
704 uword n = fh->section_header_count;
709 for (
i = 0;
i < n;
i++)
718 #define _(t,f) em->sections[i].header.f = elf_swap_##t (em, h->f);
726 #define _(t,f) em->sections[i].header.f = elf_swap_##t (em, h->f);
732 if (s->
header.type != ELF_SECTION_NO_BITS)
760 if (s->
header.type == ELF_SECTION_DYNAMIC_SYMBOL_TABLE)
774 #define _(t,f) tab->symbols[i].f = elf_swap_##t (em, tab->symbols[i].f);
786 #define _(t,f) tab->symbols[i].f = elf_swap_##t (em, sym32[i].f);
804 if (sym64->name != 0)
813 uword has_addend = s->
header.type == ELF_SECTION_RELOCATION_ADD;
826 has_addend *
sizeof (rs->
addend[0]));
852 has_addend *
sizeof (r32s->
addend[0]));
882 case ELF_SECTION_SYMBOL_TABLE:
883 case ELF_SECTION_DYNAMIC_SYMBOL_TABLE:
887 case ELF_SECTION_RELOCATION_ADD:
888 case ELF_SECTION_RELOCATION:
911 case ELF_DYNAMIC_ENTRY_INIT_FUNCTION:
912 case ELF_DYNAMIC_ENTRY_FINI_FUNCTION:
913 case ELF_DYNAMIC_ENTRY_SYMBOL_HASH:
914 case ELF_DYNAMIC_ENTRY_GNU_HASH:
915 case ELF_DYNAMIC_ENTRY_STRING_TABLE:
916 case ELF_DYNAMIC_ENTRY_SYMBOL_TABLE:
917 case ELF_DYNAMIC_ENTRY_PLT_GOT:
918 case ELF_DYNAMIC_ENTRY_PLT_RELOCATION_ADDRESS:
919 case ELF_DYNAMIC_ENTRY_RELA_ADDRESS:
920 case ELF_DYNAMIC_ENTRY_VERSION_NEED:
921 case ELF_DYNAMIC_ENTRY_VERSYM:
927 e->data = es->
header.exec_address;
993 ELF_TWOS_COMPLEMENT_BIG_ENDIAN);
996 if (!(
h->magic[0] == 0x7f
997 &&
h->magic[1] ==
'E' &&
h->magic[2] ==
'L' &&
h->magic[3] ==
'F'))
1000 if (
h->file_class == ELF_64BIT)
1003 #define _(t,f) fh->f = elf_swap_##t (em, h64->f);
1011 #define _(t,f) fh->f = elf_swap_##t (em, h32->f);
1028 if (g->
header.memory_size == 0)
1031 g_lo = g->
header.virtual_address;
1032 g_hi = g_lo + g->
header.memory_size;
1036 s_lo = s->
header.exec_address;
1037 s_hi = s_lo + s->
header.file_size;
1039 if (s_lo >= g_lo && s_hi <= g_hi)
1098 uword *entries_swapped = 0;
1112 if (n->
need.first_aux_offset != 0)
1114 ASSERT (n->
need.first_aux_offset % sizeof (n[0]) == 0);
1115 j =
i + (n->
need.first_aux_offset /
sizeof (n[0]));
1124 if (
a->aux.next_offset == 0)
1126 ASSERT (
a->aux.next_offset % sizeof (
a->aux) == 0);
1127 j += (
a->aux.next_offset /
sizeof (
a->aux));
1167 #define _(t,f) s->f = elf_swap_##t (em, s->f);
1182 #define _(t,f) syms[i].f = elf_swap_##t (em, tab->symbols[i].f);
1201 if (g->
header.type == ELF_SEGMENT_INTERP)
1218 uword start_address,
1220 u32 * section_index_result)
1232 if (section_index_result)
1233 *section_index_result = s->
index;
1248 case ELF_SECTION_DYNAMIC:
1264 case ELF_DYNAMIC_ENTRY_STRING_TABLE:
1271 dynamic_string_table_section_index);
1274 case ELF_DYNAMIC_ENTRY_SYMBOL_TABLE:
1290 case ELF_DYNAMIC_ENTRY_VERSYM:
1297 versym_section_index);
1306 case ELF_DYNAMIC_ENTRY_VERSION_NEED:
1313 verneed_section_index);
1324 #include <sys/types.h>
1325 #include <sys/stat.h>
1332 struct stat fd_stat;
1333 uword mmap_length = 0;
1339 fd = open (file_name, 0);
1346 if (fstat (fd, &fd_stat) < 0)
1351 mmap_length = fd_stat.st_size;
1353 data = mmap (0, mmap_length, PROT_READ, MAP_SHARED, fd, 0);
1373 munmap (
data, mmap_length);
1383 munmap (
data, mmap_length);
1405 l = strlen ((
char *) n);
1409 for (j = 0; j <= l; j++)
1427 __attribute__ ((unused));
1436 __attribute__ ((unused));
1441 b->old_table = old_table;
1446 __attribute__ ((unused));
1451 return b->new_table;
1458 u32 n_sections_with_changed_exec_address = 0;
1459 u32 *deferred_symbol_and_string_sections = 0;
1460 u32 n_deleted_sections = 0;
1473 if (s->
header.type == ~0)
1482 em->
file_header.section_header_string_table_index);
1520 case ELF_DYNAMIC_ENTRY_NEEDED_LIBRARY:
1521 case ELF_DYNAMIC_ENTRY_RPATH:
1522 case ELF_DYNAMIC_ENTRY_RUN_PATH:
1537 n->
need.file_name_offset =
1540 if (n->
need.first_aux_offset != 0)
1542 a = n + n->
need.first_aux_offset /
sizeof (n[0]);
1547 if (
a->aux.next_offset == 0)
1549 a +=
a->aux.next_offset /
sizeof (
a[0]);
1553 if (n->
need.next_offset == 0)
1556 n += n->
need.next_offset /
sizeof (n[0]);
1573 u64 exec_address = 0, file_offset = 0;
1574 u64 file_size, align_size;
1582 n_deleted_sections++;
1583 case ELF_SECTION_UNUSED:
1586 case ELF_SECTION_STRING_TABLE:
1587 case ELF_SECTION_SYMBOL_TABLE:
1590 em->
file_header.section_header_string_table_index))
1604 if (s->
header.file_offset == ~0)
1605 s->
header.file_offset = file_offset;
1608 if (s->
header.exec_address > exec_address)
1610 exec_address = s->
header.exec_address;
1611 file_offset = s->
header.file_offset;
1614 if (s->
header.flags & ELF_SECTION_FLAG_ALLOC)
1618 s->
header.exec_address = exec_address;
1621 if (s->
header.type == ELF_SECTION_NO_BITS)
1622 file_size = s->
header.file_size;
1631 else if (s[1].header.type == ELF_SECTION_NO_BITS)
1634 align = s[1].
header.align;
1636 if (s->
header.flags & ELF_SECTION_FLAG_ALLOC)
1639 align_size = v - exec_address;
1644 align_size = v - file_offset;
1648 s->
header.file_offset = file_offset;
1649 s->
header.file_size = file_size;
1652 if (s->
header.type != ELF_SECTION_NO_BITS)
1653 file_offset += align_size;
1654 exec_address += align_size;
1662 fh->section_header_file_offset = file_offset;
1663 fh->section_header_count =
vec_len (em->
sections) - n_deleted_sections;
1664 file_offset += (
u64) fh->section_header_count * fh->section_header_size;
1669 for (
i = 0;
i <
vec_len (deferred_symbol_and_string_sections);
i++)
1673 deferred_symbol_and_string_sections[
i]);
1675 s->
header.file_offset = file_offset;
1680 file_offset += align_size;
1682 vec_free (deferred_symbol_and_string_sections);
1700 u64 s_lo, s_hi, f_lo = 0;
1703 if (g->
header.memory_size == 0)
1714 if (n_sections == 0)
1718 f_lo = s->
header.file_offset;
1726 f_lo = s->
header.file_offset;
1734 if (n_sections == 0)
1739 if (g->
header.file_offset == 0 && g->
header.type == ELF_SEGMENT_LOAD)
1741 s_lo = g->
header.virtual_address;
1742 f_lo = g->
header.file_offset;
1745 g->
header.virtual_address = s_lo;
1746 g->
header.physical_address = s_lo;
1747 g->
header.file_offset = f_lo;
1748 g->
header.memory_size = s_hi - s_lo;
1760 fd = open (file_name, O_CREAT | O_RDWR | O_TRUNC, 0755);
1764 f = fdopen (fd,
"w");
1775 if (fwrite (&
h,
sizeof (
h), 1,
f) != 1)
1795 #define _(t,field) h.field = elf_swap_##t (em, h.field);
1799 if (fwrite (&
h,
sizeof (
h), 1,
f) != 1)
1809 #define _(t,field) h32.field = elf_swap_##t (em, h.field);
1813 if (fwrite (&h32,
sizeof (h32), 1,
f) != 1)
1829 if (s->
header.type == ~0)
1836 #define _(t,field) h.field = elf_swap_##t (em, h.field);
1840 if (fwrite (&
h,
sizeof (
h), 1,
f) != 1)
1852 #define _(t,field) h32.field = elf_swap_##t (em, h.field);
1856 if (fwrite (&h32,
sizeof (h32), 1,
f) != 1)
1873 if (s->
header.file_size == 0)
1876 if (fseek (
f, s->
header.file_offset, SEEK_SET) < 0)
1883 if (s->
header.type == ELF_SECTION_NO_BITS)
1895 if (fseek (
f, em->
file_header.section_header_file_offset, SEEK_SET) < 0)
1899 (0,
"fseek 0x%Lx", em->
file_header.section_header_file_offset);
1906 if (s->
header.type == ~0)
1913 #define _(t,field) h.field = elf_swap_##t (em, h.field);
1917 if (fwrite (&
h,
sizeof (
h), 1,
f) != 1)
1929 #define _(t,field) h32.field = elf_swap_##t (em, h.field);
1933 if (fwrite (&h32,
sizeof (h32), 1,
f) != 1)
1968 void *contents,
uword n_content_bytes)
1972 uword *p, is_new_section;
1992 em->
file_header.section_header_string_table_index);
1997 s->
header.file_offset = ~0;
1998 s->
header.file_size = n_content_bytes;
2003 vec_add (st, section_name, strlen (section_name));
2011 em->
file_header.section_header_count += is_new_section
2019 uword n_deleted = 0;
2029 em->
file_header.segment_header_count -= n_deleted;
static void elf_swap_first_header(elf_main_t *em, elf_first_header_t *h)
static u8 * format_elf_relocation_type(u8 *s, va_list *args)
static u16 clib_byte_swap_u16(u16 x)
elf_section_t * elf_get_section_by_start_address_no_check(elf_main_t *em, uword start_address)
#define foreach_elf32_section_header
static u8 * format_elf_symbol_visibility(u8 *s, va_list *args)
#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)
#define clib_memcpy(d, s, n)
static void elf_parse_dynamic(elf_main_t *em)
static void elf_parse_sections(elf_main_t *em, void *data)
#define foreach_elf_section_type
static uword pointer_to_uword(const void *p)
elf64_file_header_t file_header
static void * elf_get_section_contents(elf_main_t *em, uword section_index, uword elt_size)
u32 dynamic_section_index
static void elf_main_free(elf_main_t *em)
u32 verneed_section_index
#define vec_end(v)
End (last data address) of vector.
@ foreach_elf_architecture
static u8 * format_elf_file_class(u8 *s, va_list *args)
#define clib_error_return(e, args...)
static u16 elf_swap_u16(elf_main_t *em, u16 x)
#define FORMAT_ELF_MAIN_SYMBOLS
static void layout_sections(elf_main_t *em)
u32 dynamic_symbol_table_index
void elf_create_section_with_contents(elf_main_t *em, char *section_name, elf64_section_header_t *header, void *contents, uword n_content_bytes)
static u8 * format_elf_segment(u8 *s, va_list *args)
#define foreach_elf_dynamic_version_need_aux_field
#define foreach_elf64_file_header
#define hash_create_string(elts, value_bytes)
u8 * format_elf_symbol(u8 *s, va_list *args)
@ foreach_elf_dynamic_entry_type
#define clib_error_report(e)
static u32 string_table_add_name_index(string_table_builder_t *b, u32 index)
#define foreach_elf_symbol_type
vnet_hw_if_output_node_runtime_t * r
static u8 * format_elf_dynamic_entry_type(u8 *s, va_list *args)
static u8 * format_elf_segment_type(u8 *s, va_list *args)
clib_error_t * elf_delete_named_section(elf_main_t *em, char *section_name)
elf_symbol_table_t * symbol_tables
static u64 elf_swap_u64(elf_main_t *em, u64 x)
static u8 * format_elf_relocation(u8 *s, va_list *args)
static u8 * format_elf_section_type(u8 *s, va_list *args)
#define foreach_elf_file_class
#define ELF_SYMBOL_SECTION_RESERVED_LO
#define foreach_elf_x86_64_relocation_type
#define hash_set(h, key, value)
static uword round_pow2(uword x, uword pow2)
#define foreach_elf64_symbol_header
static void elf_swap_verneed(elf_dynamic_version_need_t *n)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
#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).
static void set_dynamic_verneed(elf_main_t *em)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
static void add_relocation_table(elf_main_t *em, elf_section_t *s)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
#define foreach_elf_symbol_reserved_section_index
__clib_export u8 * format_elf_main(u8 *s, va_list *args)
#define foreach_elf_dynamic_version_need_field
@ foreach_elf_segment_flag
#define foreach_elf_symbol_binding
static u8 * elf_section_name(elf_main_t *em, elf_section_t *s)
#define clib_bitmap_free(v)
Free a bitmap.
static u8 * format_elf_symbol_binding_and_type(u8 *s, va_list *args)
static char * elf_find_interpreter(elf_main_t *em, void *data)
u32 dynamic_string_table_section_index
static u64 round_pow2_u64(u64 x, u64 pow2)
#define hash_set_mem(h, key, value)
#define foreach_elf_symbol_visibility
#define foreach_elf32_segment_header
__clib_export clib_error_t * elf_get_section_by_start_address(elf_main_t *em, uword start_address, elf_section_t **result)
sll srl srl sll sra u16x4 i
static void byte_swap_verneed(elf_main_t *em, elf_dynamic_version_need_union_t *vus)
static void elf_swap_verneed_aux(elf_dynamic_version_need_aux_t *n)
__clib_export clib_error_t * elf_write_file(elf_main_t *em, char *file_name)
static int elf_segment_va_compare(void *a1, void *a2)
@ foreach_elf_segment_type
#define ELF_SYMBOL_SECTION_RESERVED_HI
#define foreach_elf64_section_header
u8 * dynamic_string_table
static u8 * format_elf_section(u8 *s, va_list *args)
#define FORMAT_ELF_MAIN_RELOCATIONS
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
elf_relocation_with_addend_t * relocations
static void string_table_init(string_table_builder_t *b, u8 *old_table)
uword * segment_index_bitmap
__clib_export void elf_set_dynamic_entries(elf_main_t *em)
static u32 string_table_add_name(string_table_builder_t *b, u8 *n)
static void add_symbol_table(elf_main_t *em, elf_section_t *s)
static u8 * format_elf_symbol_section_name(u8 *s, va_list *args)
elf64_segment_header_t header
#define elf_relocation_next(r, type)
static u8 * format_elf_data_encoding(u8 *s, va_list *args)
elf64_section_header_t header
elf_dynamic_version_need_union_t * verneed
#define vec_free(V)
Free vector's memory (no header).
#define CLIB_ARCH_IS_BIG_ENDIAN
uword elf_delete_segment_with_type(elf_main_t *em, elf_segment_type_t segment_type)
static void elf_set_section_contents(elf_main_t *em, uword section_index, void *new_contents, uword n_content_bytes)
#define hash_get_mem(h, key)
#define foreach_elf32_symbol_header
__clib_export clib_error_t * elf_read_file(elf_main_t *em, char *file_name)
description fragment has unexpected format
static int elf_section_offset_compare(void *a1, void *a2)
static u8 * format_elf_architecture(u8 *s, va_list *args)
uword * section_by_start_address
#define CLIB_MEM_UNPOISON(a, s)
static u8 * format_elf_abi(u8 *s, va_list *args)
static u32 elf_swap_u32(elf_main_t *em, u32 x)
#define vec_foreach(var, vec)
Vector iterator.
#define clib_error_return_unix(e, args...)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V,...
static u8 * format_elf_file_type(u8 *s, va_list *args)
elf_dynamic_version_need_t need
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
static void set_symbol_table(elf_main_t *em, u32 table_index)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
#define foreach_elf_data_encoding
elf64_dynamic_entry_t * dynamic_entries
elf_relocation_table_t * relocation_tables
@ foreach_elf_section_flag
elf_first_header_t first_header
static void elf_main_init(elf_main_t *em)
static u8 * elf_symbol_name(elf_symbol_table_t *t, elf64_symbol_t *sym)
#define FORMAT_ELF_MAIN_DYNAMIC
static u8 * format_elf_dynamic_entry(u8 *s, va_list *args)
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_segments(elf_main_t *em, void *data)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
uword * section_index_bitmap
#define foreach_elf32_file_header
u32 dynamic_symbol_table_section_index
vl_api_fib_path_type_t type
#define vec_bytes(v)
Number of data bytes in vector.
static void add_dynamic_entries(elf_main_t *em, elf_section_t *s)
static u8 * string_table_done(string_table_builder_t *b)
#define foreach_elf64_segment_header
#define vec_clone(NEW_V, OLD_V)
Clone a vector.
__clib_export clib_error_t * elf_get_section_by_name(elf_main_t *em, char *section_name, elf_section_t **result)