#undef _
}
-clib_error_t *
+__clib_export clib_error_t *
elf_get_section_by_name (elf_main_t * em, char *section_name,
elf_section_t ** result)
{
return p ? vec_elt_at_index (em->sections, p[0]) : 0;
}
-clib_error_t *
-elf_get_section_by_start_address (elf_main_t * em, uword start_address,
- elf_section_t ** result)
+__clib_export clib_error_t *
+elf_get_section_by_start_address (elf_main_t *em, uword start_address,
+ elf_section_t **result)
{
elf_section_t *s =
elf_get_section_by_start_address_no_check (em, start_address);
(i64) s2->header.virtual_address);
}
-u8 *
-format_elf_main (u8 * s, va_list * args)
+__clib_export u8 *
+format_elf_main (u8 *s, va_list *args)
{
elf_main_t *em = va_arg (*args, elf_main_t *);
u32 verbose = va_arg (*args, u32);
}
}
-void
-elf_set_dynamic_entries (elf_main_t * em)
+__clib_export void
+elf_set_dynamic_entries (elf_main_t *em)
{
uword i;
#include <sys/stat.h>
#include <fcntl.h>
-clib_error_t *
+__clib_export clib_error_t *
elf_read_file (elf_main_t * em, char *file_name)
{
int fd;
layout_sections (elf_main_t * em)
{
elf_section_t *s;
- u32 n_sections_with_changed_exec_address = 0;
u32 *deferred_symbol_and_string_sections = 0;
u32 n_deleted_sections = 0;
/* note: rebuild is always zero. Intent lost in the sands of time */
if (s->header.flags & ELF_SECTION_FLAG_ALLOC)
{
s->exec_address_change = exec_address - s->header.exec_address;
- n_sections_with_changed_exec_address += s->exec_address_change != 0;
s->header.exec_address = exec_address;
}
s_lo = s_hi = 0;
/* *INDENT-OFF* */
- clib_bitmap_foreach (si, g->section_index_bitmap, ({
+ clib_bitmap_foreach (si, g->section_index_bitmap) {
u64 lo, hi;
s = vec_elt_at_index (em->sections, si);
if (hi > s_hi)
s_hi = hi;
}
- }));
+ }
/* *INDENT-ON* */
if (n_sections == 0)
}
}
-clib_error_t *
-elf_write_file (elf_main_t * em, char *file_name)
+__clib_export clib_error_t *
+elf_write_file (elf_main_t *em, char *file_name)
{
int fd;
FILE *f;