33 #define _(t,f) n->f = clib_byte_swap_##t (n->f); 41 #define _(t,f) n->f = clib_byte_swap_##t (n->f); 84 #define _(f,i) case ELF_SECTION_##f: t = #f; break; 90 s =
format (s,
"unknown 0x%x", type);
104 return format (s,
"%=40s%=10s%=20s%=8s%=16s%=16s%=16s",
105 "Name",
"Index",
"Type",
"Size",
"Align",
"Address",
"File offset");
107 s =
format (s,
"%-40s%10d%=20U%8Lx%16d%16Lx %Lx-%Lx",
114 h->file_offset, h->file_offset + h->file_size);
119 if (h->flags & ELF_SECTION_FLAG_##f) s = format (s, " %s", #f); 135 #define _(f,i) case ELF_SEGMENT_##f: t = #f; break; 141 s =
format (s,
"unknown 0x%x", type);
154 return format (s,
"%=16s%=16s%=16s%=16s",
155 "Type",
"Virt. Address",
"Phys. Address",
"Size");
157 s =
format (s,
"%=16U%16Lx%16Lx%16Lx%16Lx",
167 if (h->flags & ELF_SEGMENT_FLAG_##f) s = format (s, " %s", #f); 178 int bt = va_arg (*args,
int);
180 char * type_string = 0;
181 char * binding_string = 0;
183 switch ((b = ((bt >> 4) & 0xf)))
185 #define _(f,n) case n: binding_string = #f; break; 191 switch ((t = ((bt >> 0) & 0xf)))
193 #define _(f,n) case n: type_string = #f; break; 200 s =
format (s,
"%s", binding_string);
202 s =
format (s,
"binding 0x%x", b);
205 s =
format (s,
" %s", type_string);
207 s =
format (s,
" type 0x%x", t);
215 int visibility = va_arg (*args,
int);
220 #define _(f,n) case n: t = #f; break; 226 return format (s,
"%s", t);
228 return format (s,
"unknown 0x%x", visibility);
235 int si = va_arg (*args,
int);
249 #define _(f,n) case n: t = #f; break; 258 return format (s,
"%s", t);
260 return format (s,
"unknown 0x%x", si);
270 return format (s,
"%=32s%=16s%=16s%=16s%=16s%=16s",
271 "Symbol",
"Size",
"Value",
"Type",
"Visibility",
"Section");
273 s =
format (s,
"%-32s%16Ld%16Lx%=16U%=16U%U",
275 sym->size, sym->value,
287 int type = va_arg (*args,
int);
292 #define _(f,i) [i] = #f, 294 case ELF_ARCH_X86_64:
296 static char * tab[] = {
311 s =
format (s,
"0x%02x", type);
327 return format (s,
"%=16s%=16s%=16s",
"Address",
"Type",
"Symbol");
332 s =
format (s,
"%16Lx%16U",
336 if (sym->section_index != 0)
349 s =
format (s,
" %c 0x%Lx",
364 #define _(f,n) case n: t = #f; break; 370 return format (s,
"%s", t);
372 return format (s,
"unknown 0x%x", type);
382 return format (s,
"%=40s%=16s",
"Type",
"Data");
388 case ELF_DYNAMIC_ENTRY_NEEDED_LIBRARY:
389 case ELF_DYNAMIC_ENTRY_RPATH:
390 case ELF_DYNAMIC_ENTRY_RUN_PATH:
394 case ELF_DYNAMIC_ENTRY_INIT_FUNCTION:
395 case ELF_DYNAMIC_ENTRY_FINI_FUNCTION:
396 case ELF_DYNAMIC_ENTRY_SYMBOL_HASH:
397 case ELF_DYNAMIC_ENTRY_GNU_HASH:
398 case ELF_DYNAMIC_ENTRY_STRING_TABLE:
399 case ELF_DYNAMIC_ENTRY_SYMBOL_TABLE:
400 case ELF_DYNAMIC_ENTRY_PLT_GOT:
401 case ELF_DYNAMIC_ENTRY_PLT_RELOCATION_ADDRESS:
402 case ELF_DYNAMIC_ENTRY_RELA_ADDRESS:
403 case ELF_DYNAMIC_ENTRY_VERSION_NEED:
404 case ELF_DYNAMIC_ENTRY_VERSYM:
410 s =
format (s,
"0x%Lx", e->data);
415 s =
format (s,
"0x%Lx", e->data);
424 int a = va_arg (*args,
int);
429 #define _(f,n) case n: t = #f; break; 433 return format (s,
"unknown 0x%x", a);
436 return format (s,
"%s", t);
441 int a = va_arg (*args,
int);
446 #define _(f,n) case n: t = #f; break; 450 return format (s,
"unknown 0x%x", a);
453 return format (s,
"%s", t);
458 int a = va_arg (*args,
int);
463 #define _(f) case ELF_##f: t = #f; break; 467 return format (s,
"unknown 0x%x", a);
470 return format (s,
"%s", t);
475 int a = va_arg (*args,
int);
478 if (a >= ELF_ARCH_SPECIFIC_LO && a <= ELF_ARCH_SPECIFIC_HI)
479 return format (s,
"arch-specific 0x%x", a - ELF_ARCH_SPECIFIC_LO);
481 if (a >= ELF_OS_SPECIFIC_LO && a <= ELF_OS_SPECIFIC_HI)
482 return format (s,
"os-specific 0x%x", a - ELF_OS_SPECIFIC_LO);
486 #define _(f,n) case n: t = #f; break; 490 return format (s,
"unknown 0x%x", a);
493 return format (s,
"%s", t);
498 int a = va_arg (*args,
int);
503 #define _(f) case ELF_##f: t = #f; break; 507 return format (s,
"unknown 0x%x", a);
510 return format (s,
"%s", t);
533 u32 verbose = va_arg (*args,
u32);
536 s =
format (s,
"File header: machine: %U, file type/class %U/%U, data-encoding: %U, abi: %U version %d\n",
543 s =
format (s,
" entry 0x%Lx, arch-flags 0x%x",
559 s =
format (s,
"\nSections %d at file offset 0x%Lx-0x%Lx:\n",
560 fh->section_header_count,
561 fh->section_header_file_offset,
562 fh->section_header_file_offset + fh->section_header_count * fh->section_header_size);
575 if (h->
header.type != ELF_SEGMENT_UNUSED && h->
header.type != ~0)
581 s =
format (s,
"\nSegments: %d at file offset 0x%Lx-0x%Lx:\n",
582 fh->segment_header_count,
583 fh->segment_header_file_offset,
584 fh->segment_header_file_offset + fh->segment_header_count * fh->segment_header_size);
622 s =
format (s,
"\nRelocations for section %s:\n",
638 s =
format (s,
"\nDynamic linker information:\n");
651 void * d = data + em->
file_header.segment_header_file_offset;
657 for (i = 0; i < n; i++)
664 #define _(t,f) em->segments[i].header.f = elf_swap_##t (em, h->f); 672 #define _(t,f) em->segments[i].header.f = elf_swap_##t (em, h->f); 685 void * d = data + fh->section_header_file_offset;
686 uword n = fh->section_header_count;
691 for (i = 0; i < n; i++)
700 #define _(t,f) em->sections[i].header.f = elf_swap_##t (em, h->f); 708 #define _(t,f) em->sections[i].header.f = elf_swap_##t (em, h->f); 714 if (s->
header.type != ELF_SECTION_NO_BITS)
743 if (s->
header.type == ELF_SECTION_DYNAMIC_SYMBOL_TABLE)
755 #define _(t,f) tab->symbols[i].f = elf_swap_##t (em, tab->symbols[i].f); 766 #define _(t,f) tab->symbols[i].f = elf_swap_##t (em, sym32[i].f); 783 if (sym64->name != 0)
793 uword has_addend = s->
header.type == ELF_SECTION_RELOCATION_ADD;
805 sizeof (rs[0]) + has_addend *
sizeof (rs->
addend[0]));
810 for (i = 0; i <
vec_len (r); i++)
830 sizeof (r32s[0]) + has_addend *
sizeof (r32s->
addend[0]));
859 case ELF_SECTION_SYMBOL_TABLE:
860 case ELF_SECTION_DYNAMIC_SYMBOL_TABLE:
864 case ELF_SECTION_RELOCATION_ADD:
865 case ELF_SECTION_RELOCATION:
887 case ELF_DYNAMIC_ENTRY_INIT_FUNCTION:
888 case ELF_DYNAMIC_ENTRY_FINI_FUNCTION:
889 case ELF_DYNAMIC_ENTRY_SYMBOL_HASH:
890 case ELF_DYNAMIC_ENTRY_GNU_HASH:
891 case ELF_DYNAMIC_ENTRY_STRING_TABLE:
892 case ELF_DYNAMIC_ENTRY_SYMBOL_TABLE:
893 case ELF_DYNAMIC_ENTRY_PLT_GOT:
894 case ELF_DYNAMIC_ENTRY_PLT_RELOCATION_ADDRESS:
895 case ELF_DYNAMIC_ENTRY_RELA_ADDRESS:
896 case ELF_DYNAMIC_ENTRY_VERSION_NEED:
897 case ELF_DYNAMIC_ENTRY_VERSYM:
902 e->data = es->
header.exec_address;
938 for (i = 0; i <
vec_len (es); i++)
961 memset (em, 0,
sizeof (em[0]));
970 if (! (h->
magic[0] == 0x7f
971 && h->
magic[1] ==
'E' 972 && h->
magic[2] ==
'L' 973 && h->
magic[3] ==
'F'))
979 #define _(t,f) fh->f = elf_swap_##t (em, h64->f); 987 #define _(t,f) fh->f = elf_swap_##t (em, h32->f); 1004 if (g->
header.memory_size == 0)
1007 g_lo = g->
header.virtual_address;
1008 g_hi = g_lo + g->
header.memory_size;
1012 s_lo = s->
header.exec_address;
1013 s_hi = s_lo + s->
header.file_size;
1015 if (s_lo >= g_lo && s_hi <= g_hi)
1044 for (i = 0; i <
vec_len (e); i++)
1059 for (i = 0; i <
vec_len (e); i++)
1072 uword * entries_swapped = 0;
1075 for (i = 0; i <
vec_len (vus); i++)
1086 if (n->
need.first_aux_offset != 0)
1088 ASSERT (n->
need.first_aux_offset % sizeof (n[0]) == 0);
1089 j = i + (n->
need.first_aux_offset /
sizeof (n[0]));
1098 if (a->
aux.next_offset == 0)
1101 j += (a->
aux.next_offset /
sizeof (a->
aux));
1137 #define _(t,f) s->f = elf_swap_##t (em, s->f); 1152 #define _(t,f) syms[i].f = elf_swap_##t (em, tab->symbols[i].f); 1171 if (g->
header.type == ELF_SEGMENT_INTERP)
1188 uword start_address,
1190 u32 * section_index_result)
1202 if (section_index_result)
1203 *section_index_result = s->
index;
1217 case ELF_SECTION_DYNAMIC:
1233 case ELF_DYNAMIC_ENTRY_STRING_TABLE:
1240 case ELF_DYNAMIC_ENTRY_SYMBOL_TABLE:
1256 case ELF_DYNAMIC_ENTRY_VERSYM:
1268 case ELF_DYNAMIC_ENTRY_VERSION_NEED:
1282 #include <sys/types.h> 1283 #include <sys/stat.h> 1289 struct stat fd_stat;
1290 uword mmap_length = 0;
1296 fd = open (file_name, 0);
1303 if (fstat (fd, &fd_stat) < 0)
1308 mmap_length = fd_stat.st_size;
1310 data = mmap (0, mmap_length, PROT_READ, MAP_SHARED, fd, 0);
1319 error =
elf_parse (em, data, mmap_length);
1328 munmap (data, mmap_length);
1338 munmap (data, mmap_length);
1357 l = strlen ((
char *) n);
1361 for (j = 0; j <= l; j++)
1386 memset (b, 0,
sizeof (b[0]));
1400 u32 n_sections_with_changed_exec_address = 0;
1401 u32 * deferred_symbol_and_string_sections = 0;
1402 u32 n_deleted_sections = 0;
1413 if (s->
header.type == ~0)
1417 vec_add (st, name, strlen ((
char *) name) + 1);
1456 case ELF_DYNAMIC_ENTRY_NEEDED_LIBRARY:
1457 case ELF_DYNAMIC_ENTRY_RPATH:
1458 case ELF_DYNAMIC_ENTRY_RUN_PATH:
1475 if (n->
need.first_aux_offset != 0)
1477 a = n + n->
need.first_aux_offset /
sizeof (n[0]);
1481 if (a->
aux.next_offset == 0)
1483 a += a->
aux.next_offset /
sizeof (a[0]);
1487 if (n->
need.next_offset == 0)
1490 n += n->
need.next_offset /
sizeof (n[0]);
1504 u64 exec_address = 0, file_offset = 0;
1505 u64 file_size, align_size;
1513 n_deleted_sections++;
1514 case ELF_SECTION_UNUSED:
1517 case ELF_SECTION_STRING_TABLE:
1518 case ELF_SECTION_SYMBOL_TABLE:
1534 if (s->
header.file_offset == ~0)
1535 s->
header.file_offset = file_offset;
1538 if (s->
header.exec_address > exec_address)
1540 exec_address = s->
header.exec_address;
1541 file_offset = s->
header.file_offset;
1544 if (s->
header.flags & ELF_SECTION_FLAG_ALLOC)
1548 s->
header.exec_address = exec_address;
1551 if (s->
header.type == ELF_SECTION_NO_BITS)
1552 file_size = s->
header.file_size;
1561 else if (s[1].header.type == ELF_SECTION_NO_BITS)
1564 align = s[1].
header.align;
1566 if (s->
header.flags & ELF_SECTION_FLAG_ALLOC)
1569 align_size = v - exec_address;
1574 align_size = v - file_offset;
1578 s->
header.file_offset = file_offset;
1579 s->
header.file_size = file_size;
1582 if (s->
header.type != ELF_SECTION_NO_BITS)
1583 file_offset += align_size;
1584 exec_address += align_size;
1592 fh->section_header_file_offset = file_offset;
1593 fh->section_header_count =
vec_len (em->
sections) - n_deleted_sections;
1594 file_offset += fh->section_header_count * fh->section_header_size;
1599 for (i = 0; i <
vec_len (deferred_symbol_and_string_sections); i++)
1603 s->
header.file_offset = file_offset;
1608 file_offset += align_size;
1610 vec_free (deferred_symbol_and_string_sections);
1626 u64 s_lo, s_hi, f_lo = 0;
1629 if (g->
header.memory_size == 0)
1636 s = vec_elt_at_index (em->sections, si);
1637 lo = s->header.exec_address;
1638 hi = lo + s->align_size;
1639 if (n_sections == 0)
1643 f_lo = s->header.file_offset;
1651 f_lo = s->header.file_offset;
1658 if (n_sections == 0)
1663 if (g->header.file_offset == 0
1664 && g->header.type == ELF_SEGMENT_LOAD)
1666 s_lo = g->header.virtual_address;
1667 f_lo = g->header.file_offset;
1670 g->header.virtual_address = s_lo;
1671 g->header.physical_address = s_lo;
1672 g->header.file_offset = f_lo;
1673 g->header.memory_size = s_hi - s_lo;
1684 fd = open (file_name, O_CREAT | O_RDWR | O_TRUNC, 0755);
1688 f = fdopen (fd,
"w");
1699 if (fwrite (&h,
sizeof (h), 1, f) != 1)
1719 #define _(t,field) h.field = elf_swap_##t (em, h.field); 1723 if (fwrite (&h,
sizeof (h), 1, f) != 1)
1733 #define _(t,field) h32.field = elf_swap_##t (em, h.field); 1737 if (fwrite (&h32,
sizeof (h32), 1, f) != 1)
1753 if (s->
header.type == ~0)
1760 #define _(t,field) h.field = elf_swap_##t (em, h.field); 1764 if (fwrite (&h,
sizeof (h), 1, f) != 1)
1774 #define _(t,field) h32.field = elf_swap_##t (em, h.field); 1778 if (fwrite (&h32,
sizeof (h32), 1, f) != 1)
1793 if (s->
header.file_size == 0)
1796 if (fseek (f, s->
header.file_offset, SEEK_SET) < 0)
1799 if (s->
header.type == ELF_SECTION_NO_BITS)
1809 if (fseek (f, em->
file_header.section_header_file_offset, SEEK_SET) < 0)
1816 if (s->
header.type == ~0)
1823 #define _(t,field) h.field = elf_swap_##t (em, h.field); 1827 if (fwrite (&h,
sizeof (h), 1, f) != 1)
1837 #define _(t,field) h32.field = elf_swap_##t (em, h.field); 1841 if (fwrite (&h32,
sizeof (h32), 1, f) != 1)
1871 char * section_name,
1874 uword n_content_bytes)
1878 uword * p, is_new_section;
1901 s->
header.file_offset = ~0;
1902 s->
header.file_size = n_content_bytes;
1907 vec_add (st, section_name, strlen (section_name));
1920 uword n_deleted = 0;
1924 if (s->
header.type == segment_type)
1931 em->
file_header.segment_header_count -= n_deleted;
static u8 * format_elf_file_type(u8 *s, va_list *args)
always_inline void elf_swap_first_header(elf_main_t *em, elf_first_header_t *h)
u8 * format_elf_main(u8 *s, va_list *args)
#define ELF_SYMBOL_SECTION_RESERVED_HI
static u8 * format_elf_symbol_section_name(u8 *s, va_list *args)
always_inline uword round_pow2(uword x, uword pow2)
elf64_segment_header_t header
#define vec_clone(NEW_V, OLD_V)
Clone a vector.
#define hash_set(h, key, value)
sll srl srl sll sra u16x4 i
u32 verneed_section_index
static u8 * format_elf_section_type(u8 *s, va_list *args)
always_inline void elf_swap_verneed(elf_dynamic_version_need_t *n)
static u8 * format_elf_segment_type(u8 *s, va_list *args)
#define foreach_elf32_section_header
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
#define foreach_elf64_section_header
uword elf_delete_segment_with_type(elf_main_t *em, elf_segment_type_t segment_type)
void elf_set_dynamic_entries(elf_main_t *em)
static void elf_parse_dynamic(elf_main_t *em)
static u8 * format_elf_relocation(u8 *s, va_list *args)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define hash_set_mem(h, key, value)
static u8 * format_elf_dynamic_entry(u8 *s, va_list *args)
#define clib_error_report(e)
#define foreach_elf_section_type
always_inline void elf_set_section_contents(elf_main_t *em, uword section_index, void *new_contents, uword n_content_bytes)
void elf_parse_symbols(elf_main_t *em)
#define vec_bytes(v)
Number of data bytes in vector.
u32 dynamic_section_index
always_inline u8 * elf_section_name(elf_main_t *em, elf_section_t *s)
#define FORMAT_ELF_MAIN_RELOCATIONS
#define foreach_elf64_file_header
#define vec_add(V, E, N)
Add N elements to end of vector V (no header, unspecified alignment)
#define foreach_elf_dynamic_version_need_aux_field
#define foreach_elf64_symbol_header
uword * section_index_bitmap
always_inline u64 elf_swap_u64(elf_main_t *em, u64 x)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void add_symbol_table(elf_main_t *em, elf_section_t *s)
#define foreach_elf32_segment_header
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V...
#define vec_end(v)
End (last data address) of vector.
#define foreach_elf_file_class
static u8 * format_elf_abi(u8 *s, va_list *args)
static void set_symbol_table(elf_main_t *em, u32 table_index)
elf_symbol_table_t * symbol_tables
static u8 * format_elf_data_encoding(u8 *s, va_list *args)
static uword pointer_to_uword(const void *p)
#define hash_create_string(elts, value_bytes)
#define foreach_elf_dynamic_version_need_field
elf_dynamic_version_need_aux_t aux
#define clib_bitmap_foreach(i, ai, body)
clib_error_t * elf_write_file(elf_main_t *em, char *file_name)
#define foreach_elf_symbol_visibility
static void add_relocation_table(elf_main_t *em, elf_section_t *s)
always_inline void elf_swap_verneed_aux(elf_dynamic_version_need_aux_t *n)
u8 * dynamic_string_table
#define clib_error_return_unix(e, args...)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
#define foreach_elf_data_encoding
#define elf_relocation_next(r, type)
static u8 * format_elf_segment(u8 *s, va_list *args)
#define foreach_elf64_segment_header
static void byte_swap_verneed(elf_main_t *em, elf_dynamic_version_need_union_t *vus)
always_inline uword * clib_bitmap_set(uword *ai, uword i, uword value)
static u32 string_table_add_name_index(string_table_builder_t *b, u32 index)
always_inline void elf_main_init(elf_main_t *em)
#define foreach_elf32_file_header
always_inline uword clib_bitmap_get(uword *ai, uword i)
always_inline u16 elf_swap_u16(elf_main_t *em, u16 x)
static void * elf_get_section_contents_with_starting_address(elf_main_t *em, uword start_address, uword elt_size, u32 *section_index_result)
elf_first_header_t first_header
always_inline u64 round_pow2_u64(u64 x, u64 pow2)
#define vec_free(V)
Free vector's memory (no header).
always_inline void elf_main_free(elf_main_t *em)
#define foreach_elf32_symbol_header
clib_error_t * elf_read_file(elf_main_t *em, char *file_name)
elf_relocation_with_addend_t * relocations
#define clib_memcpy(a, b, c)
static u8 * format_elf_architecture(u8 *s, va_list *args)
static void set_dynamic_verneed(elf_main_t *em)
static void layout_sections(elf_main_t *em)
static u8 * format_elf_dynamic_entry_type(u8 *s, va_list *args)
static int elf_segment_va_compare(void *a1, void *a2)
#define foreach_elf_x86_64_relocation_type
static void elf_parse_segments(elf_main_t *em, void *data)
always_inline u8 * elf_symbol_name(elf_symbol_table_t *t, elf64_symbol_t *sym)
clib_error_t * elf_delete_named_section(elf_main_t *em, char *section_name)
u32 dynamic_symbol_table_section_index
static u8 * format_elf_section(u8 *s, va_list *args)
static void string_table_init(string_table_builder_t *b, u8 *old_table)
static int elf_section_offset_compare(void *a1, void *a2)
elf64_dynamic_entry_t * dynamic_entries
static u32 string_table_add_name(string_table_builder_t *b, u8 *n)
static void elf_parse_sections(elf_main_t *em, void *data)
#define clib_bitmap_free(v)
elf_relocation_table_t * relocation_tables
static void add_dynamic_entries(elf_main_t *em, elf_section_t *s)
static u8 * format_elf_relocation_type(u8 *s, va_list *args)
elf_dynamic_version_need_t need
#define FORMAT_ELF_MAIN_SYMBOLS
#define foreach_elf_symbol_binding
#define CLIB_ARCH_IS_BIG_ENDIAN
u8 * format_elf_symbol(u8 *s, va_list *args)
#define FORMAT_ELF_MAIN_DYNAMIC
#define ELF_SYMBOL_SECTION_RESERVED_LO
#define foreach_elf_symbol_reserved_section_index
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * elf_parse(elf_main_t *em, void *data, uword data_bytes)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
static u8 * format_elf_file_class(u8 *s, va_list *args)
uword * segment_index_bitmap
elf64_file_header_t file_header
always_inline void * elf_get_section_contents(elf_main_t *em, uword section_index, uword elt_size)
elf_section_t * elf_get_section_by_start_address_no_check(elf_main_t *em, uword start_address)
#define hash_get_mem(h, key)
#define foreach_elf_symbol_type
u32 dynamic_symbol_table_index
elf64_section_header_t header
#define vec_foreach(var, vec)
Vector iterator.
elf_dynamic_version_need_union_t * verneed
static u8 * format_elf_symbol_visibility(u8 *s, va_list *args)
void elf_create_section_with_contents(elf_main_t *em, char *section_name, elf64_section_header_t *header, void *contents, uword n_content_bytes)
#define clib_error_return(e, args...)
always_inline u16 clib_byte_swap_u16(u16 x)
clib_error_t * elf_get_section_by_name(elf_main_t *em, char *section_name, elf_section_t **result)
static u8 * string_table_done(string_table_builder_t *b)
static u8 * format_elf_symbol_binding_and_type(u8 *s, va_list *args)
clib_error_t * elf_get_section_by_start_address(elf_main_t *em, uword start_address, elf_section_t **result)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
static char * elf_find_interpreter(elf_main_t *em, void *data)
uword * section_by_start_address
always_inline u32 elf_swap_u32(elf_main_t *em, u32 x)
u32 dynamic_string_table_section_index